Skip to content

chore: upgrade to yarn 3 #6162

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

Merged
merged 3 commits into from
Aug 20, 2023
Merged

chore: upgrade to yarn 3 #6162

merged 3 commits into from
Aug 20, 2023

Conversation

JamesHenry
Copy link
Member

@JamesHenry JamesHenry commented Dec 3, 2022

PR Checklist

Overview

Migrates the codebase from yarn v1 to yarn v3, using the node_modules linker - not PnP - to ensure maximum consistency before and after the migration.

I confirmed that there were no issues with lerna publishing by publishing a canary version to verdaccio locally (this will not negatively impact the canary release post-merge):

image

Sorry, something went wrong.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JamesHenry!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@netlify
Copy link

netlify bot commented Dec 3, 2022

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 7d2396e
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/64e11b877623d60008e113be
😎 Deploy Preview https://deploy-preview-6162--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@JamesHenry JamesHenry force-pushed the yarn-3 branch 2 times, most recently from 6bed2f3 to d8a5d74 Compare December 3, 2022 14:05
@JamesHenry JamesHenry marked this pull request as ready for review December 3, 2022 14:34
@JamesHenry
Copy link
Member Author

@bradzacher @JoshuaKGoldberg please have a play with this, it all looks good to me locally and CI is passing.

Once you are happy and approve the PR please do not merge, so that I can coordinate the update of the automation jobs

JoshuaKGoldberg
JoshuaKGoldberg previously approved these changes Dec 3, 2022
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looks great, thanks! 🔥

bradzacher
bradzacher previously approved these changes Dec 7, 2022
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

25a

once you fix the CI I'm happy with this.
now i'll need to get used to the new console output from yarn sadge

bradzacher
bradzacher previously approved these changes Dec 12, 2022
bradzacher
bradzacher previously approved these changes Dec 14, 2022
@liuxingbaoyu
Copy link
Contributor

Thanks for all this!

@bradzacher bradzacher added repo maintenance things to do with maintenance of the repo, and not with code/docs 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labels Jan 30, 2023
@nx-cloud
Copy link

nx-cloud bot commented Jul 30, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 7d2396e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 40 targets

Sent with 💌 from NxCloud.

@JamesHenry JamesHenry force-pushed the yarn-3 branch 2 times, most recently from c129fc4 to b87880b Compare July 30, 2023 12:40
@typescript-eslint typescript-eslint deleted a comment from nx-cloud bot Jul 30, 2023
@typescript-eslint typescript-eslint deleted a comment from nx-cloud bot Jul 30, 2023
@@ -52,7 +52,11 @@
},
"devDependencies": {
"@typescript-eslint/parser": "6.2.0",
"ajv": "^8.12.0",
Copy link
Member Author

@JamesHenry JamesHenry Jul 30, 2023

Choose a reason for hiding this comment

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

I had to downgrade this to match the rest of the workspace, otherwise patch-package hard errors on it

@@ -78,6 +78,10 @@
},
"devDependencies": {
"@typescript-eslint/parser": "6.2.0",
"downlevel-dts": "*",
"jest": "29.6.1",
Copy link
Member Author

@JamesHenry JamesHenry Jul 30, 2023

Choose a reason for hiding this comment

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

Having to match all these jest versions is pretty cumbersome, but required to make the naked jest calls in npm scripts work with modern yarn.

The way they recommend handling this is different and involves sharing scripts between workspaces, or using run -T in front of the script contents, see here:

https://yarnpkg.com/getting-started/qa#how-to-share-scripts-between-workspaces

Somewhat related - we could avoid the need for this entirely if we always let Nx run the tasks through its own executors and then just switch the script contents to be nx test like we did here:

"test": "nx test --code-coverage",
- it would resolve jest for us, and we wouldn't need to bend over backwards to make yarn happy

Copy link
Member

Choose a reason for hiding this comment

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

That sounds good to me! IIRC you'd mentioned this as a potential followup a while back. I'm definitely in favor.

@@ -76,15 +76,19 @@
"@types/prettier": "*",
"@typescript-eslint/rule-schema-to-typescript-types": "6.2.0",
"@typescript-eslint/rule-tester": "6.2.0",
"ajv": "^6.12.6",
"ajv": "^6.10.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to match other references

@JamesHenry JamesHenry removed the awaiting response Issues waiting for a reply from the OP or another party label Jul 30, 2023
@@ -72,6 +72,9 @@ jobs:
rm migrations.json
fi

# Run the special nx repair command to ensure config matches latest and greatest
npx nx repair
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

(not a blocker, I just am curious what this actually does)

@@ -5,7 +5,9 @@
command = "NX_VERBOSE_LOGGING=true yarn patch-package && yarn nx build website"
[build.environment]
NETLIFY_USE_YARN = "true"
YARN_FLAGS = "--ignore-scripts"
# TODO: adjust these once https://github.com/netlify/build-image/issues/612 is resolved
Copy link
Member

Choose a reason for hiding this comment

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

That awkward moment when the upstream repo is archived without resolving the issue... 🤷

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

This looks great! I read through and think I understand the strategies and upstream-blocked-todo-workarounds. Also I tried it out locally and -with the caveat I commented in package.json- it seems to work great on my end. Nice! 👏

Only requesting changes because I think we'll need to update the local development docs.

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Jul 31, 2023
@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label Aug 19, 2023
@JamesHenry
Copy link
Member Author

@JoshuaKGoldberg Brought it back up to date and updated the local development guide. Hopefully we can merge now!

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Tried it out locally again and it all works great! No need for me to manually run .cjs files from the repo. Thanks! Awesome stuff @JamesHenry 🚀

@JoshuaKGoldberg JoshuaKGoldberg merged commit 2e1cfd5 into main Aug 20, 2023
@JoshuaKGoldberg JoshuaKGoldberg deleted the yarn-3 branch August 20, 2023 22:10
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repo: Can't develop because of yarn1
5 participants