Conversation
…-auth/core instances pnpm creates two instances of @better-auth/core due to different peer dependency contexts (@better-auth/cli pulls in @better-auth/telemetry which creates a separate resolution). Importing BetterAuthOptions and Where directly from @better-auth/core resolved to the wrong instance, making those types incompatible with the ones used internally by better-auth/adapters. Fix by importing BetterAuthOptions and Where from better-auth instead, which resolves to the same instance that createAdapterFactory uses. Also pin @better-auth/core via pnpm override to prevent further drift. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated pnpm overrides to pin Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @ymc9's task —— View job PR Review: Better Auth Type Compatibility FixCode Review AnalysisThis PR addresses a legitimate dependency resolution issue with Better Auth that causes type incompatibilities. Here's my comprehensive review: ✅ Code Quality & Best PracticesExcellent Solution: The fix correctly addresses the root cause by importing types from the unified Clean Changes:
✅ Dependency ManagementSmart Prevention: The pnpm override in Consistent Versioning: The override aligns with the devDependency versions already specified in the Better Auth package. ✅ Bug Fix AssessmentRoot Cause Correctly Identified: The issue stems from Appropriate Solution: Using the unified ✅ Security ConsiderationsNo Security Issues: The changes only modify import sources and don't introduce any security vulnerabilities. The pnpm override actually improves security by ensuring consistent dependency versions.
|
|
Claude finished @ymc9's task —— View job PR Review: Better Auth Type Compatibility FixTodo List
Code Review AnalysisThis PR addresses a legitimate dependency resolution issue with Better Auth that causes type incompatibilities. Here's my comprehensive review: ✅ Code Quality & Best PracticesExcellent Solution: The fix correctly addresses the root cause by importing types from the unified Clean Changes:
✅ Dependency ManagementSmart Prevention: The pnpm override in Consistent Versioning: The override aligns with the devDependency versions already specified in the Better Auth package. ✅ Bug Fix AssessmentRoot Cause Correctly Identified: The issue stems from Appropriate Solution: Using the unified ✅ Security ConsiderationsNo Security Issues: The changes only modify import sources and don't introduce any security vulnerabilities. The pnpm override actually improves security by ensuring consistent dependency versions.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
package.json (1)
17-17:⚠️ Potential issue | 🟡 MinorPin
packageManagerto the repo-required pnpm version.Line 17 uses
pnpm@10.33.0, but this repo policy requirespnpm@10.12.1.As per coding guidelines "Use pnpm for package management with version pinned to
pnpm@10.12.1."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` at line 17, The packageManager field is pinned to pnpm@10.33.0 but repo policy requires pnpm@10.12.1; update the packageManager value (the "packageManager" JSON key in package.json) to "pnpm@10.12.1" so the repository uses the required pinned pnpm version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@package.json`:
- Line 17: The packageManager field is pinned to pnpm@10.33.0 but repo policy
requires pnpm@10.12.1; update the packageManager value (the "packageManager"
JSON key in package.json) to "pnpm@10.12.1" so the repository uses the required
pinned pnpm version.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 69d5e636-ec09-45fa-b68f-9f8bb1a8b7a1
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
package.jsonpackages/auth-adapters/better-auth/src/adapter.ts
|
Claude finished @ymc9's task —— View job PR Review: Better Auth Type Compatibility FixTodo List
Code Review AnalysisThis PR addresses a legitimate dependency resolution issue with Better Auth that causes type incompatibilities. Here's my comprehensive review: ✅ Code Quality & Best PracticesExcellent Solution: The fix correctly addresses the root cause by importing types from the unified Clean Changes:
✅ Dependency ManagementSmart Prevention: The pnpm override in Consistent Versioning: The override aligns with the devDependency versions already specified in the Better Auth package. Kysely Upgrade: Updated workspace dependency to ✅ Bug Fix AssessmentRoot Cause Correctly Identified: The issue stems from Appropriate Solution: Using the unified ✅ Security ConsiderationsNo Security Issues: The changes only modify import sources and don't introduce any security vulnerabilities. The pnpm override actually improves security by ensuring consistent dependency versions.
|
Summary
@better-auth/coregets two separate pnpm store instances because@better-auth/clipulls in@better-auth/telemetry, which creates a different peer dependency resolution contextBetterAuthOptionsandWheredirectly from@better-auth/coreinadapter.tsresolved to the wrong instance — incompatible with the types used internally bybetter-auth/adapters'screateAdapterFactorybetter-authinstead, which uses the same@better-auth/coreinstance ascreateAdapterFactory@better-auth/coreto1.4.19to prevent future driftTest plan
pnpm --filter @zenstackhq/better-auth buildcompletes without TypeScript errors@zenstackhq/better-authtests:pnpm --filter @zenstackhq/better-auth test🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Refactor
Bug Fixes