Skip to content

Commit a497ac5

Browse files
committed
ci: migrated yarn to pnpm
1 parent 9ed6376 commit a497ac5

File tree

8 files changed

+30
-34
lines changed

8 files changed

+30
-34
lines changed

.github/ISSUE_TEMPLATE/08-bug-report-complex.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ body:
4646
description: The steps we need to take to reproduce the bug using your repro
4747
value: |
4848
1) clone the repo
49-
2) `yarn install`
50-
3) `yarn lint`
49+
2) `pnpm install`
50+
3) `pnpm run lint`
5151
validations:
5252
required: true
5353
- type: textarea

.github/actions/prepare-build/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ runs:
2222
if: steps['build-cache'].outputs.cache-hit == 'true'
2323
shell: bash
2424
run: |
25-
yarn nx run types:build
25+
pnpm exec nx run types:build
2626
env:
2727
SKIP_AST_SPEC_REBUILD: true
2828

@@ -31,6 +31,6 @@ runs:
3131
shell: bash
3232
# Website will be built by the Netlify GitHub App
3333
run: |
34-
yarn nx run-many --target=build --parallel --exclude=website --exclude=website-eslint
34+
pnpm exec nx run-many --target=build --parallel --exclude=website --exclude=website-eslint
3535
env:
3636
SKIP_AST_SPEC_REBUILD: true

.github/actions/prepare-install/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ runs:
6868
working-directory: ${{ inputs.working-directory }}
6969
run: |
7070
yarn install --immutable --inline-builds
71-
yarn check-clean-workspace-after-install
71+
pnpm run check-clean-workspace-after-install
7272
env:
7373
# CI optimizations. Overrides yarnrc.yml options (or their defaults) in the CI action.
7474
YARN_ENABLE_GLOBAL_CACHE: 'false' # Use local cache folder to keep downloaded archives

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ jobs:
7272
uses: ./.github/actions/prepare-install
7373
with:
7474
node-version: ${{ env.PRIMARY_NODE_VERSION }}
75-
- run: yarn generate-configs
75+
- run: pnpm run generate-configs
7676
- run: git status --porcelain
7777
- if: failure()
78-
run: echo "Outdated result detected from yarn generate-configs. Please check in any file changes."
78+
run: echo "Outdated result detected from pnpm run generate-configs. Please check in any file changes."
7979

8080
lint_without_build:
8181
name: Lint without build
@@ -93,7 +93,7 @@ jobs:
9393
node-version: ${{ env.PRIMARY_NODE_VERSION }}
9494

9595
- name: Run Check
96-
run: yarn ${{ matrix.lint-task }}
96+
run: pnpm run ${{ matrix.lint-task }}
9797

9898
lint_with_build:
9999
name: Lint with build
@@ -114,7 +114,7 @@ jobs:
114114
uses: ./.github/actions/prepare-build
115115

116116
- name: Run Check
117-
run: yarn ${{ matrix.lint-task }}
117+
run: pnpm run ${{ matrix.lint-task }}
118118
env:
119119
ESLINT_USE_FLAT_CONFIG: true
120120

@@ -130,7 +130,7 @@ jobs:
130130
with:
131131
node-version: ${{ env.PRIMARY_NODE_VERSION }}
132132
- name: Run stylelint check
133-
run: yarn stylelint
133+
run: pnpm run stylelint
134134
working-directory: packages/website
135135

136136
integration_tests:
@@ -148,7 +148,7 @@ jobs:
148148
uses: ./.github/actions/prepare-build
149149

150150
- name: Run integration tests
151-
run: yarn test-integration
151+
run: pnpm run test-integration
152152
env:
153153
CI: true
154154

@@ -198,12 +198,12 @@ jobs:
198198
# we don't collect coverage on other node versions so they run faster
199199
- name: Run unit tests with coverage for ${{ matrix.package }}
200200
if: env.PRIMARY_NODE_VERSION == matrix.node-version && matrix.os == 'ubuntu-latest'
201-
run: yarn nx run ${{ matrix.package }}:test -- --coverage
201+
run: pnpm exec nx run ${{ matrix.package }}:test -- --coverage
202202
env:
203203
CI: true
204204
- name: Run unit tests for ${{ matrix.package }}
205205
if: env.PRIMARY_NODE_VERSION != matrix.node-version || matrix.os != 'ubuntu-latest'
206-
run: yarn nx test ${{ matrix.package }}
206+
run: pnpm exec nx test ${{ matrix.package }}
207207
env:
208208
CI: true
209209

