Skip to content

Commit eb30d59

Browse files
authored
refactor: migrate to pnpm (#48)
* refactor: migrate to pnpm * refactor: added config file * refactor: migrated those as well * refactor: removed obsolete seperators * refactor: another try * fix: problem * Revert "refactor: another try" This reverts commit 3c0d32b. * docs: add further information * docs: added further information * refactor: further adaptions * refactor: migrated field * refactor: resilience * refactor: regenerated lock file * refactor: adapted values * fix: order of parameters * refactor: needed to add pnpm lock file * refactor: corrected command * refactor: corrected command * refactor: corrected command * Update MIGRATION_TO_PNPM.md * Update MIGRATION_TO_PNPM.md * Update package.json
1 parent e45f790 commit eb30d59

26 files changed

+10633
-18056
lines changed

.config/.lintstagedrc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"*.md": "markdownlint --config .config/.markdown-lint.yml --fix",
3-
"test/fixtures/*.css": "npm run build:docs",
4-
"*.{js,ts,tsx,jsx,mjs,cjs}": "npm run lint:xo -- --fix",
5-
"package-lock.json": "npm audit fix"
3+
"test/fixtures/*.css": "pnpm run build:docs",
4+
"*.{js,ts,tsx,jsx,mjs,cjs}": "pnpm run lint:xo --fix",
5+
"pnpm-lock.yaml": "pnpm audit --fix"
66
}

.github/WORKFLOWS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This is the main orchestrator workflow that runs analysis tasks in parallel, the
5151

5252
- **Test**: Runs on Node.js 22.x, 24.x
5353
- Checkout repository
54-
- Install dependencies (with npm cache)
54+
- Install dependencies (with pnpm cache)
5555
- Run tests with Vitest
5656
- Upload test coverage to Codecov
5757
- **Build**: Builds package and uploads artifacts
@@ -276,7 +276,7 @@ Current performance benchmarks:
276276

277277
## Cache Strategy
278278

279-
All workflows use npm caching with `actions/setup-node@v4` to speed up dependency installation.
279+
All workflows use pnpm caching with `actions/setup-node@v4` to speed up dependency installation.
280280

281281
## Artifact Retention
282282

