Skip to content

Commit cc36ff8

Browse files
authored
Upgrade to Yarn 4 (#1954)
* chore: upgrade to yarn 4 * chore: update yarn cache command and enable Corepack in workflows * chore: update package dependencies to use yarn workspace protocol * chore: remove deprecated yarn flag from workflows
1 parent af450fa commit cc36ff8

File tree

38 files changed

+13975
-10313
lines changed

38 files changed

+13975
-10313
lines changed

.github/workflows/pull_request.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ jobs:
1313
with:
1414
node-version: '22.21.1'
1515

16+
- name: Enable Corepack
17+
run: corepack enable
18+
1619
- name: Get yarn cache directory path
1720
id: yarn-cache-dir-path
18-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
21+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
1922
- uses: actions/cache@v4.3.0
2023
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
2124
with:
@@ -24,38 +27,38 @@ jobs:
2427
restore-keys: |
2528
${{ runner.os }}-yarn-
2629
27-
- name: 📡 Install dependencies
28-
run: yarn install --frozen-lockfile --ignore-engines
30+
- name: Install dependencies
31+
run: yarn install --immutable
2932

30-
- name: 🤖 Ensure TS references are up to date
33+
- name: Ensure TS references are up to date
3134
run: yarn type:update-refs && git diff --exit-code
3235

33-
- name: 👀 Ensure we have no ESM-only dependencies
36+
- name: Ensure we have no ESM-only dependencies
3437
run: yarn vendor-check
3538

36-
- name: 🛠 Build packages
39+
- name: Build packages
3740
run: yarn build
3841

39-
- name: 🧪 Run tests
42+
- name: Run tests
4043
run: yarn test
4144
env:
4245
CI: true
4346

44-
- name: 📃 Generate docs
47+
- name: Generate docs
4548
run: yarn docs:generate
4649

47-
- name: ❤️ Run lint
50+
- name: Run lint
4851
run: yarn lint
4952

50-
- name: Build visx site without failure
53+
- name: Build visx site without failure
5154
run: yarn build
5255
working-directory: './packages/visx-demo/'
5356

5457
# @TODO
5558
# this fails on forks, we need to update workflow event type to `pull_request_target`
5659
# but this needs security review
5760
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target
58-
- name: 📐 Report package sizes
61+
- name: Report package sizes
5962
run: yarn build:sizes && yarn check:sizes
6063
env:
6164
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/push.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ jobs:
1717
node-version: '22.21.1'
1818
registry-url: 'https://registry.npmjs.org'
1919

20+
- name: Enable Corepack
21+
run: corepack enable
22+
2023
- name: Get yarn cache directory path
2124
id: yarn-cache-dir-path
22-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
25+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
2326
- uses: actions/cache@v4.3.0
2427
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
2528
with:
@@ -28,16 +31,16 @@ jobs:
2831
restore-keys: |
2932
${{ runner.os }}-yarn-
3033
31-
- name: 📡 Install dependencies
32-
run: yarn install --frozen-lockfile --ignore-engines
34+
- name: Install dependencies
35+
run: yarn install --immutable
3336

34-
- name: 🛠 Build packages
37+
- name: Build packages
3538
run: yarn build
3639

37-
- name: 📃 Generate docs
40+
- name: Generate docs
3841
run: yarn docs:generate
3942

40-
- name: 📐 Commit package sizes
43+
- name: Commit package sizes
4144
if: github.repository_owner == 'airbnb'
4245
# note: `git diff-index --quiet HEAD`
4346
# has exit code 0 if there are changes vs HEAD, else nothing to commit
@@ -49,7 +52,7 @@ jobs:
4952
git diff-index --quiet HEAD || git commit -m "build(${GITHUB_SHA}): auto-commit package sizes"
5053
git push
5154
52-
- name: 🚀 Release
55+
- name: Release
5356
if: github.repository_owner == 'airbnb'
5457
# the following configurations are needed for lerna to
5558
# - have git credentials for commiting tags
@@ -63,7 +66,7 @@ jobs:
6366
env:
6467
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6568

66-
- name: 🎨 Build and deploy gallery
69+
- name: Build and deploy gallery
6770
# below we
6871
# - setup git credentials provided via actions/checkout@v2
6972
# - initialize gh-pages-branch as an orphan branch so we don't build history

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,14 @@ webpack.config.js
3535
npm-shrinkwrap.json
3636
package-lock.json
3737

38+
# Yarn 4
39+
.yarn/*
40+
!.yarn/patches
41+
!.yarn/plugins
42+
!.yarn/releases
43+
!.yarn/sdks
44+
!.yarn/versions
45+
.pnp.*
46+
3847
# Generated files
3948
packages/visx-demo/src/generated/

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
enableGlobalCache: false
2+
3+
nodeLinker: node-modules

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"engines": {
1414
"node": ">=22.0.0",
15-
"yarn": ">=1.17.0"
15+
"yarn": ">=4.0.0"
1616
},
1717
"contributors": [
1818
{
@@ -99,7 +99,6 @@
9999
"fast-glob": "3.2.5",
100100
"filesize": "6.1.0",
101101
"jsdom": "27.0.0",
102-
"husky": "^3.0.0",
103102
"lerna": "^7.0.2",
104103
"node-fetch": "2.6.1",
105104
"prettier": "^2.8.1",
@@ -110,13 +109,10 @@
110109
"typescript": "^5.7.0",
111110
"vitest": "4"
112111
},
113-
"packageManager": "yarn@1.22.19",
112+
"packageManager": "yarn@4.10.3",
114113
"workspaces": {
115114
"packages": [
116115
"./packages/*"
117-
],
118-
"nohoist": [
119-
"**/@visx/vendor/**"
120116
]
121117
},
122118
"resolutions": {

packages/visx-annotation/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
},
3333
"dependencies": {
3434
"@types/react": "*",
35-
"@visx/drag": "3.13.0-alpha.0",
36-
"@visx/group": "3.13.0-alpha.0",
37-
"@visx/text": "3.13.2-alpha.0",
35+
"@visx/drag": "workspace:*",
36+
"@visx/group": "workspace:*",
37+
"@visx/text": "workspace:*",
3838
"classnames": "^2.3.1",
3939
"react-use-measure": "^2.0.4"
4040
},

packages/visx-axis/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
"homepage": "https://github.com/airbnb/visx#readme",
3030
"dependencies": {
3131
"@types/react": "*",
32-
"@visx/group": "3.13.0-alpha.0",
33-
"@visx/point": "3.12.0",
34-
"@visx/scale": "3.12.0",
35-
"@visx/shape": "3.13.0-alpha.0",
36-
"@visx/text": "3.13.2-alpha.0",
32+
"@visx/group": "workspace:*",
33+
"@visx/point": "workspace:*",
34+
"@visx/scale": "workspace:*",
35+
"@visx/shape": "workspace:*",
36+
"@visx/text": "workspace:*",
3737
"classnames": "^2.3.1"
3838
},
3939
"peerDependencies": {

packages/visx-brush/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
"react": "^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0"
3434
},
3535
"dependencies": {
36-
"@visx/drag": "3.13.0-alpha.0",
37-
"@visx/event": "3.12.0",
38-
"@visx/group": "3.13.0-alpha.0",
39-
"@visx/scale": "3.12.0",
40-
"@visx/shape": "3.13.0-alpha.0",
36+
"@visx/drag": "workspace:*",
37+
"@visx/event": "workspace:*",
38+
"@visx/group": "workspace:*",
39+
"@visx/scale": "workspace:*",
40+
"@visx/shape": "workspace:*",
4141
"classnames": "^2.3.1"
4242
}
4343
}

packages/visx-delaunay/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"dependencies": {
3434
"@types/react": "*",
35-
"@visx/vendor": "3.12.0",
35+
"@visx/vendor": "workspace:*",
3636
"classnames": "^2.3.1"
3737
},
3838
"peerDependencies": {

packages/visx-demo/package.json

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,44 @@
3131
"@types/d3-scale-chromatic": "^1.3.1",
3232
"@types/nprogress": "^0.2.0",
3333
"@types/prismjs": "^1.16.0",
34-
"@visx/annotation": "3.13.2-alpha.0",
35-
"@visx/axis": "3.13.2-alpha.0",
36-
"@visx/bounds": "3.13.1-alpha.0",
37-
"@visx/brush": "3.13.0-alpha.0",
38-
"@visx/chord": "3.13.0-alpha.0",
39-
"@visx/clip-path": "3.13.0-alpha.0",
40-
"@visx/curve": "3.12.0",
41-
"@visx/delaunay": "3.13.0-alpha.0",
42-
"@visx/drag": "3.13.0-alpha.0",
43-
"@visx/event": "3.12.0",
44-
"@visx/geo": "3.13.0-alpha.0",
45-
"@visx/glyph": "3.13.0-alpha.0",
46-
"@visx/gradient": "3.13.0-alpha.0",
47-
"@visx/grid": "3.13.0-alpha.0",
48-
"@visx/group": "3.13.0-alpha.0",
49-
"@visx/heatmap": "3.13.0-alpha.0",
50-
"@visx/hierarchy": "3.13.0-alpha.0",
51-
"@visx/legend": "3.13.0-alpha.0",
52-
"@visx/marker": "3.13.0-alpha.0",
53-
"@visx/mock-data": "3.12.0",
54-
"@visx/network": "3.13.0-alpha.0",
55-
"@visx/pattern": "3.13.0-alpha.0",
56-
"@visx/point": "3.12.0",
57-
"@visx/react-spring": "3.13.2-alpha.0",
58-
"@visx/responsive": "3.13.2-alpha.0",
59-
"@visx/sankey": "3.13.0-alpha.0",
60-
"@visx/scale": "3.12.0",
61-
"@visx/shape": "3.13.0-alpha.0",
62-
"@visx/stats": "3.13.0-alpha.0",
63-
"@visx/text": "3.13.2-alpha.0",
64-
"@visx/threshold": "3.13.0-alpha.0",
65-
"@visx/tooltip": "3.13.1-alpha.0",
66-
"@visx/vendor": "3.12.0",
67-
"@visx/visx": "3.13.2-alpha.0",
68-
"@visx/voronoi": "3.13.0-alpha.0",
69-
"@visx/wordcloud": "3.13.0-alpha.0",
70-
"@visx/xychart": "3.13.2-alpha.0",
71-
"@visx/zoom": "3.13.0-alpha.0",
34+
"@visx/annotation": "workspace:*",
35+
"@visx/axis": "workspace:*",
36+
"@visx/bounds": "workspace:*",
37+
"@visx/brush": "workspace:*",
38+
"@visx/chord": "workspace:*",
39+
"@visx/clip-path": "workspace:*",
40+
"@visx/curve": "workspace:*",
41+
"@visx/delaunay": "workspace:*",
42+
"@visx/drag": "workspace:*",
43+
"@visx/event": "workspace:*",
44+
"@visx/geo": "workspace:*",
45+
"@visx/glyph": "workspace:*",
46+
"@visx/gradient": "workspace:*",
47+
"@visx/grid": "workspace:*",
48+
"@visx/group": "workspace:*",
49+
"@visx/heatmap": "workspace:*",
50+
"@visx/hierarchy": "workspace:*",
51+
"@visx/legend": "workspace:*",
52+
"@visx/marker": "workspace:*",
53+
"@visx/mock-data": "workspace:*",
54+
"@visx/network": "workspace:*",
55+
"@visx/pattern": "workspace:*",
56+
"@visx/point": "workspace:*",
57+
"@visx/react-spring": "workspace:*",
58+
"@visx/responsive": "workspace:*",
59+
"@visx/sankey": "workspace:*",
60+
"@visx/scale": "workspace:*",
61+
"@visx/shape": "workspace:*",
62+
"@visx/stats": "workspace:*",
63+
"@visx/text": "workspace:*",
64+
"@visx/threshold": "workspace:*",
65+
"@visx/tooltip": "workspace:*",
66+
"@visx/vendor": "workspace:*",
67+
"@visx/visx": "workspace:*",
68+
"@visx/voronoi": "workspace:*",
69+
"@visx/wordcloud": "workspace:*",
70+
"@visx/xychart": "workspace:*",
71+
"@visx/zoom": "workspace:*",
7272
"babel-loader": "^8.2.2",
7373
"classnames": "^2.3.1",
7474
"d3-collection": "^1.0.4",
@@ -90,4 +90,4 @@
9090
"publishConfig": {
9191
"access": "public"
9292
}
93-
}
93+
}

0 commit comments

Comments
 (0)