Skip to content

Add --enable-pnpm-catalog flag to opt into pnpm workspace catalog detection - #1714

Open
cyril-sf wants to merge 1 commit into
changesets:mainfrom
yappbox:pnpm-catalog-support
Open

cyril-sf wants to merge 1 commit into
changesets:mainfrom
yappbox:pnpm-catalog-support

Conversation

@cyril-sf

@cyril-sf cyril-sf commented Aug 19, 2025

Copy link
Copy Markdown

When using pnpm workspaces with the catalog feature, updating a dependency version in the catalog section of pnpm-workspace.yaml is detected as a change by changesets.

Allow changeset add and changeset status to include updates from pnpm workspace catalogs when requested via the new flag.

Fixes #1707

@changeset-bot

changeset-bot Bot commented Aug 19, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3f7aac5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@changesets/cli Minor
@changesets/git Minor
@changesets/apply-release-plan Patch
@changesets/read Patch
@changesets/release-utils Patch
@changesets/get-release-plan Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Aug 19, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 9 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@ca0be26). Learn more about missing BASE report.
⚠️ Report is 61 commits behind head on main.

Files with missing lines Patch % Lines
packages/git/src/index.ts 89.13% 5 Missing ⚠️
packages/cli/src/run.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1714   +/-   ##
=======================================
  Coverage        ?   80.87%           
=======================================
  Files           ?       54           
  Lines           ?     2311           
  Branches        ?      703           
=======================================
  Hits            ?     1869           
  Misses          ?      437           
  Partials        ?        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cyril-sf
cyril-sf force-pushed the pnpm-catalog-support branch 2 times, most recently from 60c1607 to 17358fd Compare August 19, 2025 21:06
@chriswiggins

Copy link
Copy Markdown

Found out about pnpm catalogs yesterday (awesome feature!) and this is the only blocker stopping us from adopting them. Anything we can do to help with merging this PR?

@cyril-sf

Copy link
Copy Markdown
Author

I'm happy to work on any change that would be necessary to get this through the finish line.

@Andarist

Copy link
Copy Markdown
Member

Is catalog: useful mainly for external packages outside of the monorepo? If yes, then it seems we should make the auto-bumps based on its changes an option. If you think about catalog: as being just a sugar over inlined versions from the catalog then Changesets would, traditionally, not bump your monorepo packages based on changes to external dependencies. There were requests to make that work though so perhaps this would be a good occasion to implement this as a flag if you have already implemented the core sinceRef~ logic for the catalog anyway.

@cyril-sf

cyril-sf commented Sep 12, 2025

Copy link
Copy Markdown
Author

Thanks for the reply!

Changesets would, traditionally, not bump your monorepo packages based on changes to external dependencies

This doesn't seem right. If my package depends on React 17 and I bump it to 18, it requires a version bump of my package.

But happy to have a flag if that's what it takes. I can try to take a stab at it next week.

@chriswiggins

Copy link
Copy Markdown

Changesets will generate a change for any files in a normal (flat) repository right? In the monorepo catalog case, there could be no file changes under each of the packages, but the workspace file (and associated catalog entries) IS modified, which would mean a change, which is what @cyril-sf has implemented I think?

@cyril-sf

Copy link
Copy Markdown
Author

@chriswiggins correct!

@cyril-sf cyril-sf changed the title Add support for catalog feature with pnpm workspace Add --enable-pnpm-catalog flag to opt into pnpm workspace catalog detection Oct 20, 2025
@cyril-sf
cyril-sf force-pushed the pnpm-catalog-support branch from 23858af to 7edcd69 Compare October 20, 2025 15:09
…ection

When using pnpm workspaces with the catalog feature, updating a dependency version in the catalog section of pnpm-workspace.yaml is detected as a change by changesets

- Allow changeset add and changeset status to include updates from pnpm workspace catalogs when requested via the new flag.
- Keep catalog-only edits ignored by default, while documenting and surfacing the opt-in behaviour.
@cyril-sf
cyril-sf force-pushed the pnpm-catalog-support branch from 7edcd69 to 3f7aac5 Compare October 20, 2025 15:11
@cyril-sf

Copy link
Copy Markdown
Author

@Andarist I've added a --enable-pnpm-catalog option.

I'm not sure how to test end to end without the code being part of a release. I usually just run npx changeset.

Let me know if it's good or if you have feedback!

@lenaggar

Copy link
Copy Markdown

I would love to see this merged, I worked on an improvement to have a single catalog for all the packages/apps inside our monorepo.

However, since we also rely on renovate PRs to upgrade our dependencies, they all fail on the CI because the changeset generated no changes.

@elliott-with-the-longest-name-on-github

Copy link
Copy Markdown

I just wanted to respond to this as it bit us over at SvelteKit today:

If you think about catalog: as being just a sugar over inlined versions from the catalog then Changesets would, traditionally, not bump your monorepo packages based on changes to external dependencies. There were requests to make that work though so perhaps this would be a good occasion to implement this as a flag if you have already implemented the core sinceRef~ logic for the catalog anyway.

This isn't really correct, at least not as I'm reading it. When you publish a package with catalog:x versions, the catalog:x in that package's package.json is replaced with the version from the workspace catalog. So, in effect, updating the version in the workspace catalog is the same as you manually going into each package.json that references that package using catalog:x and updating the version there. If you were to do that manually, you'd have to change the package.json in each package, which would show up as a change to changesets. Ergo, changing the catalog file should show up as a change for each package that references the updated dependency.

Hoping this can get merged at some point; we'd love to be able to use catalogs as our monorepo has quite a few packages and we're basically stuck only using it for dev dependencies.

@cyril-sf

Copy link
Copy Markdown
Author

@Andarist (or an admin on this repo), any chance to get some feedback one way or the other?

@Robbe95

Robbe95 commented Mar 20, 2026

Copy link
Copy Markdown

Would love to see catalog support getting added, it just makes managing deps so much easier, especially together with changesets. Is there any movement on this?

@Netail

Netail commented May 8, 2026

Copy link
Copy Markdown
Contributor

Perhaps a little more generic, to also support Yarn's catalogs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changesets doesn't detect changes when updating dependency versions in pnpm workspace catalog

7 participants