Commit f489a78
committed
fix(packaging): inline json-schema-typed in dist .d.mts; move validator provider types to subpath-only
The bundled server/client dist .d.mts files leaked two type references that
break downstream consumers with skipLibCheck:false (the TS default):
- types-*.d.mts imported 'json-schema-typed', which is not a dependency of
server/client (only of core, which is bundled). Fixed by adding
'json-schema-typed' to dts.resolve so the JSONSchema type is inlined.
- ajvProvider-*.d.mts referenced URIComponent without a declaration.
ajv@8.18.0's .d.ts does `import { URIComponent } from "fast-uri"`, but
fast-uri ships its types as `export = namespace`, which the dts bundler
cannot destructure — it drops the import and leaves the bare reference.
Fixed by removing the type-only re-exports of AjvJsonSchemaValidator /
CfWorkerJsonSchemaValidator / CfWorkerSchemaDraft from the public root
barrel: those classes/types are still exported from the dedicated
/validators/ajv and /validators/cf-worker subpaths (and the runtime
_shims conditional), so the inlined ajv type chunk is no longer reachable
from index.d.mts. The codemod already routes v1 imports to the subpaths.
Also:
- @modelcontextprotocol/node package.json: remove typesVersions.sse entry
pointing at nonexistent dist/sse.d.mts.
- server/client READMEs: note that TS >=6.0 needs "types": ["node"] in
tsconfig (TS 6 dropped implicit @types inclusion; the published .d.mts
references Buffer).
Verified: pnpm build:all + typecheck:all + docs:check green; fresh npm
install of packed tarballs + `npx tsc --noEmit` (NodeNext + bundler,
strict, skipLibCheck:false) is clean.1 parent 92b185d commit f489a78
7 files changed
Lines changed: 16 additions & 13 deletions
File tree
- .changeset
- packages
- client
- core/src/exports/public
- middleware/node
- server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 30 | | |
38 | 31 | | |
39 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments