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

Update to Yarn Berry #6271

Closed
wants to merge 24 commits into from
Closed

Update to Yarn Berry #6271

wants to merge 24 commits into from

Conversation

queengooborg
Copy link
Collaborator

@queengooborg queengooborg commented May 14, 2022

This PR is intended to be an experiment and demonstration of what we would need to do if we wanted to upgrade to Yarn v2+ (codenamed "Berry"). Note that I don't actually intend for this PR to be merged, at least not unless we want to make the switch (see mdn/mdn-community#61 for discussion on that).

@queengooborg queengooborg marked this pull request as draft May 14, 2022 02:08
@github-actions github-actions bot added the merge conflicts 🚧 Please rebase onto or merge the latest main. label May 16, 2022
@github-actions
Copy link
Contributor

This pull request has merge conflicts that must be resolved before we can merge this.

@github-actions github-actions bot removed the merge conflicts 🚧 Please rebase onto or merge the latest main. label May 25, 2022
@caugner
Copy link
Contributor

caugner commented May 25, 2022

So it seems we're running into two issues here:

  1. yarn add file:mdn-yari-0.1.6.tgz fails, after having created the file with npm pack:
    yarn add file:mdn-yari-0.1.6.tgz
    ➤ YN0027: file:mdn-yari-0.1.6.tgz@unknown can't be resolved to a satisfying range
    ➤ YN0035: The remote server failed to provide the requested resource
    ➤ YN0035:   Response Code: 404 (Not Found)
    ➤ YN0035:   Request Method: GET
    ➤ YN0035:   Request URL: https://registry.yarnpkg.com/file:mdn-yari-0.1.6.tgz
    
  2. yarn install in deployer/aws-lambda/tests/ alternatively changes the yarn.lock file, causing yarn --immutable to always fail.

Possible solutions:

  1. Replace npm pack/publish with yarn pack/publish (edit: Did't fix it, but switching to yarn v1 for that part worked.).
  2. Use workspaces to link the packages. (edit: Doesn't solve the ever-mutating yarn.lock file.)

@caugner
Copy link
Contributor

caugner commented May 25, 2022

@queengooborg Sorry for trashing your branch. I realized only now that I could and should have opened a separate PR targeting your PR.

I don't quite see what we're doing wrong in yari that would cause yarn v3 to either continuously update a hash in yarn.lock, or to bail with this error: Error: While persisting /Users/me/github/mdn/yari/libs/fundamental-redirects/ -> /Users/me/github/mdn/yari/deployer/aws-lambda/content-origin-request/node_modules/@yari-internal/fundamental-redirects EEXIST: file already exists, symlink '../../../../../libs/fundamental-redirects' -> '/Users/me/github/mdn/yari/deployer/aws-lambda/content-origin-request/node_modules/@yari-internal/fundamental-redirects'

Using workspaces doesn't help either. 🤷

@queengooborg
Copy link
Collaborator Author

No worries, please feel free to push to any of my branches here on Yari!

That hash-or-error issue is certainly weird though...

@caugner
Copy link
Contributor

caugner commented May 25, 2022

Even without --immutable, yarn isn't happy:

image

🤦

@github-actions
Copy link
Contributor

This pull request has merge conflicts that must be resolved before we can merge this.

@github-actions github-actions bot added the merge conflicts 🚧 Please rebase onto or merge the latest main. label May 27, 2022
@queengooborg
Copy link
Collaborator Author

queengooborg commented May 30, 2022

Closing this since mdn/mdn-community#108 voted NPM in favor of Yarn Berry.

@queengooborg queengooborg deleted the yarn-berry branch May 30, 2022 08:31
@caugner caugner mentioned this pull request Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge conflicts 🚧 Please rebase onto or merge the latest main.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants