[PR #8465] chore(better-auth): migrate build from tsdown to rollup #7994

Open
opened 2026-03-13 13:56:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8465
Author: @himself65
Created: 3/6/2026
Status: 🔄 Open

Base: canaryHead: chore/migrate-build-to-rollup


📝 Commits (2)

  • 977f8d1 chore(better-auth): migrate build from tsdown to rollup
  • b1fb428 chore: code

📊 Changes

9 files changed (+369 additions, -109 deletions)

View changed files

📝 packages/better-auth/package.json (+7 -3)
packages/better-auth/rollup.config.ts (+107 -0)
packages/better-auth/scripts/rename-dts.mjs (+15 -0)
📝 packages/better-auth/src/client/path-to-object.ts (+1 -1)
📝 packages/better-auth/src/plugins/custom-session/index.ts (+1 -0)
packages/better-auth/tsconfig.build.json (+21 -0)
packages/better-auth/tsdown.config.ts (+0 -72)
📝 packages/core/src/api/index.ts (+6 -6)
📝 pnpm-lock.yaml (+211 -27)

📄 Description

Summary

  • Replace tsdown with rollup + rollup-plugin-swc3 for the better-auth package build
  • Use tsc --emitDeclarationOnly with a dedicated tsconfig.build.json for type declarations
  • Add post-build script (scripts/rename-dts.mjs) to rename .d.ts.d.mts
  • Fix type inference in createAuthEndpoint by using const Method type parameter and replacing any with proper types (Method, Use)
  • Minor type fixes in path-to-object.ts, anonymous/index.ts, and custom-session/index.ts

Test plan

  • Verify pnpm build succeeds in packages/better-auth
  • Verify generated output in dist/ has correct .mjs and .d.mts files
  • Run pnpm typecheck to ensure no type regressions
  • Run existing tests to confirm no runtime breakage

🔄 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/8465 **Author:** [@himself65](https://github.com/himself65) **Created:** 3/6/2026 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `chore/migrate-build-to-rollup` --- ### 📝 Commits (2) - [`977f8d1`](https://github.com/better-auth/better-auth/commit/977f8d167670119c7bb2bf6fe498f08aa04fad90) chore(better-auth): migrate build from tsdown to rollup - [`b1fb428`](https://github.com/better-auth/better-auth/commit/b1fb428267b7554c22c2ef03fda7b0b66c541357) chore: code ### 📊 Changes **9 files changed** (+369 additions, -109 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/package.json` (+7 -3) ➕ `packages/better-auth/rollup.config.ts` (+107 -0) ➕ `packages/better-auth/scripts/rename-dts.mjs` (+15 -0) 📝 `packages/better-auth/src/client/path-to-object.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/custom-session/index.ts` (+1 -0) ➕ `packages/better-auth/tsconfig.build.json` (+21 -0) ➖ `packages/better-auth/tsdown.config.ts` (+0 -72) 📝 `packages/core/src/api/index.ts` (+6 -6) 📝 `pnpm-lock.yaml` (+211 -27) </details> ### 📄 Description ## Summary - Replace `tsdown` with `rollup` + `rollup-plugin-swc3` for the `better-auth` package build - Use `tsc --emitDeclarationOnly` with a dedicated `tsconfig.build.json` for type declarations - Add post-build script (`scripts/rename-dts.mjs`) to rename `.d.ts` → `.d.mts` - Fix type inference in `createAuthEndpoint` by using `const Method` type parameter and replacing `any` with proper types (`Method`, `Use`) - Minor type fixes in `path-to-object.ts`, `anonymous/index.ts`, and `custom-session/index.ts` ## Test plan - [ ] Verify `pnpm build` succeeds in `packages/better-auth` - [ ] Verify generated output in `dist/` has correct `.mjs` and `.d.mts` files - [ ] Run `pnpm typecheck` to ensure no type regressions - [ ] Run existing tests to confirm no runtime breakage --- <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 13:56:05 -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#7994