-
Notifications
You must be signed in to change notification settings - Fork 41
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
Switch to Yarn 4 (Berry) #680
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #680 +/- ##
=========================================
- Coverage 55.76% 0 -55.77%
=========================================
Files 401 0 -401
Lines 5986 0 -5986
Branches 1312 0 -1312
=========================================
- Hits 3338 0 -3338
+ Misses 2268 0 -2268
+ Partials 380 0 -380
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -8,28 +8,28 @@ const monorepoRoot = path.resolve(__dirname, "../../.."); | |||
* Because .*ignore files are not composable, we cannot import or otherwise reuse | |||
* a top-level .eslintignore. To avoid repetition and to maintain a coherent behavior | |||
* of ESLint CLI and IDE extensions, we generate ignore patterns for each workspace | |||
* based from .gitignore. This is done via ignorePatterns option in ESLint config. | |||
* based from .prettierignore. This is done via ignorePatterns option in ESLint config. |
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.
Switching ignore list source because of a new section called "Shared between linters". We can ignore .yarn/
in linters, but we still need to track .yarn/releases/*
by git.
"lint:eslint": "eslint --report-unused-disable-directives .", | ||
"prepare": "rimraf ./dev/src && lnk -f ./src ./dev", |
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.
prepare
is deprecated in Yarn Berry
.github/workflows/ci.yml
Outdated
packages: | ||
name: NPM Packages | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 30 ## https://github.com/actions/upload-artifact/issues/358 | ||
timeout-minutes: 60 |
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've increased timeout because cold yarn + rust warmup has been causing CI failures: https://github.com/blockprotocol/blockprotocol/actions/runs/3887049425/jobs/6632856500
We are no longer affected by actions/upload-artifact#358 once #769 has been merged. I've kept a large timeout just in case, but I don't think we need it except for some really rare edge cases.
Can we get rid of our top-level It would complement our cleanup of root (started in #875) well. |
@nonparibus it's mentioned in PR why we can't
|
I have realized we can specify a custom directory for |
|
🌟 What is the purpose of this PR?
This PR migrates this repo to Yarn Berry (a.k.a. Yarn Modern) by introducing a local version of Yarn (
yarn set version canary
).🔗 Related links
🚫 Blocked by
main
on merge)🔍 What does this change?
yarn help
).yarn/releases
for everyone)yarn.lock
is a valid YAML now (this change is the largest contributor to PR diff)📜 Does this require a change to the docs?
As of this PR's opening, Yarn 4 was still RC and subject to breaking changes. However, since October 2023
4.x
has been official and stable.@kachkaev: Yarn Berry has a built-in
yarn patch
functionality, but these patches are not automatically upgraded: [Bug?]: Yarn upgrade doesn't upgrade patches yarnpkg/berry#4970. I've keptpatch-package
for now, but we should be able to remove this extra dependency one day and end up with.yarn/patches
instead ofpatches
in root.@kachkaev: I had to add
"lib": ["DOM", "DOM.Iterable", "ESNext"]
to the base Node.js config. This was needed for type-checkingnode_modules
as part oflint:tsc
. The problem is with some Node-only dependencies depending on typings from DOM lib. We could get away with these upstream bugs because package resolution in Yarn 1 is a bit more loose.🐾 Next steps
patch-package
, when resolved.🛡 What tests cover this?