chore: migrate from tsup to tsdown#60
Merged
MidnightDesign merged 4 commits intomasterfrom Apr 9, 2026
Merged
Conversation
tsup is effectively unmaintained and has a bug with TypeScript 6.0 (egoist/tsup#1388 — unconditionally injects baseUrl which triggers TS5101). tsdown is the spiritual successor, powered by Rolldown, and supports TS6 out of the box. - Replace tsup + esbuild with tsdown (rolldown-based bundler) - Port react-compiler babel plugin from esbuild onLoad to rolldown transform hook - Remove fixCjsDefaultInteropPlugin (rolldown handles CJS interop correctly without the isNodeMode bug) - Update package.json exports to match tsdown output extensions (.mjs/.d.mts for ESM, .cjs/.d.cts for CJS) - Update api-extractor config for new .d.mts entry point - Remove esbuild from onlyBuiltDependencies in pnpm-workspace.yaml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove rolldown type import (transitive dep, not direct) — let TS infer the plugin type - Remove babel-plugin-react-compiler from knip ignoreDependencies (knip can now detect it via tsdown config) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the @eventjet/react-seatmaps package build pipeline from tsup/esbuild to tsdown (rolldown-based) to unblock a future TypeScript 6 upgrade and align emitted artifacts/exports with tsdown’s output.
Changes:
- Replace
tsupconfig/plugins with atsdownconfig, porting the React compiler Babel transform to rolldown’stransformhook. - Update
package.jsonexports/types fields and API Extractor entrypoint to use.mjs/.d.mts. - Remove the pnpm
onlyBuiltDependenciesallowlist entry and adjust knip ignored dependencies.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Removes onlyBuiltDependencies configuration from the workspace. |
| packages/seatmaps/tsup.config.ts | Deletes the prior tsup/esbuild build configuration (including the CJS interop patch). |
| packages/seatmaps/tsdown.config.ts | Adds tsdown config and ports the React compiler Babel transform. |
| packages/seatmaps/package.json | Switches build scripts to tsdown; updates exports/types to .mjs/.d.mts; removes esbuild and tsup deps. |
| packages/seatmaps/api/react-seatmaps.api.md | Updates API report output corresponding to the new declaration emit/import aliasing. |
| packages/seatmaps/api-extractor.json | Points API Extractor at dist/index.d.mts. |
| knip.json | Updates ignored dependency list for knip. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Update AGENTS.md references from tsup to tsdown - Update dependabot.yml build-tools group pattern from tsup to tsdown - Add condition-specific types in package.json exports (d.mts for ESM, d.cts for CJS) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pass sourceMaps: true to transformAsync so the transform produces source maps that Rolldown can chain into the final bundle output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rieschl
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
tsup is the bundler we use to produce CJS, ESM, and declaration files from our TypeScript source. It's powered by esbuild under the hood. tsup is no longer actively maintained and has a bug with TypeScript 6.0 — it unconditionally injects a
baseUrlcompiler option during declaration generation, which TS6 now rejects as deprecated. This blocks #59 (Dependabot dev-tooling update that includes the TS6 upgrade).tsdown is tsup's spiritual successor, built on Rolldown (a Rust-based bundler) instead of esbuild. It supports TS6 out of the box and has a compatible configuration format.
Since tsup and tsdown use different bundler engines, our two custom esbuild plugins had to be ported to Rolldown's plugin API. The React Compiler plugin (which runs a Babel transform on every source file) was rewritten as a Rolldown
transformhook. The CJS default interop fix for Emotion was dropped entirely — Rolldown's CJS output handles__esModuleinterop correctly without the workaround esbuild needed.Summary
onLoadto rolldowntransformhookfixCjsDefaultInteropPlugin— rolldown handles CJS interop correctly without the esbuildisNodeModebugDetails
.d.mtsfor ESM,.d.ctsfor CJS).d.mtsentry pointbabel-plugin-react-compilerfrom knipignoreDependencies(knip detects it through tsdown config)onlyBuiltDependenciesfor esbuild (rolldown uses optional deps, no install scripts)Test plan
pnpm build)pnpm test)pnpm api:check)@emotion/styleddefault export resolves correctly🤖 Generated with Claude Code