Repository navigation
fix(yarn): parse grouped lockfile keys resolving to one version - #60
Merged
Merged
Conversation
Grouped Berry keys like "caniuse-lite@npm:^1.0.30001702, caniuse-lite@npm:^1.0.30001746" were passed to splitPackage, whose last-@ search crossed the descriptor boundary and produced a malformed name that 404'd on npm download. Derive the name from the entry's resolution locator instead, which always holds the single resolved package. Closes ai#55
Grouped Yarn 1 keys like "@scope/pkg@^1.0.0", "@scope/pkg@^2.0.0" were passed whole to splitPackage, whose last-@ search crossed the descriptor boundary and produced a malformed name that 404'd on npm download. Yarn 1 has no resolution locator, so derive the name from the first grouped descriptor; every descriptor in a group shares one package ident. Refs ai#55
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.
Yarn writes several descriptors that resolve to the same package as one comma-separated lockfile entry:
Loader gives this whole string to
splitPackage. It looks for last@, but does not know about comma, so it cuts in wrong place and returnscaniuse-lite@^1.0.30001702, caniuse-lite. This is not real package so registry returns an error.Fix is to read the name from the package that was actually installed.
resolutionlocator, not the key.Read more at #55.
Fixes #55