[PR #5334] [MERGED] fix(organization): compatibility with declaration on tsconfig.json #14183

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

📋 Pull Request Information

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

Base: canaryHead: himself65/2025/10/15/type-check


📝 Commits (4)

  • 951a46f fix(organization): compatibility with declaration on tsconfig.json
  • 1df56a9 Update e2e/smoke/test/fixtures/tsconfig-decelration/package.json
  • 1afbe2b Update e2e/smoke/test/typecheck.spec.ts
  • 5343796 chore: lint fix

📊 Changes

6 files changed (+61 additions, -20 deletions)

View changed files

e2e/smoke/test/fixtures/tsconfig-decelration/package.json (+12 -0)
e2e/smoke/test/fixtures/tsconfig-decelration/src/index.ts (+6 -0)
e2e/smoke/test/fixtures/tsconfig-decelration/tsconfig.json (+16 -0)
📝 e2e/smoke/test/typecheck.spec.ts (+10 -5)
📝 packages/better-auth/src/plugins/organization/organization.ts (+8 -15)
📝 pnpm-lock.yaml (+9 -0)

📄 Description

Summary by cubic

Makes the organization plugin compatible with TypeScript projects that enable compilerOptions.declaration. Refactors endpoint type composition and adds an e2e typecheck fixture to prevent declaration emit errors.

  • Bug Fixes

    • Reworked OrganizationEndpoints to safely compose dynamicAccessControl and teams endpoints with base endpoints.
    • Avoids conditional intersection patterns that break when emitting declarations.
  • Tests

    • Added tsconfig-decelration fixture with declaration: true using the organization plugin.
    • Updated smoke test to run typecheck for the new fixture and existing ones.

🔄 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/5334 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/15/2025 **Status:** ✅ Merged **Merged:** 10/15/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/15/type-check` --- ### 📝 Commits (4) - [`951a46f`](https://github.com/better-auth/better-auth/commit/951a46f8e1e20968481cb8d333656e9d416da09a) fix(organization): compatibility with declaration on tsconfig.json - [`1df56a9`](https://github.com/better-auth/better-auth/commit/1df56a928dbc33b2288acf31bc3af79f66e7599c) Update e2e/smoke/test/fixtures/tsconfig-decelration/package.json - [`1afbe2b`](https://github.com/better-auth/better-auth/commit/1afbe2b7a0f3f1b9a124636df8fa779f23b63a99) Update e2e/smoke/test/typecheck.spec.ts - [`5343796`](https://github.com/better-auth/better-auth/commit/5343796e0f2c9e0068b6222fe9970aa259021666) chore: lint fix ### 📊 Changes **6 files changed** (+61 additions, -20 deletions) <details> <summary>View changed files</summary> ➕ `e2e/smoke/test/fixtures/tsconfig-decelration/package.json` (+12 -0) ➕ `e2e/smoke/test/fixtures/tsconfig-decelration/src/index.ts` (+6 -0) ➕ `e2e/smoke/test/fixtures/tsconfig-decelration/tsconfig.json` (+16 -0) 📝 `e2e/smoke/test/typecheck.spec.ts` (+10 -5) 📝 `packages/better-auth/src/plugins/organization/organization.ts` (+8 -15) 📝 `pnpm-lock.yaml` (+9 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Makes the organization plugin compatible with TypeScript projects that enable compilerOptions.declaration. Refactors endpoint type composition and adds an e2e typecheck fixture to prevent declaration emit errors. - **Bug Fixes** - Reworked OrganizationEndpoints to safely compose dynamicAccessControl and teams endpoints with base endpoints. - Avoids conditional intersection patterns that break when emitting declarations. - **Tests** - Added tsconfig-decelration fixture with declaration: true using the organization plugin. - Updated smoke test to run typecheck for the new fixture and existing ones. <!-- 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:21:00 -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#14183