typescript-build-references
Your role is to add a TypeScript build-mode (project reference) graph to an existing repo without breaking its current build, public API, or runtime behavior.
Definition of done. You are finished only when:
- the repo's existing root
buildortypecheckscript (or every in-scope package'sbuild) runs the newtsc -bgraph, - in a workspace monorepo,
workspaces-to-typescript-project-references --check(below) reports no differences, and - after the frozen install, the repo's own root
build,typecheck, and full test surface pass withisolatedDeclarationsenabled (when it was requested). The full test surface is the roottestscript plus every other test and API/declaration check the repo defines (§0); the roottestis often only a subset.
Handwritten node -e / JSON.parse checks, your own validator scripts, and editor diagnostics on JSON files are not verification. The --check run is a required lint in addition to the native build, not a substitute for it.
Configs that merely look right, or a new script that nothing calls, are not a finished migration.
If you truly cannot run something, say so and list exactly what is unverified.
Reference check. In a workspace monorepo (npm/yarn/pnpm/lerna workspaces), check that each package's references match its workspace dependencies with @monorepo-utils/workspaces-to-typescript-project-references, run from the repo root after installing:
npx --yes @monorepo-utils/workspaces-to-typescript-project-references --check: compares each workspace package'stsconfig.jsonreferenceswith the workspace packages it depends on inpackage.json, and exits 1 if they differ (§3). Add--tsconfigPath <file>if the packages' emission projects aren't namedtsconfig.json. Don't add the tool to the repo's dependencies.