Skip to content

Commit 74a90c5

Browse files
danielroepi0
andauthored
chore: use pnpm for framework monorepo (#7895)
Co-authored-by: Pooya Parsa <pooya@pi0.io>
1 parent 9388e65 commit 74a90c5

32 files changed

+9413
-16368
lines changed

.github/workflows/ci.yml

Lines changed: 79 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name: CI
33
on:
44
push:
55
paths-ignore:
6-
- 'docs/**'
6+
- "docs/**"
77
branches:
88
- main
99
pull_request:
1010
paths-ignore:
11-
- 'docs/**'
11+
- "docs/**"
1212
branches:
1313
- main
1414

@@ -25,16 +25,17 @@ jobs:
2525

2626
steps:
2727
- uses: actions/checkout@v3
28+
- run: corepack enable
2829
- uses: actions/setup-node@v3
2930
with:
3031
node-version: ${{ matrix.node }}
31-
cache: 'yarn'
32+
cache: "pnpm"
3233

3334
- name: Install dependencies
34-
run: yarn --immutable
35+
run: pnpm install
3536

3637
- name: Build
37-
run: yarn build
38+
run: pnpm build
3839

3940
- name: Cache dist
4041
uses: actions/cache@v3
@@ -54,16 +55,17 @@ jobs:
5455

5556
steps:
5657
- uses: actions/checkout@v3
58+
- run: corepack enable
5759
- uses: actions/setup-node@v3
5860
with:
5961
node-version: ${{ matrix.node }}
60-
cache: 'yarn'
62+
cache: "pnpm"
6163

6264
- name: Install dependencies
63-
run: yarn --immutable
65+
run: pnpm install
6466

6567
- name: Lint
66-
run: yarn lint
68+
run: pnpm lint
6769

6870
typecheck:
6971
runs-on: ${{ matrix.os }}
@@ -77,19 +79,20 @@ jobs:
7779

7880
steps:
7981
- uses: actions/checkout@v3
82+
- run: corepack enable
8083
- uses: actions/setup-node@v3
8184
with:
8285
node-version: ${{ matrix.node }}
83-
cache: 'yarn'
86+
cache: "pnpm"
8487

8588
- name: Install dependencies
86-
run: yarn --immutable
89+
run: pnpm install
8790

88-
- name: Stub
89-
run: yarn stub
91+
- name: Build (stub)
92+
run: pnpm build:stub
9093

9194
- name: Typecheck
92-
run: yarn typecheck
95+
run: pnpm typecheck
9396

9497
test-fixtures:
9598
runs-on: ${{ matrix.os }}
@@ -103,25 +106,47 @@ jobs:
103106

104107
steps:
105108
- uses: actions/checkout@v3
109+
- run: corepack enable
106110
- uses: actions/setup-node@v3
107111
with:
108112
node-version: ${{ matrix.node }}
109-
cache: 'yarn'
113+
cache: "pnpm"
110114

111115
- name: Install dependencies
112-
run: yarn --immutable
116+
run: pnpm install
117+
118+
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
119+
# Install playwright's binary under custom directory to cache
120+
- name: Set Playwright path
121+
if: runner.os != 'Windows'
122+
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
123+
- name: Set Playwright path (windows)
124+
if: runner.os == 'Windows'
125+
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
126+
127+
- name: Cache Playwright's binary
128+
uses: actions/cache@v3
129+
with:
130+
# Playwright removes unused browsers automatically
131+
# So does not need to add playwright version to key
132+
key: ${{ runner.os }}-playwright-bin-v1
133+
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
134+
135+
- name: Install Playwright
136+
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
137+
run: pnpm playwright install chromium
113138

114-
- name: Stub
115-
run: yarn stub
139+
- name: Build (stub)
140+
run: pnpm build:stub
116141

117142
- name: Test (unit)
118-
run: yarn test:unit
143+
run: pnpm test:unit
119144

120145
- name: Test (fixtures)
121-
run: yarn test:fixtures
146+
run: pnpm test:fixtures
122147

123148
- name: Test (fixtures with dev)
124-
run: yarn test:fixtures:dev
149+
run: pnpm test:fixtures:dev
125150
env:
126151
NODE_OPTIONS: --max-old-space-size=8192
127152

@@ -137,19 +162,41 @@ jobs:
137162

138163
steps:
139164
- uses: actions/checkout@v3
165+
- run: corepack enable
140166
- uses: actions/setup-node@v3
141167
with:
142168
node-version: ${{ matrix.node }}
143-
cache: 'yarn'
169+
cache: "pnpm"
144170

145171
- name: Install dependencies
146-
run: yarn --immutable
172+
run: pnpm install
173+
174+
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
175+
# Install playwright's binary under custom directory to cache
176+
- name: Set Playwright path (non-windows)
177+
if: runner.os != 'Windows'
178+
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
179+
- name: Set Playwright path (windows)
180+
if: runner.os == 'Windows'
181+
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
182+
183+
- name: Cache Playwright's binary
184+
uses: actions/cache@v3
185+
with:
186+
# Playwright removes unused browsers automatically
187+
# So does not need to add playwright version to key
188+
key: ${{ runner.os }}-playwright-bin-v1
189+
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
190+
191+
- name: Install Playwright
192+
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
193+
run: pnpm playwright install chromium
147194

148-
- name: Stub
149-
run: yarn stub
195+
- name: Build (stub)
196+
run: pnpm build:stub
150197

151198
- name: Test (fixtures)
152-
run: yarn test:fixtures:webpack
199+
run: pnpm test:fixtures:webpack
153200

154201
test-types:
155202
needs:
@@ -165,13 +212,14 @@ jobs:
165212

166213
steps:
167214
- uses: actions/checkout@v3
215+
- run: corepack enable
168216
- uses: actions/setup-node@v3
169217
with:
170218
node-version: ${{ matrix.node }}
171-
cache: 'yarn'
219+
cache: "pnpm"
172220

173221
- name: Install dependencies
174-
run: yarn --immutable
222+
run: pnpm install
175223

176224
- name: Restore dist cache
177225
uses: actions/cache@v3
@@ -180,7 +228,7 @@ jobs:
180228
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}
181229

