Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): update yarn-parser to handle yarn v4 syntax #29067

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

a88zach
Copy link
Contributor

@a88zach a88zach commented Nov 25, 2024

Update the yarn-parser so that yarn.lock file generation works with yarn v4

Current Behavior

yarn.lock is not correctly created when using yarn v4

"":
  version: 1.22.8
  resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin<compat/resolve>::version=1.22.8&hash=c3c19d"
  dependencies:
    is-core-module: "npm:^2.13.0"
    path-parse: "npm:^1.0.7"
    supports-preserve-symlinks-flag: "npm:^1.0.0"
  bin:
    resolve: bin/resolve
  checksum: 0446f024439cd2e50c6c8fa8ba77eaa8370b4180f401a96abf3d1ebc770ac51c1955e12764cde449fde3fff480a61f84388e3505ecdbab778f4bef5f8212c729
  languageName: node
  linkType: hard

Expected Behavior

yarn.lock should be created correctly with no missing keys

Related Issue(s)

Fixes #19881

@a88zach a88zach requested review from meeroslav and a team as code owners November 25, 2024 19:08
Copy link

vercel bot commented Nov 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Nov 25, 2024 7:11pm

normalizedKey = key
.slice(0, key.indexOf('#'))
.replace(`@patch:${packageName}@`, '@npm:');
.replace(regEx, '@npm:$2');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entries for yarn 3 follow this syntax:
resolve@patch:[email protected]#~builtin<compat/resolve>

The entries for yarn 4 follow this syntax:
resolve@patch:resolve@npm%3A1.22.8#optional!builtin<compat/resolve>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yarn.lock not generated correctly with yarn v4
2 participants