-
Notifications
You must be signed in to change notification settings - Fork 586
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
[rush-lib] Add pnpm-config.json to specify overrides,packageExtensions,neverBuiltDependencies in top level package.json created by Rush.js #3107
Conversation
Should these options go in |
As per zkochan said in this comment pnpm/pnpm#4080 (comment), these three properties are ok in monorepo scenario.
I am not sure, but currently |
@octogonz - thoughts on where these options should live? |
Hi @octogonz , could you kindly take a look at this. I believe it helps a lot to fix tons of |
Hi @octogonz , i saw your issue at pnpm/pnpm#4407. And zkochan adds more pnpm.xxx configurations into pnpm.
I'd like to add these fields into Recap my proposal:
And, if the central way to manage pnpm options is in the opposite direction to Rush design goal. I am also open to close this PR. Then, the official way turn out to be specify them in each projects, which is acceptable but kind of difficult to use IMHO... |
Note: PR #3337 has renamed our GitHub |
42125cf
to
feafd55
Compare
Can we just put these options in a separate file, whose schema is not tracked by Rush (so that new options added to pnpm don't require updates to Rush to support), and whose contents just get directly transcribed into |
Sure! @dmichon-msft I updated my code, and now those fields are specified in |
feafd55
to
2e24fd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't like having Rush do any validation whatsoever of the pnpm
field. That's pnpm
's job and adding the extra validation layer just makes it more brittle.
libraries/rush-lib/src/logic/pnpm/test/PnpmProjectManifestConfiguration.test.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/PnpmProjectManifestConfiguration.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/PnpmProjectManifestConfiguration.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/PnpmProjectManifestConfiguration.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/PnpmProjectManifestConfiguration.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/PnpmProjectManifestConfiguration.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/PnpmProjectManifestConfiguration.ts
Outdated
Show resolved
Hide resolved
…-03.json Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
…setting, and PNPM 5 is no longer supported as of Rush 5.47.0. Tune up the docs for the other "pnpmOptions" settings.
…ns", "neverBuiltDependencies", "allowedDeprecatedVersions", and a property bag "unsupportedPackageJsonSettings"
Proposed pnpm-config.json template for "rush init"
No worries @iclanton, i think this kind of "back and forth" shows me how Rush maintainers think of a "small feature" which may affect the whole system. I recalled in the first implementation of this feature, from my previous experience, i choose to follow the fashion of making everything explicitly, which means Rush should validate every pnpm field by JSON Schema. But i didn't defend it well. Now, here is a batch of code changes according to @octogonz 's proposal and your review suggestions. cc @dmichon-msft Could you kindly take another look? |
libraries/rush-lib/src/logic/pnpm/test/PnpmOptionsConfiguration.test.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/test/PnpmOptionsConfiguration.test.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/test/PnpmOptionsConfiguration.test.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/test/PnpmOptionsConfiguration.test.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/pnpm/test/PnpmOptionsConfiguration.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
Summary
Pnpm has some configurations in top level package.json. For now there is no way to add them. This PR adds support for overrides,packageExtensions,neverBuiltDependencies... in pnpmOptions
Details
Specify a bunch of pnpm configurations by
pnpmOptions
inrush.json
. it will be added undercommon/temp/package.json
'spnpm
property.overrides
packageExtensions
neverBuiltDependencies
onlyBuiltDependencies
peerDependencyRules
How it was tested
Test cases added, and tested in this repo.