Skip to content

Commit dad491b

Browse files
committed
chore: migrate from npm to pnpm
Replace npm with pnpm as the package manager across the repo: - Add packageManager field and pnpm config to package.json - Add ci script for frozen-lockfile installs - Update CI workflows to use pnpm with node_modules caching - Align publish workflow to Node 22 - Replace package-lock.json with pnpm-lock.yaml - Update CLAUDE.md command references
1 parent c879bfe commit dad491b

File tree

6 files changed

+12994
-24344
lines changed

6 files changed

+12994
-24344
lines changed

.github/workflows/build-and-test.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,25 @@ jobs:
1111
- name: Check out code
1212
uses: actions/checkout@v4
1313

14+
- name: Set up pnpm
15+
uses: pnpm/action-setup@v4
16+
1417
- name: Set up Node 22
1518
uses: actions/setup-node@v4
1619
with:
1720
node-version: '22'
18-
cache: 'npm'
1921

20-
- name: NPM Install
21-
run: npm ci
22+
- name: Cache node_modules
23+
uses: actions/cache@v4
24+
with:
25+
path: node_modules
26+
key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
27+
28+
- name: Install
29+
run: pnpm run ci
2230

2331
- name: Build
24-
run: npm run build:ci
32+
run: pnpm run build:ci
2533
test:
2634
runs-on: ubuntu-24.04
2735
steps:
@@ -30,17 +38,25 @@ jobs:
3038
with:
3139
fetch-depth: 0
3240

41+
- name: Set up pnpm
42+
uses: pnpm/action-setup@v4
43+
3344
- name: Set up Node 22
3445
uses: actions/setup-node@v4
3546
with:
3647
node-version: '22'
37-
cache: 'npm'
3848

39-
- name: NPM Install
40-
run: npm ci
49+
- name: Cache node_modules
50+
uses: actions/cache@v4
51+
with:
52+
path: node_modules
53+
key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
54+
55+
- name: Install
56+
run: pnpm run ci
4157

4258
- name: Test
43-
run: npm run test:ci
59+
run: pnpm run test:ci
4460

4561
- name: Publish Unit Test Results
4662
uses: EnricoMi/publish-unit-test-result-action@v2

.github/workflows/publish.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,25 @@ jobs:
1515
- name: Check out code
1616
uses: actions/checkout@v4
1717

18-
- name: Set up Node 20
18+
- name: Set up pnpm
19+
uses: pnpm/action-setup@v4
20+
21+
- name: Set up Node 22
1922
uses: actions/setup-node@v4
2023
with:
21-
node-version: '20'
22-
cache: 'npm'
24+
node-version: '22'
25+
26+
- name: Cache node_modules
27+
uses: actions/cache@v4
28+
with:
29+
path: node_modules
30+
key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
2331

24-
- name: NPM Install
25-
run: npm ci
32+
- name: Install
33+
run: pnpm run ci
2634

2735
- name: Build
28-
run: npm run build:ci
36+
run: pnpm run build:ci
2937

3038
- uses: google-github-actions/auth@v2
3139
id: auth
@@ -36,10 +44,10 @@ jobs:
3644
# Ref https://github.com/semantic-release/npm/pull/844
3745
- name: Update npmrc for publish
3846
shell: bash
39-
run: npm config set -L project @hypertrace:registry ${{ secrets.GAR_NPM_PUBLISH_REGISTRY }}
47+
run: echo "@hypertrace:registry=${{ secrets.GAR_NPM_PUBLISH_REGISTRY }}" >> .npmrc
4048

4149
- name: Publish
42-
run: npm run semantic-release
50+
run: pnpm run semantic-release
4351
env:
4452
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4553
NPM_TOKEN: ${{ steps.auth.outputs.access_token }}

CLAUDE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ Hyperdash Angular (`@hypertrace/hyperdash-angular`) is an Angular library provid
1212

1313
```bash
1414
# Development
15-
npm start # Dev server at localhost:4200
16-
npm run build # Build app and library
15+
pnpm start # Dev server at localhost:4200
16+
pnpm run build # Build app and library
1717

1818
# Testing
19-
npm test # Run tests (watch mode)
20-
npm run test:ci:lib # Library tests only (CI mode)
21-
npm run test:ci:app # App tests only (CI mode)
22-
npm run test:ci # Full CI suite (lint + all tests)
19+
pnpm test # Run tests (watch mode)
20+
pnpm run test:ci:lib # Library tests only (CI mode)
21+
pnpm run test:ci:app # App tests only (CI mode)
22+
pnpm run test:ci # Full CI suite (lint + all tests)
2323

2424
# Code Quality
25-
npm run lint # Run ESLint
26-
npm run commit # Interactive conventional commit (commitizen)
25+
pnpm run lint # Run ESLint
26+
pnpm run commit # Interactive conventional commit (commitizen)
2727
```
2828

2929
## Architecture
@@ -78,7 +78,7 @@ Core `@hypertrace/hyperdash` classes are wrapped as Angular injectable services
7878
### Commits
7979

8080
- Conventional commits required (enforced via commitlint)
81-
- Use `npm run commit` for interactive commit wizard
81+
- Use `pnpm run commit` for interactive commit wizard
8282
- Pre-commit hook runs oxfmt on staged files
8383

8484
## ESLint Rules of Note

0 commit comments

Comments
 (0)