@@ -346,7 +346,7 @@ if (results.avgProcessTime > 1) { // Change this value
346346
Follow the established patterns:
347347
348348
1. Use `actions/checkout@v4` and `actions/setup-node@v4`
349-
2. Include npm caching
349+
2. Include pnpm caching
350350
3. Add appropriate error handling
351351
4. Upload relevant artifacts
352352
5. Use semantic commit messages

.github/workflows/audit-fix-pr.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Suggest npm audit fix for Dependabot PRs
1+
name: Suggest pnpm audit --fix for Dependabot PRs
22

33
on:
44
pull_request:
@@ -18,43 +18,49 @@ jobs:
1818
ref: ${{ github.head_ref }}
1919
token: ${{ secrets.GITHUB_TOKEN }}
2020

21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
run_install: false
25+
2126
- name: Set up Node.js
2227
uses: actions/setup-node@v4
2328
with:
2429
node-version-file: ".nvmrc"
25-
cache: "npm"
30+
cache: "pnpm"
2631

2732
- name: Install dependencies
28-
run: npm ci
33+
run: pnpm install --frozen-lockfile
2934

30-
- name: Run npm audit fix
31-
run: npm audit fix
35+
- name: Run pnpm audit --fix
36+
run: pnpm audit --fix
3237

33-
- name: Check if only package-lock.json changed
38+
- name: Check if only pnpm-lock.yaml changed
3439
id: changes
3540
run: |
3641
git diff --name-only > changed_files.txt
3742
cat changed_files.txt
3843
39-
if grep -Fxq "package-lock.json" changed_files.txt && [ "$(wc -l < changed_files.txt)" -eq 1 ]; then
44+
if grep -Fxq "pnpm-lock.yaml" changed_files.txt && [ "$(wc -l < changed_files.txt)" -eq 1 ]; then
4045
echo "changed=true" >> "$GITHUB_OUTPUT"
4146
else
4247
echo "changed=false" >> "$GITHUB_OUTPUT"
4348
fi
4449
4550
- name: Create PR with audit fix
4651
if: steps.changes.outputs.changed == 'true'
52+
id: create-pr
4753
uses: peter-evans/create-pull-request@v6
4854
with:
4955
token: ${{ secrets.GITHUB_TOKEN }}
50-
commit-message: "chore: npm audit fix"
56+
commit-message: "chore: pnpm audit --fix"
5157
branch: "refactor-auditfix-${{ github.head_ref }}"
52-
title: "chore: Apply npm audit fix on top of #${{ github.event.pull_request.number }}"
58+
title: "chore: Apply pnpm audit --fix on top of #${{ github.event.pull_request.number }}"
5359
labels: security, dependabot
5460
body: |
55-
This PR applies `npm audit fix` on top of the Dependabot PR #${{ github.event.pull_request.number }}.
61+
This PR applies `pnpm audit --fix` on top of the Dependabot PR #${{ github.event.pull_request.number }}.
5662
57-
It is created automatically to suggest applying security updates that `npm audit fix` can resolve.
63+
It is created automatically to suggest applying security updates that `pnpm audit --fix` can resolve.
5864
base: ${{ github.head_ref }}
5965

6066
- name: Approve PR

.github/workflows/ci.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,25 @@ jobs:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
2525

26+
- name: Install pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
run_install: false
30+
2631
- name: Setup Node.js ${{ matrix.node-version }}
2732
uses: actions/setup-node@v4
2833
with:
2934
node-version: ${{ matrix.node-version }}
30-
cache: "npm"
35+
cache: "pnpm"
3136

3237
- name: Install dependencies
33-
run: npm ci
38+
run: pnpm install --frozen-lockfile
3439

3540
- name: Run tests
36-
run: npm test
41+
run: pnpm test
3742

3843
- name: Upload test coverage
39-
if: matrix.node-version == '24.x'
44+
if: matrix.node-version == '24'
4045
uses: codecov/codecov-action@v4
4146
with:
4247
token: ${{ secrets.CODECOV_TOKEN }}
@@ -53,17 +58,22 @@ jobs:
5358
- name: Checkout repository
5459
uses: actions/checkout@v4
5560

61+
- name: Install pnpm
62+
uses: pnpm/action-setup@v4
63+
with:
64+
run_install: false
65+
5666
- name: Setup Node.js
5767
uses: actions/setup-node@v4
5868
with:
5969
node-version-file: ".nvmrc"
60-
cache: "npm"
70+
cache: "pnpm"
6171

6272
- name: Install dependencies
63-
run: npm ci
73+
run: pnpm install --frozen-lockfile
6474

6575
- name: Build package
66-
run: npm run build
76+
run: pnpm run build
6777

6878
- name: Upload build artifacts
6979
uses: actions/upload-artifact@v4
@@ -91,14 +101,19 @@ jobs:
91101
- name: Checkout repository
92102
uses: actions/checkout@v4
93103

104+
- name: Install pnpm
105+
uses: pnpm/action-setup@v4
106+
with:
107+
run_install: false
108+
94109
- name: Setup Node.js
95110
uses: actions/setup-node@v4
96111
with:
97112
node-version-file: ".nvmrc"
98-
cache: "npm"
113+
cache: "pnpm"
99114

100115
- name: Install dependencies
101-
run: npm ci
116+
run: pnpm install --frozen-lockfile
102117

103118
- name: Lint Markdown files
104-
run: npm run lint:markdownlint
119+
run: pnpm run lint:markdownlint

.github/workflows/codeql.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ jobs:
6161
- name: Checkout repository
6262
uses: actions/checkout@v4
6363

64+
- name: Install pnpm
65+
uses: pnpm/action-setup@v4
66+
with:
67+
run_install: false
68+
6469
# Add any setup steps before running the `github/codeql-action/init` action.
6570
# This includes steps like installing compilers or runtimes (`actions/setup-node`
6671
# or others). This is typically only required for manual builds.
@@ -70,7 +75,7 @@ jobs:
7075
uses: actions/setup-node@v4
7176
with:
7277
node-version-file: ".nvmrc"
73-
cache: "npm"
78+
cache: "pnpm"
7479

7580
# Initializes the CodeQL tools for scanning.
7681
- name: Initialize CodeQL

.github/workflows/default.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,30 @@ jobs:
3434
- name: Checkout repository
3535
uses: actions/checkout@v4
3636

37+
- name: Install pnpm
38+
uses: pnpm/action-setup@v4
39+
with:
40+
run_install: false
41+
3742
- name: Setup Node.js
3843
uses: actions/setup-node@v4
3944
with:
4045
node-version-file: ".nvmrc"
41-
cache: "npm"
46+
cache: "pnpm"
4247

4348
- name: Install dependencies
44-
run: npm ci
49+
run: pnpm install --frozen-lockfile
4550

4651
- name: Lint code (xo), markdown (markdownlint), and package (publint)
47-
run: npm run lint
52+
run: pnpm run lint
4853

4954
- name: Check code style
50-
run: npx --no prettier . --check
55+
run: pnpm exec prettier . --check
5156

5257
- name: Check spelling
5358
uses: codespell-project/actions-codespell@v2
5459
with:
55-
skip: "*.lock,*.json,coverage,node_modules,dist,_site,.git"
60+
skip: "pnpm-lock.yaml,coverage,node_modules,dist,_site,.git"
5661
ignore_words_list: "moz,webkit"
5762
check_filenames: true
5863

@@ -70,17 +75,22 @@ jobs:
7075
with:
7176
fetch-depth: 0 # Needed for quality analysis
7277

78+
- name: Install pnpm
79+
uses: pnpm/action-setup@v4
80+
with:
81+
run_install: false
82+
7383
- name: Setup Node.js
7484
uses: actions/setup-node@v4
7585
with:
7686
node-version-file: ".nvmrc"
77-
cache: "npm"
87+
cache: "pnpm"
7888

7989
- name: Install dependencies
80-
run: npm ci
90+
run: pnpm install --frozen-lockfile
8191

8292
- name: Run tests with coverage
83-
run: npm run test:vitest --workspaces -- --coverage --coverage.reporter lcov --coverage.reporter json
93+
run: pnpm run --recursive test:vitest --coverage --coverage.reporter lcov --coverage.reporter json
8494

8595
- name: Upload coverage reports
8696
uses: actions/upload-artifact@v4
@@ -102,7 +112,7 @@ jobs:
102112
packages: read
103113

104114
audit-fix:
105-
name: Suggest npm audit fix for Dependabot PRs
115+
name: Suggest pnpm audit --fix for Dependabot PRs
106116
uses: ./.github/workflows/audit-fix-pr.yml
107117
secrets: inherit
108118
permissions:

.github/workflows/deploy-pages.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,28 @@ jobs:
2727
- name: Checkout repository
2828
uses: actions/checkout@v4
2929

30+
- name: Install pnpm
31+
uses: pnpm/action-setup@v4
32+
with:
33+
run_install: false
34+
3035
- name: Setup Node.js
3136
uses: actions/setup-node@v4
3237
with:
3338
node-version-file: ".nvmrc"
34-
cache: "npm"
39+
cache: "pnpm"
3540

3641
- name: Install dependencies
37-
run: npm ci
42+
run: pnpm install --frozen-lockfile
3843

3944
- name: Run tests
40-
run: npm test
45+
run: pnpm test
4146

4247
- name: Run linting
43-
run: npm run lint
48+
run: pnpm run lint
4449

4550
- name: Build package
46-
run: npm run build
51+
run: pnpm run build
4752

4853
- name: Prepare GitHub Pages content
4954
run: ./.github/scripts/prepare-pages.sh

.github/workflows/docs.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,22 @@ jobs:
2424
with:
2525
token: ${{ secrets.GITHUB_TOKEN }}
2626

27+
- name: Install pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
run_install: false
31+
2732
- name: Setup Node.js
2833
uses: actions/setup-node@v4
2934
with:
3035
node-version-file: ".nvmrc"
31-
cache: "npm"
36+
cache: "pnpm"
3237

3338
- name: Install dependencies
34-
run: npm ci
39+
run: pnpm install --frozen-lockfile
3540

3641
- name: Build package
37-
run: npm run build
42+
run: pnpm run build
3843

3944
- name: Generate API documentation
4045
run: |

.github/workflows/performance-optimized.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,26 @@ jobs:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
2525

26+
- name: Install pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
run_install: false
30+
2631
- name: Setup Node.js
2732
uses: actions/setup-node@v4
2833
with:
2934
node-version-file: ".nvmrc"
30-
cache: "npm"
35+
cache: "pnpm"
3136

3237
- name: Install dependencies
33-
run: npm ci
38+
run: pnpm install --frozen-lockfile
3439

3540
- name: Run performance benchmarks
3641
run: |
3742
# Add your performance testing commands here
3843
# This is a placeholder - adapt to your actual performance tests
3944
echo "Running performance benchmarks..."
40-
npm run build
45+
pnpm run build
4146
4247
# Example: measure bundle size changes
4348
echo "### Performance Report" >> $GITHUB_STEP_SUMMARY

.github/workflows/performance.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,25 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28+
- name: Install pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
run_install: false
32+
2833
- name: Setup Node.js
2934
uses: actions/setup-node@v4
3035
with:
3136
node-version-file: ".nvmrc"
32-
cache: "npm"
37+
cache: "pnpm"
3338

3439
- name: Install dependencies
35-
run: npm ci
40+
run: pnpm install --frozen-lockfile
3641

3742
- name: Build package
38-
run: npm run build
43+
run: pnpm run build
3944

4045
- name: Install Playwright
41-
run: npx --no playwright install chromium
46+
run: pnpm exec playwright install chromium
4247

4348
- name: Run performance benchmark
4449
run: node test/performance/run-benchmark.cjs

0 commit comments

Comments
 (0)