Skip to content

chore(build): migrate the web runner, mcpdo and TUI bundles from tsup to tsdown - #2807

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/chore/2797-tsdown-remaining-clients
Oct 25, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/chore/2797-tsdown-remaining-clients

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2797

Follows the CLI prototype from #1492. No client builds with tsup any more.

What changed

  • Web runner (clients/web/tsdown.runner.config.ts), mcpdo (clients/mcpdo/tsdown.config.ts) and TUI (clients/tui/tsdown.config.ts) now build with tsdown. Each has a const EXTERNALS = [...] expanded with subpath patterns into deps.neverBundle, plus fixedExtension: false and outputOptions.comments: { jsdoc: false }, the same as clients/cli/tsdown.config.ts.
  • TUI: JSX goes through inputOptions.transform.jsx: "react-jsx", and ink-form / ink-scroll-view are in deps.alwaysBundle, which overrides tsdown's auto-externalization of the client's own dependencies. __tests__/tsupConfig.test.ts is now tsdownConfig.test.ts and reads the deps lists through tsdown's UserConfig / DepsConfig types. Its React-externals assertions are unchanged. I checked that it still catches a regression by dropping ink-form from the bundled list: the test failed.
  • mcpdo: the shared code goes into a hashed chunk written flat into build/, so src/daemon/ensure.ts still finds mcpdod.js next to it. The mcpdo suite spawns the built daemon, so it covers that path. With tsup gone, npm ls esbuild is empty in this install, so its esbuild and sucrase overrides and its allowScripts entries are removed.
  • Web and TUI keep their esbuild overrides and allowScripts. Vite and Storybook (web) and tsx (TUI) still install esbuild, and Vite and Storybook accept ^0.27.0, which includes the advisory range the override avoids.
  • Lockstep: tsdown is held at 0.23.1 and Rolldown overridden to 1.2.13 in every install, matching the CLI and the root's Vite. Otherwise verify:dep-lockstep rejects the skew.
  • Updated BUNDLED_CLIENTS, the external-list paths in AGENTS.md and scripts/sdk-watch.mjs, each client's tsconfig include, docs/tsdown-migration.md (now marked complete, with measurements), and the docs and skills that named the old configs.

Acceptance

  • No tsup dependency remains in any client manifest.
  • Each bundle emits the same set of bare package imports as its tsup build. I diffed them before and after the switch. The only difference is that Rolldown writes Node builtins with the node: prefix.
Bundle tsup tsdown
Web runner 341 KB 275 KB
mcpdo (all chunks) 964 KB 727 KB
TUI 1054 KB 810 KB
  • verify:bundle-externals passes (4 bundles), as does verify:dep-lockstep. npm run local:gate passes, including every client's test:coverage.

No UI change, so no screenshots.

🤖 Generated with Claude Code

