Repository navigation
Fix yarn.lock v1 scoped alias for unscoped package - #5470
Open
Shubham-dev-stack wants to merge 1 commit into
Open
Shubham-dev-stack wants to merge 1 commit into
Shubham-dev-stack wants to merge 1 commit into
Conversation
Author
|
Hi @JonoYang @pombredanne, gentle ping on this PR when you have a moment. All package parsing tests and fixtures pass locally. Happy to address any feedback or adjust anything needed! |
Signed-off-by: Shubham <shubhamcyberr@gmail.com>
Shubham-dev-stack
force-pushed
the
fix-yarn-lock-v1-scoped-alias
branch
from
December 2, 2026 03:05
faed1da to
ee88d60
Compare
This branch has not been deployed
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.
Fixes #5466
When a
yarn.lockv1 file has a scoped alias for an unscoped package (like@jest/react-is-18@npm:react-is@^18.3.1),YarnLockV1Handler.parsewas failing with anAssertionErrorbecausereq.count('@')is 3 instead of 2 or 4.Also, if we only allowed 3
@s, splitting on/first would leave@jestas the namespace forreact-is. So I stripped the<alias>@npm:prefix beforerpartition('/')to get the right package name and empty namespace.Added a test case and expected fixture for this in
tests/packagedcode/test_npm.py.Tasks
pytest tests/packagedcode/test_npm.py -k yarn_locklocally