[PR #5249] [MERGED] chore: use tsdown as bundler #5881

Closed
opened 2026-03-13 12:40:03 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5249
Author: @himself65
Created: 10/12/2025
Status: Merged
Merged: 10/13/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/10/12/bundler


📝 Commits (2)

  • e475223 chore: use tsdown to bundle package
  • 45b4308 fix: social.test.ts

📊 Changes

64 files changed (+943 additions, -1330 deletions)

View changed files

e2e/smoke/test/fixtures/tsconfig-verbatim-module-syntax-node10/package.json (+13 -0)
e2e/smoke/test/fixtures/tsconfig-verbatim-module-syntax-node10/src/index.ts (+8 -0)
e2e/smoke/test/fixtures/tsconfig-verbatim-module-syntax-node10/tsconfig.json (+14 -0)
e2e/smoke/test/typecheck.spec.ts (+13 -0)
📝 package.json (+0 -1)
📝 packages/better-auth/package.json (+57 -57)
📝 packages/better-auth/src/api/routes/account.test.ts (+46 -35)
📝 packages/better-auth/src/oauth2/link-account.test.ts (+42 -33)
📝 packages/better-auth/src/plugins/admin/admin.test.ts (+53 -67)
📝 packages/better-auth/src/plugins/anonymous/anon.test.ts (+56 -36)
📝 packages/better-auth/src/plugins/last-login-method/last-login-method.test.ts (+48 -37)
📝 packages/better-auth/src/plugins/oauth-proxy/oauth-proxy.test.ts (+47 -35)
📝 packages/better-auth/src/social.test.ts (+48 -55)
📝 packages/better-auth/tsdown.config.ts (+59 -64)
packages/cli/build.config.ts (+0 -7)
📝 packages/cli/package.json (+8 -9)
📝 packages/cli/test/info.test.ts (+7 -7)
packages/cli/tsdown.config.ts (+8 -0)
📝 packages/core/package.json (+14 -15)
📝 packages/core/src/error/codes.ts (+1 -1)

...and 44 more files

📄 Description

Summary by cubic

Switch the repo’s bundler from Unbuild to Tsdown and standardize ESM outputs to .js across packages. This simplifies builds, reduces deps, and improves NodeNext/TypeScript compatibility (including verbatimModuleSyntax).

  • Refactors

    • Replaced Unbuild scripts/configs with tsdown.config.ts in better-auth, core, cli, expo, sso, and stripe.
    • Updated package.json exports from .mjs to .js; kept CJS .cjs entries.
    • Adjusted core imports to relative paths for cleaner bundling.
    • Enabled DTS and treeshaking where needed; CLI builds as ESM only.
    • Added an e2e smoke fixture to validate TS 5 “verbatimModuleSyntax” with NodeNext.
  • Dependencies

    • Removed Unbuild and related transitive deps; added Tsdown to the workspace catalog and devDependencies.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5249 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/12/2025 **Status:** ✅ Merged **Merged:** 10/13/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/12/bundler` --- ### 📝 Commits (2) - [`e475223`](https://github.com/better-auth/better-auth/commit/e4752230f4866d525b7af47c108c40db3f4217a2) chore: use `tsdown` to bundle package - [`45b4308`](https://github.com/better-auth/better-auth/commit/45b430801749f8f141d6378c0f9d54ff80b3e5d7) fix: social.test.ts ### 📊 Changes **64 files changed** (+943 additions, -1330 deletions) <details> <summary>View changed files</summary> ➕ `e2e/smoke/test/fixtures/tsconfig-verbatim-module-syntax-node10/package.json` (+13 -0) ➕ `e2e/smoke/test/fixtures/tsconfig-verbatim-module-syntax-node10/src/index.ts` (+8 -0) ➕ `e2e/smoke/test/fixtures/tsconfig-verbatim-module-syntax-node10/tsconfig.json` (+14 -0) ➕ `e2e/smoke/test/typecheck.spec.ts` (+13 -0) 📝 `package.json` (+0 -1) 📝 `packages/better-auth/package.json` (+57 -57) 📝 `packages/better-auth/src/api/routes/account.test.ts` (+46 -35) 📝 `packages/better-auth/src/oauth2/link-account.test.ts` (+42 -33) 📝 `packages/better-auth/src/plugins/admin/admin.test.ts` (+53 -67) 📝 `packages/better-auth/src/plugins/anonymous/anon.test.ts` (+56 -36) 📝 `packages/better-auth/src/plugins/last-login-method/last-login-method.test.ts` (+48 -37) 📝 `packages/better-auth/src/plugins/oauth-proxy/oauth-proxy.test.ts` (+47 -35) 📝 `packages/better-auth/src/social.test.ts` (+48 -55) 📝 `packages/better-auth/tsdown.config.ts` (+59 -64) ➖ `packages/cli/build.config.ts` (+0 -7) 📝 `packages/cli/package.json` (+8 -9) 📝 `packages/cli/test/info.test.ts` (+7 -7) ➕ `packages/cli/tsdown.config.ts` (+8 -0) 📝 `packages/core/package.json` (+14 -15) 📝 `packages/core/src/error/codes.ts` (+1 -1) _...and 44 more files_ </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Switch the repo’s bundler from Unbuild to Tsdown and standardize ESM outputs to .js across packages. This simplifies builds, reduces deps, and improves NodeNext/TypeScript compatibility (including verbatimModuleSyntax). - **Refactors** - Replaced Unbuild scripts/configs with tsdown.config.ts in better-auth, core, cli, expo, sso, and stripe. - Updated package.json exports from .mjs to .js; kept CJS .cjs entries. - Adjusted core imports to relative paths for cleaner bundling. - Enabled DTS and treeshaking where needed; CLI builds as ESM only. - Added an e2e smoke fixture to validate TS 5 “verbatimModuleSyntax” with NodeNext. - **Dependencies** - Removed Unbuild and related transitive deps; added Tsdown to the workspace catalog and devDependencies. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:40:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5881