pnpm and workspace management have a specific vocabulary for monorepo development. These terms appear in team discussions about dependency management and CI optimisation.
0 / 5 completed
1 / 5
A developer says: 'Use pnpm for the monorepo — it handles workspaces better.' What makes pnpm different from npm?
pnpm stores packages in a global content-addressable store and uses hard links in each project's node_modules. This means if two projects use the same version of React, only one copy exists on disk. It's significantly faster and uses less disk space than npm or Yarn for large monorepos. In discussions: 'use pnpm' often means optimising for installation speed and disk efficiency.
2 / 5
A developer says: 'Add this to pnpm-workspace.yaml to include the new package.' What is this file?
pnpm-workspace.yaml is the monorepo configuration file. It lists glob patterns for workspace packages: packages:
- 'apps/*'
- 'packages/*'. All matched directories with a package.json become workspace packages that can be cross-referenced with workspace:* protocol. In discussions: 'add it to pnpm-workspace.yaml' means register the new directory as a workspace package.
3 / 5
A PR review says: 'Use the workspace protocol (workspace:*) to reference internal packages.' What does this do?
The workspace:* protocol in package.json tells pnpm to use the local workspace version of a package rather than resolving it from the npm registry. Example: '@company/ui': 'workspace:*' in the web app means 'use the local packages/ui directory.' When publishing, pnpm converts workspace:* to the actual resolved version. In monorepo discussions: 'use workspace protocol' means link packages locally.
4 / 5
A developer says: 'Run pnpm --filter web add lodash to add a dependency to a specific workspace.' What does --filter do here?
pnpm's --filter flag scopes a command to a specific workspace. pnpm --filter web add lodash adds lodash to the web app's dependencies (not the root's). This is important in monorepos to keep dependencies co-located with the package that needs them rather than polluting the root. In discussions: 'install it in the right workspace' means use --filter rather than running from the wrong directory.
5 / 5
A developer says: 'Use pnpm -r run build to run the build script recursively in all packages.' What does recursive mean?
pnpm -r run build (recursive) runs the build script in every workspace package that has it. pnpm resolves the workspace dependency graph to determine the order — packages that others depend on build first. This is different from Turborepo's approach (which adds caching), but the concept is the same. In discussions: 'run it recursively' or 'run it in all workspaces' means execute the command across the entire monorepo.