@@ -238,7 +238,7 @@ jobs:
238238
- name: Build
239239
uses: ./.github/actions/prepare-build
240240
- name: Run unit tests for ${{ matrix.package }}
241-
run: yarn nx test ${{ matrix.package }} --coverage=false
241+
run: pnpm exec nx test ${{ matrix.package }} --coverage=false
242242
env:
243243
CI: true
244244
TYPESCRIPT_ESLINT_PROJECT_SERVICE: true
@@ -290,7 +290,7 @@ jobs:
290290
run: npx tsx tools/release/apply-canary-version.mts
291291

292292
- name: Publish all packages to npm with the canary tag
293-
# NOTE: this needs to be npx, rather than yarn, to make sure the authenticated npm registry is used
293+
# NOTE: this needs to be npx, rather than pnpm, to make sure the authenticated npm registry is used
294294
run: npx nx release publish --tag canary --verbose
295295
env:
296296
NX_CLOUD_DISTRIBUTED_EXECUTION: false

.github/workflows/nx-migrate.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,31 @@ jobs:
4949
# Get the version of Nx we are migrating to
5050
NX_VERSION=$(node -e "console.log(require('./package.json').devDependencies['nx'])")
5151
52-
# Revert renovate's changes to package.json and yarn.lock so that it is a clean migrate from the status quo
53-
git checkout HEAD~1 -- package.json yarn.lock
52+
# Revert renovate's changes to package.json and pnpm-lock.yaml so that it is a clean migrate from the status quo
53+
git checkout HEAD~1 -- package.json pnpm-lock.yaml
5454
55-
YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
55+
pnpm install
5656
57-
yarn nx migrate $NX_VERSION
57+
pnpm exec nx migrate $NX_VERSION
5858
5959
# Sometimes Nx can require config formatting changes after a migrate command
60-
YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
61-
yarn nx format
60+
pnpm install
61+
pnpm exec nx format
6262
6363
# migrations.json may or may not exist after running nx migrate
6464
if [ -f migrations.json ]; then
65-
# This will also invoke yarn automatically
66-
yarn nx migrate --run-migrations=migrations.json
65+
# This will also invoke pnpm automatically
66+
pnpm exec nx migrate --run-migrations=migrations.json
6767
6868
# After we have run its migrations, we no longer need the migrations.json file
6969
rm migrations.json
7070
fi
7171
7272
# Run the special nx repair command to ensure config matches latest and greatest
73-
yarn nx repair
73+
pnpm exec nx repair
7474
7575
# Ensure all the changed files are formatted appropriately
76-
yarn format
76+
pnpm run format
7777
7878
# Commit all the changes to the PR (see note on not being able to use secrets.GITHUB_TOKEN for this)
7979
git config --global user.email "[email protected]"

.github/workflows/prettier-update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
# We cannot use secrets.GITHUB_TOKEN for this because it is not permitted to kick off subsequent actions worfklow runs, so we use a PAT instead
3737
GITHUB_TOKEN: ${{ secrets.JAMES_HENRY_GITHUB_TOKEN }}
3838
run: |
39-
yarn --mode skip-build
40-
yarn format
39+
pnpm install --ignore-scripts
40+
pnpm run format
4141
4242
# Commit all the changes to the PR (see note on not being able to use secrets.GITHUB_TOKEN for this)
4343
git config --global user.email "[email protected]"

netlify.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
[build]
33
base = ""
44
publish = "packages/website/build"
5-
command = "NX_VERBOSE_LOGGING=true yarn nx build website"
6-
[build.environment]
7-
NETLIFY_USE_YARN = "true"
8-
# TODO: adjust these once https://github.com/netlify/build-image/issues/612 is resolved
9-
YARN_ENABLE_GLOBAL_CACHE = "true"
10-
YARN_GLOBAL_FOLDER = "/opt/buildhome/.yarn_cache"
5+
command = "NX_VERBOSE_LOGGING=true pnpm exec nx build website"
116

127
# https://docs.netlify.com/configure-builds/file-based-configuration/#redirects
138

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
"start": "nx run website:start",
4646
"test": "nx run-many --target=test --exclude integration-tests --exclude website --exclude website-eslint",
4747
"test-integration": "nx run integration-tests:test",
48-
"typecheck": "nx run-many --target=typecheck"
48+
"typecheck": "nx run-many --target=typecheck",
49+
"knip": "knip"
4950
},
5051
"engines": {
5152
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"

0 commit comments

Comments
 (0)