Skip to content

Commit 9fe17f3

Browse files
yosriadyclaude
andauthored
chore: migrate from npm to pnpm 11 (#16)
* chore: migrate from npm to pnpm 11 - package.json: scripts npm->pnpm, drop npm-style overrides, add packageManager + devEngines.packageManager (pnpm@11.1.2) and engines.node>=22 (pnpm 11 requires Node 22+) - pnpm-workspace.yaml: pnpm 11 config home (.npmrc is now auth/registry only). minimumReleaseAge: 2880 correctly encodes the 48h supply-chain cooldown (old .npmrc min-release-age=2 was malformed; pnpm 11 default is only 1440/24h). allowBuilds for @swc/core + unrs-resolver set false (prebuilt platform bindings used; strictDepBuilds is a pnpm 11 default). overrides migrated here (pnpm does not read npm-style top-level overrides). - delete .npmrc (held only the malformed general setting) - ci.yml/release.yml: SHA-pinned pnpm/action-setup@v6.0.8, cache: pnpm, pnpm install --frozen-lockfile / build / test. release.yml keeps npm publish --provenance (OIDC trusted publishing is an npm-registry feature) - replace package-lock.json with pnpm-lock.yaml (v9.0) Verified with pnpm 11.1.2 on Node 22: frozen-lockfile install, build (cjs+esm), test (34 passed, 4 skipped), lint all exit 0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(CI): SHA-pin and bump checkout/setup-node to Node 24 majors actions/checkout@v4 and actions/setup-node@v4 run on Node.js 20, which GitHub forces to Node 24 by 2026-06-02 and removes by 2026-09-16. Bump to the latest majors (checkout v6.0.2, setup-node v6.4.0) and SHA-pin them in ci.yml (was tag-pinned) and release.yml (was pinned at v4.3.1/v4.4.0), consistent with the third-party action pinning policy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: address review — drop engines.node, declare workspace root - package.json: remove engines.node ">=22". The repo had no engines field before this PR; constraining library consumers' Node runtime is unrelated to the pnpm dev-tooling migration and would be a breaking change. The pnpm/Node dev requirement is already covered by devEngines + the pinned CI Node version. - pnpm-workspace.yaml: add explicit `packages: ['.']` so the single-package workspace is declared (schema-compliant, robust if subdirs are added). Lockfile regenerated (gains importers: section); resolution unchanged. Re-verified with pnpm 11.1.2 / Node 22: frozen-lockfile install, build, test, lint all exit 0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bbe6887 commit 9fe17f3

7 files changed

Lines changed: 3048 additions & 4758 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,45 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
24+
with:
25+
version: 11.1.2
2126

2227
- name: Setup Node
23-
uses: actions/setup-node@v4
28+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2429
with:
2530
node-version: "22.14.0"
26-
cache: 'npm'
31+
cache: 'pnpm'
2732

2833
- name: Install dependencies
29-
run: npm ci
34+
run: pnpm install --frozen-lockfile
3035

3136
- name: Build SDK
32-
run: npm run build
37+
run: pnpm build
3338

3439
test:
3540
runs-on: ubuntu-latest
3641
needs: build
3742
steps:
3843
- name: Checkout
39-
uses: actions/checkout@v4
44+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
45+
46+
- name: Setup pnpm
47+
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
48+
with:
49+
version: 11.1.2
4050

4151
- name: Setup Node
42-
uses: actions/setup-node@v4
52+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4353
with:
4454
node-version: "22.14.0"
45-
cache: 'npm'
55+
cache: 'pnpm'
4656

4757
- name: Install dependencies
48-
run: npm ci
58+
run: pnpm install --frozen-lockfile
4959

5060
- name: Run tests
51-
run: npm test
61+
run: pnpm test

.github/workflows/release.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818
with:
1919
fetch-depth: 0 # Fetch all history for changelog generation
2020

@@ -33,17 +33,24 @@ jobs:
3333
fi
3434
echo "✅ Tag is on main branch, proceeding with release"
3535
36+
- name: Setup pnpm
37+
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
38+
with:
39+
version: 11.1.2
40+
3641
- name: Setup Node
37-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
42+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
3843
with:
3944
node-version: "22.14.0"
40-
cache: 'npm'
45+
cache: 'pnpm'
4146

47+
# Trusted publishing (OIDC) is an npm-registry feature; keep the
48+
# publish step on the npm CLI even though deps use pnpm.
4249
- name: Update npm for trusted publishing
4350
run: npm install -g npm@latest
4451

4552
- name: Install dependencies
46-
run: npm ci
53+
run: pnpm install --frozen-lockfile
4754

4855
- name: Extract version from tag
4956
id: version
@@ -76,10 +83,10 @@ jobs:
7683
echo "✅ Version match confirmed: $TAG_VERSION"
7784
7885
- name: Build SDK
79-
run: npm run build
86+
run: pnpm build
8087

8188
- name: Run tests
82-
run: npm test
89+
run: pnpm test
8390

8491
- name: Generate release notes
8592
id: release_notes

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)