Skip to content

Commit fcdb0d7

Browse files
authored
chore: convert to pnpm; pin gh actions (#598)
refs projectwallace/projectwallace#4 refs projectwallace/projectwallace#7
1 parent be0199d commit fcdb0d7

10 files changed

Lines changed: 2778 additions & 7603 deletions

File tree

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
version: 2
55
updates:
6-
- package-ecosystem: 'npm'
6+
- package-ecosystem: 'npm' # pnpm is detected automatically via pnpm-lock.yaml
77
directory: '/'
88
schedule:
99
interval: 'monthly'

.github/workflows/release.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,24 @@ jobs:
1212
publish-npm:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v6
16-
- uses: actions/setup-node@v6
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
16+
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
17+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
1718
with:
1819
node-version: 24
19-
- run: npm ci --ignore-scripts --no-audit --no-fund
20-
- run: npm test
21-
- run: npm run build
20+
cache: pnpm
21+
- run: pnpm install --frozen-lockfile --ignore-scripts
22+
- run: pnpm test
23+
- run: pnpm run build
2224
- name: Bump version from release tag
25+
env:
26+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
2327
run: |
2428
VERSION=${GITHUB_REF_NAME#v}
25-
npm version $VERSION --no-git-tag-version
29+
pnpm version $VERSION --no-git-tag-version
2630
git config user.name "github-actions[bot]"
2731
git config user.email "github-actions[bot]@users.noreply.github.com"
28-
git add package.json package-lock.json
32+
git add package.json pnpm-lock.yaml
2933
git commit -m "chore: bump version to $VERSION"
30-
git push origin HEAD:${{ github.event.repository.default_branch }}
31-
- run: npm publish --access public
34+
git push origin HEAD:$DEFAULT_BRANCH
35+
- run: pnpm publish --no-git-checks

.github/workflows/test.yml

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
41
name: Node.js CI
52

63
on:
@@ -9,64 +6,77 @@ on:
96
pull_request:
107
branches: [main]
118

9+
permissions:
10+
contents: read
11+
1212
jobs:
1313
lint:
1414
name: Lint JS
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v6
18-
- uses: actions/setup-node@v6
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
18+
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
19+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
1920
with:
2021
node-version: 22
21-
- run: npm ci --ignore-scripts --no-audit --no-fund
22-
- run: npm run lint
22+
cache: pnpm
23+
- run: pnpm install --frozen-lockfile --ignore-scripts
24+
- run: pnpm run lint
2325

2426
test:
2527
name: Unit tests
2628
runs-on: ubuntu-latest
2729
steps:
28-
- uses: actions/checkout@v6
29-
- uses: actions/setup-node@v6
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
31+
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
32+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
3033
with:
3134
node-version: 22
32-
- run: npm ci --ignore-scripts --no-audit --no-fund
33-
- run: npm test
35+
cache: pnpm
36+
- run: pnpm install --frozen-lockfile --ignore-scripts
37+
- run: pnpm test
3438

3539
code-coverage:
3640
name: Code coverage
3741
runs-on: ubuntu-latest
3842
steps:
39-
- uses: actions/checkout@v6
40-
- uses: actions/setup-node@v6
43+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
44+
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
45+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
4146
with:
4247
node-version: 22
43-
- run: npm ci --ignore-scripts --no-audit --no-fund
44-
- run: npm test
48+
cache: pnpm
49+
- run: pnpm install --frozen-lockfile --ignore-scripts
50+
- run: pnpm test
4551
- name: Upload coverage reports to Codecov
46-
uses: codecov/codecov-action@v6
52+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
4753
with:
4854
token: ${{ secrets.CODECOV_TOKEN }}
4955

5056
build:
5157
name: Build
5258
runs-on: ubuntu-latest
5359
steps:
54-
- uses: actions/checkout@v6
55-
- uses: actions/setup-node@v6
60+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
61+
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
62+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
5663
with:
5764
node-version: 22
58-
- run: npm ci --ignore-scripts --no-audit --no-fund
59-
- run: npm run build
65+
cache: pnpm
66+
- run: pnpm install --frozen-lockfile --ignore-scripts
67+
- run: pnpm run build
6068
env:
6169
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6270

6371
knip:
6472
name: Lint unused code
6573
runs-on: ubuntu-latest
6674
steps:
67-
- uses: actions/checkout@v6
68-
- uses: actions/setup-node@v6
75+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
76+
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
77+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
6978
with:
7079
node-version: 22
71-
- run: npm ci --ignore-scripts --no-audit --no-fund
72-
- run: npm run knip
80+
cache: pnpm
81+
- run: pnpm install --frozen-lockfile --ignore-scripts
82+
- run: pnpm run knip

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Security settings are configured in pnpm-workspace.yaml

.oxlintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"no-warning-comments": "off",
5353
"no-case-declarations": "off",
5454
"no-inline-comments": "off",
55-
"no-useless-return": "warn"
55+
"no-useless-return": "warn",
56+
"require-unicode-regexp": "off"
5657
}
5758
}

knip.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { KnipConfig } from 'knip'
22

33
const config: KnipConfig = {
44
project: ['src/**/*.ts'],
5-
ignoreDependencies: ['prettier', '@vitest/coverage-v8'],
65
}
76

87
export default config

0 commit comments

Comments
 (0)