[PR #3832] [CLOSED] fix: ensure zod v4 type annotations work with core types #13281

Closed
opened 2026-04-13 08:51:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3832
Author: @Kinfe123
Created: 8/6/2025
Status: Closed

Base: canaryHead: fix/zod-v4-core-annotation-issue


📝 Commits (7)

  • 6cb90a2 fix(org): use correct slug lookup when setting active org
  • 1349b20 docs: adding reference to surrealdb adapter rewrite (#3754)
  • d7a0a4f chore(demo): replace isLoading using useTransition (#3775)
  • 2a829fa fix(reddit): refresh access token should use basic auth (#3753)
  • 8c37484 docs: unify component implementations for consistency (#3799)
  • af4b4c7 fix: add missing team reference in teamMember schema (#3801)
  • 5fce7eb fix: ensure zod v4 type annotations work with core types

📊 Changes

14 files changed (+173 additions, -156 deletions)

View changed files

.changeset/old-planets-camp.md (+5 -0)
📝 demo/nextjs/app/client-test/page.tsx (+19 -21)
📝 demo/nextjs/app/dashboard/user-card.tsx (+21 -19)
📝 demo/nextjs/app/features.tsx (+0 -22)
📝 demo/nextjs/components/sign-in.tsx (+11 -11)
📝 docs/app/docs/[[...slug]]/page.client.tsx (+5 -8)
📝 docs/components/generate-apple-jwt.tsx (+45 -42)
📝 docs/components/landing/section-svg.tsx (+13 -18)
📝 docs/content/docs/adapters/community-adapters.mdx (+1 -0)
📝 packages/better-auth/src/index.ts (+2 -0)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+19 -5)
📝 packages/better-auth/src/plugins/organization/organization.ts (+4 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+27 -10)
📝 packages/better-auth/src/social-providers/reddit.ts (+1 -0)

📄 Description

We need to keep both zod/v4 and zod/v4/core exports to ensure type annotations work correctly with Zod v4. This will solve making it hard for typescript to figure out the annotation due to internal module export conflict. you can run -

npx tsc --declaration --declarationMap

which checks for tsc and other unnecessary leaks as well.


🔄 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/3832 **Author:** [@Kinfe123](https://github.com/Kinfe123) **Created:** 8/6/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/zod-v4-core-annotation-issue` --- ### 📝 Commits (7) - [`6cb90a2`](https://github.com/better-auth/better-auth/commit/6cb90a269344be86e4637f6ed9a848ca98314268) fix(org): use correct slug lookup when setting active org - [`1349b20`](https://github.com/better-auth/better-auth/commit/1349b20e7fb43cc4e0eb24872f436de1fdb0f781) docs: adding reference to surrealdb adapter rewrite (#3754) - [`d7a0a4f`](https://github.com/better-auth/better-auth/commit/d7a0a4f135d22632a89004c68e9f748155189a69) chore(demo): replace isLoading using `useTransition` (#3775) - [`2a829fa`](https://github.com/better-auth/better-auth/commit/2a829fa62a7f93b18c111d9300f1e3b89720865a) fix(reddit): refresh access token should use `basic` auth (#3753) - [`8c37484`](https://github.com/better-auth/better-auth/commit/8c37484786025f1a6192b2ae7db6efd82a9507c7) docs: unify component implementations for consistency (#3799) - [`af4b4c7`](https://github.com/better-auth/better-auth/commit/af4b4c7d20bb901da151094254f8ebdd6b61ccc1) fix: add missing team reference in teamMember schema (#3801) - [`5fce7eb`](https://github.com/better-auth/better-auth/commit/5fce7eba584f86b31b7b2da9b20c70d62d61e667) fix: ensure zod v4 type annotations work with core types ### 📊 Changes **14 files changed** (+173 additions, -156 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/old-planets-camp.md` (+5 -0) 📝 `demo/nextjs/app/client-test/page.tsx` (+19 -21) 📝 `demo/nextjs/app/dashboard/user-card.tsx` (+21 -19) 📝 `demo/nextjs/app/features.tsx` (+0 -22) 📝 `demo/nextjs/components/sign-in.tsx` (+11 -11) 📝 `docs/app/docs/[[...slug]]/page.client.tsx` (+5 -8) 📝 `docs/components/generate-apple-jwt.tsx` (+45 -42) 📝 `docs/components/landing/section-svg.tsx` (+13 -18) 📝 `docs/content/docs/adapters/community-adapters.mdx` (+1 -0) 📝 `packages/better-auth/src/index.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+19 -5) 📝 `packages/better-auth/src/plugins/organization/organization.ts` (+4 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+27 -10) 📝 `packages/better-auth/src/social-providers/reddit.ts` (+1 -0) </details> ### 📄 Description We need to keep both zod/v4 and zod/v4/core exports to ensure type annotations work correctly with Zod v4. This will solve making it hard for typescript to figure out the annotation due to internal module export conflict. you can run - ``` npx tsc --declaration --declarationMap ``` which checks for tsc and other unnecessary leaks as well. --- <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 08:51:13 -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#13281