-
-
Notifications
You must be signed in to change notification settings - Fork 25.7k
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(yarn)!: add optional support for yarn berry #12374
Conversation
This updates the yarn plugin to better support Yarn berry (aka Yarn v2 and beyond) because some commands are no longer available or changed in modern Yarn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn --version
is a really slow command. In my tests it was around 150ms for v1 and 300ms for v4.
We can't add 300ms in startup, it'd make it really slow.
I like the idea though, and I propose using a zstyle
config for it, like global-path
I'm not familiar with this. Can you provide a resource? Also, do you mean that through a zstyle the user would configure if they want the Yarn v1 or Yarn Berry set? |
Yep, I mean exactly that. You can see an example in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
alias yuca="yarn global upgrade && yarn cache clean" | ||
fi | ||
|
||
unset is_yarn_berry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carlosala you forgot to remove this line in your "nit" commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, thanks!
BREAKING CHANGE: some `yarn` aliases changed . Please see README for further information. Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
Standards checklist:
Changes:
yii
andyifl
are added. These are to install dependencies while locking versions down to theyarn.lock
file. The reasonyifl
is an alias foryii
is to respect that for v1 it's yarn install --frozen-lockfile, whereas for berry it's yarn install --immutable, soyii
.ydlx
andyn
are added to coveryarn dlx
andyarn node
Other comments:
Version checking inspired by the git plugin