Migration and production practices
A successful monorepo migration preserves delivery, proves its build graph, and gives teams a paved road before enforcing new rules.
Inventory before moving files
List repositories, owners, runtimes, build commands, deployment targets, dependency relationships, secrets, and compliance boundaries. Identify duplicate libraries and conflicting package names.
Choose a small representative application first. It should exercise the proposed tooling without being the company’s most critical deployment.
Migrate in controlled stages
- Create the workspace and common toolchain
- Import history where its value justifies the complexity
- Move one application without redesigning it
- Declare and verify package boundaries
- Reproduce the existing build and deployment
- Enable graph-aware caching and affected CI
- Document the path, then migrate additional teams
Protect the software supply chain
Limit who can change root build configuration, publishing credentials, lockfiles, and CI workflows. Use protected branches, provenance where supported, dependency scanning, and least-privilege automation tokens.
A monorepo increases blast radius for privileged configuration. It also makes consistent controls easier to apply when ownership is explicit.
Design the local developer experience
A contributor should be able to clone, install, discover relevant commands, run one application, and test one package without learning the whole repository. Provide task aliases and documentation generated from the same configuration CI uses.
Watch mode should scope work. Local services should have predictable ports and optional dependencies. Avoid scripts that silently modify unrelated packages.
Measure whether the monorepo is paying off
- Cold and cached CI duration
- Local feedback time
- Cache hit rate
- Change failure rate
- Cross-package change lead time
- Boundary violations and dependency cycles
- Time required to onboard a contributor
Can you explain “Migration and production practices” without reaching for the API reference?
Describe the main trade-off, one failure mode, and the decision you would make in a real project.