Skip to content

Commit 2a7611d

Browse files
fix(packages): add types/typesVersions for legacy moduleResolution: node (#1898)
1 parent 5433f40 commit 2a7611d

7 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@modelcontextprotocol/client': patch
3+
'@modelcontextprotocol/server': patch
4+
'@modelcontextprotocol/node': patch
5+
'@modelcontextprotocol/express': patch
6+
'@modelcontextprotocol/fastify': patch
7+
'@modelcontextprotocol/hono': patch
8+
---
9+
10+
Add top-level `types` field (and `typesVersions` on client/server for their subpath exports) so consumers on legacy `moduleResolution: "node"` can resolve type declarations. The `exports` map remains the source of truth for `nodenext`/`bundler` resolution. The `typesVersions` map includes entries for subpaths added by sibling PRs in this series (`zod-schemas`, `stdio`); those entries are no-ops until the corresponding `dist/*.d.mts` files exist.

packages/client/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@
4747
}
4848
}
4949
},
50+
"types": "./dist/index.d.mts",
51+
"typesVersions": {
52+
"*": {
53+
"validators/cf-worker": [
54+
"dist/validators/cfWorker.d.mts"
55+
],
56+
"stdio": [
57+
"dist/stdio.d.mts"
58+
]
59+
}
60+
},
5061
"files": [
5162
"dist"
5263
],

packages/middleware/express/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"import": "./dist/index.mjs"
2828
}
2929
},
30+
"types": "./dist/index.d.mts",
3031
"files": [
3132
"dist"
3233
],

packages/middleware/fastify/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"import": "./dist/index.mjs"
2828
}
2929
},
30+
"types": "./dist/index.d.mts",
3031
"files": [
3132
"dist"
3233
],

packages/middleware/hono/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"import": "./dist/index.mjs"
2828
}
2929
},
30+
"types": "./dist/index.d.mts",
3031
"files": [
3132
"dist"
3233
],

packages/middleware/node/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
"import": "./dist/index.mjs"
2727
}
2828
},
29+
"types": "./dist/index.d.mts",
30+
"typesVersions": {
31+
"*": {
32+
"sse": [
33+
"dist/sse.d.mts"
34+
]
35+
}
36+
},
2937
"files": [
3038
"dist"
3139
],

packages/server/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@
4747
}
4848
}
4949
},
50+
"types": "./dist/index.d.mts",
51+
"typesVersions": {
52+
"*": {
53+
"validators/cf-worker": [
54+
"dist/validators/cfWorker.d.mts"
55+
],
56+
"zod-schemas": [
57+
"dist/zodSchemas.d.mts"
58+
],
59+
"stdio": [
60+
"dist/stdio.d.mts"
61+
]
62+
}
63+
},
5064
"files": [
5165
"dist"
5266
],

0 commit comments

Comments
 (0)