pediatric-ai-scribe-v3/scripts
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
..
build-client.mjs chore(ts): frontend build scaffold — esbuild + tsconfig.client + main.ts 2026-04-27 23:54:38 +02:00
download-whisper-models.sh v6: Use transformers.js v2.0.0 (proven worker compatibility) 2026-04-01 00:32:23 +00:00
e2e.sh test(lint): static reference linter — catches dead-code + orphan refs 2026-04-23 18:58:38 +02:00
import-milestones.js Add admin dashboard for developmental milestones management 2026-03-31 20:55:41 +00:00
lint-references.js feat: ED encounters + notes model selector; remove AI corrections; fix notes framing 2026-04-26 19:06:00 +02:00
maintenance.js Maintenance CLI + unpin postgres digest 2026-04-14 04:00:13 +02:00
release.sh release.sh: drop node dependency, use sed for version bump 2026-04-14 23:40:38 +02:00