mirror of
https://github.com/better-auth/better-auth.git
synced 2026-08-22 16:42:53 -05:00
Better Auth required Kysely for every install because @better-auth/core declared it a non-optional peer and the main package a hard dependency, even though core used it only for types and the runtime load was already lazy. A Kysely-internal change therefore broke every user's build, including those on Drizzle, Prisma, or Mongo who never touch Kysely.
Sever the coupling: vendor the small structural database-handle types into core so its published types no longer import from kysely; relocate database-type detection to a kysely-free core helper and reach Kysely's value imports only through the already-lazy adapter path; guard that path with a clear error when kysely is absent. Kysely moves to an optional peer dependency. The redundant better-auth/minimal entry is removed, and a bare Kysely Dialect must now be passed as { dialect, type }.