-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Better support sets of dependencies that should be on the same version in pnpm catalogs #8245
Description
Contribution
- I'd be willing to implement this feature (contributing guide)
Describe the user story
The catalog: protocol allows developers to deduplicate dependency specifiers across different package.json files in a repo.
There are some sets of dependencies (typically ones published from a monorepo) that follow similar version schemes and ideally upgrade "together". For example, you generally want to keep react, react-dom, and react-is on the same version.
# pnpm-workspace.yaml
catalog:
react: ^18.3.1
react-dom: ^18.3.1
react-is: ^18.3.1Describe the solution you'd like
It would be convenient to offer some way to further deduplicate grouped sets of dependencies that all share the same version.
Wildcard
# pnpm-workspace.yaml
catalogs:
react:
'*': '^18.3.1Referencing another entry:
# pnpm-workspace.yaml
catalog:
react: ^18.3.1
react-dom: catalog:default:react
react-is: catalog:default:reactDescribe the drawbacks of your solution
Both approaches make it harder to automatically upgrade dependencies through pnpm update. The pnpm update command's implementation would need to understand these grouped sets of dependencies share a version.
I'm not sure whether we should implement this feature yet, but wanted to drop down a feature request describing the problem and gauge whether we should solve it. Please 👍 if you think some solution to this would be valuable.
Describe alternatives you've considered
N/A