| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
⚠️ No Changeset foundLatest commit: 278710a Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
Sorry, something went wrong.
|
@modelcontextprotocol/client
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@2095
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/codemod@2095
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@2095
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server-legacy@2095
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@2095
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/fastify@2095
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@2095
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@2095 commit: 278710a |
Sorry, something went wrong.
There was a problem hiding this comment.
Apologies, this one fell through the cracks and probably needs a couple of updates now - happy to re-review when updated.
Sorry, something went wrong.
Internal-only build configuration change. Consumers are not affected:
they continue to import from the built `.mjs`/`.d.mts` files declared
in each package's `exports` map.
What changed:
- `common/tsconfig/tsconfig.json`: `module: NodeNext` → `module: ESNext`,
`moduleResolution: NodeNext` → `moduleResolution: bundler`.
- `examples/{client,server}-quickstart/tsconfig.json`: same flip
(they extend a different base and overrode the resolution).
- Strip `.js` extensions from every relative TypeScript import across
packages/, examples/, scripts/, test/.
- Update CLAUDE.md to reflect the new import convention.
Why:
- Removes the long-standing footgun of having to write `from './foo.js'`
in `.ts` source files. Bundler resolution treats the path as a module
reference and lets the tooling resolve it.
- Aligns with what the bundler (`tsdown`), vitest, and downstream
consumers' bundlers actually do at runtime.
Verification: `pnpm typecheck:all`, `pnpm lint:all`, `pnpm test:all`,
`pnpm build:all` all pass.
- Make examples/{client,server}-quickstart extend @modelcontextprotocol/tsconfig
instead of carrying standalone compilerOptions. Drop the inline target/lib/
module/moduleResolution/strict/etc. duplicates; only outDir, rootDir,
declaration overrides, and workspace paths remain.
- Align docs/{client,server}-quickstart.md tsconfig snippets to ESNext/bundler
to match what the example projects now compile under.
- Adjust examples/client-quickstart/src/index.ts for the stricter
noUncheckedIndexedAccess inherited from the shared base.
- Strip leftover .js suffixes from vi.mock / vi.importActual string specifiers
in packages/client/test/client/middleware.test.ts.
The shared @modelcontextprotocol/tsconfig sets types: [node, vitest/globals], which the quickstarts inherit even though neither declares vitest as a devDependency — tsc only finds vitest types via the hoisted workspace root node_modules. Override types: [node] on each quickstart compilerOptions to break the accidental coupling.
…cli.ts
- Update docs/client-quickstart.md and docs/server-quickstart.md tsconfig
blocks to target: ESNext / lib: [ESNext], matching the shared base the
example tsconfigs now inherit from (was ES2023/ES2022, drifted after
consolidation onto @modelcontextprotocol/tsconfig).
- Delete scripts/cli.ts and the dangling server/client npm scripts that
referenced it across packages/{client,core,server}, packages/middleware/node,
test/{integration,helpers,conformance}, and examples/{client,server,shared}.
The file's imports point at ../src/* paths that ceased to exist post-monorepo;
no tsconfig builds it and no working npm script can reach it.
…kage The packages/codemod/ package (added in #1950) was written before the bundler resolution flip and used the old .js-extension import convention. This brings it in line with the rest of the repo. Backtick string fixtures that simulate user code (which intentionally still uses .js) are left alone.
Cover server-legacy, e2e tests, and jsonSchemaValidatorOverride tests that were added after the branch diverged.
…olver comment tsx is no longer invoked by core/client/server/middleware-node/examples-shared after the dead server/client npm scripts were removed; test/e2e, codemod and the workspace root keep theirs. Also update the eslint-config resolver comment that still described NodeNext-style './foo.js' imports.
|
Fixed the remaining import-extension cleanup in 278710ae. Changes:
Verified:
|
Sorry, something went wrong.
Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> Co-authored-by: Konstantin Konstantinov <KKonstantinov@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Summary
Why
Under moduleResolution: NodeNext, every relative TS import has to be written with a .js extension (import x from './foo.js') — a long-standing footgun for new contributors and a frequent source of confusion when scripts/codemods generate imports. moduleResolution: bundler treats the path as a module reference, matching what tsdown, vitest, and downstream consumers' bundlers already do at runtime.
This is an internal-only build configuration change. Consumers are not affected: they continue to import from the built .mjs/.d.mts files declared in each package's exports map, which still carry the .js extensions Node's NodeNext resolver requires at runtime.
Test plan