Skip to content

Commit 3ac9ec9

Browse files
build: use pnpm (#23664)
Co-authored-by: HonkingGoose <[email protected]>
1 parent 8b3bfe4 commit 3ac9ec9

File tree

18 files changed

+11052
-11081
lines changed

18 files changed

+11052
-11081
lines changed

.devcontainer/post-create.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ fi
99

1010
set -x
1111

12-
exec yarn install
12+
exec pnpm install

.github/actions/calculate-prefetch-matrix/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ runs:
2626
- name: Calculate cache keys
2727
id: cache-keys
2828
env:
29-
HASH: ${{ hashFiles('yarn.lock') }}
29+
HASH: ${{ hashFiles('pnpm-lock.yaml') }}
3030
shell: bash
3131
run: |
3232
echo 'MACOS_KEY=node_modules-macOS-${{ inputs.node-version }}-${{ env.HASH }}' >> "$GITHUB_ENV"

.github/actions/setup-node/action.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ runs:
2929
}}-${{
3030
inputs.node-version
3131
}}-${{
32-
hashFiles('yarn.lock')
32+
hashFiles('pnpm-lock.yaml')
3333
}}' >> "$GITHUB_ENV"
3434
3535
- name: Restore `node_modules`
@@ -55,17 +55,15 @@ runs:
5555
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
5656
with:
5757
node-version: ${{ inputs.node-version }}
58-
cache: ${{ env.CACHE_HIT != 'true' && 'yarn' || '' }}
58+
cache: ${{ env.CACHE_HIT != 'true' && 'pnpm' || '' }}
5959

6060
- name: Install dependencies
6161
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3
6262
if: env.CACHE_HIT != 'true'
6363
with:
6464
timeout_minutes: 10
6565
max_attempts: 3
66-
command: |
67-
yarn install --frozen-lockfile --ignore-scripts
68-
yarn prepare:re2
66+
command: pnpm install
6967

7068
- name: Write `node_modules` cache
7169
if: inputs.save-cache == 'true' && env.CACHE_HIT != 'true'
@@ -79,7 +77,7 @@ runs:
7977
shell: bash
8078
run: >
8179
if [[ -d lib ]]; then
82-
yarn prepare:generate;
80+
pnpm prepare:generate;
8381
fi
8482
8583
- name: Git config

.github/contributing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Before you start any Pull Request, it's recommended that you open a [discussion]
3131
That way you can be sure that the maintainer(s) agree on what to change and how, and you can hopefully get a quick merge afterwards.
3232
Also, let the maintainers know that you plan to work on a particular issue so that no one else starts any duplicate work.
3333

34-
Pull Requests can only be merged once all status checks are green, which means `yarn test` passes, and coverage is 100%.
34+
Pull Requests can only be merged once all status checks are green, which means `pnpm test` passes, and coverage is 100%.
3535

3636
## Do not force push to your pull request branch
3737

.github/workflows/build.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ env:
3838
data/
3939
tools/
4040
package.json
41-
yarn.lock
41+
pnpm-lock.yaml
4242
codecov.yml
4343
4444
jobs:
@@ -121,7 +121,7 @@ jobs:
121121
FILTER_SHARDS: ${{ github.event.pull_request.draft && 'true' || '' }}
122122
CHANGED_FILES: ${{ steps.changed-files.outputs.changed-files }}
123123
run: |
124-
echo "$(yarn -s schedule-test-shards)" >> "$GITHUB_OUTPUT"
124+
echo "$(pnpm -s schedule-test-shards)" >> "$GITHUB_OUTPUT"
125125
126126
prefetch:
127127
needs: [setup]
@@ -187,7 +187,7 @@ jobs:
187187
key: eslint-main-cache
188188

189189
- name: Lint
190-
run: yarn -s eslint-ci
190+
run: pnpm -s eslint-ci
191191

192192
- name: Remove cache
193193
if: github.event_name == 'push'
@@ -230,7 +230,7 @@ jobs:
230230
key: prettier-main-cache
231231

232232
- name: Lint
233-
run: yarn -s prettier --cache-location .cache/prettier
233+
run: pnpm -s prettier --cache-location .cache/prettier
234234

235235
- name: Remove cache
236236
if: github.event_name == 'push'
@@ -267,10 +267,10 @@ jobs:
267267
uses: DavidAnson/markdownlint-cli2-action@8f3516061301755c97ff833a8e933f09282cc5b5 # v11.0.0
268268

269269
- name: Lint fenced code blocks
270-
run: yarn -s doc-fence-check
270+
run: pnpm -s doc-fence-check
271271

272272
- name: Lint documentation
273-
run: yarn -s lint-documentation
273+
run: pnpm -s lint-documentation
274274

275275
lint-other:
276276
needs: [setup]
@@ -288,13 +288,13 @@ jobs:
288288
os: ${{ runner.os }}
289289

290290
- name: Lint project file structure
291-
run: yarn -s ls-lint
291+
run: pnpm -s ls-lint
292292

293293
- name: Check git version
294-
run: yarn -s git-check
294+
run: pnpm -s git-check
295295

296296
- name: Test schema
297-
run: yarn -s test-schema
297+
run: pnpm -s test-schema
298298

299299
test:
300300
needs: [setup, prefetch]
@@ -331,7 +331,7 @@ jobs:
331331
}}-${{
332332
env.NODE_VERSION
333333
}}-${{
334-
hashFiles('yarn.lock')
334+
hashFiles('pnpm-lock.yaml')
335335
}}-${{
336336
matrix.cache-key
337337
}}
@@ -341,7 +341,7 @@ jobs:
341341
run: |
342342
for shard in ${{ matrix.shards }};
343343
do
344-
TEST_SHARD="$shard" yarn -s jest \
344+
TEST_SHARD="$shard" pnpm -s jest \
345345
--ci \
346346
--test-timeout ${{ matrix.test-timeout-milliseconds }} \
347347
--coverage ${{ matrix.coverage }}
@@ -396,11 +396,11 @@ jobs:
396396
os: ${{ runner.os }}
397397

