Deferred from #891 / PR #893 (Phase 2 scaffolding).
Problem
The v2 dependency DAG is currently written down in four places:
scripts/check-architecture-boundaries.js → V2_PACKAGES[*].deps
v2/*/package.json → dependencies (six files)
v2/*/tsconfig.json → references (six files)
knip.json → workspaces["v2/*"].ignoreDependencies (five entries)
check-architecture-boundaries.js pins all four together, so drift in any of
them fails pnpm lint today — that part is covered and proven in PR #893. The
remaining cost is edit burden: adding a package or changing one edge is ~14 hand
edits across 13 files.
Beyond the DAG, the six manifests carry ~130 lines of byte-identical
boilerplate (scripts.{build,lint}, nx.targets.{build,lint}, type, main,
types) differing only by package name and cwd.
Fix recipe
Add scripts/gen-v2-packages.mjs that emits the six package.json files, the
six tsconfig.json files, and the knip.json v2 block from a single table,
then gate it exactly like the existing precedent in package.json:
"arch:config:check": "pnpm arch:config:generate && git diff --exit-code -- 'packages/*/safer-architecture.config.json'"
scripts/gen-architecture-configs.mjs is the shape to copy.
Not in scope
The V2_PACKAGES table itself should stay hand-written. It is a deliberate
transcription of frozen law in docs/architecture/components.md, and the
value of an independent transcription is that drift fails whichever side moves.
Deferred from #891 / PR #893 (Phase 2 scaffolding).
Problem
The v2 dependency DAG is currently written down in four places:
scripts/check-architecture-boundaries.js→V2_PACKAGES[*].depsv2/*/package.json→dependencies(six files)v2/*/tsconfig.json→references(six files)knip.json→workspaces["v2/*"].ignoreDependencies(five entries)check-architecture-boundaries.jspins all four together, so drift in any ofthem fails
pnpm linttoday — that part is covered and proven in PR #893. Theremaining cost is edit burden: adding a package or changing one edge is ~14 hand
edits across 13 files.
Beyond the DAG, the six manifests carry ~130 lines of byte-identical
boilerplate (
scripts.{build,lint},nx.targets.{build,lint},type,main,types) differing only by package name andcwd.Fix recipe
Add
scripts/gen-v2-packages.mjsthat emits the sixpackage.jsonfiles, thesix
tsconfig.jsonfiles, and theknip.jsonv2 block from a single table,then gate it exactly like the existing precedent in
package.json:scripts/gen-architecture-configs.mjsis the shape to copy.Not in scope
The
V2_PACKAGEStable itself should stay hand-written. It is a deliberatetranscription of frozen law in
docs/architecture/components.md, and thevalue of an independent transcription is that drift fails whichever side moves.