Skip to content

Commit 5ac1910

Browse files
authored
chore: pnpm (#1527)
1 parent 4e3d27e commit 5ac1910

File tree

14 files changed

+14495
-32399
lines changed

14 files changed

+14495
-32399
lines changed

.github/workflows/preview.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ on:
1212
- 'example/**'
1313
- 'site/**'
1414
- 'test/**'
15-
- '.npmignore'
15+
- '.node-version'
16+
- '.nvmrc'
1617
- '.prettierignore'
17-
- '.prettierrc'
18-
- '.renovaterc.json'
18+
- '.prettierrc.json'
1919
- '*.md'
20+
- 'deno.check*'
21+
- 'docker-compose.yml'
2022
- 'LICENSE'
2123

2224
jobs:
@@ -27,17 +29,20 @@ jobs:
2729
steps:
2830
- uses: actions/checkout@v4
2931

32+
- name: Install pnpm
33+
uses: pnpm/action-setup@v4
34+
3035
- name: Use Node.js
3136
uses: actions/setup-node@v4
3237
with:
33-
cache: 'npm'
38+
cache: 'pnpm'
3439
node-version: lts/*
3540

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

3944
- name: Build
40-
run: npm run build
45+
run: pnpm build
4146

4247
- name: Release preview version
43-
run: npx [email protected] publish --template './example'
48+
run: pnpx [email protected] publish --template './example'

.github/workflows/test.yml

Lines changed: 68 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ on:
1010
- 'docs/**'
1111
- 'example/**'
1212
- 'site/**'
13-
- '.npmignore'
13+
- '.node-version'
14+
- '.nvmrc'
1415
- '.prettierignore'
15-
- '.prettierrc'
16-
- '.renovaterc.json'
16+
- '.prettierrc.json'
1717
- '*.md'
1818
- 'LICENSE'
1919
pull_request:
@@ -23,10 +23,10 @@ on:
2323
- 'docs/**'
2424
- 'example/**'
2525
- 'site/**'
26-
- '.npmignore'
26+
- '.node-version'
27+
- '.nvmrc'
2728
- '.prettierignore'
28-
- '.prettierrc'
29-
- '.renovaterc.json'
29+
- '.prettierrc.json'
3030
- '*.md'
3131
- 'LICENSE'
3232
workflow_dispatch:
@@ -46,24 +46,27 @@ jobs:
4646
steps:
4747
- uses: actions/checkout@v4
4848

49+
- name: Install pnpm
50+
uses: pnpm/action-setup@v4
51+
4952
- name: Use Node.js ${{ matrix.node-version }}
5053
uses: actions/setup-node@v4
5154
with:
55+
cache: 'pnpm'
5256
node-version: ${{ matrix.node-version }}
53-
cache: 'npm'
5457

5558
- name: Install dependencies
56-
run: npm ci
59+
run: pnpm install
5760

5861
- name: Run docker compose
5962
run: docker compose up -d
6063

6164
- name: Run node tests
62-
run: ${{ matrix.with-transformer && 'TEST_TRANSFORMER=1 ' || '' }}npm test
65+
run: ${{ matrix.with-transformer && 'TEST_TRANSFORMER=1 ' || '' }}pnpm test
6366

6467
- name: Run esbuild test
6568
if: ${{ !matrix.with-transformer }}
66-
run: npm run test:esbuild
69+
run: pnpm test:esbuild
6770

6871
deno:
6972
name: Deno
@@ -78,28 +81,31 @@ jobs:
7881
steps:
7982
- uses: actions/checkout@v4
8083

84+
- name: Install pnpm
85+
uses: pnpm/action-setup@v4
86+
8187
- name: Use Node.js
8288
uses: actions/setup-node@v4
8389
with:
90+
cache: 'pnpm'
8491
node-version: lts/*
85-
cache: 'npm'
8692

8793
- name: Use Deno ${{ matrix.deno-version }}
8894
uses: denoland/setup-deno@v2
8995
with:
9096
deno-version: ${{ matrix.deno-version }}
9197

9298
- name: Install dependencies
93-
run: npm ci
99+
run: pnpm install
94100

95101
- name: Run docker compose
96102
run: docker compose up -d
97103

98104
- name: Build
99-
run: npm run build
105+
run: pnpm build
100106

101107
- name: Run deno tests
102-
run: npm run test:deno
108+
run: pnpm test:deno
103109

104110
bun:
105111
name: Bun
@@ -113,14 +119,17 @@ jobs:
113119
steps:
114120
- uses: actions/checkout@v4
115121

122+
- name: Install pnpm
123+
uses: pnpm/action-setup@v4
124+
116125
- name: Use Node.js
117126
uses: actions/setup-node@v4
118127
with:
128+
cache: 'pnpm'
119129
node-version: lts/*
120-
cache: 'npm'
121130

122131
- name: Install dependencies
123-
run: npm ci
132+
run: pnpm install
124133

125134
- name: Use Bun ${{ matrix.bun-version }}
126135
uses: oven-sh/setup-bun@v2
@@ -131,7 +140,7 @@ jobs:
131140
run: docker compose up -d
132141

133142
- name: Run bun tests
134-
run: npm run test:bun
143+
run: pnpm test:bun
135144

136145
browser:
137146
name: Browser
@@ -140,20 +149,23 @@ jobs:
140149
steps:
141150
- uses: actions/checkout@v4
142151

152+
- name: Install pnpm
153+
uses: pnpm/action-setup@v4
154+
143155
- name: Use Node.js
144156
uses: actions/setup-node@v4
145157
with:
158+
cache: 'pnpm'
146159
node-version: lts/*
147-
cache: 'npm'
148160

149161
- name: Install dependencies
150-
run: npm ci
162+
run: pnpm install
151163

152164
- name: Install playwright
153-
run: npx playwright install chromium
165+
run: pnpx playwright install chromium
154166

155167
- name: Run browser tests
156-
run: npm run test:browser
168+
run: pnpm test:browser
157169

158170
cloudflare-workers:
159171
name: Cloudflare Workers
@@ -162,20 +174,23 @@ jobs:
162174
steps:
163175
- uses: actions/checkout@v4
164176

177+
- name: Install pnpm
178+
uses: pnpm/action-setup@v4
179+
165180
- name: Use Node.js
166181
uses: actions/setup-node@v4
167182
with:
183+
cache: 'pnpm'
168184
node-version: lts/*
169-
cache: 'npm'
170185

171186
- name: Install dependencies
172-
run: npm ci
187+
run: pnpm install
173188

174189
- name: Run docker compose
175190
run: docker compose up -d
176191

177192
- name: Run cloudflare workers test
178-
run: npm run test:cloudflare-workers
193+
run: pnpm test:cloudflare-workers
179194

180195
older-typescript-version:
181196
name: Older TypeScript version
@@ -198,30 +213,33 @@ jobs:
198213
steps:
199214
- uses: actions/checkout@v4
200215

216+
- name: Install pnpm
217+
uses: pnpm/action-setup@v4
218+
201219
- name: Use Node.js
202220
uses: actions/setup-node@v4
203221
with:
222+
cache: 'pnpm'
204223
node-version: 20.x
205-
cache: 'npm'
206224

207225
- name: Install dependencies
208-
run: npm ci
226+
run: pnpm install
209227

210228
- name: Run build with newer TypeScript
211-
run: npm run build
229+
run: pnpm build
212230

213231
- run: |
214232
echo "TS_VERSION=${{ matrix.typescript-version }}" >> $GITHUB_ENV
215233
echo "TSD_VERSION=${{ fromJson('{ "^4.6":"0.20.0", "^4.7":"0.22.0", "^4.8":"0.24.1", "^4.9":"0.27.0", "^5.0":"0.28.1", "^5.2":"0.29.0", "^5.3":"0.30.7", "^5.4":"0.31.2" }')[env.TS_VERSION] }} >> $GITHUB_ENV"
216234
217235
- name: Install Typescript (${{ env.TS_VERSION }}) and TSD (${{ env.TSD_VERSION }})
218-
run: npm i -D typescript@${{ env.TS_VERSION }} tsd@${{ env.TSD_VERSION }}
236+
run: pnpm i -w -D typescript@${{ env.TS_VERSION }} tsd@${{ env.TSD_VERSION }}
219237

220238
- name: Exclude non-backward compatible tests
221-
run: npx tsx ./scripts/exclude-test-files-for-backwards-compat.mts
239+
run: pnpx tsx ./scripts/exclude-test-files-for-backwards-compat.mts
222240

223241
- name: Run tests with older TypeScript version
224-
run: npm run test:typings && npm run test:node:build
242+
run: pnpm test:typings && pnpm test:node:build
225243

226244
jsdocs:
227245
name: JSDocs
@@ -230,25 +248,28 @@ jobs:
230248
steps:
231249
- uses: actions/checkout@v4
232250

251+
- name: Install pnpm
252+
uses: pnpm/action-setup@v4
253+
233254
- name: Use Node.js
234255
uses: actions/setup-node@v4
235256
with:
257+
cache: 'pnpm'
236258
node-version: lts/*
237-
cache: 'npm'
238259

239260
- name: Use Deno
240261
uses: denoland/setup-deno@v2
241262
with:
242263
deno-version: 2.x
243264

244265
- name: Install dependencies
245-
run: npm ci
266+
run: pnpm install
246267

247268
- name: Build
248-
run: npm run build
269+
run: pnpm build
249270

250271
- name: Type-check JSDocs code blocks
251-
run: npm run test:jsdocs
272+
run: pnpm test:jsdocs
252273

253274
typescript-benchmarks:
254275
name: TypeScript Benchmarks
@@ -257,17 +278,20 @@ jobs:
257278
steps:
258279
- uses: actions/checkout@v4
259280

281+
- name: Install pnpm
282+
uses: pnpm/action-setup@v4
283+
260284
- name: Use Node.js
261285
uses: actions/setup-node@v4
262286
with:
287+
cache: 'pnpm'
263288
node-version: lts/*
264-
cache: 'npm'
265289

266290
- name: Install dependencies
267-
run: npm ci
291+
run: pnpm install
268292

269293
- name: Run benchmarks
270-
run: npm run bench:ts
294+
run: pnpm bench:ts
271295

272296
typescript-native:
273297
name: TypeScript Native
@@ -276,17 +300,20 @@ jobs:
276300
steps:
277301
- uses: actions/checkout@v4
278302

303+
- name: Install pnpm
304+
uses: pnpm/action-setup@v4
305+
279306
- name: Use Node.js
280307
uses: actions/setup-node@v4
281308
with:
309+
cache: 'pnpm'
282310
node-version: lts/*
283-
cache: 'npm'
284311

285312
- name: Install dependencies
286-
run: npm ci && npm install -D @typescript/native-preview
313+
run: pnpm i && pnpm i -w -D @typescript/native-preview
287314

288315
- name: Build
289-
run: npm run build
316+
run: pnpm build
290317

291318
- name: Run TypeScript Native tests
292-
run: npx tsgo --project ./tsconfig.json && npx tsgo --project ./test/node/tsconfig.json
319+
run: pnpm tsgo --project ./tsconfig.json && pnpm tsgo --project ./test/node/tsconfig.json

CONTRIBUTING.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,17 @@ for all cases, are best left for consumers to implement.
144144

145145
1. clone your fork.
146146

147-
1. install node.js (preferably the latest even-numbered version).
147+
1. install Node.js (preferably the latest even-numbered version). we recommend using [`fnm`](https://github.com/Schniz/fnm) for managing Node.js versions.
148148

149-
1. run `npm i` in your terminal to install dependencies.
149+
1. install `corepack` by running `npm i -g corepack` in your terminal.
150+
151+
1. run `corepack enable` in your terminal.
152+
153+
1. `cd` into the repository.
154+
155+
1. run `corepack install` in your terminal to install the exact package manager and version used in this project.
156+
157+
1. run `pnpm i` in your terminal to install dependencies. if `pnpm` tells you it ignored a `postinstall` script from some package - tells us immediately via issue or Discord - this is a security concern!
150158

151159
1. create a branch (we don't care about naming).
152160

@@ -161,8 +169,8 @@ PR's description. E.g. `closes #123` will link the PR to issue/pull request #123
161169

162170
1. write typings tests @ [/test/typings](https://github.com/kysely-org/kysely/tree/master/test/typings)
163171

164-
1. install docker.
172+
1. install Docker.
165173

166-
1. run `docker compose up` in your terminal to spin up database instances.
174+
1. run `docker compose up -d` in your terminal to spin up database instances.
167175

168-
1. run `npm test` in another terminal to run tests.
176+
1. run `pnpm test` in your terminal.

0 commit comments

Comments
 (0)