[PR #8555] [MERGED] chore: mark third-party peerDependencies as optional in adapter packages #24960

Closed
opened 2026-04-15 22:39:21 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8555
Author: @himself65
Created: 3/11/2026
Status: Merged
Merged: 3/11/2026
Merged by: @himself65

Base: canaryHead: fix/optional-peer-deps


📝 Commits (2)

  • 6827033 fix: mark third-party peerDependencies as optional in adapter packages
  • e1dfff7 chore: add knip ignoreDependencies for optional peer deps in adapter packages

📊 Changes

3 files changed (+22 additions, -0 deletions)

View changed files

📝 knip.jsonc (+12 -0)
📝 packages/kysely-adapter/package.json (+5 -0)
📝 packages/mongo-adapter/package.json (+5 -0)

📄 Description

Summary

  • Mark mongodb as optional peer in @better-auth/mongo-adapter
  • Mark kysely as optional peer in @better-auth/kysely-adapter
  • Mark ioredis as optional peer in @better-auth/redis-storage

These packages are dependencies of the main better-auth package (for re-export paths like better-auth/adapters/mongodb). Without peerDependenciesMeta: { optional: true }, package managers warn about or auto-install mongodb, kysely, and ioredis for all better-auth users, even if they don't use those adapters.

prisma-adapter and drizzle-adapter already had this set correctly.

Test plan

  • Verify pnpm install does not pull in mongodb, kysely, or ioredis unless explicitly installed by the user

🔄 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/8555 **Author:** [@himself65](https://github.com/himself65) **Created:** 3/11/2026 **Status:** ✅ Merged **Merged:** 3/11/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/optional-peer-deps` --- ### 📝 Commits (2) - [`6827033`](https://github.com/better-auth/better-auth/commit/6827033a4e98f35b003222de548b29b47d095d73) fix: mark third-party peerDependencies as optional in adapter packages - [`e1dfff7`](https://github.com/better-auth/better-auth/commit/e1dfff728d4692baf064e24e68a95d26b5f56fc4) chore: add knip ignoreDependencies for optional peer deps in adapter packages ### 📊 Changes **3 files changed** (+22 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `knip.jsonc` (+12 -0) 📝 `packages/kysely-adapter/package.json` (+5 -0) 📝 `packages/mongo-adapter/package.json` (+5 -0) </details> ### 📄 Description ## Summary - Mark `mongodb` as optional peer in `@better-auth/mongo-adapter` - Mark `kysely` as optional peer in `@better-auth/kysely-adapter` - Mark `ioredis` as optional peer in `@better-auth/redis-storage` These packages are dependencies of the main `better-auth` package (for re-export paths like `better-auth/adapters/mongodb`). Without `peerDependenciesMeta: { optional: true }`, package managers warn about or auto-install `mongodb`, `kysely`, and `ioredis` for all `better-auth` users, even if they don't use those adapters. `prisma-adapter` and `drizzle-adapter` already had this set correctly. ## Test plan - [ ] Verify `pnpm install` does not pull in `mongodb`, `kysely`, or `ioredis` unless explicitly installed by the user --- <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-15 22:39:21 -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#24960