Skip to content

Commit 2628658

Browse files
authored
feat(repo): migrate to pnpm (nrwl#16284)
1 parent 8329395 commit 2628658

File tree

38 files changed

+29430
-171902
lines changed

38 files changed

+29430
-171902
lines changed

.circleci/config.yml

+29-32
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ orbs:
1414
# -------------------------
1515
machine:
1616
pre:
17-
- mkdir ~/.cache/yarn
17+
- mkdir ~/.pnpm-store
1818
- mkdir ~/.cache/Cypress
1919
- mkdir ~/Library/Caches/Homebrew
2020
- mkdir /usr/local/Homebrew
2121

2222
dependencies:
2323
cache_directories:
24-
- ~/.cache/yarn
24+
- ~/.pnpm-store
2525
- ~/.cache/Cypress
2626
- /usr/local/Homebrew
2727
- ~/Library/Caches/Homebrew
2828
override:
29-
- yarn install
29+
- pnpm install
3030
- brew install
3131

3232
defaults: &defaults
@@ -52,29 +52,30 @@ executors:
5252
# COMMANDS
5353
# -------------------------
5454
commands:
55-
run-yarn-install:
55+
run-pnpm-install:
5656
parameters:
5757
os:
5858
type: string
5959
steps:
6060
- restore_cache:
61-
name: Restore Yarn Package Cache
61+
name: Restore pnpm Package Cache
6262
keys:
63-
- node-deps-{{ arch }}-v2-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
63+
- node-deps-{{ arch }}-v3-{{ checksum "pnpm-lock.yaml" }}
6464
- run:
65-
name: Install dependencies
66-
command: yarn install --prefer-offline --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
65+
name: Install pnpm package manager
66+
command: |
67+
npm install -g @pnpm/[email protected]
68+
- run:
69+
name: Install Dependencies
70+
command: |
71+
pnpm install --frozen-lockfile
6772
- save_cache:
68-
name: Save Yarn Package Cache
69-
key: node-deps-{{ arch }}-v2-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
73+
name: Save pnpm Package Cache
74+
key: node-deps-{{ arch }}-v3-{{ checksum "pnpm-lock.yaml" }}
7075
paths:
71-
- ~/.cache/yarn
76+
- ~/.pnpm-store
7277
- ~/.cache/Cypress
73-
install-pnpm:
74-
steps:
75-
- run:
76-
name: Install PNPM
77-
command: npm install --prefix=$HOME/.local -g @pnpm/[email protected]
78+
- node_modules
7879

7980
setup:
8081
parameters:
@@ -114,13 +115,8 @@ commands:
114115
- node/install:
115116
# Use LTS version
116117
node-version: ''
117-
- run-yarn-install:
118+
- run-pnpm-install:
118119
os: << parameters.os >>
119-
- when:
120-
condition:
121-
equal: [<< parameters.os >>, linux]
122-
steps:
123-
- install-pnpm
124120

125121
# -------------------------
126122
# JOBS
@@ -162,7 +158,7 @@ jobs:
162158
os: << parameters.os >>
163159
- run:
164160
name: Agent
165-
command: npx nx-cloud start-agent
161+
command: pnpm nx-cloud start-agent
166162
no_output_timeout: 60m
167163

168164
# -------------------------
@@ -184,29 +180,29 @@ jobs:
184180
os: linux
185181
- nx/set-shas:
186182
main-branch-name: 'master'
187-
- run: npx nx-cloud start-ci-run --stop-agents-after="e2e"
183+
- run: pnpm nx-cloud start-ci-run --stop-agents-after="e2e"
188184
- run:
189185
name: Check Documentation
190-
command: npx nx documentation --no-dte
186+
command: pnpm nx documentation --no-dte
191187
no_output_timeout: 20m
192188
- run:
193189
name: Run Checks/Lint/Test/Build
194190
no_output_timeout: 60m
195191
command: |
196192
pids=()
197193
198-
npx nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD &
194+
pnpm nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD &
199195
pids+=($!)
200196
201-
npx nx run-many -t check-imports check-commit check-lock-files depcheck --parallel=1 --no-dte &
197+
pnpm nx run-many -t check-imports check-commit check-lock-files depcheck --parallel=1 --no-dte &
202198
pids+=($!)
203199
204-
yarn nx affected --target=lint --base=$NX_BASE --head=$NX_HEAD --parallel=3 &
200+
pnpm nx affected --target=lint --base=$NX_BASE --head=$NX_HEAD --parallel=3 &
205201
pids+=($!)
206-
yarn nx affected --target=test --base=$NX_BASE --head=$NX_HEAD --parallel=1 &
202+
pnpm nx affected --target=test --base=$NX_BASE --head=$NX_HEAD --parallel=1 &
207203
pids+=($!)
208-
(yarn nx affected --target=build --base=$NX_BASE --head=$NX_HEAD --parallel=3 &&
209-
npx nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --parallel=1) &
204+
(pnpm nx affected --target=build --base=$NX_BASE --head=$NX_HEAD --parallel=3 &&
205+
pnpm nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --parallel=1) &
210206
pids+=($!)
211207
212208
for pid in "${pids[@]}"; do
@@ -221,6 +217,7 @@ jobs:
221217
NX_E2E_CI_CACHE_KEY: e2e-circleci-macos
222218
NX_DAEMON: 'true'
223219
NX_PERF_LOGGING: 'false'
220+
SELECTED_PM: 'npm' # explicitly define npm for macOS tests
224221
steps:
225222
- run:
226223
name: Set dynamic nx run variable
@@ -232,7 +229,7 @@ jobs:
232229
- run:
233230
name: Run E2E Tests for macOS
234231
command: |
235-
npx nx affected -t e2e-macos --parallel=1
232+
pnpm nx affected -t e2e-macos --parallel=1 --base=$NX_BASE --head=$NX_HEAD
236233
no_output_timeout: 45m
237234

238235
# -------------------------

.github/workflows/e2e-matrix.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,15 @@ jobs:
3939
- name: Checkout
4040
uses: actions/checkout@v3
4141

42+
- name: Install PNPM
43+
run: |
44+
npm install -g @pnpm/[email protected]
45+
4246
- name: Set node
4347
uses: actions/setup-node@v3
4448
with:
4549
node-version: ${{ matrix.node_version }}
50+
cache: 'pnpm'
4651

4752
- name: Cache node_modules
4853
id: cache-modules
@@ -54,7 +59,7 @@ jobs:
5459

5560
- name: Install packages
5661
if: steps.cache-modules.outputs.cache-hit != 'true'
57-
run: yarn install --prefer-offline --frozen-lockfile --non-interactive
62+
run: pnpm install --frozen-lockfile
5863

5964
- name: Homebrew cache directory path
6065
if: ${{ matrix.os == 'macos-latest' }}
@@ -320,14 +325,14 @@ jobs:
320325
run: mkdir -p outputs
321326

322327
- name: Install PNPM
323-
if: ${{ matrix.package_manager == 'pnpm' }}
324328
run: |
325329
npm install -g @pnpm/[email protected]
326330
327331
- name: Use Node.js ${{ matrix.node_version }}
328332
uses: actions/setup-node@v3
329333
with:
330334
node-version: ${{ matrix.node_version }}
335+
cache: 'pnpm'
331336
registry-url: http://localhost:4872
332337

333338
- name: Cache node_modules
@@ -338,8 +343,7 @@ jobs:
338343
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ github.run_id }}
339344

