[PR #5368] [CLOSED] feat: esm only #31564

Closed
opened 2026-04-17 22:27:43 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5368
Author: @himself65
Created: 10/16/2025
Status: Closed

Base: canaryHead: himself65/2025/10/16/esm


📝 Commits (4)

📊 Changes

14 files changed (+192 additions, -581 deletions)

View changed files

📝 packages/better-auth/package.json (+134 -409)
📝 packages/better-auth/tsdown.config.ts (+3 -55)
📝 packages/cli/tsdown.config.ts (+4 -2)
📝 packages/core/package.json (+22 -88)
📝 packages/core/tsdown.config.ts (+3 -2)
📝 packages/expo/package.json (+2 -4)
📝 packages/expo/tsdown.config.ts (+3 -2)
📝 packages/sso/package.json (+2 -4)
📝 packages/sso/tsdown.config.ts (+3 -1)
📝 packages/stripe/package.json (+2 -4)
📝 packages/stripe/tsdown.config.ts (+3 -1)
📝 packages/telemetry/package.json (+2 -8)
📝 packages/telemetry/tsdown.config.ts (+3 -1)
📝 pnpm-lock.yaml (+6 -0)

📄 Description

Summary by cubic

Move the entire repo to ESM-only. Removes all CJS outputs, simplifies exports, and updates build configs. Adds a Node engine requirement and clarifies peer deps for adapters.

  • Refactors

    • ESM-only builds across all packages; CJS entries removed.
    • Package exports simplified to ESM default + types.
    • tsdown configs unified: format "esm", unbundle true, clean true.
    • better-auth: add engines (Node >=22.12 or 24+); promote Prisma/Drizzle/Mongo/@tanstack start to peerDependencies with optional flags.
    • CLI now ships types (dts: true).
  • Migration

    • Require Node >=22.12.0 or >=24.0.0.
    • Replace require() with import. For CJS environments, use dynamic import() or transpile.
    • Ensure tooling handles ESM (e.g., tsconfig module ESNext and NodeNext/Bundler resolution, bundlers set to prefer ESM).

🔄 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/5368 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/16/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `himself65/2025/10/16/esm` --- ### 📝 Commits (4) - [`1ef47ab`](https://github.com/better-auth/better-auth/commit/1ef47ab8375b9d4858b607a8108f263ec8641196) feat: esm only - [`b3a2aa5`](https://github.com/better-auth/better-auth/commit/b3a2aa51ef9bdbfa4fbd4d11b2fbffbfe246005b) chore: update - [`d27fc06`](https://github.com/better-auth/better-auth/commit/d27fc068bfc424577aa2ff37bebb647e4cc7c07f) chore: update - [`5c1e5a1`](https://github.com/better-auth/better-auth/commit/5c1e5a125e66fa55c0710aa05a3707753483ee8c) chore: lock ### 📊 Changes **14 files changed** (+192 additions, -581 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/package.json` (+134 -409) 📝 `packages/better-auth/tsdown.config.ts` (+3 -55) 📝 `packages/cli/tsdown.config.ts` (+4 -2) 📝 `packages/core/package.json` (+22 -88) 📝 `packages/core/tsdown.config.ts` (+3 -2) 📝 `packages/expo/package.json` (+2 -4) 📝 `packages/expo/tsdown.config.ts` (+3 -2) 📝 `packages/sso/package.json` (+2 -4) 📝 `packages/sso/tsdown.config.ts` (+3 -1) 📝 `packages/stripe/package.json` (+2 -4) 📝 `packages/stripe/tsdown.config.ts` (+3 -1) 📝 `packages/telemetry/package.json` (+2 -8) 📝 `packages/telemetry/tsdown.config.ts` (+3 -1) 📝 `pnpm-lock.yaml` (+6 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Move the entire repo to ESM-only. Removes all CJS outputs, simplifies exports, and updates build configs. Adds a Node engine requirement and clarifies peer deps for adapters. - **Refactors** - ESM-only builds across all packages; CJS entries removed. - Package exports simplified to ESM default + types. - tsdown configs unified: format "esm", unbundle true, clean true. - better-auth: add engines (Node >=22.12 or 24+); promote Prisma/Drizzle/Mongo/@tanstack start to peerDependencies with optional flags. - CLI now ships types (dts: true). - **Migration** - Require Node >=22.12.0 or >=24.0.0. - Replace require() with import. For CJS environments, use dynamic import() or transpile. - Ensure tooling handles ESM (e.g., tsconfig module ESNext and NodeNext/Bundler resolution, bundlers set to prefer ESM). <!-- 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-04-17 22:27:43 -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#31564