Skip to content

build: configure tsdown to output both ESM and CJS#2033

Open
lppedd wants to merge 3 commits intomodelcontextprotocol:mainfrom
lppedd:build/cjs
Open

build: configure tsdown to output both ESM and CJS#2033
lppedd wants to merge 3 commits intomodelcontextprotocol:mainfrom
lppedd:build/cjs

Conversation

@lppedd
Copy link
Copy Markdown

@lppedd lppedd commented May 8, 2026

Motivation and Context

The SDK v2 needs proper packaging for both ESM and CJS consumers.

tsdown can easily do that, but was not properly configured.
Each module system's output is isolated into its own dist/{module-system} subdir.

Fixes #971

How Has This Been Tested?

  • Executed all test cases.
  • Packaged tarballs and installed them locally.
  • Verified the outputted consumer files properly run, and that they properly bundle SDK declarations.

Breaking Changes

There is no "obvious" breaking change that I can think of.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

No AI-assistant was involved in the changes. If something's broken it's my fault.

@lppedd lppedd requested a review from a team as a code owner May 8, 2026 13:23
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

⚠️ No Changeset found

Latest commit: 4a86307

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 changesets

When 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

@lppedd
Copy link
Copy Markdown
Author

lppedd commented May 8, 2026

You need to bump Node.js/Deno/Bun memory a little bit, otherwise it goes out of memory while building with tsdown.
8 gigs are more than enough.

Nevermind. Fixed.

This solves an OOM issue with rolldown and this project structure,
which btw I cannot debug further. Will remain a mistery.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 8, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2033

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2033

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2033

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2033

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2033

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2033

commit: 4a86307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CommonJS export paths broken - missing index.js file in dist/cjs

1 participant