182230
- name: Test (types)
183-
run: yarn test:types
231+
run: pnpm test:types
184232

185233
build-release:
186234
if: |
@@ -205,13 +253,14 @@ jobs:
205253

206254
steps:
207255
- uses: actions/checkout@v3
256+
- run: corepack enable
208257
- uses: actions/setup-node@v3
209258
with:
210259
node-version: ${{ matrix.node }}
211-
cache: 'yarn'
260+
cache: "pnpm"
212261

213262
- name: Install dependencies
214-
run: yarn --immutable
263+
run: pnpm install
215264

216265
- name: Restore dist cache
217266
uses: actions/cache@v3

.github/workflows/docs-e2e.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v3
22+
- run: corepack enable
2223
- uses: actions/setup-node@v3
2324
with:
2425
node-version: ${{ matrix.node }}
25-
cache: "yarn"
26+
cache: "pnpm"
2627

2728
- name: Install dependencies
28-
run: yarn --immutable
29+
run: pnpm install
2930

3031
- run: node ./scripts/crawl.mjs
3132
env:

.github/workflows/docs.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ name: Docs
33
on:
44
push:
55
paths:
6-
- 'docs/**'
7-
- '.github/workflows/docs.yml'
6+
- "docs/**"
7+
- ".github/workflows/docs.yml"
88
branches:
99
- main
1010
pull_request:
1111
paths:
12-
- 'docs/**'
13-
- '.github/workflows/docs.yml'
12+
- "docs/**"
13+
- ".github/workflows/docs.yml"
1414
branches:
1515
- main
1616

@@ -25,13 +25,14 @@ jobs:
2525

2626
steps:
2727
- uses: actions/checkout@v3
28+
- run: corepack enable
2829
- uses: actions/setup-node@v3
2930
with:
3031
node-version: ${{ matrix.node }}
31-
cache: 'yarn'
32+
cache: "pnpm"
3233

3334
- name: Install dependencies
34-
run: yarn --immutable
35+
run: pnpm install
3536

3637
- name: Lint (docs)
37-
run: yarn lint:docs
38+
run: pnpm lint:docs

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ node_modules
33
jspm_packages
44

55
package-lock.json
6-
# */**/yarn.lock
6+
*/**/yarn.lock
7+
/.yarn
78

89
# Logs
910
*.log
@@ -13,10 +14,6 @@ package-lock.json
1314
.tmp
1415
.cache
1516

16-
# Yarn
17-
**/.yarn/cache
18-
**/.yarn/*state*
19-
2017
# Generated dirs
2118
dist
2219
.nuxt

.gitpod.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
tasks:
22
- init: |
3-
npx yarn install
4-
npx yarn stub
5-
command: npx yarn play
3+
npx pnpm install
4+
npx pnpm build:stub
5+
command: npx pnpm play
66
77
ports:
88
- port: 3000

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false
3+
shell-emulator=true

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 0 additions & 363 deletions
This file was deleted.

.yarn/plugins/@yarnpkg/plugin-typescript.cjs

Lines changed: 0 additions & 9 deletions
This file was deleted.

.yarn/releases/yarn-3.2.4.cjs

Lines changed: 0 additions & 801 deletions
This file was deleted.

.yarnrc.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)