ADR-0010: No TypeScript Project References
Date: 2026-07-28 Status: Accepted
Context
TypeScript Project References (composite: true + references in tsconfig) allow one project to depend on another's build output, enabling incremental builds across packages. Many monorepo tools (Nx, Lerna) recommend or require them.
The question: should Walnut Admin adopt Project References for its packages?
Decision
No. The monorepo does not use TypeScript Project References.
Six reasons:
Heterogeneous toolchain: Frontend uses
moduleResolution: bundler(Vite). Backend usesmoduleResolution: node10(NestJS + SWC). Project References require a unified module resolution strategy.Source-consumed pattern conflict:
@walnut/clientand@walnut/axiosexport raw.tssource. Project References expect compiled.js+.d.tsoutput. These patterns are incompatible.Vite/VitePress don't read references: The frontend build tools resolve packages via pnpm workspace symlinks +
exports, not via tsconfig references.Backend doesn't participate: The server has its own
tsconfig.jsonwithpathsfor@walnut-server/*libs. It doesn't extend the root tsconfig and wouldn't benefit from cross-package references.Maintenance overhead: Three small source-consumed packages don't justify
tsbuildinfocoordination.Risk to existing resolution: 49 subpath imports across the frontend work via
exports. Introducing references could break this resolution.
Consequences
- Package dependency ordering is handled by Turborepo (
dependsOn: ["^build"]), not by TypeScript - Type checking across packages relies on
exports+ pnpm workspace symlinks — the same mechanism used at runtime - If in the future the number of packages exceeds ~15 and incremental builds become a bottleneck, revisit this decision