[rush] Rename the subspace pnpmfileSettings file to globalPnpmfileSettings.json to avoid overwriting the original pnpmfileSettings.json #5133
+12
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This MR rename subspace pnpmfileSettings file to globalPnpmfileSettings.json, because subspace pnpmfileSettings overrides original pnpmfileSettings and they have different data structures.
subspace pnpmfileSettings
rushstack/libraries/rush-lib/src/logic/pnpm/IPnpmfile.ts
Lines 34 to 39 in e64a1e5
original pnpmfileSettings
rushstack/libraries/rush-lib/src/logic/pnpm/IPnpmfile.ts
Lines 13 to 22 in e64a1e5
Due to the missing preferredVersion information in subspace pnpmfileSettings file, the preferredVersion does not take effect when the subspace is enabled.
Fixes #5118
Details
After debugging rush-lib, I found that pnpmfileSettings.json will be written twice.
First time:
rushstack/libraries/rush-lib/src/logic/pnpm/PnpmfileConfiguration.ts
Lines 80 to 83 in 438525c
Second time:
rushstack/libraries/rush-lib/src/logic/pnpm/SubspacePnpmfileConfiguration.ts
Lines 50 to 56 in 438525c
The second write operation will overwrite the first write content. And pnpmfileSettings.json is read once by global-pnpmfile.cjs and pnpmfile.cjs respectively.
Maybe we should distinguish the file names written twice, one is named pnpmfileSettings.json and the other named is globalPnpmfileSettings.json.
How it was tested
Impacted documentation