- Best source: [monorepo.tools](https://monorepo.tools)
- Inspired by John’s presentation
- A single repository with multiple linked projects
- Why use a monorepo?
- No overhead for new repositories (avoids extra git/pipelines/boards)
- One version across all packages (avoids versioning hell)
- Single commit fixes everything (ensures atomic changes)
Monorepo is a new code organization abstraction, evolving from:
- Function/Routine → Class → Project
- YUI Compressor → Ant → Flex → Grunt → Gulp → Webpack → TypeScript → Rust tools?
- Polyrepo (npm linking) → Linking Scripts → Lerna → Rush → Nx
- Lerna
- Nx
- Rush
- Bazel / Gradle / Turborepo
- Linking Projects/Packages (
npm link) – enables cross-package imports - Task Runners – execute scripts
- Parallel Execution
- Ordered Execution
Using Lerna under the hood as a task runner:
foo start fx --env.dev1 --fast
npx lerna ls -la - Nx (by Nrwl) takes over Lerna → [Lerna Docs](https://lerna.js.org/docs/lerna-and-nx)
- Visualized Graphs – Improved dependency tracking
- Faster Builds – Caching results locally & remotely
- Nx Console & Tooling – Advanced task management
- Move & Refactor Support – Controlled project reorganization
- Code Generators – Automate repetitive code tasks
- CI Improvements – Avoids rebuilding everything for a single change
- Potential AI Integration – Metadata & automation
- Hybrid Structure Issues – Some packages have
package.json, others don’t - Codegen Packages Not Recognized
nx initfailed to build the project graph- Custom Conventions Conflicts
- Lerna vs. Nx (
tsconfig.base.jsonvs.tsconfig.json) - No
src/,dist/,folderstructure in Nx
- Lerna vs. Nx (
- Command Differences – Older Lerna workflows need adaptation
- CI Caching Strategy – How to reuse build cache efficiently?
- Claiming 2-10x faster builds using Nx execution in Lerna (from version 8+)
- Install caching with Lerna and enable it:
npx lerna add-caching
- Verify the dependency graph:
nx graph
- Example image reference:

- Manual migration for full control
- Define
nx.json, specify inputs/outputs fordist"build": { "dependsOn": ["^build"], "inputs": ["{projectRoot}/**/*"], "outputs": ["{projectRoot}/dist"], "cache": true }
- Define custom
sourceRootin{projectRoot}/index.ts - Use
project.jsonto define project type (e.g., shell/common) - Set
"implicitDependencies": ["dtp-client-rxjs"]
nx show projects
nx show projects --with-target=build
nx show project dtp-client-shellnx build dtp-client-rxjs
rm -rf dist && nx build dtp-client-rxjsnx graph📌 Troubleshooting: Use nx reset if needed
nx affected --base=main --head=HEAD --graph
nx affected --base=HEAD --target=build --graph --uncommittednx run-many --target=build --all --parallel=5- Resolve
tsconfig.rootissues for better project referencing - Use Nx DevKit Plugin System to define certain features declaratively
- Integrate AI-powered project metadata analysis (e.g., Copilot, AI tools)






What is a Monorepo?
My Take on Monorepos
Monorepo is a new code organization abstraction, evolving from:
Project Tools Evolution:
Monorepo Evolution:
Tools & Features
Popular Monorepo Tools
Core Features
npm link) – enables cross-package importsFooUpgrade (Task Runner)
Using Lerna under the hood as a task runner:
Why Upgrade to Nx?
Key Reasons:
Main Challenges in Migration
package.json, others don’tnx initfailed to build the project graphtsconfig.base.jsonvs.tsconfig.json)src/,dist/,folderstructure in NxUpgrade Process
1 SIMPLE
useNxflag in Lerna2 FULL Migration using
nx initnx.json, specify inputs/outputs fordistsourceRootin{projectRoot}/index.tsproject.jsonto define project type (e.g., shell/common)"implicitDependencies": ["dtp-client-rxjs"]DEMO: Nx in Action
1 Checking Available Projects
2 Task Build Cache
nx build dtp-client-rxjs rm -rf dist && nx build dtp-client-rxjs3 Visualizing Dependency Graph
📌 Troubleshooting: Use
nx resetif needed4 Affected Builds (Optimized Execution)
5.Run All Builds in Parallel
Future Enhancements
tsconfig.rootissues for better project referencingQ&A 🎤
Let's Discuss the Migration Process!