Skip to content

Commit 370ad81

Browse files
authored
chore: npm -> pnpm (#746)
1 parent c507982 commit 370ad81

18 files changed

+9610
-15248
lines changed

.github/workflows/accuracy-tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ jobs:
3131
- uses: actions/checkout@v5
3232
with:
3333
persist-credentials: false
34+
- uses: pnpm/action-setup@v4
3435
- uses: actions/setup-node@v6
3536
with:
3637
node-version-file: package.json
37-
cache: "npm"
38+
cache: "pnpm"
3839
- name: Install dependencies
39-
run: npm ci
40+
run: pnpm install --frozen-lockfile
4041
- name: Run accuracy tests
41-
run: npm run test:accuracy
42+
run: pnpm run test:accuracy
4243
- name: Upload accuracy test summary
4344
if: always()
4445
uses: actions/upload-artifact@v5

.github/workflows/check.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches:
66
- main
77
pull_request:
8-
pull_request_target:
9-
branches:
10-
- main
118

129
permissions: {}
1310

@@ -19,14 +16,15 @@ jobs:
1916
- uses: actions/checkout@v5
2017
with:
2118
persist-credentials: false
19+
- uses: pnpm/action-setup@v4
2220
- uses: actions/setup-node@v6
2321
with:
2422
node-version-file: package.json
25-
cache: "npm"
23+
cache: "pnpm"
2624
- name: Install dependencies
27-
run: npm ci
25+
run: pnpm install --frozen-lockfile
2826
- name: Run style check
29-
run: npm run check
27+
run: pnpm run check
3028

3129
check-generate:
3230
runs-on: ubuntu-latest
@@ -35,13 +33,14 @@ jobs:
3533
- uses: actions/checkout@v5
3634
with:
3735
persist-credentials: false
36+
- uses: pnpm/action-setup@v4
3837
- uses: actions/setup-node@v6
3938
with:
4039
node-version-file: package.json
41-
cache: "npm"
40+
cache: "pnpm"
4241
- name: Install dependencies
43-
run: npm ci
44-
- run: npm run generate
42+
run: pnpm install --frozen-lockfile
43+
- run: pnpm run generate
4544

4645
check-dep:
4746
name: Check dependencies
@@ -51,14 +50,16 @@ jobs:
5150
- uses: actions/checkout@v5
5251
with:
5352
persist-credentials: false
53+
- uses: pnpm/action-setup@v4
5454
- uses: actions/setup-node@v6
5555
with:
5656
node-version-file: package.json
57-
cache: "npm"
57+
cache: "pnpm"
5858
- name: Install dependencies, build and remove dev dependencies
5959
run: |
60-
npm ci
60+
pnpm install --frozen-lockfile
6161
rm -rf node_modules
62-
npm pkg set scripts.prepare="exit 0"
63-
npm install --omit=dev
64-
- run: npx -y @modelcontextprotocol/inspector@0.16.5 --cli --method tools/list -- node dist/esm/index.js
62+
pnpm pkg set scripts.prepare="exit 0"
63+
pnpm install --prod --frozen-lockfile
64+
- name: List available tools
65+
run: pnpm dlx @modelcontextprotocol/inspector@0.16.5 --cli --method tools/list -- node dist/esm/index.js

.github/workflows/cleanup-atlas-env.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ jobs:
1515
- uses: actions/checkout@v5
1616
with:
1717
persist-credentials: false
18+
- uses: pnpm/action-setup@v4
1819
- uses: actions/setup-node@v6
1920
with:
2021
node-version-file: package.json
21-
cache: "npm"
22+
cache: "pnpm"
2223
- name: Install dependencies
23-
run: npm ci
24+
run: pnpm install --frozen-lockfile
2425
- name: Run cleanup script
2526
env:
2627
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
2728
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
2829
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
29-
run: npm run atlas:cleanup
30+
run: pnpm run atlas:cleanup

.github/workflows/code-health-fork.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ jobs:
2828
name: Setup Docker Environment
2929
with:
3030
set-host: true
31+
- uses: pnpm/action-setup@v4
3132
- uses: actions/setup-node@v6
3233
with:
3334
node-version-file: package.json
34-
cache: "npm"
35+
cache: "pnpm"
3536
- name: Install dependencies
36-
run: npm ci
37+
run: pnpm install --frozen-lockfile
3738
- name: Run tests
38-
run: npm test
39+
run: pnpm test
3940
env:
4041
SKIP_ATLAS_TESTS: "true"
4142
SKIP_ATLAS_LOCAL_TESTS: "true"
@@ -46,11 +47,12 @@ jobs:
4647
steps:
4748
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
4849
- uses: actions/checkout@v5
50+
- uses: pnpm/action-setup@v4
4951
- uses: actions/setup-node@v6
5052
with:
5153
node-version-file: package.json
52-
cache: "npm"
54+
cache: "pnpm"
5355
- name: Install dependencies
54-
run: npm ci
56+
run: pnpm install --frozen-lockfile
5557
- name: Run tests
56-
run: npm test -- tests/integration/tools/atlas-local/
58+
run: pnpm test -- tests/integration/tools/atlas-local/

.github/workflows/code-health-long-running.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ jobs:
1717
- uses: actions/checkout@v5
1818
with:
1919
persist-credentials: false
20+
- uses: pnpm/action-setup@v4
2021
- uses: actions/setup-node@v6
2122
with:
2223
node-version-file: package.json
23-
cache: "npm"
24+
cache: "pnpm"
2425
- name: Install dependencies
25-
run: npm ci
26+
run: pnpm install --frozen-lockfile
2627
- name: Run tests
2728
env:
2829
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
2930
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
3031
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
31-
run: npm test -- tests/integration/tools/atlas --project=long-running-tests
32+
run: pnpm test tests/integration/tools/atlas --project=long-running-tests
3233
- name: Upload test results
3334
uses: actions/upload-artifact@v5
3435
if: always()

.github/workflows/code-health.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ jobs:
2929
name: Setup Docker Environment
3030
with:
3131
set-host: true
32+
- uses: pnpm/action-setup@v4
3233
- uses: actions/setup-node@v6
3334
with:
3435
node-version-file: package.json
35-
cache: "npm"
36+
cache: "pnpm"
3637
- name: Install dependencies
37-
run: npm ci
38+
run: pnpm install --frozen-lockfile
3839
- name: Run tests
39-
run: npm test
40+
run: pnpm test
4041
env:
4142
SKIP_ATLAS_TESTS: "true"
4243
SKIP_ATLAS_LOCAL_TESTS: "true"
@@ -56,18 +57,19 @@ jobs:
5657
- uses: actions/checkout@v5
5758
with:
5859
persist-credentials: false
60+
- uses: pnpm/action-setup@v4
5961
- uses: actions/setup-node@v6
6062
with:
6163
node-version-file: package.json
62-
cache: "npm"
64+
cache: "pnpm"
6365
- name: Install dependencies
64-
run: npm ci
66+
run: pnpm install --frozen-lockfile
6567
- name: Run tests
6668
env:
6769
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
6870
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
6971
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
70-
run: npm test -- tests/integration/tools/atlas/
72+
run: pnpm test tests/integration/tools/atlas/
7173
- name: Upload test results
7274
uses: actions/upload-artifact@v5
7375
if: always()
@@ -84,14 +86,15 @@ jobs:
8486
- uses: actions/checkout@v5
8587
with:
8688
persist-credentials: false
89+
- uses: pnpm/action-setup@v4
8790
- uses: actions/setup-node@v6
8891
with:
8992
node-version-file: package.json
90-
cache: "npm"
93+
cache: "pnpm"
9194
- name: Install dependencies
92-
run: npm ci
95+
run: pnpm install --frozen-lockfile
9396
- name: Run tests
94-
run: npm test -- tests/integration/tools/atlas-local/
97+
run: pnpm test tests/integration/tools/atlas-local/
9598
- name: Upload test results
9699
uses: actions/upload-artifact@v5
97100
if: always()
@@ -108,12 +111,13 @@ jobs:
108111
- uses: actions/checkout@v5
109112
with:
110113
persist-credentials: false
114+
- uses: pnpm/action-setup@v4
111115
- uses: actions/setup-node@v6
112116
with:
113117
node-version-file: package.json
114-
cache: "npm"
118+
cache: "pnpm"
115119
- name: Install dependencies
116-
run: npm ci
120+
run: pnpm install --frozen-lockfile
117121
- name: Download test results
118122
uses: actions/download-artifact@v6
119123
with:
@@ -131,7 +135,7 @@ jobs:
131135
path: coverage/atlas-local
132136
- name: Merge coverage reports
133137
run: |
134-
npx -y lcov-result-merger@5.0.1 "coverage/*/lcov.info" "coverage/lcov.info"
138+
pnpm dlx lcov-result-merger@5.0.1 "coverage/*/lcov.info" "coverage/lcov.info"
135139
- name: Coveralls GitHub Action
136140
uses: coverallsapp/github-action@v2.3.6
137141
with:
@@ -146,10 +150,6 @@ jobs:
146150
- uses: actions/checkout@v5
147151
with:
148152
persist-credentials: false
149-
- uses: actions/setup-node@v6
150-
with:
151-
node-version-file: package.json
152-
cache: "npm"
153153
- name: Install dependencies
154154
run: |
155155
sudo apt-get install -y git-secrets

.github/workflows/prepare-release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,23 @@ jobs:
2323
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
2424
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
2525
- uses: actions/checkout@v5
26+
- uses: pnpm/action-setup@v4
2627
- uses: actions/setup-node@v6
2728
with:
2829
node-version-file: package.json
2930
registry-url: "https://registry.npmjs.org"
30-
cache: "npm"
31+
cache: "pnpm"
3132
- name: Install dependencies
32-
run: npm ci
33+
run: pnpm install --frozen-lockfile
3334
- name: Bump version
3435
id: bump-version
3536
run: |
36-
echo "NEW_VERSION=$(npm version ${{ inputs.version }} --no-git-tag-version)" >> $GITHUB_OUTPUT
37-
npm run build:update-package-version
37+
echo "NEW_VERSION=$(pnpm version ${{ inputs.version }} --no-git-tag-version)" >> $GITHUB_OUTPUT
38+
pnpm run build:update-package-version
3839
3940
- name: Update server.json version and arguments
4041
run: |
41-
npm run generate:arguments
42+
pnpm run generate:arguments
4243
4344
- name: Create release PR
4445
uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # 7.0.9

.github/workflows/publish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ jobs:
1818
- uses: actions/checkout@v5
1919
with:
2020
fetch-depth: 0
21+
- uses: pnpm/action-setup@v4
2122
- uses: actions/setup-node@v6
2223
with:
2324
node-version-file: package.json
2425
registry-url: "https://registry.npmjs.org"
25-
cache: "npm"
26+
cache: "pnpm"
2627
- name: Get version
2728
id: get-version
2829
shell: bash
@@ -84,18 +85,19 @@ jobs:
8485
- uses: actions/checkout@v5
8586
with:
8687
persist-credentials: false
88+
- uses: pnpm/action-setup@v4
8789
- uses: actions/setup-node@v6
8890
with:
8991
node-version-file: package.json
9092
registry-url: "https://registry.npmjs.org"
91-
cache: "npm"
93+
cache: "pnpm"
9294

9395
- name: Build package
9496
run: |
95-
npm ci
96-
npm run build
97+
pnpm install --frozen-lockfile
98+
pnpm run build
9799
- name: Publish to NPM
98-
run: npm publish --tag ${{ needs.check.outputs.RELEASE_CHANNEL }}
100+
run: pnpm publish --tag ${{ needs.check.outputs.RELEASE_CHANNEL }} --no-git-checks
99101
env:
100102
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
101103

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ coverage
33
package-lock.json
44
tests/tmp
55
src/common/atlas/openapi.d.ts
6+
pnpm-lock.yaml

CONTRIBUTING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This project implements a Model Context Protocol (MCP) server for MongoDB and Mo
1111
### Prerequisites
1212

1313
- Node.js (v20 or later)
14-
- npm
14+
- pnpm
1515

1616
### Getting Started
1717

@@ -25,7 +25,7 @@ This project implements a Model Context Protocol (MCP) server for MongoDB and Mo
2525
2. Install dependencies:
2626

2727
```
28-
npm install
28+
pnpm install
2929
```
3030

3131
3. Add the mcp server to your IDE of choice (see the [README](README.md) for detailed client integration instructions)
@@ -52,7 +52,7 @@ This project implements a Model Context Protocol (MCP) server for MongoDB and Mo
5252
3. Run the inspector and double check your changes:
5353

5454
```
55-
npm run inspect
55+
pnpm run inspect
5656
```
5757

5858
4. Commit your changes using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format.
@@ -65,15 +65,15 @@ When adding new features or fixing bugs, please ensure that you also add tests t
6565

6666
The tests can be found in the `tests` directory.
6767

68-
You can run tests using the following npm scripts:
68+
You can run tests using the following pnpm scripts:
6969

70-
- `npm test`: Run all tests
70+
- `pnpm test`: Run all tests
7171

7272
To run a specific test file or directory:
7373

7474
```bash
75-
npm test -- path/to/test/file.test.ts
76-
npm test -- path/to/directory
75+
pnpm test path/to/test/file.test.ts
76+
pnpm test path/to/directory
7777
```
7878

7979
#### Accuracy Tests and colima
@@ -84,7 +84,7 @@ If you use [colima](https://github.com/abiosoft/colima) to run Docker on Mac, yo
8484

8585
### Restart Server
8686

87-
- Run `npm run build` to re-build the server if you made changes to the code
87+
- Run `pnpm run build` to re-build the server if you made changes to the code
8888
- Press `Cmd + Shift + P` and type List MCP Servers
8989
- Select the MCP server you want to restart
9090
- Select the option to restart the server
@@ -102,7 +102,7 @@ To see MCP logs, check https://code.visualstudio.com/docs/copilot/chat/mcp-serve
102102
For debugging, we use the MCP inspector tool. From the root of this repository, run:
103103

104104
```shell
105-
npm run inspect
105+
pnpm run inspect
106106
```
107107

108108
This is equivalent to:

0 commit comments

Comments
 (0)