[PR #5285] [MERGED] refactor: move context api to core #14149

Closed
opened 2026-04-13 09:20:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: canaryHead: himself65/2025/10/13/refactor


📝 Commits (1)

  • b15cabb refactor: move context api to core

📊 Changes

10 files changed (+33 additions, -22 deletions)

View changed files

📝 packages/better-auth/src/api/routes/sign-up.ts (+1 -1)
📝 packages/better-auth/src/auth.ts (+1 -1)
📝 packages/better-auth/src/db/internal-adapter.ts (+4 -1)
📝 packages/better-auth/src/db/with-hooks.ts (+1 -1)
📝 packages/better-auth/src/index.ts (+1 -1)
📝 packages/better-auth/src/plugins/organization/adapter.ts (+1 -1)
📝 packages/core/package.json (+10 -0)
packages/core/src/context/index.ts (+5 -0)
📝 packages/core/src/context/transaction.ts (+8 -16)
📝 packages/core/tsdown.config.ts (+1 -0)

📄 Description

Summary by cubic

Moved the context API (getCurrentAdapter, runWithAdapter, runWithTransaction) to @better-auth/core/context to centralize transaction handling. Updated imports across packages; no functional changes.

  • Refactors

    • Added core/src/context with subpath export in core package.json.
    • Updated better-auth and plugins to import from @better-auth/core/context.
    • Simplified adapter types and aligned internal imports; included context in tsdown build.
  • Migration

    • If you imported these helpers from better-auth internal paths, switch to @better-auth/core/context.

🔄 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/5285 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/13/2025 **Status:** ✅ Merged **Merged:** 10/13/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/13/refactor` --- ### 📝 Commits (1) - [`b15cabb`](https://github.com/better-auth/better-auth/commit/b15cabb246fd23ac57ae57d114aff8283744e99f) refactor: move context api to core ### 📊 Changes **10 files changed** (+33 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/sign-up.ts` (+1 -1) 📝 `packages/better-auth/src/auth.ts` (+1 -1) 📝 `packages/better-auth/src/db/internal-adapter.ts` (+4 -1) 📝 `packages/better-auth/src/db/with-hooks.ts` (+1 -1) 📝 `packages/better-auth/src/index.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/organization/adapter.ts` (+1 -1) 📝 `packages/core/package.json` (+10 -0) ➕ `packages/core/src/context/index.ts` (+5 -0) 📝 `packages/core/src/context/transaction.ts` (+8 -16) 📝 `packages/core/tsdown.config.ts` (+1 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Moved the context API (getCurrentAdapter, runWithAdapter, runWithTransaction) to @better-auth/core/context to centralize transaction handling. Updated imports across packages; no functional changes. - **Refactors** - Added core/src/context with subpath export in core package.json. - Updated better-auth and plugins to import from @better-auth/core/context. - Simplified adapter types and aligned internal imports; included context in tsdown build. - **Migration** - If you imported these helpers from better-auth internal paths, switch to @better-auth/core/context. <!-- 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-13 09:20:12 -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#14149