[PR #7653] [MERGED] chore: simplify type #15715

Closed
opened 2026-04-13 10:11:19 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7653
Author: @himself65
Created: 1/28/2026
Status: Merged
Merged: 1/28/2026
Merged by: @himself65

Base: canaryHead: himself65/2026/01/27/types


📝 Commits (1)

📊 Changes

3 files changed (+50 additions, -71 deletions)

View changed files

📝 packages/better-auth/src/client/types.ts (+13 -18)
📝 packages/better-auth/src/db/field.ts (+35 -29)
📝 packages/better-auth/src/types/helper.ts (+2 -24)

📄 Description

Summary by cubic

Simplified and tightened type definitions across client and DB helpers to reduce complexity and improve type safety.

  • Refactors

    • Standardized field inference to use Fields extends Record<string, DBFieldAttribute>, returning never on invalid schemas.
    • Switched client plugin schema inference to BetterAuthPluginDBSchema and removed InferPluginsFromClient.
    • Simplified StripEmptyObjects and removed unused helpers (LiteralNumber, LiteralUnion, DeepPartial, Expand, PreserveJSDoc, OmitId).
    • Added guards in InferFieldsFromPlugins and options; additionalFields now explicitly typed as a DBFieldAttribute map.
  • Migration

    • If you relied on {} fallbacks in field inference, update code to handle never types.
    • If you used removed helpers or expected StripEmptyObjects to drop empty keys, replace with local utilities or adjust usage.

Written for commit 740bb8daed. Summary will update on new commits.


🔄 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/7653 **Author:** [@himself65](https://github.com/himself65) **Created:** 1/28/2026 **Status:** ✅ Merged **Merged:** 1/28/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2026/01/27/types` --- ### 📝 Commits (1) - [`740bb8d`](https://github.com/better-auth/better-auth/commit/740bb8daed676a440b39a82bd60bfb050a8290f9) chore: simplify type ### 📊 Changes **3 files changed** (+50 additions, -71 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/client/types.ts` (+13 -18) 📝 `packages/better-auth/src/db/field.ts` (+35 -29) 📝 `packages/better-auth/src/types/helper.ts` (+2 -24) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Simplified and tightened type definitions across client and DB helpers to reduce complexity and improve type safety. - **Refactors** - Standardized field inference to use Fields extends Record<string, DBFieldAttribute>, returning never on invalid schemas. - Switched client plugin schema inference to BetterAuthPluginDBSchema and removed InferPluginsFromClient. - Simplified StripEmptyObjects and removed unused helpers (LiteralNumber, LiteralUnion, DeepPartial, Expand, PreserveJSDoc, OmitId). - Added guards in InferFieldsFromPlugins and options; additionalFields now explicitly typed as a DBFieldAttribute map. - **Migration** - If you relied on {} fallbacks in field inference, update code to handle never types. - If you used removed helpers or expected StripEmptyObjects to drop empty keys, replace with local utilities or adjust usage. <sup>Written for commit 740bb8daed676a440b39a82bd60bfb050a8290f9. Summary will update on new commits.</sup> <!-- 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 10:11:19 -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#15715