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

Unvendor Yarn; favor Corepack for installation #243

Merged
merged 2 commits into from
Jun 6, 2024
Merged

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Apr 25, 2024

According to the Yarn documentation, Yarn no longer needs to be bundled with a project, but rather, installing Yarn ought to be done using Corepack, which is shipped in modern Node versions. This commit removes the Yarn binary from the repo and updates the installation instructions in the README to match.

Examples

(None)

According to the Yarn documentation, Yarn no longer needs to be bundled
with a project, but rather, installing Yarn ought to be done using
[Corepack](https://yarnpkg.com/corepack), which is shipped in modern
Node versions. This commit removes the Yarn binary from the repo and
updates the installation instructions in the README to match.
@mcmire mcmire requested a review from a team as a code owner April 25, 2024 21:06
@legobeat
Copy link
Contributor

Looks like corepack support is still pending in @actions/setup-node: actions/setup-node#901

@legobeat
Copy link
Contributor

Devs will still need to run corepack enable locally but other than that it seems like we can hack around it like #244 .

* ci: run `corepack enable` as part of prepare

* chore(ci): do redundant setup-node step before checkout to enable yarn v4 before deps install

- makes nodejs version `lts/*` explicit in ci workflow
Copy link
Contributor Author

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

I kind of dislike the hacks we have to do here. It makes the GitHub workflow files longer and more complicated than they need to be. It's true Corepack is the recommended way to install Yarn, but it doesn't mean that the yarnPath method is deprecated. So I'm inclined to not do this and keep the current way. Then again, the downside to the current approach is that projects are obligated to use the same version of Yarn as in the template, which doesn't seem completely necessary either. Sigh...

@legobeat
Copy link
Contributor

legobeat commented Apr 29, 2024

I kind of dislike the hacks we have to do here. It makes the GitHub workflow files longer and more complicated than they need to be.

Agreed. I still find it less ugly and less objectively bad than redundantly checking in the entire minified yarn cjs file without additional integrity-checking in every repo...

@mcmire
Copy link
Contributor Author

mcmire commented Apr 30, 2024

Yeah, that's true. Okay, I'm convinced. ✅

@legobeat legobeat requested a review from a team May 1, 2024 04:33
@legobeat legobeat requested a review from a team May 9, 2024 00:53
@mcmire mcmire requested a review from a team May 28, 2024 21:23
@legobeat legobeat requested review from a team and removed request for a team May 29, 2024 07:45
@legobeat
Copy link
Contributor

legobeat commented Jun 1, 2024

@mcmire ping

@legobeat legobeat requested review from HowardBraham and bergeron June 1, 2024 01:59
@mcmire mcmire merged commit 03f796f into main Jun 6, 2024
16 checks passed
@mcmire mcmire deleted the remove-yarn-binary branch June 6, 2024 21:19
@mcmire mcmire mentioned this pull request Jun 25, 2024
3 tasks
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.

3 participants