-
Notifications
You must be signed in to change notification settings - Fork 664
feat: add support for pnpm catalogs #5467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for pnpm catalogs #5467
Conversation
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
libraries/rush-lib/src/logic/pnpm/test/PnpmWorkspaceFile.test.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-with-catalog.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
|
@dmichon-msft Anything else we need here before this can be 🚢 -ed ? |
|
Hi @aramissennyeydd - thanks for this, great stuff. Question about how you're using |
|
@benkeen Good question, it's unfortunately not something I have experience with - we don't use any of the I know pnpm update itself has support for catalogs through the root |
|
Thanks the info! I put in a request ticket here: |
|
Hi, the CDN version of pnpm-config.schema.json also needs to be update. Catalog related schemas are missing. |

Summary
Adds support for defining pnpm catalog values to pnpm-config.json. This makes updating versions across a monorepo way easier because you can specify a version once and it gets picked up in a bunch of other places.
Details
https://pnpm.io/9.x/catalogs, basically this allows using an alias for common versions to reduce the size of changesets that target global versions.
My goal is for this to resemble the existing pnpm options. Weirdly, this needs to be in the pnpm-workspace file and isn't supported as a package.json pnpm property.
How it was tested
Added unit tests.
Tested in our monorepo with a
catalog:package forinstall/updateandadd. Thecatalog:specifier works for all 3, for install, a newcatalogtop level property is added into the lockfile and for add, ifcatalog:is the global version, add will automatically use it for new packages. I also tested that the temp shrinkwrap files still work, they use the resolved version in the specifier.I will likely need a preview version to test this with publish to make sure it works there as well.
Impacted documentation
Not sure? Might need additional documentation where pnpm-options values are described.