fix(packages): add types/typesVersions for legacy moduleResolution: node (#1898)

This commit is contained in:
Felix Weinberger 2026-04-28 14:51:03 +01:00 • committed by GitHub
commit 2a7611d46b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,10 @@
---
'@modelcontextprotocol/client': patch
'@modelcontextprotocol/server': patch
'@modelcontextprotocol/node': patch
'@modelcontextprotocol/express': patch
'@modelcontextprotocol/fastify': patch
'@modelcontextprotocol/hono': patch
---
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.

View file

@ -47,6 +47,17 @@
}
}
},
"types": "./dist/index.d.mts",
"typesVersions": {
"*": {
"validators/cf-worker": [
"dist/validators/cfWorker.d.mts"
],
"stdio": [
"dist/stdio.d.mts"
]
}
},
"files": [
"dist"
],

View file

@ -27,6 +27,7 @@
"import": "./dist/index.mjs"
}
},
"types": "./dist/index.d.mts",
"files": [
"dist"
],

View file

@ -27,6 +27,7 @@
"import": "./dist/index.mjs"
}
},
"types": "./dist/index.d.mts",
"files": [
"dist"
],

View file

@ -27,6 +27,7 @@
"import": "./dist/index.mjs"
}
},
"types": "./dist/index.d.mts",
"files": [
"dist"
],

View file

@ -26,6 +26,14 @@
"import": "./dist/index.mjs"
}
},
"types": "./dist/index.d.mts",
"typesVersions": {
"*": {
"sse": [
"dist/sse.d.mts"
]
}
},
"files": [
"dist"
],

View file

@ -47,6 +47,20 @@
}
}
},
"types": "./dist/index.d.mts",
"typesVersions": {
"*": {
"validators/cf-worker": [
"dist/validators/cfWorker.d.mts"
],
"zod-schemas": [
"dist/zodSchemas.d.mts"
],
"stdio": [
"dist/stdio.d.mts"
]
}
},
"files": [
"dist"
],