Dev.to
7/20/2026

One Monorepo, Two Outputs: How I Eliminated Duplicate Starter Templates
Short summary
The author solves template drift by maintaining a single canonical Turborepo monorepo and dynamically flattening it into a standalone Next.js app via a deterministic pipeline. The pipeline resolves workspace packages, rewrites import paths, moves files, merges manifests, and inlines shared config. This approach treats the monorepo as source code and the generated starter as compiled output, making the process testable and maintainable.
- •Single canonical monorepo eliminates template drift between standalone and monorepo starters
- •A deterministic 6-step pipeline transforms monorepo into standalone app via AST import rewriting
- •Treats scaffolding as compilation: monorepo is source, generated project is output
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



