[PR #5196] [MERGED] chore: use type from core #5841

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

📋 Pull Request Information

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

Base: canaryHead: himself65/2025/10/09/type-db


📝 Commits (1)

  • 5be94fa chore: use type from core

📊 Changes

6 files changed (+13 additions, -29 deletions)

View changed files

📝 packages/better-auth/src/db/with-hooks.ts (+2 -2)
📝 packages/better-auth/src/types/models.ts (+0 -13)
📝 packages/core/src/db/index.ts (+2 -0)
📝 packages/core/src/db/type.ts (+1 -10)
📝 packages/core/src/types/context.ts (+2 -2)
📝 packages/core/src/types/init-options.ts (+6 -2)

📄 Description

Summary by cubic

Centralized model typings by adopting DBPreservedModels from @better-auth/core and removing the duplicated Models type. This reduces duplication and keeps model names consistent across packages.

  • Refactors

    • Exported DBPreservedModels from core and replaced Models in hooks, context, and init-options.
    • Removed unused module augmentation in core/db/type.ts.
  • Migration

    • Replace any Models imports with DBPreservedModels from @better-auth/core/db.
    • generateId’s model parameter now uses LiteralUnion<DBPreservedModels, string>; no runtime changes.

🔄 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/5196 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/9/2025 **Status:** ✅ Merged **Merged:** 10/9/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/09/type-db` --- ### 📝 Commits (1) - [`5be94fa`](https://github.com/better-auth/better-auth/commit/5be94fa3f77bcf316021bfa38128eb682c00b793) chore: use type from core ### 📊 Changes **6 files changed** (+13 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/with-hooks.ts` (+2 -2) 📝 `packages/better-auth/src/types/models.ts` (+0 -13) 📝 `packages/core/src/db/index.ts` (+2 -0) 📝 `packages/core/src/db/type.ts` (+1 -10) 📝 `packages/core/src/types/context.ts` (+2 -2) 📝 `packages/core/src/types/init-options.ts` (+6 -2) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Centralized model typings by adopting DBPreservedModels from @better-auth/core and removing the duplicated Models type. This reduces duplication and keeps model names consistent across packages. - **Refactors** - Exported DBPreservedModels from core and replaced Models in hooks, context, and init-options. - Removed unused module augmentation in core/db/type.ts. - **Migration** - Replace any Models imports with DBPreservedModels from @better-auth/core/db. - generateId’s model parameter now uses LiteralUnion<DBPreservedModels, string>; no runtime changes. <!-- 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:38:38 -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#5841