Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/middleware/express/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default defineConfig({
shims: true,
dts: {
resolver: 'tsc',
// Keep workspace deps as external imports in the bundled .d.ts instead of
// inlining their type graph — see ../node/tsdown.config.ts for the rationale.
compilerOptions: {
baseUrl: '.',
paths: {
'@modelcontextprotocol/server': ['../server/src/index.ts']
}
paths: {},
preserveSymlinks: true
}
}
});
8 changes: 4 additions & 4 deletions packages/middleware/fastify/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default defineConfig({
shims: true,
dts: {
resolver: 'tsc',
// Keep workspace deps as external imports in the bundled .d.ts instead of
// inlining their type graph — see ../node/tsdown.config.ts for the rationale.
compilerOptions: {
baseUrl: '.',
paths: {
'@modelcontextprotocol/server': ['../server/src/index.ts']
}
paths: {},
preserveSymlinks: true
}
}
});
8 changes: 4 additions & 4 deletions packages/middleware/hono/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default defineConfig({
shims: true,
dts: {
resolver: 'tsc',
// Keep workspace deps as external imports in the bundled .d.ts instead of
// inlining their type graph — see ../node/tsdown.config.ts for the rationale.
compilerOptions: {
baseUrl: '.',
paths: {
'@modelcontextprotocol/server': ['../server/src/index.ts']
}
paths: {},
preserveSymlinks: true
}
}
});
10 changes: 8 additions & 2 deletions packages/middleware/node/src/streamableHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
import type { IncomingMessage, ServerResponse } from 'node:http';

import { getRequestListener } from '@hono/node-server';
import type { AuthInfo, JSONRPCMessage, MessageExtraInfo, RequestId, Transport } from '@modelcontextprotocol/core';
import type { WebStandardStreamableHTTPServerTransportOptions } from '@modelcontextprotocol/server';
import type {
AuthInfo,
JSONRPCMessage,
MessageExtraInfo,
RequestId,
Transport,
WebStandardStreamableHTTPServerTransportOptions
} from '@modelcontextprotocol/server';
import { WebStandardStreamableHTTPServerTransport } from '@modelcontextprotocol/server';

/**
Expand Down
21 changes: 16 additions & 5 deletions packages/middleware/node/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,23 @@ export default defineConfig({
// Bundles d.ts files into a single output
dts: {
resolver: 'tsc',
// override just for DTS generation:
// The dev tsconfig.json maps @modelcontextprotocol/* to workspace source via
// `paths` so typecheck/IDE work without a prior build. For declaration emit we
// need the opposite: resolve workspace deps through node_modules and keep them
// as *external* imports in the bundled .d.ts (server is a peerDependency, so
// consumers already have its types). `paths: {}` disables the dev source
// mappings; `preserveSymlinks` keeps `node_modules` in the resolved path so
// rolldown-plugin-dts recognises the dep as external instead of inlining the
// whole upstream type graph (which OOMs once core's surface gets large enough).
//
// TODO: drop this override once tsdown pulls rolldown-plugin-dts >=0.21.0
// (sxzz/rolldown-plugin-dts@03998d41 honours rolldown `external` before the
// node_modules path test). Bumping also requires reworking the `dts.resolve`
// usage in packages/{server,client}/tsdown.config.ts — that option was removed
// in the same release.
compilerOptions: {
baseUrl: '.',
paths: {
'@modelcontextprotocol/core': ['../core/src/index.ts']
}
paths: {},
preserveSymlinks: true
}
}
});
Loading