Skip to content

chore(deps): replace rollup with rolldown#12109

Open
devin-ai-integration[bot] wants to merge 9 commits intomainfrom
devin/1770315917-replace-rollup-with-rolldown
Open

chore(deps): replace rollup with rolldown#12109
devin-ai-integration[bot] wants to merge 9 commits intomainfrom
devin/1770315917-replace-rollup-with-rolldown

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 5, 2026

Description

Refs: Requested by @Swimburger
Link to Devin run

Replaces tsup (which uses esbuild + rollup) with tsdown@0.20.3 (which uses rolldown@1.0.0-rc.3) across the monorepo. Replaces esbuild-plugin-polyfill-node with @rolldown/plugin-node-polyfills@1.0.3.

Changes Made

Bundler migration

  • Replace tsup@^8.5.0 with tsdown@0.20.3 in 6 package.json files (root, generator-cli, configs, cli, cli-v2, seed)
  • Update @rolldown/binding-darwin-arm64 from 1.0.0-rc.2 to 1.0.0-rc.3, add @rolldown/binding-linux-x64-gnu@1.0.0-rc.3
  • Update all build scripts to use import { build } from "tsdown" instead of import tsup from "tsup" / tsup.build()
  • Rename tsupOverridestsdownOverrides, tsupOptionstsdownOptions, PRODUCTION_TSUP_OVERRIDESPRODUCTION_TSDOWN_OVERRIDES across all build callers
  • Replace esbuildOptions (conditions) with inputOptions.resolve.conditionNames in seed/build.mjs
  • Replace esbuild-plugin-polyfill-node with @rolldown/plugin-node-polyfills in configs/build-utils.mjs (buildDynamicSnippets)
  • Add keytar to FULL_EXTERNALS and MINIMAL_EXTERNALS in both cli and cli-v2 (native .node binaries cannot be bundled by rolldown)
  • Add inlineOnly: false to all tsdown build configs (required to suppress tsdown 0.20.3 dependency bundling warning)
  • Add outputOptions: { codeSplitting: false } to single-entry CJS builds (cli, cli-v2, seed, configs) to prevent circular chunk dependencies at runtime
  • Remove metafile: true from production build overrides (not supported by tsdown)
  • Updated FULL_EXTERNALS regex from /^tsup/ to /^tsdown/
  • Update generator-cli bin/cli to require ../dist/cli.cjs (tsdown outputs .cjs not .js)
  • Update generator-cli package.json main/types to dist/api.cjs / dist/api.d.cts

Build fixes

  • Add missing tsconfig project references (root tsconfig.json, cli-logger, swift/dynamic-snippets, python-v2/sdk)
  • Remove unused ir-sdk reference from typescript/model/union-generator/tsconfig.json
  • Add "sideEffects": false to rust/dynamic-snippets/package.json

Test updates

  • Update ETE test snapshots (auto-generated example IDs changed due to different bundler hashing)
  • Update v2 test expectation: validation message changed from "edition is required""edition must be a string"

⚠️ Key Areas for Review

  1. Bundle size: The CLI bundle is ~36.9MB. Reviewer should verify this is acceptable compared to the previous tsup build.
  2. Validation message change: The CLI v2 fern check now reports "edition must be a string" instead of "edition is required" for an invalid fern.yml. This is a behavioral change caused by rolldown bundling the validation library differently. Reviewer should verify this is acceptable.
  3. keytar externalization: Added to both cli and cli-v2 externals to prevent bundling native .node files. Verify runtime behavior.
  4. codeSplitting: false: Only applied to single-entry builds. generator-cli has multiple entries and cannot use this option — verify no circular dependency issues at runtime.
  5. @rolldown/plugin-node-polyfills (packages/configs/build-utils.mjs): Replaces esbuild-plugin-polyfill-node for browser builds. Verify dynamic snippets work correctly.
  6. inputOptions.resolve.conditionNames (packages/seed/build.mjs): Verify rolldown respects this the same way esbuild respects conditions.
  7. Non-required seed test failures: go-sdk, ts-sdk, csharp-sdk seed tests are failing (non-required). May warrant investigation.

Testing

  • pnpm install completes successfully
  • pnpm run check (biome lint) passes
  • Local pnpm run fern:build completes successfully
  • Local CLI runs: node packages/cli/cli/dist/prod/cli.cjs --version works
  • ETE tests pass locally with updated snapshots
  • All 7 required CI checks pass (compile, test, lint, biome, depcheck, validate versions, test-ete)

- Replace tsup@8.5.0 with tsdown@0.20.1 in all packages
- Update @rolldown/binding-darwin-arm64 from 1.0.0-rc.2 to 1.0.0-rc.3
- Update build scripts to use tsdown API (import { build } from 'tsdown')
- Replace esbuildOptions with inputOptions for rolldown compatibility
- Remove esbuild-plugin-polyfill-node dependency (replaced with platform: browser + define)
- Rename tsupOverrides/tsupOptions to tsdownOverrides/tsdownOptions throughout

Co-Authored-By: Niels Swimberghe <3382717+Swimburger@users.noreply.github.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🌱 Seed Test Selector

Select languages to run seed tests for:

  • Python
  • TypeScript
  • Java
  • Go
  • Ruby
  • C#
  • PHP
  • Swift
  • Rust
  • OpenAPI
  • Postman

How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR.

Comment on lines 90 to 92
define: {
"process.env.NODE_ENV": JSON.stringify("production")
},
Copy link
Member

Choose a reason for hiding this comment

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

This is not guaruanteed to be for a production env

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch - removed the hardcoded process.env.NODE_ENV define. The nodePolyfills() plugin handles process polyfilling now.

devin-ai-integration bot and others added 8 commits February 5, 2026 18:56
…nals

Co-Authored-By: Niels Swimberghe <3382717+Swimburger@users.noreply.github.com>
Co-Authored-By: Niels Swimberghe <3382717+Swimburger@users.noreply.github.com>
Co-Authored-By: Niels Swimberghe <3382717+Swimburger@users.noreply.github.com>
…ternal to cli-v2

Co-Authored-By: Niels Swimberghe <3382717+Swimburger@users.noreply.github.com>
Co-Authored-By: Niels Swimberghe <3382717+Swimburger@users.noreply.github.com>
Co-Authored-By: Niels Swimberghe <3382717+Swimburger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant