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

support yarn version 2 #36

Closed
vignanl opened this issue Mar 30, 2021 · 4 comments · Fixed by #252
Closed

support yarn version 2 #36

vignanl opened this issue Mar 30, 2021 · 4 comments · Fixed by #252

Comments

@vignanl
Copy link

vignanl commented Mar 30, 2021

Projects which use Yarn version 2 are facing caching issue with lage because there is a logical dependency of parsing yarn lock file in workspace-tools. current workspace-tools can only parse lock files of yarn version 1, it breaks for yarn version 2 lock files.

#microsoft/lage#129

@axelhzf
Copy link

axelhzf commented Apr 27, 2021

It looks like parsing yarn2 is possible with the @yarnpkg/core package

https://github.com/snyk/nodejs-lockfile-parser/pull/75/files#diff-b2c66eb5bb9dd1c3dc4998a5d18767af92cc71cd287f5b115a8a602dfc7a275aR27

And here is how to test the lockfile version

https://github.com/snyk/nodejs-lockfile-parser/pull/75/files#diff-d5a4b3a0309f2337144861084c1014523cced561eb722cb9684c63f5e41e0567R120

If using an external library is an option, https://github.com/snyk/nodejs-lockfile-parser can parse lockfiles in several formats including yarn2.

@shaulgo
Copy link

shaulgo commented Mar 24, 2022

Are there any plans to fix this?

@kenotron
Copy link
Member

kenotron commented Sep 6, 2022

The external lockfiles parser would be okay if it's relatively clean and simple (and well maintained)!

@kenotron
Copy link
Member

Sooooo, first off, I have a great coworker who is also interested in this. He is going to contribute a disabled, failing test that tests against yarn 2 / 3 here first. I'll then have the opportunity to fix it by either consuming a new package (like nodejs-lockfile-parser) or consuming the @yarnpkg/core from v2+ directly. Some implementation notes:

We'll need a failing test here:

https://github.com/microsoft/workspace-tools/tree/master/src/__tests__

And likely a yarn 2/3 fixture added to:

https://github.com/microsoft/workspace-tools/tree/master/src/__fixtures__

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 a pull request may close this issue.

4 participants