pnpm catalog

Manages the catalogs of a workspace.

Commands#

migrate#

pnpm catalog migrate

Moves dependency specifiers into the default catalog of pnpm-workspace.yaml and replaces them in the workspace projects' package.json files with catalog:. It reads dependencies, devDependencies, optionalDependencies, and peerDependencies of every workspace project, the root project included.

A dependency moves only when every project that declares it directly uses the same specifier, and the default catalog has no different entry for it. Catalogs set by an updateConfig hook count. Because a hook's catalogs replace the ones in pnpm-workspace.yaml, a new entry is added only if the hook passes it through; otherwise the dependency is listed and left unchanged. A dependency whose direct declarations disagree with each other or with the catalog is listed and left unchanged. Dependencies that already use the catalog: or workspace: protocol, and local paths such as file: and link:, stay as they are.

The lockfile is not changed. Run pnpm install afterwards.