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

feat: support for yarn 2 and yarn berry (3) #788

Closed
wants to merge 5 commits into from
Closed

feat: support for yarn 2 and yarn berry (3) #788

wants to merge 5 commits into from

Conversation

xhayper
Copy link

@xhayper xhayper commented Nov 24, 2022

This PR is confirmed to work on yarn classic (1), yarn 2 and yarn berry (3).

However due to the limitation of yarn 2 and yarn berry (3)'s cli, it's not possible to filter out devdependencies.

I will mark this PR as draft until someone figure out how to do so, i have been searching for a way to filter it out for a while now and i am too afraid to do massive codebase change.

  • filter out devDependencies

close #517

@xhayper
Copy link
Author

xhayper commented Nov 24, 2022

@microsoft-github-policy-service agree

@joaomoreno joaomoreno self-assigned this Nov 30, 2022
@joaomoreno
Copy link
Member

However due to the limitation of yarn 2 and yarn berry (3)'s cli, it's not possible to filter out devdependencies.

What is the limitation, exactly?

@xhayper
Copy link
Author

xhayper commented Nov 30, 2022

Currently, the CLI don't have the list command, so i move to using yarn info which can list out dependencies BUT have far less option than the list command in yarn classic. we can't filter out devdependencies using info command AND that's the only way to list all dependencies as of right now for yarn 2+.

Reference: https://yarnpkg.com/cli/info

@xhayper
Copy link
Author

xhayper commented Dec 1, 2022

I found out that there's an API for the yarn package manager, i will use it to figure out if we can filter out devdependencies.

https://github.com/yarnpkg/berry/blob/master/packages/plugin-essentials/sources/commands/info.ts

@xhayper
Copy link
Author

xhayper commented Dec 1, 2022

i am having trouble using the API, i don't know how to correctly implement the feature using the yarn api at all, it's too confusing for me to understand.

@Vap0r1ze
Copy link

I think you could filter them out manually by checking the package.json in cwd

@joaomoreno
Copy link
Member

Closing due to lack of activity.

@joaomoreno joaomoreno closed this Dec 5, 2023
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.

Support yarn v2
3 participants