… to tsdown (#2797)

Follows the CLI prototype from #1492, so no client builds with tsup any more.

- Each config keeps a `const EXTERNALS = [...]` expanded with subpath
  patterns for `deps.neverBundle`, plus `fixedExtension: false` and
  `outputOptions.comments: { jsdoc: false }`, as in clients/cli.
- TUI: JSX via `inputOptions.transform.jsx`, and ink-form / ink-scroll-view
  in `deps.alwaysBundle`. tsupConfig.test.ts becomes tsdownConfig.test.ts,
  reading the deps lists through tsdown's UserConfig with its
  React-externals assertions unchanged.
- mcpdo: the shared chunk is written flat into build/, so ensure.ts still
  finds mcpdod.js as a sibling. With tsup gone, esbuild is out of this
  install, so its esbuild/sucrase overrides and allowScripts go too. Web and
  TUI keep theirs, since Vite, Storybook and tsx still install esbuild.
- tsdown is held at 0.23.1 and Rolldown overridden to 1.2.13 in every
  install, matching the CLI and the root's Vite for verify:dep-lockstep.
- BUNDLED_CLIENTS, the external-list paths in AGENTS.md and sdk-watch, the
  tsconfig includes and the docs/skills follow the renames.

Each bundle emits the same set of bare package imports as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Oct 25, 2026
@cliffhall cliffhall linked an issue Oct 25, 2026 that may be closed by this pull request
@cliffhall
cliffhall requested a balanced review from Copilot October 25, 2026 04:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The migration preserves entry-point and externalization contracts, retains React bundling safeguards, and has no identified blocking defects.

No open issues 🎉

3 files not reviewed
  • clients/mcpdo/package-lock.json: Generated file
  • clients/tui/package-lock.json: Generated file
  • clients/web/package-lock.json: Generated file
What changed in this PR

Completes #2797 by migrating the web runner, mcpdo, and TUI to tsdown, following the CLI prototype from #1492 and standardizing all four bundled clients.

Changes:

  • Replaces tsup configurations and build commands while preserving entry filenames, shared-core bundling, and external package subpaths.
  • Adapts the TUI’s React bundling safeguards and aligns Rolldown versions.
  • Updates verification references, documentation, and development procedures to reflect the completed migration.
File Description
specification/​v2_cli_tui_launcher.md Updates build architecture references to tsdown.
specification/​v2_catalog_launch_config.md Updates the linked specification’s description.
scripts/​verify-dep-lockstep.mjs Updates a toolchain comment.
scripts/​verify-bundle-externals.mjs Points verification at the new configurations.
scripts/​sdk-watch.mjs Updates generated upgrade-checklist paths.
scripts/​pack-and-verify.mjs Updates bundler guidance in an error message.
README.md Refreshes build and migration documentation references.
docs/​tsdown-migration.md Records completion, measurements, and migration details.
docs/​quality-gate.md Documents tsdown bundle verification.
docs/​publishing.md Updates configuration and React-policy test paths.
docs/​architecture.md Documents the unified tsdown alias setup.
core/​auth/​node/​file-lock.ts Updates the bundler compatibility comment only.
clients/​web/​vite.config.ts Updates the separate-runner comment only.
clients/​web/​tsup.runner.config.ts Removes the old runner configuration.
clients/​web/​tsdown.runner.config.ts Adds the tsdown runner configuration.
clients/​web/​tsconfig.node.json Includes the renamed runner configuration.
clients/​web/​src/​test/​integration/​server/​vite-base-config.test.ts Updates bundler terminology in comments only.
clients/​web/​server/​vite-base-config.ts Updates the production-externalization comment only.
clients/​web/​README.md Documents the new runner build command.
clients/​web/​package.json Switches the runner to tsdown and overrides Rolldown.
clients/​web/​eslint.config.js Updates the generated-output comment only.
clients/​tui/​tsup.config.ts Removes the old TUI configuration.
clients/​tui/​tsdown.config.ts Adds tsdown with JSX and React bundling policies.
clients/​tui/​tsconfig.json Includes the renamed build configuration.
clients/​tui/​README.md Updates bundling-policy documentation.
clients/​tui/​package.json Switches builds to tsdown and overrides Rolldown.
clients/​tui/​package-lock.json Replaces the tsup dependency tree with tsdown’s.
clients/​tui/​__tests__/​tsdownConfig.test.ts Adapts React-policy checks to tsdown configuration types.
clients/​mcpdo/​tsup.config.ts Removes the old mcpdo configuration.
clients/​mcpdo/​tsdown.config.ts Adds the two-entry tsdown build configuration.
clients/​mcpdo/​tsconfig.json Includes the renamed build configuration.
clients/​mcpdo/​src/​daemon/​ensure.ts Clarifies chunk-relative daemon lookup in comments only.
clients/​mcpdo/​README.md Updates the development-build description.
clients/​mcpdo/​package.json Switches builds and removes obsolete dependency overrides and script policies.
AGENTS.md Updates bundler paths and dependency-policy terminology.
.claude/​skills/​release/​SKILL.md Marks the tsup advisory example as historical.
.claude/​skills/​project-structure/​SKILL.md Updates the TUI build description.
.claude/​skills/​local-dev/​SKILL.md Refreshes build, alias, and dependency guidance.

Review effort: Balanced

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed after round 1. It came back clean: approval recommended, no inline comments, nothing suppressed. Per pr-flow 7c, one clean round ends the loop, so I haven't requested another.

@cliffhall
cliffhall merged commit 72126af into v2/main Oct 25, 2026
11 checks passed
@cliffhall
cliffhall deleted the v2/chore/2797-tsdown-remaining-clients branch October 25, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate the web runner, mcpdo and TUI bundles from tsup to tsdown

2 participants