Skip to content

cleanupUnusedCatalogs setting removes catalog entries referenced in overrides #11072

@frankeld

Description

@frankeld

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

No response

Which area(s) of pnpm are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

pnpm-workspace.yaml:

catalog:
  lodash: ^4.17.21
overrides:
  lodash: "catalog:"

package.json (no direct dependency on lodash):

{
  "dependencies": {}
}

Running pnpm install removes the lodash entry from the catalog, even though it's still used by the override.

Describe the Bug

removePackagesFromWorkspaceCatalog does not consider overrides when building the set of used catalog entries.

Expected Behavior

Catalog entries used in overrides remain when cleanupUnusedCatalogs is enabled

Which Node.js version are you using?

Various

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions