Skip to content

chore!: migrate build pipeline from tsc to tsdown#51

Merged
chybisov merged 5 commits into
mainfrom
chore/migrate-to-tsdown
Mar 25, 2026
Merged

chore!: migrate build pipeline from tsc to tsdown#51
chybisov merged 5 commits into
mainfrom
chore/migrate-to-tsdown

Conversation

@chybisov
Copy link
Copy Markdown
Member

Which Linear task is linked to this PR?

N/A — Build tooling improvement.

Why was it implemented this way?

Migrates the build pipeline from tsc to tsdown (powered by Rolldown/OXC in Rust) for significantly faster builds. This approach was proven in the SDK repo where build times went from ~13s to ~650ms.

What changed:

  1. tsdown added as root devDependency — single build tool replacing multiple tsc invocations per package.

  2. tsdown.config.ts created for each package — dual ESM/CJS output with source maps and declaration files (.d.ts with source maps via OXC's isolated declarations).

  3. isolatedDeclarations: true added to root tsconfig.json — required by OXC's declaration emitter. All exported functions, variables, and class members now have explicit type annotations (~30 files updated).

  4. Package scripts simplified:

    • build inlined to single command (rm -rf dist && version.js && build.js && printf package.json markers)
    • Removed build:cjs, build:esm, build:types, build:clean scripts
    • clean simplified to rm -rf dist
    • watch replaced with tsdown --watch
    • check:types (tsc --noEmit) kept as-is
  5. scripts/build.js created — per-package build timing wrapper around tsdown.

  6. All packages now produce both ESM and CJS — previously only @bigmi/core had CJS output.

Why tsdown over alternatives:

  • Built on Rolldown (Rust) — dramatically faster than tsc
  • Native isolatedDeclarations support via OXC — generates .d.ts without a full TypeScript program
  • Drop-in replacement that preserves the same output structure (dist/esm/, dist/cjs/)

Visual showcase (Screenshots or Videos)

Build output after migration:

✔ @bigmi/react built in 531ms
✔ @bigmi/client built in 739ms
✔ @bigmi/core built in 871ms

Checklist before requesting a review

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.
  • If this PR modifies the Bigmi API or adds new features that require documentation, I have updated the documentation in the public-docs repository.

@chybisov chybisov merged commit 0c4defb into main Mar 25, 2026
1 check passed
@chybisov chybisov deleted the chore/migrate-to-tsdown branch March 25, 2026 13:56
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