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

Closed
opened 2026-04-13 10:29:20 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/8555

State: closed
Merged: Yes


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
**Original Pull Request:** https://github.com/better-auth/better-auth/pull/8555 **State:** closed **Merged:** Yes --- ## 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
GiteaMirror added the pull-request label 2026-04-13 10:29:20 -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#16306