Skip to content

build: switch library/CLI bundling from rollup to esbuild - #81

Merged
mcarvin8 merged 1 commit into
mainfrom
build/switch-to-esbuild
Sep 11, 2026
Merged

mcarvin8 merged 1 commit into
mainfrom
build/switch-to-esbuild

Conversation

@mcarvin8

Copy link
Copy Markdown
Owner

Summary

  • Replace rollup with esbuild for bundling src/index.ts and src/cli.ts (esbuild was already a devDependency, used for the GitHub Action bundle).
  • Generate type declarations separately via tsc --emitDeclarationOnly, since esbuild doesn't emit .d.ts files.
  • Drop the unused UMD output — nothing in the repo referenced dist/index.umd.js.
  • src/cli.ts: switch from import.meta.url to __dirname for locating package.json. Rollup shimmed import.meta.url for CJS output automatically; esbuild leaves it empty in CJS, which silently broke --version.
  • Remove rollup, @rollup/plugin-terser, @rollup/plugin-typescript devDependencies and rollup.config.mjs.

Test plan

  • npm run build — clean, produces dist/{index,cli}.{mjs,cjs} (+min variants) and dist/typings/**
  • node dist/cli.cjs --version / --help — works
  • npm test — 377/377 passing, 100% coverage
  • npm run lint — clean
  • npm run lint:dependencies (knip) — clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01PgrCBtiV8FbFLrHv3zrCgN

Rollup and esbuild were both in use (esbuild only for the GitHub Action
bundle), so this drops the redundant tooling. Type declarations are now
generated separately via tsc --emitDeclarationOnly since esbuild doesn't
emit .d.ts files. Also drops the unused UMD output, which nothing in the
repo referenced.

cli.ts switches from import.meta.url to __dirname for locating
package.json, since esbuild's CJS output leaves import.meta.url empty
(Rollup shimmed this automatically; esbuild does not).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PgrCBtiV8FbFLrHv3zrCgN
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcarvin8
mcarvin8 merged commit 0ce7374 into main Sep 11, 2026
7 checks passed
@mcarvin8
mcarvin8 deleted the build/switch-to-esbuild branch September 11, 2026 13:09
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.

2 participants