-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
chore: upgrade to yarn 3 #6162
Conversation
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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
6bed2f3
to
d8a5d74
Compare
@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 |
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.
Looks great, thanks! 🔥
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.
Thanks for all this! |
c129fc4
to
b87880b
Compare
@@ -52,7 +52,11 @@ | |||
}, | |||
"devDependencies": { | |||
"@typescript-eslint/parser": "6.2.0", | |||
"ajv": "^8.12.0", |
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.
I had to downgrade this to match the rest of the workspace, otherwise patch-package
hard errors on it
packages/utils/package.json
Outdated
@@ -78,6 +78,10 @@ | |||
}, | |||
"devDependencies": { | |||
"@typescript-eslint/parser": "6.2.0", | |||
"downlevel-dts": "*", | |||
"jest": "29.6.1", |
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.
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:
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", |
jest
for us, and we wouldn't need to bend over backwards to make yarn happy
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.
That sounds good to me! IIRC you'd mentioned this as a potential followup a while back. I'm definitely in favor.
packages/eslint-plugin/package.json
Outdated
@@ -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", |
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.
Changed to match other references
@@ -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 |
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.
wat
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.
(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 |
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.
That awkward moment when the upstream repo is archived without resolving the issue... 🤷
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.
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 Brought it back up to date and updated the local development guide. Hopefully we can merge now! |
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.
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 🚀
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):