Workspace detection
Patterns are read from the first of these that yields at least one pattern:
pnpm-workspace.yaml(packages:)package.json(workspaces, either an array orworkspaces.packages)lerna.json(packages;["packages/*"]when the field is missing)
If none of them yields a pattern, the root package.json is used as a
single-package fallback.
With pnpm-workspace.yaml, the root package is also included even when
packages: does not list it, matching pnpm, which always treats the workspace
root as part of the workspace. With package.json workspaces or
lerna.json, the root is not added.
Pattern syntax
Section titled “Pattern syntax”Patterns are relative to the repository root.
*matches within one directory level,?matches one character.**matches any number of directory levels;apps/**also matchesappsitself.- A leading
!removes directories matched by the other patterns.
node_modules, .git, dist, build, coverage and .turbo are never
searched.
A matched directory counts as a package when its package.json has a non-empty
name. If two directories have the same package name, the first one (in path
order) is used.
Which packages are registered
Section titled “Which packages are registered”Packages marked "private": true are always excluded, then --only / --exclude
are applied (see Options). On a real (non-dry) run,
packages not yet published to the registry are skipped with a warning.