398398
- name: Merge coverage reports
399-
run: yarn -s nyc merge ./coverage/json ./coverage/nyc/coverage.json
399+
run: pnpm nyc merge ./coverage/json ./coverage/nyc/coverage.json
400400

401401
- name: Check coverage threshold
402402
run: |
403-
yarn -s nyc check-coverage -t ./coverage/nyc \
403+
pnpm nyc check-coverage -t ./coverage/nyc \
404404
--branches 98 \
405405
--functions 100 \
406406
--lines 100 \
@@ -455,10 +455,10 @@ jobs:
455455
os: ${{ runner.os }}
456456

457457
- name: Build
458-
run: yarn -s build
458+
run: pnpm -s build
459459

460460
- name: Pack
461-
run: yarn -s test-e2e:pack
461+
run: pnpm -s test-e2e:pack
462462

463463
- name: Upload
464464
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
@@ -482,7 +482,7 @@ jobs:
482482
os: ${{ runner.os }}
483483

484484
- name: Build
485-
run: yarn -s build:docs
485+
run: pnpm -s build:docs
486486

487487
- name: Upload
488488
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
@@ -516,10 +516,10 @@ jobs:
516516
name: renovate-package
517517

518518
- name: Install dependencies
519-
run: yarn -s test-e2e:install
519+
run: pnpm -s test-e2e:install
520520

521521
- name: E2E Test
522-
run: yarn -s test-e2e:run
522+
run: pnpm -s test-e2e:run
523523

524524
release:
525525
needs:
@@ -564,8 +564,8 @@ jobs:
564564
565565
- name: semantic-release
566566
run: |
567-
echo '//registry.yarnpkg.com/:_authToken=${NPM_TOKEN}' >> ./.npmrc
568-
yarn -s semantic-release --dry-run ${{env.DRY_RUN}}
567+
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ./.npmrc
568+
pnpm -s semantic-release --dry-run ${{env.DRY_RUN}}
569569
git checkout -- .npmrc
570570
env:
571571
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/devcontainer.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Build and run dev container task
2121
uses: devcontainers/ci@57eaf0c9b518a76872bc429cdceefd65a912309b # v0.3.1900000329
2222
with:
23-
runCmd: yarn build
23+
runCmd: pnpm build

.github/workflows/release-npm.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,24 @@ jobs:
5151
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
5252
with:
5353
node-version: ${{ env.NODE_VERSION }}
54-
cache: yarn
54+
cache: pnpm
5555

5656
- name: Init platform
5757
run: |
5858
git config --global core.autocrlf false
5959
git config --global core.symlinks true
6060
git config --global user.email '[email protected]'
6161
git config --global user.name 'Renovate Bot'
62-
yarn config set version-git-tag false
6362
6463
- name: Installing dependencies
6564
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3
6665
with:
6766
timeout_minutes: 10
6867
max_attempts: 3
69-
command: yarn install --frozen-lockfile
68+
command: pnpm install
7069

7170
- name: Build ${{ env.NPM_VERSION }}
72-
run: yarn build
71+
run: pnpm build
7372

7473
- name: Prepare ${{ env.NPM_VERSION }}
7574
run: |

.github/workflows/update-data.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
2626
with:
2727
node-version: ${{ env.NODE_VERSION }}
28-
cache: yarn
28+
cache: pnpm
2929

3030
- name: Install dependencies
31-
run: yarn install --frozen-lockfile
31+
run: pnpm install
3232

3333
- name: Update static data
34-
run: yarn run update-static-data
34+
run: pnpm run update-static-data
3535

3636
- name: Run Prettier
37-
run: yarn prettier-fix
37+
run: pnpm prettier-fix
3838

3939
- name: Create pull request
4040
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2

.husky/pre-commit

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/sh
2+
3+
# shellcheck source=/dev/null
24
. "$(dirname "$0")/_/husky.sh"
35

4-
yarn ls-lint
6+
pnpm ls-lint
57

68
BRANCH_NAME=$(git branch --show-current)
79

.npmrc

+5
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
save-exact = true
22
provenance = true
3+
4+
# pnpm run settings
5+
# https://pnpm.io/cli/run
6+
shell-emulator = true
7+
enable-pre-post-scripts = true

.prettierignore

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
package.json
1212
**/__fixtures__/
1313
**/__mocks__/
14-
bin/yarn*
1514
.clinic/
1615
.eslintcache
1716

.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"internalConsoleOptions": "neverOpen",
102102
"disableOptimisticBPs": true,
103103
"cwd": "${workspaceFolder}",
104-
"runtimeExecutable": "yarn",
104+
"runtimeExecutable": "pnpm",
105105
"args": [
106106
"jest",
107107
"--runInBand",

.vscode/settings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
},
1818
"omnisharp.autoStart": false,
1919
"jest.autoRun": "off",
20-
"jest.jestCommandLine": "yarn jest",
21-
"npm.packageManager": "yarn",
20+
"jest.jestCommandLine": "pnpm jest",
21+
"npm.packageManager": "pnpm",
2222
"prettier.prettierPath": "./node_modules/prettier",
2323
"editor.formatOnSave": true,
2424
"editor.codeActionsOnSave": {

0 commit comments

Comments
 (0)