You do not need Nx or Turborepo to run a multi-package JavaScript repository. For a lot of teams, a pnpm workspace and a few conventions do the job with a fraction of the ceremony.
The reflex when a repo grows past one package is to reach for a build orchestrator. Sometimes that is the right call. But the orchestrator is a second tool to learn, configure, cache and keep current, and it earns its keep only once you have enough packages and enough CI minutes for task caching and affected-graph builds to matter. Before that point, pnpm’s own workspace support gives you internal package linking, cross-package scripts and a content-addressed store that saves real disk and install time. This is how to run that lean setup, and where its ceiling actually is.
The store is the reason to start here
pnpm keeps every version of every package once, in a global content-addressed store, and hard-links files from there into each project’s node_modules. Ten packages in your monorepo depending on the same version of a library do not produce ten copies on disk; they produce ten hard links to one set of files. Installs are faster because most of the work is linking, not copying, and repeat installs across projects reuse what is already in the store.
That single design choice is why pnpm is a sensible default for a monorepo before any orchestrator enters the picture: the thing that usually hurts in a large JavaScript repo — duplicated dependencies and slow installs — is handled by the package manager itself. If disk pressure on a build box is your constraint, it belongs in the same conversation as the rest of your server headroom decisions, not as an afterthought.
Declaring the workspace
A workspace is a root pnpm-workspace.yaml file that lists which directories hold packages. Everything else — linking, filtering, catalogs — keys off this one file. A typical layout keeps deployable applications under apps/ and shared libraries under packages/.
# pnpm-workspace.yaml
packages:
- 'apps/*'
- 'packages/*'
# A leading '!' excludes a matching path.
- '!**/test/**'
# Shared dependency versions (catalogs, pnpm 9.5+).
# One place to declare the version every package should use.
catalog:
react: ^18.3.1
react-dom: ^18.3.1
typescript: ^5.5.4
catalogs:
# A named catalog, e.g. for one package pinned to an older major.
legacy:
react: ^17.0.2
Run pnpm install once at the root. pnpm discovers every package matching those globs, resolves the whole dependency graph together, and links each package’s node_modules from the shared store.
Linking internal packages with the workspace protocol
When one internal package depends on another, you do not want it resolving from the npm registry — you want the local source. The workspace: protocol makes that explicit. Write it in the consuming package’s package.json and pnpm links the local directory instead of downloading anything.
{
"name": "@acme/web",
"dependencies": {
"@acme/ui": "workspace:^",
"react": "catalog:",
"react-dom": "catalog:"
},
"devDependencies": {
"typescript": "catalog:"
}
}
The protocol has three range forms that matter: workspace:* links whatever version is in the repo with no range on publish; workspace:^ and workspace:~ apply caret and tilde ranges. This is not just a dev-time convenience. When you run pnpm publish, pnpm rewrites those specifiers to concrete versions — workspace:^ against a local 1.5.0 becomes ^1.5.0 in the published manifest — so consumers outside the repo get an ordinary, registry-resolvable dependency. You get local linking in development and correct semver in what ships, with no manual step.
The catalog: entries above pull versions from the catalog you declared in pnpm-workspace.yaml. Catalogs solve the version-drift problem that every growing monorepo hits: fifteen packages each declaring their own react range, slowly diverging. Declare the version once in the catalog, reference it as catalog: everywhere, and a single edit in one file bumps the lot. It is the same discipline that makes a shared API contract worth the effort — the value is in there being one authoritative source rather than copies that quietly drift apart.
Running scripts across packages
Two flags do most of the work. -r (recursive) runs a script in every package that defines it, in topological order — dependencies build before the packages that consume them. --filter narrows the set, and its ... syntax walks the dependency graph in either direction.
# Build every package that has a build script, in dependency order.
pnpm -r build
# Build @acme/web and everything it depends on (trailing '...').
pnpm --filter @acme/web... build
# Test every package that depends on @acme/ui (leading '...').
pnpm --filter ...@acme/ui test
# Only packages changed since main, plus their dependents.
pnpm --filter "...[origin/main]" build
# Add a dependency to one package, from the repo root.
pnpm --filter @acme/web add zod
# Run in parallel where order does not matter (dev servers).
pnpm -r --parallel dev
That --filter "...[origin/main]" form is the one people assume they need an orchestrator for: build only what changed since a git ref, plus the things that depend on it. pnpm computes it from the workspace graph and git, with no cache server and no config. It is not the full affected-graph-with-remote-caching machine that Nx offers, but for a mid-sized repo on modest CI it is often enough.
Where the lean setup runs out
Be honest about the ceiling. pnpm runs your scripts; it does not cache their results. Run pnpm -r build twice with nothing changed and it builds twice. There is no task-output cache, no remote cache shared across a team’s machines and CI, no distributed execution. Those are exactly the problems Nx and Turborepo exist to solve, and once your build times or CI bill make repeated rebuilds the bottleneck, adopting one of them is the right move — layered on top of the same pnpm workspace, which they are designed to sit above rather than replace.
The signal to reach for an orchestrator is concrete: CI spends most of its time rebuilding things that did not change, or developers wait on local rebuilds that a cache would return instantly. Until you can point at that, the extra tool is cost without return. A workspace, the workspace: protocol, a catalog and --filter is a complete, fast monorepo — the same instinct that says keep your tooling minimal until the problem is real applies here. Add the orchestrator when the build tells you to, not when the repo count does.
Free interactive tool
Website compliance checklist
What your site has to do, based on what it actually does
Answer as much or as little as you like — the list builds as you go. Nothing is stored against your name and no email is required.
Everything that applies
Ordered by what to do first: legal requirements you can close quickly, then larger pieces of work, then what is expected rather than required. Not exhaustive, and not a legal audit.
Dated PDF, yours to keep or circulate.
Can you trust the architecture you have?
Architecture diagrams rarely show the reality of how systems actually operate. An independent review establishes what is really there.