Add 'rush-pnpm up' support for catalogs#5585
Conversation
|
Howdy @iclanton, @dmichon-msft - don't suppose either of you have context or time to look at this? |
|
Shouldn't users be running |
|
Huh, neat. I never associated those two commands in my mind.
That could always be done with Tell me if I'm being barmy. |
|
Hey @iclanton - sorry to bug, got some time to look at this, this week? [We'd love this feature for our repo!] |
|
Hi @octogonz, @dmichon-msft would either of you be free for a review? |
iclanton
left a comment
There was a problem hiding this comment.
This overall looks fine, but would it be better to just include whatever functionality is missing from rush update?
| * @param workspaceYamlFilename - The path to the pnpm-workspace.yaml file | ||
| * @returns The catalogs object, or undefined if the file doesn't exist or has no catalogs | ||
| */ | ||
| public static loadCatalogsFromFile( |
| this._json.globalOnlyBuiltDependencies = onlyBuiltDependencies; | ||
| } | ||
| if (this.jsonFilename) { | ||
| JsonFile.save(this._json, this.jsonFilename, { updateExistingFile: true }); |
Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
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 Couple of thoughts:
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. |
Addresses: #5578
Right now, when you update packages in a Rush/pnpm repo using
rush-pnpm up, it updates the catalog entries incommon/temp/pnpm-workspace.yaml, but doesn't update Rush's actual catalog, stored inpnpm-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.