fix: reuse catalog resolutions of npm aliases correctly#8281
Merged
Conversation
Member
Author
|
I had a more complicated fix in #8280, but went with the one here after realizing the catalog snapshot version should probably stay as concrete versions for now. Otherwise we'd store peers suffixes in the catalog snapshot, which was never intended. |
zkochan
approved these changes
Jul 5, 2024
Member
|
Looks complicated but if it works, let it be, I guess. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When running
pnpm updatein this repo, pnpm looks forexeca@0.1.2and 404s instead of looking forsafe-execa@0.1.2.This is because of a bug in my prior PR from a few days ago. 🤦🏻♂️
The repo uses the catalog specifier for
execa. The change above isn't handling npm aliases correctly.pnpm/pnpm-workspace.yaml
Line 136 in a3d5f60
Changes
Using
replaceVersionInPrefto fix the bug above. This function handlesnpm:specifiers correctly.We're currently using this function elsewhere for a very similar short-circuiting purpose.
pnpm/pkg-manager/resolve-dependencies/src/resolveDependencies.ts
Line 1200 in 89363fa