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(build): support yarn 2.x #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mtyeh411
Copy link

@mtyeh411 mtyeh411 commented Jul 22, 2023

this PR adds support for yarn 2.x

i had offered these changes to the original gjaldon/heroku-buildpack-phoenix-static project over 2 years ago (gjaldon/heroku-buildpack-phoenix-static#116)

offering these changes to the Gigalixir fork since that seems to be getting maintained

@gigatim
Copy link
Contributor

gigatim commented Aug 26, 2023

I'd be happy to add yarn 2 support to the buildpack. Can you answer the following questions:

  1. why are you checking for .pnp.* and not just .pnp.js?
  2. is the goal of is_yarn2_configured to determine if the major version of yarn downloaded/installed is 2 or greater?
  3. why set the yarn version to berry instead of the specifically installed version of yarn?

Your PR has several bash errors in it, but I'm willing to clean them up if you can answer the questions above.

@mtyeh411
Copy link
Author

mtyeh411 commented Nov 19, 2023

hi @gigatim i totally didn't see the message you posted. i offered theses changes a year and a half ago back when this buildpack was managed in the other project.

that all being said, i'll attempt to answer your questions as best as i can:

  1. why are you checking for .pnp.* and not just .pnp.js?

my glob pattern is also looking for .pnp.cjs and .pnp.loader.mjs files in addition to .pnp.js. checking for just .pnp.js should probably be sufficient.

  1. is the goal of is_yarn2_configured to determine if the major version of yarn downloaded/installed is 2 or greater?

the intent should be to check the requested major version of yarn if 2 or greater.

  1. why set the yarn version to berry instead of the specifically installed version of yarn?

this is a bug (it literally just bit me as i was attempting to deploy last night and it was targeting yarn 4.x). i just pushed change to fix that.

i'm more than happy to hand this over to you. i've been using my buildpack fork for the past year and a half but it has been suited to my situation (for a project that i don't tend to regularly) and would be great to make it a more robust solution that addresses the changes to the yarn ecosystem since i first authored it

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.

None yet

2 participants