Skip to content

Commit 20a1840

Browse files
committed
chore: switch repository tooling to pnpm
Align local setup, CI, and Docker on pnpm so installs use a single supported package manager across development and deployment.
1 parent 1a8e9e4 commit 20a1840

11 files changed

Lines changed: 8305 additions & 17572 deletions

File tree

.github/workflows/deploy.production.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,21 @@ jobs:
2121
- name: ⬇️ Checkout repo
2222
uses: actions/checkout@v6
2323

24+
- name: ⎔ Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
2427
- name: ⎔ Setup node
2528
uses: actions/setup-node@v6
2629
with:
27-
cache: npm
28-
cache-dependency-path: ./package-lock.json
30+
cache: pnpm
31+
cache-dependency-path: ./pnpm-lock.yaml
2932
node-version: 24
3033

3134
- name: 📥 Install deps
32-
run: npm install
35+
run: pnpm install --frozen-lockfile
3336

3437
- name: 🔬 Lint
35-
run: npm run lint
38+
run: pnpm run lint
3639

3740
typecheck:
3841
name: ʦ TypeScript
@@ -41,18 +44,21 @@ jobs:
4144
- name: ⬇️ Checkout repo
4245
uses: actions/checkout@v6
4346

47+
- name: ⎔ Setup pnpm
48+
uses: pnpm/action-setup@v4
49+
4450
- name: ⎔ Setup node
4551
uses: actions/setup-node@v6
4652
with:
47-
cache: npm
48-
cache-dependency-path: ./package-lock.json
53+
cache: pnpm
54+
cache-dependency-path: ./pnpm-lock.yaml
4955
node-version: 24
5056

5157
- name: 📥 Install deps
52-
run: npm install
58+
run: pnpm install --frozen-lockfile
5359

5460
- name: 🔎 Type check
55-
run: npm run typecheck --if-present
61+
run: pnpm run typecheck --if-present
5662

5763
vitest:
5864
name: ⚡ Vitest
@@ -61,18 +67,21 @@ jobs:
6167
- name: ⬇️ Checkout repo
6268
uses: actions/checkout@v6
6369

70+
- name: ⎔ Setup pnpm
71+
uses: pnpm/action-setup@v4
72+
6473
- name: ⎔ Setup node
6574
uses: actions/setup-node@v6
6675
with:
67-
cache: npm
68-
cache-dependency-path: ./package-lock.json
76+
cache: pnpm
77+
cache-dependency-path: ./pnpm-lock.yaml
6978
node-version: 24
7079

7180
- name: 📥 Install deps
72-
run: npm install
81+
run: pnpm install --frozen-lockfile
7382

7483
- name: ⚡ Run vitest
75-
run: npm run test -- --coverage
84+
run: pnpm run test -- --coverage
7685

7786
deploy:
7887
name: 🚀 Deploy

.github/workflows/deploy.staging.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,21 @@ jobs:
2323
- name: ⬇️ Checkout repo
2424
uses: actions/checkout@v6
2525

26+
- name: ⎔ Setup pnpm
27+
uses: pnpm/action-setup@v4
28+
2629
- name: ⎔ Setup node
2730
uses: actions/setup-node@v6
2831
with:
29-
cache: npm
30-
cache-dependency-path: ./package-lock.json
32+
cache: pnpm
33+
cache-dependency-path: ./pnpm-lock.yaml
3134
node-version: 24
3235

3336
- name: 📥 Install deps
34-
run: npm install
37+
run: pnpm install --frozen-lockfile
3538

3639
- name: 🔬 Lint
37-
run: npm run lint
40+
run: pnpm run lint
3841

3942
typecheck:
4043
name: ʦ TypeScript
@@ -43,18 +46,21 @@ jobs:
4346
- name: ⬇️ Checkout repo
4447
uses: actions/checkout@v6
4548

49+
- name: ⎔ Setup pnpm
50+
uses: pnpm/action-setup@v4
51+
4652
- name: ⎔ Setup node
4753
uses: actions/setup-node@v6
4854
with:
49-
cache: npm
50-
cache-dependency-path: ./package-lock.json
55+
cache: pnpm
56+
cache-dependency-path: ./pnpm-lock.yaml
5157
node-version: 24
5258

5359
- name: 📥 Install deps
54-
run: npm install
60+
run: pnpm install --frozen-lockfile
5561

5662
- name: 🔎 Type check
57-
run: npm run typecheck --if-present
63+
run: pnpm run typecheck --if-present
5864

5965
vitest:
6066
name: ⚡ Vitest
@@ -63,18 +69,21 @@ jobs:
6369
- name: ⬇️ Checkout repo
6470
uses: actions/checkout@v6
6571

72+
- name: ⎔ Setup pnpm
73+
uses: pnpm/action-setup@v4
74+
6675
- name: ⎔ Setup node
6776
uses: actions/setup-node@v6
6877
with:
69-
cache: npm
70-
cache-dependency-path: ./package-lock.json
78+
cache: pnpm
79+
cache-dependency-path: ./pnpm-lock.yaml
7180
node-version: 24
7281

7382
- name: 📥 Install deps
74-
run: npm install
83+
run: pnpm install --frozen-lockfile
7584