340345
- name: Install packages
341-
if: steps.cache-modules.outputs.cache-hit != 'true'
342-
run: yarn install --prefer-offline --frozen-lockfile --non-interactive
346+
run: pnpm install --frozen-lockfile
343347

344348
- name: Cleanup
345349
if: ${{ matrix.os == 'ubuntu-latest' }}

.github/workflows/e2e-windows.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@ jobs:
3030
- name: Checkout
3131
uses: actions/checkout@v3
3232

33+
- name: Install PNPM
34+
run: |
35+
npm install -g @pnpm/[email protected]
36+
3337
- name: Set node
3438
uses: actions/setup-node@v3
3539
with:
3640
node-version: ${{ matrix.node_version }}
41+
cache: 'pnpm'
3742

3843
- name: Cache node_modules
3944
id: cache-modules
@@ -44,7 +49,7 @@ jobs:
4449

4550
- name: Install packages
4651
if: steps.cache-modules.outputs.cache-hit != 'true'
47-
run: yarn install --prefer-offline --frozen-lockfile --non-interactive
52+
run: pnpm install --frozen-lockfile
4853

4954
- name: Cache Cypress
5055
id: cache-cypress
@@ -243,10 +248,15 @@ jobs:
243248
- name: Prepare dir for output
244249
run: mkdir -p outputs
245250

251+
- name: Install PNPM
252+
run: |
253+
npm install -g @pnpm/[email protected]
254+
246255
- name: Use Node.js ${{ matrix.node_version }}
247256
uses: actions/setup-node@v3
248257
with:
249258
node-version: ${{ matrix.node_version }}
259+
cache: 'pnpm'
250260
registry-url: http://localhost:4872
251261

252262
- name: Cache node_modules
@@ -257,8 +267,7 @@ jobs:
257267
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ github.run_id }}
258268

259269
- name: Install packages
260-
if: steps.cache-modules.outputs.cache-hit != 'true'
261-
run: yarn install --prefer-offline --frozen-lockfile --non-interactive
270+
run: pnpm install --frozen-lockfile
262271

263272
- name: Cache Cypress
264273
id: cache-cypress

.github/workflows/issue-notifier.yml

+12-9
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,27 @@ jobs:
1818
- name: Checkout
1919
uses: actions/checkout@v3
2020

21+
- uses: pnpm/action-setup@v2
22+
with:
23+
version: 8.2
24+
2125
- name: Use Node.js ${{ matrix.node_version }}
2226
uses: actions/setup-node@v3
2327
with:
2428
node-version: '18'
29+
cache: 'pnpm'
30+
registry-url: http://localhost:4872
2531

26-
- name: Yarn cache directory path
27-
id: yarn-cache-dir-path
28-
shell: bash
29-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
30-
31-
- name: Cache yarn
32+
- name: Cache node_modules
33+
id: cache-modules
3234
uses: actions/cache@v3
3335
with:
34-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
35-
key: yarn-${{ hashFiles('yarn.lock') }}
36+
lookup-only: true
37+
path: '**/node_modules'
38+
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
3639

3740
- name: Install packages
38-
run: yarn install --prefer-offline --frozen-lockfile --non-interactive
41+
run: pnpm install --frozen-lockfile
3942

4043
- name: Download artifact
4144
id: download-artifact

.github/workflows/npm-audit.yml

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ jobs:
1919
- name: Run a security audit
2020
run: npx audit-ci --critical --report-type summary
2121

22-
- name: Check lock file for invalid hosts
23-
run: npx lockfile-lint -s -n -p yarn.lock -a hosts yarn npm
24-
2522
# - name: Run Dependency confusion supply chain check
2623
# run: npx snync -d .
2724

0 commit comments

Comments
 (0)