Skip to content

Commit 5f9ca64

Browse files
Update yarn to v4 (#185)
* Initial plan * Update to Yarn v4.9.2 with configuration and dependencies Co-authored-by: ChristopherChudzicki <[email protected]> * Fix ESLint configuration and complete Yarn v4 upgrade Co-authored-by: ChristopherChudzicki <[email protected]> * Remove unnecessary indent rule override from ESLint config Co-authored-by: ChristopherChudzicki <[email protected]> * Remove unnecessary packages added during Yarn v4 migration Co-authored-by: ChristopherChudzicki <[email protected]> * Fix GitHub Actions workflow for Yarn v4 and complete setup Co-authored-by: ChristopherChudzicki <[email protected]> * Remove unnecessary corepack enable step from CI workflow Co-authored-by: ChristopherChudzicki <[email protected]> * Update GitHub Actions to use setup-node@v5 with built-in caching Co-authored-by: ChristopherChudzicki <[email protected]> * Apply suggestion from @ChristopherChudzicki * pin TS version to resolve linting issue --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: ChristopherChudzicki <[email protected]> Co-authored-by: Chris Chudzicki <[email protected]>
1 parent 1e56cdb commit 5f9ca64

File tree

7 files changed

+8801
-5410
lines changed

7 files changed

+8801
-5410
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,13 @@ jobs:
77
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
88

99
- name: Set up NodeJS
10-
uses: actions/setup-node@v2-beta
10+
uses: actions/setup-node@v5
1111
with:
1212
node-version: 20.19.5
13-
14-
- name: Get yarn cache directory path
15-
id: yarn-cache-dir-path
16-
run: echo "::set-output name=dir::$(yarn cache dir)"
17-
18-
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
19-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
20-
with:
21-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
22-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
23-
restore-keys: |
24-
${{ runner.os }}-yarn-
13+
cache: 'yarn'
2514

2615
- name: Install dependencies
27-
run: yarn install --frozen-lockfile --ignore-engines --prefer-offline
16+
run: yarn install --immutable
2817

2918
- name: Lint
3019
run: yarn lint

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,13 @@ dist/*
55

66
# typescript writes this file for incremental compilation
77
.tsbuildinfo
8-
.DS_Store
8+
.DS_Store
9+
10+
# Yarn v4
11+
.yarn/*
12+
!.yarn/patches
13+
!.yarn/plugins
14+
!.yarn/releases
15+
!.yarn/sdks
16+
!.yarn/versions
17+
.pnp.*

.yarn/releases/yarn-4.9.2.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
compressionLevel: mixed
2+
3+
enableScripts: false
4+
5+
enableGlobalCache: false
6+
7+
nodeLinker: node-modules
8+
9+
yarnPath: .yarn/releases/yarn-4.9.2.cjs
10+
11+
# https://github.com/vitejs/vite-plugin-react-swc/issues/74#issuecomment-1520484130
12+
# https://github.com/swc-project/swc/issues/5616#issuecomment-1265639797
13+
# This setting ensures we always install the Linux binaries when running `yarn install`. This is needed for running
14+
# swc natively in Docker (addresses swc-loader bindings not found error).
15+
supportedArchitectures:
16+
os:
17+
- current
18+
- linux
19+
cpu:
20+
- current
21+
- x64
22+
- arm64
23+
libc:
24+
- current
25+
- glibc

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"react-router": "^6.22.2",
8282
"tiny-invariant": "^1.3.3",
8383
"ts-node": "^10.9.2",
84-
"typescript": "^5.3.3"
84+
"typescript": "5.8"
8585
},
8686
"peerDependencies": {
8787
"@types/history": "^4.9",
@@ -90,18 +90,18 @@
9090
"react-router": "^6.22.2"
9191
},
9292
"peerDependenciesMeta": {
93-
"history": {
93+
"@types/history": {
9494
"optional": true
9595
},
96-
"react-router": {
96+
"history": {
9797
"optional": true
9898
},
9999
"next": {
100100
"optional": true
101101
},
102-
"@types/history": {
102+
"react-router": {
103103
"optional": true
104104
}
105105
},
106-
"packageManager": "yarn@1.22.22"
106+
"packageManager": "yarn@4.9.2"
107107
}

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"./src/**/*.tsx"
3333
],
3434
"exclude": [
35-
"src/*.test.ts",
36-
"src/*.test.tsx",
35+
"src/**/*.test.ts",
36+
"src/**/*.test.tsx",
3737
"src/test_setup.ts",
3838
"src/test_util.ts",
3939
"src/open_api_generated/api.ts"

0 commit comments

Comments
 (0)