pediatric-ai-scribe-v3/package.json
Daniel 759135f76f chore(ts): frontend build scaffold — esbuild + tsconfig.client + main.ts
Strangler-fig migration setup for the frontend. Legacy public/js/*.js
keeps working unchanged; new TypeScript code lives under client/ and
gets bundled into public/dist/ at image-build time.

Adds:
- esbuild@0.28 as a regular dep (so docker build can run the bundler
  without --include-dev). It's small; tsx already pulled in a pinned
  version transitively.
- scripts/build-client.mjs: bundles every top-level client/*.ts file
  into public/dist/<name>.js as ESM with sourcemap. --watch mode for
  dev. Sub-directories under client/ are bundled by their parent
  entry, not separately.
- tsconfig.client.json: browser target (lib: DOM), bundler module
  resolution, isolatedModules:true so esbuild + tsc agree.
- Two npm scripts: build:client, typecheck:client.
- Dockerfile: 'RUN node scripts/build-client.mjs' between COPY and CMD,
  so the prod image ships with the built bundle.
- .gitignore: public/dist/ — build output, never committed.
- public/index.html: <script type="module" src="/dist/main.js">
  appended after legacy script tags.
- client/main.ts: minimal entry point with a console.log marker
  (window.__clientBundle = true) so we can verify the bundle loaded.

Sacred files (per project memory) kept off the migration path:
- public/js/encounters.js (save/idempotency)
- voiceDictation.js, sickVisit.js recording paths (STT plumbing)
These need explicit per-file approval from Daniel before migration.

Verification:
- npm run typecheck → 0 errors (backend)
- npm run typecheck:client → 0 errors (frontend)
- npm run build:client → public/dist/main.js + .map in 3 ms
- 46/46 unit tests pass

Next session: migrate the first real frontend module (small + isolated,
likely extensions.js or memories.js) into client/ as ES module + TS.
2026-04-27 23:54:38 +02:00

74 lines
2.5 KiB
JSON

{
"name": "pediatric-ai-scribe",
"version": "6.53.1",
"description": "AI-powered pediatric clinical documentation platform",
"main": "server.js",
"scripts": {
"start": "tsx server.js",
"typecheck": "tsc --noEmit",
"typecheck:client": "tsc --noEmit -p tsconfig.client.json",
"build:client": "node scripts/build-client.mjs",
"test": "node --test test/",
"e2e": "./scripts/e2e.sh",
"maint:check": "node scripts/maintenance.js check",
"maint:reindex": "node scripts/maintenance.js reindex",
"migrate": "node-pg-migrate",
"migrate:up": "node-pg-migrate up",
"migrate:down": "node-pg-migrate down 1",
"migrate:status": "node -e \"const{Pool}=require('pg');const p=new Pool({connectionString:process.env.DATABASE_URL});p.query('SELECT id,name,run_on FROM pgmigrations ORDER BY id').then(r=>{console.table(r.rows);p.end();}).catch(e=>{console.error(e.message);process.exit(1);})\"",
"migrate:new": "node-pg-migrate create"
},
"dependencies": {
"@marp-team/marp-cli": "^4.3.1",
"@marp-team/marp-core": "^4.3.0",
"@tiptap/core": "^3.20.4",
"@tiptap/extension-color": "^3.20.4",
"@tiptap/extension-link": "^3.20.4",
"@tiptap/extension-text-align": "^3.20.4",
"@tiptap/extension-text-style": "^3.20.4",
"@tiptap/extension-underline": "^3.20.4",
"@tiptap/starter-kit": "^3.20.4",
"argon2": "^0.41.1",
"axios": "^1.7.7",
"bcryptjs": "^2.4.3",
"cookie-parser": "^1.4.7",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"esbuild": "^0.28.0",
"express": "^4.21.0",
"express-rate-limit": "^7.4.0",
"helmet": "^8.0.0",
"jsonwebtoken": "^9.0.2",
"mammoth": "^1.8.0",
"marked": "^18.0.2",
"multer": "^1.4.5-lts.1",
"node-pg-migrate": "^7.7.0",
"nodemailer": "^8.0.5",
"openai": "^4.73.0",
"openid-client": "^6.8.2",
"pdf-parse": "^1.1.1",
"pg": "^8.13.0",
"pptxgenjs": "^4.0.1",
"qrcode": "^1.5.4",
"speakeasy": "^2.0.0",
"tsx": "^4.21.0"
},
"optionalDependencies": {
"@aws-sdk/client-bedrock": "^3.700.0",
"@aws-sdk/client-bedrock-runtime": "^3.700.0",
"@aws-sdk/client-s3": "^3.700.0",
"@aws-sdk/client-transcribe-streaming": "^3.1017.0",
"@aws-sdk/s3-request-presigner": "^3.700.0",
"@google-cloud/vertexai": "^1.9.0"
},
"devDependencies": {
"@types/cookie-parser": "^1.4.10",
"@types/cors": "^2.8.19",
"@types/express": "^4.17.25",
"@types/jsonwebtoken": "^9.0.10",
"@types/multer": "^1.4.13",
"dompurify": "^3.4.1",
"jsdom": "^29.0.2",
"typescript": "^6.0.3"
}
}