Searchable pnpm workspace cheat sheet with 60+ commands covering
every monorepo task you hit day-to-day. Setup section: creating
pnpm-workspace.yaml with glob patterns, using the pnpm catalog
feature (pnpm 9+) to pin shared dependency versions, and enabling
shamefully-hoist for tools that don't play well with strict
node_modules. Filter section — the heart of workspace usage:
--filter selects packages by name, directory path, git diff, or
dependency graph; ^pkg adds all dependents; pkg... adds all
dependencies; ...pkg adds all dependants; combining filters with
comma or multiple --filter flags; filtering by changed files since
a git ref. Install section: pnpm install at workspace root, --frozen-lockfile
in CI, adding a dependency to a specific package with --filter, the
difference between workspace-level and package-level installs.
Scripts section: pnpm run --filter, pnpm -r run <script> to run
across all packages, --parallel and --stream flags, ordering by
dependency graph with --if-present to skip missing scripts.
Publish section: changesets workflow (add → version → publish),
pnpm publish --filter, version bumping, access and registry flags.
Protocol section: workspace:*, workspace:^, workspace:~ in
package.json dependencies, how pnpm resolves them at publish time,
when to use each variant. Link section: pnpm link vs workspace
protocol, --global flag, when local linking beats workspace.
Pitfall section: hoisting surprises, phantom dependencies in strict
mode, .npmrc flags, CI frozen-lockfile gotchas, catalyst package not
found after rename, pnpm catalog gotchas, lockfile version conflicts.
Every entry: bilingual EN/ZH descriptions, ready-to-copy examples,
real-world input/output where relevant. Search filters across command,
description, examples, and pitfall text at once. 100% client-side,
works offline on a jump host — which is exactly where you need it.