Skip to content

Commit 34ff54b

Browse files
chore: migrate to PNPM (#1793)
1 parent dc556fb commit 34ff54b

File tree

30 files changed

+23186
-61343
lines changed

30 files changed

+23186
-61343
lines changed

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,40 @@ outputs:
2525
runs:
2626
using: 'composite'
2727
steps:
28+
- name: Install pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: '10'
32+
run_install: false
33+
2834
- name: Install Node
2935
uses: actions/setup-node@v4
3036
with:
3137
node-version: ${{ inputs.node-version }}
38+
cache: 'pnpm'
3239

33-
- name: Get NPM cache directory
40+
- name: Get PNPM store directory
3441
id: npm-cache-dir
3542
shell: bash
36-
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
43+
run: echo "dir=$(pnpm store path)" >> ${GITHUB_OUTPUT}
3744

38-
- name: Restore NPM cache
45+
- name: Restore PNPM store
3946
id: restore-cache
4047
uses: actions/cache/restore@v4
4148
with:
4249
path: ${{ steps.npm-cache-dir.outputs.dir }}
43-
key: npm-main-${{ inputs.platform }}-${{ hashFiles('./package-lock.json') }}
50+
key: pnpm-main-${{ inputs.platform }}-${{ hashFiles('./pnpm-lock.yaml') }}
4451
restore-keys: |
45-
npm-main-${{ inputs.platform }}-
52+
pnpm-main-${{ inputs.platform }}-
4653
4754
- name: Download dependencies
4855
shell: bash
4956
run: |
50-
npm ci --ignore-scripts --verbose || npm ci --ignore-scripts --verbose || npm ci --ignore-scripts --verbose
57+
pnpm install --frozen-lockfile
5158
52-
- name: Save NPM cache
59+
- name: Save PNPM store
5360
if: inputs.save-cache == 'true'
5461
uses: actions/cache/save@v4
5562
with:
5663
path: ${{ steps.npm-cache-dir.outputs.dir }}
57-
key: npm-main-${{ inputs.platform }}-${{ hashFiles('./package-lock.json') }}
64+
key: pnpm-main-${{ inputs.platform }}-${{ hashFiles('./pnpm-lock.yaml') }}

.github/workflows/ci.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
working-directory: ${{ runner.temp }}
179179

180180
- name: Compile code
181-
run: npm run build -- --ignore @temporalio/core-bridge
181+
run: pnpm run build --ignore @temporalio/core-bridge
182182

183183
- name: Publish to Verdaccio
184184
run: node scripts/publish-to-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry
@@ -196,7 +196,7 @@ jobs:
196196
--headless &> ./devserver.log &
197197
198198
- name: Run Tests
199-
run: npm run test
199+
run: pnpm run test
200200
env:
201201
RUN_INTEGRATION_TESTS: true
202202
REUSE_V8_CONTEXT: ${{ matrix.reuse-v8-context }}
@@ -260,13 +260,6 @@ jobs:
260260
261261
# End samples
262262

263-
- name: Upload NPM logs
264-
uses: actions/upload-artifact@v4
265-
if: failure() || cancelled()
266-
with:
267-
name: integration-tests-${{ matrix.platform }}-node${{ matrix.node }}-${{ matrix.reuse-v8-context && 'reuse' || 'noreuse' }}-logs
268-
path: ${{ startsWith(matrix.platform, 'windows') && 'C:\\npm\\_logs\\' || '~/.npm/_logs/' }}
269-
270263
- name: Upload Dev Server logs
271264
uses: actions/upload-artifact@v4
272265
if: failure() || cancelled()

.github/workflows/conventions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
# eslint-import-resolver-typescript requires packages to be built
5050
- name: Compile all non-rust code
51-
run: npm run build -- --ignore @temporalio/core-bridge
51+
run: pnpm run build --ignore @temporalio/core-bridge
5252

53-
- run: npm run lint.check
54-
- run: npm run lint.prune
53+
- run: pnpm run lint.check
54+
- run: pnpm run lint.prune

.github/workflows/docs.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,32 @@ jobs:
4545
node-version: '22'
4646
platform: 'linux-x64'
4747

48-
- run: npm run build -- --ignore @temporalio/core-bridge
48+
- run: pnpm run build --ignore @temporalio/core-bridge
4949

5050
- name: Build docs
51-
run: npm run docs
51+
run: pnpm run docs
5252
env:
5353
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
5454

55-
- name: Publish docs
56-
if: ${{ inputs.publish_target }}
55+
- name: Publish production docs
56+
if: ${{ inputs.publish_target == 'prod' }}
5757
env:
5858
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
5959
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
60+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
6061
run: |
61-
npx vercel deploy packages/docs/build \
62-
-t '${{ secrets.VERCEL_TOKEN }}' \
62+
pnpm dlx vercel deploy packages/docs/build \
63+
-t "$VERCEL_TOKEN" \
6364
--yes \
64-
${{ inputs.publish_target == 'prod' && '--prod' || '' }}
65+
--prod
66+
67+
- name: Publish preview docs
68+
if: ${{ inputs.publish_target && inputs.publish_target != 'prod' }}
69+
env:
70+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
71+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
72+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
73+
run: |
74+
pnpm dlx vercel deploy packages/docs/build \
75+
-t "$VERCEL_TOKEN" \
76+
--yes

.github/workflows/nightly-throughput-stress.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
with:
8282
node-version: '22'
8383
platform: 'linux-x64'
84+
save-cache: 'true'
8485

8586
- name: Install protoc
8687
uses: arduino/setup-protoc@v3
@@ -101,13 +102,6 @@ jobs:
101102
env:
102103
BUILD_CORE_RELEASE: true
103104

104-
- name: Save NPM cache
105-
uses: actions/cache/save@v4
106-
if: always()
107-
with:
108-
path: ${{ steps.setup-node.outputs.cache-dir }}
109-
key: npm-main-linux-x64-${{ hashFiles('./package-lock.json') }}
110-
111105
- name: Install Temporal CLI
112106
uses: temporalio/setup-temporal@v0
113107

.github/workflows/release.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,10 @@ jobs:
175175
with:
176176
node-version: '22'
177177
platform: ${{ matrix.platform }}
178+
save-cache: ${{ env.IS_MAIN_OR_RELEASE }}
178179

179180
- name: Compile code
180-
run: npm run build -- --ignore @temporalio/core-bridge
181+
run: pnpm run build --ignore @temporalio/core-bridge
181182

182183
- name: Publish to Verdaccio
183184
run: node scripts/publish-to-verdaccio.js --registry-dir ./tmp/registry
@@ -188,14 +189,6 @@ jobs:
188189
name: verdaccio-repo
189190
path: ./tmp/registry/storage
190191

191-
- name: Save NPM cache
192-
uses: actions/cache/save@v4
193-
# Only saves NPM cache from the main branch, to reduce pressure on the cache (limited to 10GB).
194-
if: ${{ env.IS_MAIN_OR_RELEASE == 'true' }}
195-
with:
196-
path: ${{ steps.setup-node.outputs.cache-dir }}
197-
key: npm-main-${{ matrix.platform }}-${{ hashFiles('./package-lock.json') }}
198-
199192
# Tests that npm init @temporalio results in a working worker and client
200193
test-npm-init:
201194
needs: build-packages

.github/workflows/stress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
save-if: ${{ env.IS_MAIN_OR_RELEASE == 'true' }}
9090

9191
- name: Compile code
92-
run: npm run build
92+
run: pnpm run build
9393
env:
9494
BUILD_CORE_RELEASE: true
9595

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ packages/*/CHANGELOG.md
1111
packages/docs/docs/api
1212
typedoc-sidebar.js
1313
lerna.json
14+
pnpm-lock.yaml
1415
README.md
1516
packages/proto/protos/root.d.ts
1617
packages/proto/protos/json-module.js

lerna.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": "1.13.2",
3-
"npmClient": "npm",
3+
"npmClient": "pnpm",
44
"command": {
55
"publish": {
66
"message": "chore(release): Publish",
@@ -11,4 +11,4 @@
1111
}
1212
},
1313
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
14-
}
14+
}

0 commit comments

Comments
 (0)