Skip to content

Add 'rush-pnpm up' support for catalogs - #5585

Merged
Ian Clanton-Thuon (iclanton) merged 6 commits into
microsoft:mainfrom
benkeen:main
Jul 28, 2026
Merged

Add 'rush-pnpm up' support for catalogs#5585
Ian Clanton-Thuon (iclanton) merged 6 commits into
microsoft:mainfrom
benkeen:main

Conversation

@benkeen

@benkeen Ben Keen (benkeen) commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Addresses: #5578

Right now, when you update packages in a Rush/pnpm repo using rush-pnpm up, it updates the catalog entries in common/temp/pnpm-workspace.yaml, but doesn't update Rush's actual catalog, stored in pnpm-config.json, so the update command doesn't fully work. This has been supported since pnpm@10.12.0. This PR enhances it to update the pnpm-config file too.

I also updated it to fix a small issue where JsonFile.save could throw an error due to an undefined $schema property.

Besides the tests, I've ran manual checks with our own Rush repo to confirm the catalog is getting updated properly.

@benkeen

Ben Keen (benkeen) commented Feb 5, 2026

Copy link
Copy Markdown
Contributor Author

Howdy Ian Clanton-Thuon (@iclanton), David Michon (@dmichon-msft) - don't suppose either of you have context or time to look at this?

@iclanton Ian Clanton-Thuon (iclanton) moved this from Needs triage to In Progress in Bug Triage Feb 9, 2026
@iclanton

Copy link
Copy Markdown
Member

Shouldn't users be running rush update instead of rush-pnpm update?

@benkeen

Copy link
Copy Markdown
Contributor Author

Huh, neat. I never associated those two commands in my mind.

rush update has a very limited, custom interface for Rush itself. What I'm trying to do is offer up all the extra options with pnpm update, for updating subsets of dependencies, like:

pnpm update -r "@babel/*"

That could always be done with rush-pnpm (but not rush update); this PR just lets that command handle catalogs too.

Tell me if I'm being barmy.

@benkeen

Copy link
Copy Markdown
Contributor Author

Hey Ian Clanton-Thuon (@iclanton) - sorry to bug, got some time to look at this, this week? [We'd love this feature for our repo!]

@benkeen

Copy link
Copy Markdown
Contributor Author

Hi Pete Gonzalez (@octogonz), David Michon (@dmichon-msft) would either of you be free for a review?

Comment thread common/changes/@microsoft/rush/main_2026-01-31-22-28.json Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overall looks fine, but would it be better to just include whatever functionality is missing from rush update?

Comment thread libraries/rush-lib/src/logic/pnpm/PnpmWorkspaceFile.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmOptionsConfiguration.ts
@benkeen

Copy link
Copy Markdown
Contributor Author

This overall looks fine, but would it be better to just include whatever functionality is missing from rush update?

I see what you're saying. I'm on the fence, but I think I'd lean towards keeping them separate. Feels like we'd be overloading rush update.

Couple of thoughts:

  • if we did this, we'd need the rush command to work with all supported package managers, and the features and nuances of how each of those update/upgrade commands work (I haven't looked into all the available options for each). We'd only want to enhance the rush update command if it supported them all.
  • API-wise, we'd need to separate the "raw" pnpm update command args from the existing rush update command args so there's no conflicts when running rush update, of course. The pnpm cmd allows various arguments we'd need to offer in order to make the command useful, which could be a challenge. They seem low-level enough that I immediately went to updating the rush-pnpm wrapper.

I dunno. I'd say enhance the rush-pnpm command first, then depending on how it goes and what sort of demand is shown, consider elevating the functionality to the full rush update later.

@benkeen

Copy link
Copy Markdown
Contributor Author

Updated, thanks Ian Clanton-Thuon (@iclanton).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments about test cleanup and async-ifying things.

Otherwise I think the gist of this is fine.

Comment thread libraries/rush-lib/src/logic/pnpm/PnpmOptionsConfiguration.ts
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmWorkspaceFile.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmWorkspaceFile.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmOptionsConfiguration.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmOptionsConfiguration.ts Outdated
Comment thread libraries/rush-lib/src/cli/test/RushPnpmCommandLineParser.test.ts Outdated
Comment thread libraries/rush-lib/src/cli/test/RushPnpmCommandLineParser.test.ts Outdated
Comment thread libraries/rush-lib/src/cli/test/RushPnpmCommandLineParser.test.ts Outdated
Comment thread libraries/rush-lib/src/cli/test/RushPnpmCommandLineParser.test.ts Outdated
Comment thread libraries/rush-lib/src/cli/test/RushPnpmCommandLineParser.test.ts Outdated
@benkeen

Copy link
Copy Markdown
Contributor Author

Updated, thanks Ian Clanton-Thuon (@iclanton).

Comment thread libraries/rush-lib/src/cli/test/RushPnpmCommandLineParser.test.ts Outdated
Comment thread libraries/rush-lib/src/cli/test/RushPnpmCommandLineParser.test.ts Outdated
Comment thread libraries/rush-lib/src/cli/test/RushPnpmCommandLineParser.test.ts Outdated
Comment thread libraries/rush-lib/src/cli/test/RushPnpmCommandLineParser.test.ts Outdated
Comment thread libraries/rush-lib/src/cli/test/RushPnpmCommandLineParser.test.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/test/PnpmOptionsConfiguration.test.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/test/PnpmWorkspaceFile.test.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmOptionsConfiguration.ts Outdated
@oliviadawd

Copy link
Copy Markdown

is there any timeline on getting this merged?

@benkeen

Copy link
Copy Markdown
Contributor Author

Apologies, Olivia Dawd (@oliviadawd) - I dropped the ball on pushing this. We don't do pnpm up's too often, and I've beeen manually copying/using AI to copy over the catalog info... 😬

I'll get the branch refreshed and push for getting it merged soon.

@oliviadawd

Copy link
Copy Markdown

no problem at all Ben Keen (@benkeen)! i'm mostly invested in this because my org's repo uses renovate and using rush-pnpm up would be great to bump the versions rather than create a regex to manually update the versions

@benkeen

Ben Keen (benkeen) commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Hey Ian Clanton-Thuon (@iclanton), just digging this PR out of the grave if you have the stomach for a fresh review. I believe it's up to date and closes the remaining open issue. I also ran a sanity check against our own repo and the catalog update works as expected.

@oliviadawd

Copy link
Copy Markdown

Ben Keen (@benkeen) it looks like there's some conflicts again? also Ian Clanton-Thuon (@iclanton) when you get the chance, could you take a look at this PR so it can get merged and released soon?

@benkeen

Copy link
Copy Markdown
Contributor Author

Updated. Don't suppose you'd have time for a review, Ian Clanton-Thuon (@iclanton)? No worries if not, I can bug one of the other folk.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good overall, but it'd be good to avoid the breaking API change.

Comment thread libraries/rush-lib/src/logic/pnpm/PnpmOptionsConfiguration.ts
Comment thread common/reviews/api/rush-lib.api.md
@iclanton
Ian Clanton-Thuon (iclanton) merged commit e9ed008 into microsoft:main Jul 28, 2026
6 checks passed
@benkeen

Copy link
Copy Markdown
Contributor Author

Thanks again, Ian Clanton-Thuon (@iclanton)!

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

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants