[PR #3398] [CLOSED] refactor/zodv4 migration #4801

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3398
Author: @Kinfe123
Created: 7/15/2025
Status: Closed

Base: mainHead: refactor/zodv4-migration


📝 Commits (8)

📊 Changes

62 files changed (+5749 additions, -6284 deletions)

View changed files

📝 packages/better-auth/build.config.ts (+2 -1)
📝 packages/better-auth/package.json (+1 -1)
📝 packages/better-auth/src/adapters/kysely-adapter/test/state.txt (+1 -1)
📝 packages/better-auth/src/api/call.test.ts (+1 -1)
📝 packages/better-auth/src/api/middlewares/origin-check.test.ts (+1 -1)
📝 packages/better-auth/src/api/routes/account.ts (+11 -11)
📝 packages/better-auth/src/api/routes/callback.ts (+1 -1)
📝 packages/better-auth/src/api/routes/email-verification.ts (+7 -9)
📝 packages/better-auth/src/api/routes/reset-password.ts (+14 -18)
📝 packages/better-auth/src/api/routes/session.ts (+8 -14)
📝 packages/better-auth/src/api/routes/sign-in.ts (+16 -23)
📝 packages/better-auth/src/api/routes/sign-up.ts (+2 -2)
📝 packages/better-auth/src/api/routes/update-user.ts (+41 -37)
📝 packages/better-auth/src/api/to-auth-endpoints.test.ts (+1 -1)
📝 packages/better-auth/src/db/field.ts (+1 -1)
📝 packages/better-auth/src/db/schema.ts (+1 -1)
📝 packages/better-auth/src/db/to-zod.ts (+2 -1)
📝 packages/better-auth/src/index.ts (+1 -1)
📝 packages/better-auth/src/oauth2/state.ts (+1 -1)
📝 packages/better-auth/src/plugins/admin/admin.ts (+32 -32)

...and 42 more files

📄 Description

Summary by cubic

Migrated all packages from Zod v3 to Zod v4, updating imports, types, and schema usage to ensure compatibility and remove deprecated patterns.

  • Refactors
    • Replaced all zod imports with zod/v4 and updated type references.
    • Updated schema definitions and usage to match Zod v4 API changes.
    • Adjusted error and description handling in schemas to use the new error property.
    • Updated dependencies and lockfiles to require Zod v4 across all packages.

🔄 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/3398 **Author:** [@Kinfe123](https://github.com/Kinfe123) **Created:** 7/15/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `refactor/zodv4-migration` --- ### 📝 Commits (8) - [`11a0f0c`](https://github.com/better-auth/better-auth/commit/11a0f0c3126f1ac9193c7c6e6fd7a241db1bbd44) zod v4 migrate - [`acb0c59`](https://github.com/better-auth/better-auth/commit/acb0c59b1fb31dba297a1ececae98a22ac24a3c5) revert - [`8538ac1`](https://github.com/better-auth/better-auth/commit/8538ac1bcfd4ca015ff8ddaff2a2bf3b04eb2f7a) migration to v4 - [`8430dd2`](https://github.com/better-auth/better-auth/commit/8430dd22c920e1d24615035300ffdf0a112493b0) lint - [`c237ab2`](https://github.com/better-auth/better-auth/commit/c237ab290d6f2f0d9b0696355aacc700ad7f98aa) pkgs - [`bc4a4c8`](https://github.com/better-auth/better-auth/commit/bc4a4c8b4a755141063cf26c8b9b1fdb7486d4c6) treeshakable - [`0f57d00`](https://github.com/better-auth/better-auth/commit/0f57d002d21c997854a2269bbe6d51ba9e19fab2) tests - [`cc17a1b`](https://github.com/better-auth/better-auth/commit/cc17a1bba4f2cb091a458266a57846e52c7e18b8) avoid only test ### 📊 Changes **62 files changed** (+5749 additions, -6284 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/build.config.ts` (+2 -1) 📝 `packages/better-auth/package.json` (+1 -1) 📝 `packages/better-auth/src/adapters/kysely-adapter/test/state.txt` (+1 -1) 📝 `packages/better-auth/src/api/call.test.ts` (+1 -1) 📝 `packages/better-auth/src/api/middlewares/origin-check.test.ts` (+1 -1) 📝 `packages/better-auth/src/api/routes/account.ts` (+11 -11) 📝 `packages/better-auth/src/api/routes/callback.ts` (+1 -1) 📝 `packages/better-auth/src/api/routes/email-verification.ts` (+7 -9) 📝 `packages/better-auth/src/api/routes/reset-password.ts` (+14 -18) 📝 `packages/better-auth/src/api/routes/session.ts` (+8 -14) 📝 `packages/better-auth/src/api/routes/sign-in.ts` (+16 -23) 📝 `packages/better-auth/src/api/routes/sign-up.ts` (+2 -2) 📝 `packages/better-auth/src/api/routes/update-user.ts` (+41 -37) 📝 `packages/better-auth/src/api/to-auth-endpoints.test.ts` (+1 -1) 📝 `packages/better-auth/src/db/field.ts` (+1 -1) 📝 `packages/better-auth/src/db/schema.ts` (+1 -1) 📝 `packages/better-auth/src/db/to-zod.ts` (+2 -1) 📝 `packages/better-auth/src/index.ts` (+1 -1) 📝 `packages/better-auth/src/oauth2/state.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/admin/admin.ts` (+32 -32) _...and 42 more files_ </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Migrated all packages from Zod v3 to Zod v4, updating imports, types, and schema usage to ensure compatibility and remove deprecated patterns. - **Refactors** - Replaced all `zod` imports with `zod/v4` and updated type references. - Updated schema definitions and usage to match Zod v4 API changes. - Adjusted error and description handling in schemas to use the new `error` property. - Updated dependencies and lockfiles to require Zod v4 across all packages. <!-- 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:00:17 -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#4801