Skip to content

Commit 673c7f6

Browse files
chore: migrate npm tooling to pnpm
1 parent 0036d89 commit 673c7f6

25 files changed

Lines changed: 6659 additions & 11044 deletions

.github/workflows/changesets.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,23 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323

24+
- uses: pnpm/action-setup@v4
25+
with:
26+
version: 10.33.0
27+
2428
- uses: actions/setup-node@v3
2529
with:
2630
node-version-file: .nvmrc
27-
cache: npm
31+
cache: pnpm
2832

2933
- name: Install package dependencies
30-
run: npm ci
34+
run: pnpm install --frozen-lockfile
3135

3236
- name: Create Release Pull Request or Publish
3337
uses: changesets/action@v1
3438
with:
35-
version: npm run changeset:version
36-
publish: npm run changeset:tag
39+
version: pnpm run changeset:version
40+
publish: pnpm run changeset:tag
3741
createGithubReleases: true
3842
title: "chore(release): version packages"
3943
env:

.github/workflows/checks.yml

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ jobs:
2020
uses: actions/checkout@v3
2121
with:
2222
fetch-depth: 0
23+
- uses: pnpm/action-setup@v4
24+
with:
25+
version: 10.33.0
2326
- uses: actions/setup-node@v3
2427
with:
2528
node-version-file: .nvmrc
26-
cache: npm
29+
cache: pnpm
2730
- name: Install package dependencies
28-
run: npm ci
31+
run: pnpm install --frozen-lockfile
2932
- name: Run commitlint
3033
uses: wagoid/commitlint-github-action@v5
3134
lint:
@@ -34,30 +37,36 @@ jobs:
3437
steps:
3538
- name: Checkout
3639
uses: actions/checkout@v3
40+
- uses: pnpm/action-setup@v4
41+
with:
42+
version: 10.33.0
3743
- uses: actions/setup-node@v3
3844
with:
3945
node-version-file: .nvmrc
40-
cache: npm
46+
cache: pnpm
4147
- name: Install package dependencies
42-
run: npm ci
48+
run: pnpm install --frozen-lockfile
4349
- name: Run Biome
44-
run: npm run lint
50+
run: pnpm run lint
4551
- name: Run Knip
46-
run: npm run knip
52+
run: pnpm run knip
4753
build-check:
4854
name: Build check
4955
runs-on: ubuntu-latest
5056
steps:
5157
- name: Checkout
5258
uses: actions/checkout@v3
59+
- uses: pnpm/action-setup@v4
60+
with:
61+
version: 10.33.0
5362
- uses: actions/setup-node@v3
5463
with:
5564
node-version-file: .nvmrc
56-
cache: npm
65+
cache: pnpm
5766
- name: Install package dependencies
58-
run: npm ci
67+
run: pnpm install --frozen-lockfile
5968
- name: Run build check
60-
run: npm run build:check
69+
run: pnpm run build:check
6170
test-units-and-cover:
6271
name: Unit Tests And Coverage
6372
runs-on: ubuntu-latest
@@ -68,16 +77,19 @@ jobs:
6877
steps:
6978
- name: Checkout
7079
uses: actions/checkout@v3
80+
- uses: pnpm/action-setup@v4
81+
with:
82+
version: 10.33.0
7183
- uses: actions/setup-node@v3
7284
with:
7385
node-version-file: .nvmrc
74-
cache: npm
86+
cache: pnpm
7587
- name: Install package dependencies
76-
run: npm ci
88+
run: pnpm install --frozen-lockfile
7789
- name: Run unit tests
78-
run: npm run test:unit
90+
run: pnpm run test:unit
7991
- name: Run coverage for unit tests
80-
run: npm run cover:unit
92+
run: pnpm run cover:unit
8193
if: ${{ always() }}
8294
- uses: actions/upload-artifact@v4
8395
name: Upload coverage report for unit tests
@@ -103,11 +115,14 @@ jobs:
103115
steps:
104116
- name: Checkout
105117
uses: actions/checkout@v3
118+
- uses: pnpm/action-setup@v4
119+
with:
120+
version: 10.33.0
106121
- uses: actions/setup-node@v3
107122
with:
108123
node-version-file: .nvmrc
109124
- name: Run integration tests
110-
run: npm run docker:test:integration
125+
run: pnpm run docker:test:integration
111126
- name: Generate Cucumber report annotations
112127
uses: deblockt/cucumber-report-annotations-action@v1.7
113128
if: ${{ always() }}
@@ -116,7 +131,7 @@ jobs:
116131
access-token: ${{ secrets.GITHUB_TOKEN }}
117132
path: .test-reports/integration/report.json
118133
- name: Run coverage for integration tests
119-
run: npm run docker:cover:integration
134+
run: pnpm run docker:cover:integration
120135
- name: Coveralls
121136
uses: coverallsapp/github-action@master
122137
if: ${{ always() }}
@@ -151,11 +166,14 @@ jobs:
151166
uses: actions/checkout@v3
152167
with:
153168
fetch-depth: 0
169+
- uses: pnpm/action-setup@v4
170+
with:
171+
version: 10.33.0
154172
- uses: actions/setup-node@v3
155173
with:
156174
node-version-file: .nvmrc
157-
cache: npm
175+
cache: pnpm
158176
- name: Install package dependencies
159-
run: npm ci
177+
run: pnpm install --frozen-lockfile
160178
- name: Check for changeset
161-
run: npx changeset status --since origin/${{ github.base_ref }}
179+
run: pnpm exec changeset status --since origin/${{ github.base_ref }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ npm-debug.log*
1313

1414
# Dependency directories
1515
node_modules/
16+
package-lock.json
1617

1718
# TypeScript cache
1819
*.tsbuildinfo
1920

20-
# Optional npm cache directory
21+
# Optional package manager cache directories
2122
.npm
23+
.pnpm-store
24+
pnpm-debug.log*
2225

2326
# Caches
2427
.eslintcache

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npx --no -- commitlint --edit ${1}
4+
pnpm exec commitlint --edit "${1}"

.husky/pre-commit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npm run lint
5-
npm run build:check
6-
npm run test:unit
4+
pnpm run lint
5+
pnpm run build:check
6+
pnpm run test:unit

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ FROM node:24-alpine AS build
22

33
WORKDIR /build
44

5-
COPY ["package.json", "package-lock.json", "./"]
5+
COPY ["package.json", "pnpm-lock.yaml", "./"]
66

7-
RUN npm install --quiet
7+
RUN corepack enable && pnpm install --frozen-lockfile --silent
88

99
COPY . .
1010

11-
RUN npm run build
11+
RUN pnpm run build
1212

1313
FROM node:24-alpine
1414

@@ -24,8 +24,9 @@ RUN apk add --no-cache --update git
2424
ADD resources /app/resources
2525

2626
COPY --from=build /build/dist .
27+
COPY --from=build /build/package.json /build/pnpm-lock.yaml ./
2728

28-
RUN npm install --omit=dev --quiet
29+
RUN corepack enable && pnpm install --prod --frozen-lockfile --silent
2930

3031
USER node:node
3132

Dockerfile.railwayapp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ ENV DB_NAME=$PGDATABASE
1717
ENV DB_USER=$PGUSER
1818
ENV DB_PASSWORD=$PGPASSWORD
1919

20-
COPY ["package.json", "package-lock.json","knexfile.js","./"]
20+
COPY ["package.json", "pnpm-lock.yaml","knexfile.js","./"]
2121

2222
ADD migrations /build/migrations
2323

24-
RUN npm install -g knex@2.4.0 && npm install --quiet
24+
RUN corepack enable && pnpm install --frozen-lockfile --silent
2525

2626
COPY . .
2727

28-
RUN npm run build
28+
RUN pnpm run build
2929

3030
FROM node:24-alpine
3131

@@ -74,17 +74,17 @@ WORKDIR /app
7474

7575
# Copy runtime artifacts and configuration
7676
COPY --from=build /build/dist .
77-
COPY --from=build /build/package.json /build/package-lock.json ./
77+
COPY --from=build /build/package.json /build/pnpm-lock.yaml ./
7878
COPY --from=build /build/knexfile.js ./
7979
COPY --from=build /build/migrations ./migrations
8080
COPY --from=build /build/seeds ./seeds
8181

82-
RUN npm install --omit=dev --quiet && npm install -g knex@2.4.0
82+
RUN corepack enable && pnpm install --prod --frozen-lockfile --silent
8383

8484
USER 1000:1000
8585

8686
RUN mkdir -p $NOSTR_CONFIG_DIR
8787

8888
ENTRYPOINT ["dumb-init", "--"]
8989

90-
CMD ["sh", "-c", "npm run db:migrate && node src/index.js"]
90+
CMD ["sh", "-c", "pnpm run db:migrate && node src/index.js"]

Dockerfile.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ FROM node:24-alpine
22

33
WORKDIR /code
44

5-
COPY ["package.json", "package-lock.json", "./"]
5+
COPY ["package.json", "pnpm-lock.yaml", "./"]
66

7-
RUN npm install --quiet
7+
RUN corepack enable && pnpm install --frozen-lockfile --silent
88

99
CMD ["true"]

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ services:
126126
entrypoint:
127127
- sh
128128
- -c
129-
- 'cd code && npm install --no-save --quiet knex@2.4.0 pg@8.8.0 && npx knex migrate:latest'
129+
- 'cd code && corepack enable && pnpm dlx --package=knex@2.4.0 --package=pg@8.8.0 knex migrate:latest'
130130
volumes:
131131
- ./migrations:/code/migrations
132132
- ./knexfile.js:/code/knexfile.js

0 commit comments

Comments
 (0)