Skip to content

tsup -> tsdown#356

Merged
david-crespo merged 1 commit into
mainfrom
migrate-tsdown
Jun 18, 2026
Merged

tsup -> tsdown#356
david-crespo merged 1 commit into
mainfrom
migrate-tsdown

Conversation

@david-crespo

@david-crespo david-crespo commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Let us drop esbuild because as of Vite 8 everything is Rolldown. Had the robot make sure the result was more or less the same.

This will be a patch release for the generator since I don't think it should affect anything for a consumer. For @oxide/api, I probably won't bother publishing it until the next actual release. Though maybe I should do a test release.

🤖 Summary and testing notes

Replaces tsup with tsdown in both @oxide/api and @oxide/openapi-gen-ts. esbuild is now gone from both node_modules and lockfiles — and since vite 8 (via vitest) no longer hard-depends on esbuild either, removing tsup eliminated the last source in the generator package too, not just the API client.

Two config notes:

  • fixedExtension: false in both, because tsdown defaults it to true on the node platform, which would emit Api.mjs/index.mjs and break the existing exports/main/bin paths that point at .js.
  • tsdown only externalizes declared deps (tsup externalized everything in node_modules). The generator imports @apidevtools/swagger-parser but only declared the thin swagger-parser wrapper, so tsdown bundled it and its whole subtree (710 KB vs 37 KB). Fixed by declaring @apidevtools/swagger-parser directly — it's auto-externalized, ships its own types, and the wrapper was a one-line re-export with no other importers.

Confirmed equivalence by building both packages with old tsup and new tsdown and comparing:

  • @oxide/api: identical output filenames (Api.js/Api.cjs/Api.d.ts/Api.d.cts), identical exported names in the .d.ts, identical require() shape ({Api, default} both the class, __esModule: true set by both), and the new .d.ts type-checks clean.
  • @oxide/openapi-gen-ts: bundle back to 39 KB, shebang + exec bit preserved, tsc clean, all 138 tests pass. Ran the bundled CLI and the source (tsx) against a real omicron spec — output was byte-identical (diff -rq).

@david-crespo david-crespo merged commit 046c662 into main Jun 18, 2026
3 checks passed
@david-crespo david-crespo deleted the migrate-tsdown branch June 18, 2026 21:40
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.

1 participant