Why Monorepos Won (and Why the Tooling Matters More Than the Structure)
Pick Turborepo if you are a TypeScript team of under about 15 engineers shipping a Next.js app, because it is one turbo.json file and its remote cache is free on every Vercel plan. Pick Nx once you have dozens of packages, add new ones every month, or need CI split across several machines with Nx Cloud. Pick moon if your repo mixes TypeScript with Rust, Go or Python and you want each project's toolchain pinned.
The monorepo itself is just a directory structure. The tool you pick to orchestrate builds, manage caching and run CI across that structure decides whether your team ships faster or spends its weeks in configuration. A poorly configured monorepo is worse than separate repos, because you inherit all the complexity with none of the benefits.
If you have not decided on one repository yet, read monorepo vs polyrepo for a startup first. It walks one API change through both setups. If you have decided and want the folder layout, package boundaries and CI setup for a SaaS product, our newer monorepo architecture guide for SaaS startups picks up where this one stops.
Versions move fast here, so this guide was checked on December 1, 2026 against Turborepo 2.11.13 (released November 18), Nx 24.1.0 (November 27) and moon 2.6.8 (November 30). The parts that changed most since the first version of this post are pricing and remote caching: Vercel's remote cache is free on all plans, Nx Cloud now sells credits, and moon's own hosted cache, moonbase, has been shut down.
A monorepo pays off when the checks are strict. On RangeX, the shooting-score app we are building, one local gate runs type-checks across six workspaces plus the app, server and vision test suites before anything merges. A CI check also fails any pull request where the 141 design tokens in Figma and the app's token file drift apart. That kind of rule is cheap to enforce when everything lives in one repo and one task runner knows the order.
This guide compares the three orchestrators that matter in 2026: Turborepo, Nx and moon. It covers task orchestration, caching, code generation, CI, migration and which one to pick for your team size.
Task Orchestration: Pipelines, Task Graphs, and Project Graphs
Task orchestration is the core job of any monorepo tool. When you run build across 12 packages, the tool needs to figure out the correct order, run in parallel where it can, and skip anything that has not changed. The three tools approach this differently.
Turborepo: Simple Task Definitions
Turborepo reads a tasks block in turbo.json (Turborepo 2 renamed the old pipeline key). You declare task dependencies. If build depends on ^build (the caret means "the build tasks of my dependencies"), Turborepo sorts your workspace graph and runs everything in the right order with as much parallelism as your machine allows. A typical turbo.json for a Next.js app, a shared UI package and an API is about 20 lines. New developers can read the whole thing in five minutes.
Nx: Fine-Grained Task Graph
Nx builds a more detailed task graph. Beyond dependency ordering, it understands inputs and outputs at the file level. Its project.json or nx.json configuration lets you define targets with explicit inputs (which files affect this task), outputs (what gets produced) and dependencies. That granularity lets Nx make smarter caching and invalidation decisions, and its plugins can infer most targets from your existing config so you write less of it by hand.
Moon: Rust-Powered Project Graph
Moon is written in Rust and models your repository as a project graph, with a moon.yml file per project. Task definitions live in those YAML files, and moon resolves the dependency and task graph quickly even in repos with hundreds of projects. Moon 2.5 made its async engine the default and added shared caching across Git worktrees, which helps if you run several agents or branches side by side on one machine. The tradeoff: moon's YAML is more verbose than turbo.json, and you have to think about the project graph and the task graph as separate things.
All three handle ordering and parallelism well. Turborepo wins on simplicity, Nx on granularity, moon on raw orchestration speed in very large repos. For most startup monorepos (under 20 packages) the difference in orchestration is small, so pick on the factors below.
Caching and Remote Cache: Where the Real Time Savings Live
Local caching is table stakes. All three tools hash your inputs and skip tasks when nothing changed. The real difference is remote caching, which shares cache artifacts across your team and CI. A cache hit on a 30-second build saves that 30 seconds for every developer and every CI run after the first.
Turborepo and Vercel Remote Cache
Turborepo's remote cache is its best feature. Run npx turbo login and npx turbo link and your build outputs, test results and logs are shared across the team. Vercel's docs, as of December 2026, say Remote Cache is free on all plans, subject to fair use: 100GB of uploads a month on Hobby, 1TB on Pro and 4TB on Enterprise. Artifacts expire after 7 days. Builds on Vercel use it automatically, and external CI can reach it with OIDC or a token.
If you are not on Vercel, Turborepo speaks an open HTTP caching API, so you can self-host. The community ducktors/turborepo-remote-cache server backed by S3 or another object store is the usual pick.
Nx Cloud
Nx Cloud is the remote cache and distributed execution layer for Nx. It goes beyond artifact caching: with what Nx now calls Nx Cloud workers, the tasks in a CI run spread across several machines, not just several cores. For a large repo this is the feature that keeps CI times flat as the repo grows.
Pricing changed to a credit model. As of December 2026, Nx's pricing page lists a free Hobby plan with 50,000 credits a month, a Team plan from $29 a month, a CI plan from $99 a month (in beta, with no base fee during the beta and usage billed per worker minute and per task), and custom Enterprise pricing. The downside has not changed: Nx Cloud is a separate service with its own dashboard and billing.
Moon: Self-Hosted or Depot
Moonbase, moon's hosted cache, is gone. The moon team shut it down, and moon 1.34 removed the integration. Today moon supports any cache that speaks the Bazel Remote Execution v2 API (added in moon 1.30), with bazel-remote as the common self-hosted choice, or Depot Cache as a hosted option (added in moon 1.32). Self-hosting suits teams with data residency requirements. Hit rates are similar across all three tools, because the hashing approaches are similar.
Our take: if you deploy on Vercel, which most Next.js startups do, Turborepo's remote cache is the simplest setup there is and costs nothing. If you need CI split across machines, Nx Cloud is the mature option. If you need the cache on your own servers, moon with bazel-remote or Turborepo with a self-hosted cache both work.
Code Generation and Scaffolding
As the monorepo grows, you need a consistent way to add packages and apps. Copying an existing package and find-replacing names is error-prone. Generators scaffold a new project with the right config, dependencies and boilerplate.
Nx Generators: The Strongest Option
Nx generators are the best thing about Nx. Run nx generate @nx/react:library shared-utils and you get a configured React library with tsconfig paths, test config, lint setup and project targets, wired into the workspace. Nx ships first-party generators for React, Angular, Node, Express, Nest, Next.js and more, and you can write your own with the @nx/devkit API. A custom generator that scaffolds a full service (API route, migration, shared types, tests) in one command pays for itself after the second service.
Turborepo Gen
Turborepo ships turbo gen, built on Plop, and you do not need to install Plop yourself. Define a template directory, write Handlebars templates and run turbo gen to scaffold a package. It works, but it is less integrated than Nx. You may still update tsconfig references and workspace dependencies by hand. For teams that value simplicity, it is good enough.
Moon: Templates with moon generate
Moon has built-in code generation through moon generate. Templates are rendered with Tera, a Rust template engine with syntax close to Twig or Liquid, and each template folder carries a template.yml that declares its variables. In moon 2 the destination moved to a flag (moon generate my-template --to ./dist). It is closer to Turborepo gen than to Nx: it writes files, it does not understand your framework.
If your team runs a TypeScript-first monorepo and adds packages more than once a month, Nx generators will save real time. If you add packages rarely, any of the three is fine.
CI/CD Integration and Affected Detection
Your monorepo tool's CI integration decides how much you pay for builds and how long your team waits for green checks. The key feature is affected detection: only run tasks for packages a pull request actually touches. Without it, every PR rebuilds everything, which defeats the point of a monorepo.
Turborepo in CI
Turborepo now has a dedicated --affected flag. turbo run lint test build --affected runs only the packages changed on the current branch, comparing main to HEAD by default, and you can override the base and head with the TURBO_SCM_BASE and TURBO_SCM_HEAD environment variables. The older filter syntax (--filter=...[origin/main]) still works. Detection is package-level by default, and a future flag lets it use each task's declared inputs for finer filtering. A GitHub Actions workflow is about 25 lines, and with a warm remote cache a PR that touches one package is usually done in a couple of minutes.
Nx Affected Commands
Nx's nx affected -t build uses the project graph and file-level dependency tracking to work out exactly which projects a change reaches. Change a shared utility and Nx traces every project that imports it, directly or not. That is more precise than package-level detection when a package has internal modules only some consumers use. Pair it with Nx Cloud workers and a 30-package repo's CI splits across several machines. The tradeoff is cost: you pay for the extra compute, now in Nx Cloud credits.
Moon's CI Command
Moon's moon ci is built for CI. It finds affected projects, runs tasks in the right order and reports results with timing for every task, which makes slow steps easy to spot. Moon 2.6 added OpenTelemetry metrics, so you can send that timing data to the same place as the rest of your observability. In moon 2, the old --update-cache option on moon ci became --force.
For setting up CI/CD, all three work with GitHub Actions and CircleCI. Turborepo is the fastest to a working pipeline. Nx has the most advanced CI features. Moon sits in the middle with one opinionated command that works out of the box.
Migration Strategy: Moving from Single Repo to Monorepo
Most startups do not start with a monorepo. You start with one Next.js app, maybe a separate API repo, and a few shared utilities copy-pasted between them. At some point the duplication hurts, types drift, and you consolidate. Here is how that goes with each tool.
The Incremental Approach (Works with All Three)
Do not migrate everything at once. Create the monorepo with your main app as the first workspace package. Then extract shared code (types, utilities, UI components) into internal packages. Then move the other apps in one at a time. Make each step its own PR so the team can review and test it alone.
Turborepo Migration
Use npx create-turbo for a new repo, or add a root turbo.json to an existing workspace, define your tasks and make sure each package has the right scripts. Turborepo works with npm, yarn, pnpm and bun workspaces, so you keep your package manager. For two apps and three libraries, plan on one to two days for a senior developer, most of it spent extracting shared code rather than configuring Turborepo.
Nx Migration
Run nx init in an existing repo to add Nx on top. You can start with caching and affected detection only, then add generators and plugins later. nx migrate handles version upgrades and breaking changes across your config,. For the same two apps and three libraries, plan on two to three days. The extra time goes into project config and learning the plugin model.
Moon Migration
Moon needs .moon/workspace.yml at the root, a .moon/toolchains.yml (plural since moon 2) for the Node version and package manager, and a moon.yml in each project. It is more explicit than the other two, so setup takes longer and the result is more predictable. Plan on three to four days. The payoff comes in repos with 20 or more packages, where explicit config stops the ambiguity that creeps into large Turborepo or Nx setups.
Whichever tool you pick, the tool is not the hard part. The hard part is drawing clean package boundaries out of tangled application code. Spend your energy there.
Plugins, Configuration Complexity, and Dependency Graph Visualization
Beyond the core features, three things shape how the tool feels a year in: plugins, how much config you maintain, and how well you can see your dependency graph.
Plugins
Nx has the most plugins by a wide margin. First-party plugins cover React, Angular, Node, Nest, Express, Storybook, Cypress, Jest, Vite, Webpack and more. Each provides generators, executors and automatic dependency detection. Community plugins add Go, Terraform and others.
Turborepo has almost no plugin system, on purpose. It runs your package.json scripts and does not try to own your build config. You set up ESLint, TypeScript and Vite the way you always do, and Turborepo orchestrates and caches the results. Teams that dislike framework lock-in like this.
Moon's plugins focus on toolchains: how moon installs and pins Node, Bun, Deno, Rust, Go and, since moon 2.4, Ruby. Its sister tool proto handles the installs. If your monorepo holds both TypeScript and Rust packages, moon manages both runtimes. Turborepo and Nx do not manage runtimes at all.
Configuration Complexity
Turborepo needs the least: one turbo.json, your existing scripts and your package manager's workspace config. One new file. Nx needs nx.json and optionally a project.json per project. Plugins can infer targets from package.json, but the full Nx feature set (generators, executors, custom plugins) is a real API to learn. One to fifteen new files depending on how far you go. Moon needs .moon/workspace.yml, .moon/toolchains.yml and a moon.yml per project. Three to twenty or more files, all explicit.
Dependency Graph Visualization
All three can show the dependency graph, and it helps new developers more than any README. nx graph opens an interactive web app with every project, its dependencies and what a given change affects. It is the best of the three. Turborepo's turbo run build --graph writes the task graph as dot, svg, html or mermaid, and turbo query gives programmatic access. Moon can render its project and task graphs too, with less interactivity than Nx.
If your developers keep asking what a package depends on or what breaks when it changes, Nx's graph view answers that in seconds.
Which One for Your Product
Here is the pick for the situations we see most. No "it depends".
Pick Turborepo If:
- Your team is 2 to 10 engineers. Less config to maintain and fewer abstractions to learn.
- You deploy on Vercel. Remote caching is two commands away and free on every plan.
- You have fewer than 20 packages. Turborepo handles this scale without Nx's extra machinery.
- You want the tool out of your build config. It orchestrates and caches your existing scripts.
Expect a one-day setup and almost no ongoing maintenance.
Pick Nx If:
- Your team is 10 to 50 or more engineers. Generators, plugins and distributed CI scale with the team.
- You add packages often. Generators save hours per new service or library.
- You need CI split across machines. Nx Cloud workers are the mature option for this.
- You use Angular. Nx grew out of the Angular world and is still the best Angular monorepo setup.
Expect a two to three day setup and moderate upkeep, mostly running nx migrate on each major release.
Pick Moon If:
- Your repo is polyglot. TypeScript, Rust, Go and Python in one repo is what moon's toolchains are for.
- You need strict reproducibility. Pinned toolchains per project mean the same build on every machine.
- You want the cache on your own servers. bazel-remote works out of the box.
Expect a three to four day setup and less ambiguity once the repo is large.
Matching Real Products to a Pick
- A Next.js SaaS with a shared UI package and an API, deployed on Vercel: Turborepo.
- A React Native app plus a Next.js admin and a Node backend sharing types: Turborepo, then Nx if the package count passes 30.
- An Angular enterprise product with several teams: Nx with Nx Cloud.
- An app with a Python computer-vision or ML service next to the TypeScript code: moon, or Turborepo with the Python service called from a package script if the TypeScript side dominates.
For most TypeScript startups in 2026, Turborepo is the right call. It does the job with little fuss, the cache is free on Vercel, and you will not outgrow it until you pass 30 packages or need distributed CI. Moving to Nx later is straightforward because both work on standard package manager workspaces.
Kanopy helps founders pick a stack and build the product on it, monorepo and CI included. If you are starting a new project or pulling separate repos together, book a free strategy call.


