2.1 KiB
2.1 KiB
Memory & TypeScript Tooling
Current Status
- TypeScript diagnostics now run with a unified configuration shared across the monorepo.
- Portal and BFF type-check reliably on machines with ~8–12GB available RAM when using the provided Node.js memory limits.
- Package builds remain incremental and continue to emit declaration files for downstream consumers.
Key Changes
- Introduced
tsconfig.base.jsonto centralise shared compiler options. - Each package/app now owns a single
tsconfig.json(plustsconfig.build.jsonfor the NestJS app) instead of dozens of per-area configs. - Removed the
.typecheckstaging folders and the chunkedrun-chunks.mjsworkflow. - Standardised type-check scripts to call
tsc --project <tsconfig> --noEmitwith explicit memory budgets. - Root
tsconfig.jsonreferences the reusable libraries (domain,logging,api-client,validation-service) for fast incremental builds.
Recommended CI/CD Setup
- Provide at least 8GB of RAM (12GB+ preferred) to the type-check job.
- Run package checks:
pnpm type-check:packages(invokestsc --noEmitfor each workspace package). - Run application checks:
pnpm type-check:apps(executes the BFF and Portal scripts sequentially). - Optional:
pnpm type-check:workspacerunstsc -b --noEmitagainst the shared libraries for an incremental baseline.
Local Development Tips
- Use
pnpm --filter <workspace> run type-check:watch(where available) for continuous feedback without emitting build artefacts. - Keep
NODE_OPTIONSmemory ceilings from the scripts; they balance speed with predictable RAM usage on developer laptops. - When additional capacity is available, bump
--max-old-space-sizeto 8192+ in CI to future-proof larger schemas.
Follow-Up Ideas
- Monitor CI telemetry to validate the new memory headroom and tune limits as the codebase grows.
- Evaluate splitting large schema modules only if memory pressure returns; the current setup avoids premature fragmentation.
- Consider enabling
strictextensions such asnoUncheckedIndexedAccessonce the pipeline is stable again.