Skip to content

Commit 89a0cd4

Browse files
committed
Update to use Yarn v3
While this project may ultimately switch back to using npm, or may opt to use pnpm instead, Yarn 3 is a significant win for as long as this app *is* using Yarn: 1. Yarn v3 is maintained; Yarn v1 is *not*. This is the most important reason to make this switch. 2. Yarn v2+ handles peer dependencies much more rigorously than Yarn v1 (or npm), albeit not quite as well as pnpm. As part of the ecosystem's move to using properly Node-resolvable packages, we are increasingly making use of peer dependencies, so this is important future-readiness.
1 parent 4dde8ab commit 89a0cd4

File tree

5 files changed

+20200
-15267
lines changed

5 files changed

+20200
-15267
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
pull_request:
88

99
env:
10-
NODE_VERSION: 12
1110
PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_number }}
1211
PERCY_PARALLEL_TOTAL: 1
1312

@@ -29,13 +28,13 @@ jobs:
2928

3029
- name: Cache Yarn cache and node_modules
3130
id: cache-dependencies
32-
uses: actions/cache@v2
31+
uses: actions/cache@v3
3332
with:
3433
path: |
3534
${{ steps.yarn-cache-dir-path.outputs.dir }}
3635
node_modules
37-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }}
38-
restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}-
36+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
37+
restore-keys: ${{ runner.os }}-yarn-
3938

4039
- name: Install dependencies
4140
run: yarn install --frozen-lockfile
@@ -44,7 +43,6 @@ jobs:
4443
- name: Lint
4544
run: yarn lint
4645

47-
4846
test-app:
4947
name: Test app
5048
runs-on: ubuntu-latest
@@ -53,7 +51,7 @@ jobs:
5351
- name: Check out a copy of the repo
5452
uses: actions/checkout@v2
5553

56-
- name: Use Node.js 14
54+
- name: Use Node.js v14
5755
uses: volta-cli/action@v4
5856

5957
- name: Get Yarn cache path
@@ -62,13 +60,13 @@ jobs:
6260

6361
- name: Cache Yarn cache and node_modules
6462
id: cache-dependencies
65-
uses: actions/cache@v2
63+
uses: actions/cache@v3
6664
with:
6765
path: |
6866
${{ steps.yarn-cache-dir-path.outputs.dir }}
6967
node_modules
70-
key: ${{ runner.os }}-14-${{ hashFiles('**/yarn.lock') }}
71-
restore-keys: ${{ runner.os }}-14-
68+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
69+
restore-keys: ${{ runner.os }}-yarn-
7270

7371
- name: Install dependencies
7472
run: yarn install --frozen-lockfile

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ terraform.tfstate.backup
1515
# dependencies
1616
/bower_components/
1717
/node_modules/
18+
.pnp.*
19+
.yarn/*
20+
!.yarn/patches
21+
!.yarn/plugins
22+
!.yarn/releases
23+
!.yarn/sdks
24+
!.yarn/versions
1825

1926
# misc
2027
/.projectile

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,6 @@
134134
],
135135
"volta": {
136136
"node": "14.17.0",
137-
"yarn": "1.22.19"
137+
"yarn": "3.3.0"
138138
}
139139
}

0 commit comments

Comments
 (0)