cat > pnpm-workspace.yaml <<'YAML'
packages:
- packages/*
- apps/*
YAMLDefine the workspace root and included package globs.
Workspace setup, filtering, recursive execution, deploy flows, and catalogs.
Create and manage pnpm workspaces.
cat > pnpm-workspace.yaml <<'YAML'
packages:
- packages/*
- apps/*
YAMLDefine the workspace root and included package globs.
Inside a workspace, pnpm installs dependencies for all projects by default.
pnpm installInside a workspace, pnpm installs dependencies for all projects by default.
pnpm -r list --depth 0Show workspace packages and their top-level dependencies.
pnpm -w exec node -p process.cwd()Run a command in the workspace root context.
pnpm add -w -D typescriptInstall a dependency into the workspace root package.json.
Useful selector patterns for targeted commands.
pnpm --filter @acme/api buildTarget a single package by name.
pnpm --filter @acme/core... testRun command on a package and all dependents.
pnpm --filter ...@acme/web buildRun command on a package and all its dependencies.
pnpm --filter "...[origin/main]" testTarget packages changed since a Git ref and their dependents.
pnpm --filter "@acme/*" lintTarget packages that match a glob pattern.
pnpm --filter ./packages/ui... buildTarget packages selected by filesystem path.
Advanced workspace capabilities.
Copy a package with isolated production dependencies to a target directory.
pnpm --filter @acme/web deploy distCopy a package with isolated production dependencies to a target directory.
cat >> pnpm-workspace.yaml <<'YAML'
catalog:
react: ^18.3.1
typescript: ^5.8.2
YAMLDefine reusable dependency versions in a workspace catalog.
Publish all packages in a workspace whose new versions are not yet in the registry.
pnpm publish -rPublish all packages in a workspace whose new versions are not yet in the registry.
pnpm -r rebuildRun rebuild across workspace packages.
Remove devDependencies from workspace package installs for production prep.
pnpm -r prune --prodRemove devDependencies from workspace package installs for production prep.