chore: switch to module ESNext + moduleResolution bundler (#2095)

This commit is contained in:
Matt 2026-06-25 12:49:17 +02:00 • committed by GitHub
commit ee732d64b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 668 additions and 863 deletions

View file

@ -43,9 +43,9 @@ import { importSPKI, jwtVerify } from 'jose';
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import { hostPerSession } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { hostPerSession } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const ISSUER = 'https://auth.example.com';
const MCP_URL = 'http://in-process/mcp';

View file

@ -12,9 +12,9 @@ import { completable, McpServer, ProtocolError, ProtocolErrorCode, ResourceTempl
import { expect } from 'vitest';
import { z } from 'zod/v4';
import { wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const COLORS = ['red', 'green', 'blue', 'rebeccapurple'] as const;
const FILE_PATHS = ['README.md', 'src/index.ts', 'src/types.ts'] as const;

View file

@ -15,9 +15,9 @@ import { McpServer, ProtocolErrorCode, Server } from '@modelcontextprotocol/serv
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import { wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
verifies('custom-methods:server-handler:roundtrip', async ({ transport }: TestArgs) => {
const SearchParams = z.object({ query: z.string(), limit: z.number().int().default(5) });

View file

@ -12,9 +12,9 @@ import { McpServer, ProtocolErrorCode, Server } from '@modelcontextprotocol/serv
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import { wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const newClient = () => new Client({ name: 'c', version: '0' });

View file

@ -22,9 +22,9 @@ import {
import { expect } from 'vitest';
import { z } from 'zod/v4';
import { tapWire, wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { tapWire, wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
/** Client with form-mode elicitation support. */
const formClient = () => new Client({ name: 'c', version: '0' }, { capabilities: { elicitation: { form: {} } } });

View file

@ -24,9 +24,9 @@ import {
import { expect } from 'vitest';
import { z } from 'zod/v4';
import { hostPerSession, tapWire, wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { hostPerSession, tapWire, wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const newClient = () => new Client({ name: 'c', version: '0' });

View file

@ -24,10 +24,10 @@ import { McpServer, ProtocolErrorCode, Server, specTypeSchemas, UrlElicitationRe
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import { hostPerSession, hostResumable, wire } from '../helpers/index.js';
import { startLegacySseHost } from '../helpers/sse-host.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { hostPerSession, hostResumable, wire } from '../helpers/index';
import { startLegacySseHost } from '../helpers/sse-host';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
verifies('flow:compat:dual-transport-server', async (_args: TestArgs) => {
// One deployment, one server factory, both transports: the modern Streamable HTTP

View file

@ -15,9 +15,9 @@ import { McpServer } from '@modelcontextprotocol/server';
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import { hostPerSession, wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { hostPerSession, wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
verifies('mcpserver:context:log-from-handler', async ({ transport }: TestArgs) => {
let releaseHandler!: () => void;

View file

@ -31,8 +31,8 @@ import { McpServer, WebStandardStreamableHTTPServerTransport } from '@modelconte
import { expect } from 'vitest';
import { z } from 'zod/v4';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const VALID_TOKEN = 'analytics-dashboard-access-token';

View file

@ -30,9 +30,9 @@ import express from 'express';
import { expect } from 'vitest';
import { z } from 'zod/v4';
import { startExpressMinimal, startExpressWithHostValidation } from '../helpers/express.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { startExpressMinimal, startExpressWithHostValidation } from '../helpers/express';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const RESOURCE_METADATA_URL = 'https://mcp.example.com/.well-known/oauth-protected-resource';
const VALID_TOKEN = 'analytics-dashboard-token';

View file

@ -19,8 +19,8 @@ import type { FastifyInstance, FastifyRequest } from 'fastify';
import { expect } from 'vitest';
import { z } from 'zod/v4';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
function forecastServer(): McpServer {
const s = new McpServer({ name: 'forecast-server', version: '0.3.0' });

View file

@ -20,8 +20,8 @@ import type { Hono } from 'hono';
import { expect } from 'vitest';
import { z } from 'zod/v4';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
function recipeServer(): McpServer {
const s = new McpServer({ name: 'recipe-server', version: '1.2.0' });

View file

@ -18,10 +18,10 @@ import { LATEST_PROTOCOL_VERSION, McpServer, WebStandardStreamableHTTPServerTran
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import type { HttpHandler } from '../helpers/index.js';
import { hostPerSession, hostStateless } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import type { HttpHandler } from '../helpers/index';
import { hostPerSession, hostStateless } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
function echoServer(): McpServer {
const s = new McpServer({ name: 's', version: '0' });

View file

@ -12,9 +12,9 @@ import { LATEST_PROTOCOL_VERSION, McpServer, parseJSONRPCMessage } from '@modelc
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import { hostResumable } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { hostResumable } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
/**
* These three tests assert the raw frame sequence of the POST SSE stream itself, so they cannot run their traffic through a connected client.

View file

@ -19,10 +19,10 @@ import express from 'express';
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import { startExpressMinimal } from '../helpers/express.js';
import { hostPerSession, hostStateless, wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { startExpressMinimal } from '../helpers/express';
import { hostPerSession, hostStateless, wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const newClient = () => new Client({ name: 'c', version: '0' });

View file

@ -32,9 +32,9 @@ import {
import { expect } from 'vitest';
import { z } from 'zod/v4';
import { tapWire, wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { tapWire, wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
function olderSupportedVersion(): string {
const older = SUPPORTED_PROTOCOL_VERSIONS.find(v => v !== LATEST_PROTOCOL_VERSION);

View file

@ -17,9 +17,9 @@ import { isJSONRPCRequest, McpServer, ProtocolError, ProtocolErrorCode, Server,
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import { tapWire, wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { tapWire, wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const ALL_LEVELS: LoggingLevel[] = ['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency'];

View file

@ -10,9 +10,9 @@ import { isJSONRPCRequest, McpServer, ProtocolError, ProtocolErrorCode, Resource
import { expect } from 'vitest';
import { z } from 'zod/v4';
import { tapWire, wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { tapWire, wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const newClient = () => new Client({ name: 'c', version: '0' });

View file

@ -14,9 +14,9 @@ import { McpServer, ProtocolError, ProtocolErrorCode, Server } from '@modelconte
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import { wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const TINY_PNG_BASE64 = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
const TINY_WAV_BASE64 = 'UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAAAAA=';

View file

@ -34,9 +34,9 @@ import {
import { expect, vi } from 'vitest';
import { z } from 'zod/v4';
import { tapWire, wire } from '../helpers/index.js';
import { verifies } from '../helpers/verifies.js';
import type { TestArgs } from '../types.js';
import { tapWire, wire } from '../helpers/index';
import { verifies } from '../helpers/verifies';
import type { TestArgs } from '../types';
const newClient = () => new Client({ name: 'c', version: '0' });

Some files were not shown because too many files have changed in this diff Show more