Skip to content

Commit bcfc3b1

Browse files
authored
build: Upgrade Yarn Classic to Yarn Berry (#752)
1 parent 46ed810 commit bcfc3b1

File tree

5 files changed

+7079
-4855
lines changed

5 files changed

+7079
-4855
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ jobs:
2424
uses: actions/setup-node@v4
2525
with:
2626
node-version: ${{ matrix.node-version }}
27-
cache: yarn
27+
- uses: threeal/[email protected]
28+
with:
29+
version: berry
30+
cache: true
31+
- name: install
32+
run: yarn install --immutable
2833
- name: install with jest@${{ matrix.jest-version }}
2934
run: yarn add --dev jest@${{ matrix.jest-version }} ts-jest@${{ matrix.jest-version }} @types/jest@${{ matrix.jest-version }}
3035
- run: yarn test:coverage
@@ -38,14 +43,16 @@ jobs:
3843
matrix:
3944
os: [ubuntu-latest, windows-latest, macOS-latest]
4045
runs-on: ${{ matrix.os }}
41-
4246
steps:
4347
- uses: actions/checkout@v4
4448
- uses: actions/setup-node@v4
4549
with:
4650
node-version: lts/*
47-
cache: yarn
48-
- run: yarn install
51+
- uses: threeal/[email protected]
52+
with:
53+
version: berry
54+
cache: true
55+
- run: yarn install --immutable
4956
- run: yarn test:coverage
5057
- uses: codecov/codecov-action@v5
5158
if: ${{ always() }}
@@ -58,8 +65,11 @@ jobs:
5865
- uses: actions/setup-node@v4
5966
with:
6067
node-version: lts/*
61-
cache: yarn
62-
- run: yarn install
68+
- uses: threeal/[email protected]
69+
with:
70+
version: berry
71+
cache: true
72+
- run: yarn install --immutable
6373
- run: yarn build
6474
- run: yarn lint
6575
- run: yarn typecheck
@@ -85,10 +95,14 @@ jobs:
8595
uses: actions/setup-node@v4
8696
with:
8797
node-version: lts/*
88-
cache: yarn
8998

90-
- name: Install Dependencies
91-
run: yarn
99+
- uses: threeal/[email protected]
100+
with:
101+
version: berry
102+
cache: true
103+
104+
- name: install
105+
run: yarn install --immutable
92106

93107
- name: Create Release Pull Request or Publish to npm
94108
id: changesets

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ coverage
99
.vscode
1010
package-lock.json
1111
*tsbuildinfo
12+
/.yarn/install-state.gz

.yarnrc.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cacheFolder: .yarn/cache
2+
3+
enableGlobalCache: true
4+
5+
nodeLinker: node-modules
6+
7+
packageExtensions:
8+
"@typescript-eslint/project-service@*":
9+
dependencies:
10+
typescript: "*"
11+
"@typescript-eslint/tsconfig-utils@*":
12+
peerDependencies:
13+
typescript: "*"
14+
"@typescript-eslint/utils@*":
15+
peerDependencies:
16+
typescript: "*"
17+
eslint-plugin-jest@*:
18+
peerDependencies:
19+
typescript: "*"
20+
21+
pnpMode: loose

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
],
1212
"scripts": {
1313
"clean": "node clean.js",
14-
"prebuild": "yarn clean",
15-
"build": "tsc && tsc-alias",
14+
"build": "yarn clean && tsc && tsc-alias",
1615
"lint": "eslint .",
1716
"lint:fix": "yarn lint --fix",
1817
"prepare": "husky",
@@ -128,12 +127,16 @@
128127
"trailingComma": "all"
129128
},
130129
"peerDependencies": {
131-
"jest": ">=27.2.5"
130+
"jest": ">=27.2.5",
131+
"typescript": ">=5.0.0"
132132
},
133133
"peerDependenciesMeta": {
134134
"jest": {
135135
"optional": true
136+
},
137+
"typescript": {
138+
"optional": false
136139
}
137140
},
138-
"packageManager": "yarn@1.22.22"
141+
"packageManager": "yarn@4.9.2"
139142
}

0 commit comments

Comments
 (0)