Skip to content

Commit cc9a2ff

Browse files
authored
chore: Migrate from npm to pnpm (#80)
* chore: migrate from npm to pnpm - Replace package-lock.json with pnpm-lock.yaml - Set packageManager to pnpm@10.23.0 - Add minimumReleaseAge: 10080 (7 days) for supply chain protection - Update CI workflows for pnpm * fix: remove deprecated @types/uuid and update Dockerfile for pnpm @types/uuid is a deprecated stub (uuid ships its own types since v9). Under pnpm's strict resolution, the @types/uuid reference caused TS2688 because the uuid package wasn't hoisted to the top-level node_modules. Also update the Dockerfile to use pnpm instead of npm, since package-lock.json no longer exists after the pnpm migration. * docs: update README commands from npm to pnpm
1 parent 8d8ae59 commit cc9a2ff

File tree

7 files changed

+7561
-21440
lines changed

7 files changed

+7561
-21440
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,33 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
1921
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
2022
with:
2123
node-version: 'lts/*'
22-
cache: 'npm'
24+
cache: 'pnpm'
2325

2426
- name: Install dependencies
25-
run: npm ci
27+
run: pnpm install --frozen-lockfile
2628

2729
- name: Build
2830
run: |
29-
npm run build
31+
pnpm run build
3032
3133
test:
3234
runs-on: ubuntu-latest
3335
steps:
3436
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
37+
- name: Install pnpm
38+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
3539
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
3640
with:
3741
node-version: 'lts/*'
38-
cache: 'npm'
42+
cache: 'pnpm'
3943

4044
- name: Install dependencies
41-
run: npm ci
45+
run: pnpm install --frozen-lockfile
4246

4347
-
4448
# Required for the package command tests to work
@@ -47,36 +51,40 @@ jobs:
4751

4852
- name: Test
4953
run: |
50-
npm test
54+
pnpm test
5155
5256
lint:
5357
runs-on: ubuntu-latest
5458
steps:
5559
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
60+
- name: Install pnpm
61+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
5662
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
5763
with:
5864
node-version: 'lts/*'
59-
cache: 'npm'
65+
cache: 'pnpm'
6066

6167
- name: Install dependencies
62-
run: npm ci
68+
run: pnpm install --frozen-lockfile
6369

6470
- name: Lint
6571
run: |
66-
npm run lint
72+
pnpm run lint
6773
6874
format:
6975
runs-on: ubuntu-latest
7076
steps:
7177
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
78+
- name: Install pnpm
79+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
7280
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
7381
with:
7482
node-version: 'lts/*'
75-
cache: 'npm'
83+
cache: 'pnpm'
7684

7785
- name: Install dependencies
78-
run: npm ci
86+
run: pnpm install --frozen-lockfile
7987

8088
- name: Format
8189
run: |
82-
npm run format:check
90+
pnpm run format:check

Dockerfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
1-
FROM node:24-slim as builder
1+
FROM node:24-slim AS builder
2+
3+
RUN corepack enable && corepack prepare pnpm@10.23.0 --activate
24

35
WORKDIR /app
46

5-
COPY package*.json ./
7+
COPY package.json pnpm-lock.yaml ./
68

7-
RUN npm ci
9+
RUN pnpm install --frozen-lockfile
810

911
COPY . .
1012

11-
RUN npm run build
13+
RUN pnpm run build
1214

1315
FROM node:24-slim AS final
1416

17+
RUN corepack enable && corepack prepare pnpm@10.23.0 --activate
18+
1519
WORKDIR /app
1620

1721
COPY --from=builder ./app/dist ./dist
1822

19-
COPY package*.json ./
23+
COPY package.json pnpm-lock.yaml ./
2024

21-
RUN npm ci --omit=dev
25+
RUN pnpm install --frozen-lockfile --prod
2226

2327
EXPOSE 7777
2428

2529
ENTRYPOINT ["node", "dist/main.js"]
2630

27-
CMD [ "serve", "--address", "[::]:7777", "--log-format", "json", "--log-level", "info" ]
31+
CMD [ "serve", "--address", "[::]:7777", "--log-format", "json", "--log-level", "info" ]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Read about how to build a new CloudQuery plugin from this template in [Creating
1010
Install dependencies
1111

1212
```shell
13-
npm install
13+
pnpm install
1414
```
1515

1616
Run the plugin locally
1717

1818
```shell
19-
npm run dev
19+
pnpm dev
2020
```
2121

2222
Run cloudquery
@@ -30,7 +30,7 @@ This will create db.sql file (a Sqlite database) with a table `Names` and two re
3030
## Building and publishing the plugin
3131

3232
1. Update the plugin metadata in [src/plugins.ts](src/plugin.ts#L99) to match your team and plugin name.
33-
2. Run `npm run build` to build the plugin.
33+
2. Run `pnpm build` to build the plugin.
3434
3. Run `node dist/main.js package -m "Initial release" v0.0.1 .`. `-m` specifies changelog and `v0.0.1` is the version.
3535
4. Run `cloudquery plugin publish -f` to publish the plugin to the CloudQuery registry.
3636

0 commit comments

Comments
 (0)