7685
- name: ⚡ Run vitest
77-
run: npm run test -- --coverage
86+
run: pnpm run test -- --coverage
7887

7988
deploy:
8089
name: 🚀 Deploy

.github/workflows/format.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,21 @@ jobs:
1818
- name: ⬇️ Checkout repo
1919
uses: actions/checkout@v6
2020

21+
- name: ⎔ Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
2124
- name: ⎔ Setup node
2225
uses: actions/setup-node@v6
2326
with:
24-
cache: npm
27+
cache: pnpm
28+
cache-dependency-path: ./pnpm-lock.yaml
2529
node-version: 24
2630

2731
- name: 📥 Install deps
28-
run: npm ci
32+
run: pnpm install --frozen-lockfile
2933

3034
- name: 👔 Format
31-
run: npm run format
35+
run: pnpm run format
3236

3337
- name: 💪 Commit
3438
run: |

.github/workflows/lint.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ jobs:
1818
- name: ⬇️ Checkout repo
1919
uses: actions/checkout@v6
2020

21+
- name: ⎔ Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
2124
- name: ⎔ Setup node
2225
uses: actions/setup-node@v6
2326
with:
24-
cache: npm
27+
cache: pnpm
28+
cache-dependency-path: ./pnpm-lock.yaml
2529
node-version: 24
2630

2731
- name: 📥 Install deps
28-
run: npm ci
32+
run: pnpm install --frozen-lockfile
2933

3034
- name: 🔬 Lint
31-
run: npm run lint
35+
run: pnpm run lint

.gitpod.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ tasks:
3737
fi
3838
fi
3939
40-
- init: npm install
41-
command: npm run setup && npm run dev
40+
- init: pnpm install
41+
command: pnpm run dev
4242

4343
vscode:
4444
extensions:

Dockerfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
FROM node:24-alpine AS development-dependencies-env
2-
COPY . /app
2+
RUN corepack enable
3+
COPY ./package.json pnpm-lock.yaml .npmrc /app/
34
WORKDIR /app
4-
RUN npm ci
5+
RUN pnpm install --frozen-lockfile
56

67
FROM node:24-alpine AS production-dependencies-env
7-
COPY ./package.json package-lock.json .npmrc /app/
8+
RUN corepack enable
9+
COPY ./package.json pnpm-lock.yaml .npmrc /app/
810
WORKDIR /app
9-
RUN npm ci --omit=dev
11+
RUN pnpm install --frozen-lockfile --prod
1012

1113
FROM node:24-alpine AS build-env
1214
COPY . /app/
1315
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
1416
WORKDIR /app
15-
RUN npm run build
17+
RUN corepack enable && pnpm run build
1618

1719
FROM node:24-alpine
18-
COPY ./package.json package-lock.json server.js /app/
19-
20+
RUN corepack enable
21+
COPY ./package.json pnpm-lock.yaml server.js /app/
2022

2123
ENV PORT="8080"
2224
ENV NODE_ENV="production"
@@ -25,6 +27,5 @@ COPY --from=production-dependencies-env /app/node_modules /app/node_modules
2527
COPY --from=build-env /app/build /app/build
2628
COPY --from=build-env /app/start.sh /app/start.sh
2729

28-
2930
WORKDIR /app
30-
CMD ["npm", "run", "start"]
31+
CMD ["pnpm", "run", "start"]

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ cp .env.example .env
2020
Install dependencies
2121

2222
```sh
23-
npm i
23+
pnpm install
2424
```
2525

2626
## Local Development
2727

2828
Now you should be good to go:
2929

3030
```sh
31-
npm run dev
31+
pnpm run dev
3232
```
3333

3434
To preview local changes to the `docs` folder in the React Router repo, select "local" from the version dropdown menu on the site. Make sure you have the [react-router repo](https://github.com/remix-run/react-router) cloned locally and `LOCAL_REPO_RELATIVE_PATH` is pointed to the correct filepath.
3535

3636
We leverage a number of LRUCache's to server-side cache various resources, such as processed markdown from GitHub, that expire at various times (usually after 5 minutes). If you want them to expire immediately for local development, set the `NO_CACHE` environment variable.
3737

3838
```sh
39-
NO_CACHE=1 npm run dev
39+
NO_CACHE=1 pnpm run dev
4040
```
4141

4242
Note that by default this assumes the relative path to your local copy of the React Router docs is `../react-router`. This can be configured via `LOCAL_REPO_RELATIVE_PATH` in your `.env` file.
@@ -46,8 +46,8 @@ Note that by default this assumes the relative path to your local copy of the Re
4646
To preview the production build locally:
4747

4848
```sh
49-
npm run build
50-
npm run preview
49+
pnpm run build
50+
pnpm run preview
5151
```
5252

5353
## Deployment
@@ -65,7 +65,7 @@ Pushing the "stage" tag will deploy to [staging](https://reactrouterdotcomstagin
6565
git checkout my/branch
6666

6767
# moves the `stage` tag and pushes it, triggering a deploy
68-
npm run push:stage
68+
pnpm run push:stage
6969
```
7070

7171
When you're happy with it, merge your branch into `main` and push.

0 commit comments

Comments
 (0)