[PR #9094] [CLOSED] fix: remove vitest from optional peer dependency #25334

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/9094
Author: @Divyansh200102
Created: 4/10/2026
Status: ❌ Closed

Base: main ← Head: 9083


📝 Commits (1)

  • e549f6b fix: remove vitest from optional peer dependency

📊 Changes

1 file changed (+0 additions, -4 deletions)

View changed files

📝 packages/better-auth/package.json (+0 -4)

📄 Description

Fixes: #9083

Changes
Dropped vitest from peerDependencies and peerDependenciesMeta in packages/better-auth/package.json.

Why
npm v7+ automatically resolves peer dependencies. Because vitest was listed as an optional peer, running npm ci --omit=dev for a production build would still install it if the user already had it in their root devDependencies. This was dragging the testing framework in production deployments.

Testing
Verified locally. Packed the package , installed it in an isolated test repo with vitest as a dev dependency, and confirmed npm ci --omit=dev successfully ignores it now.


Summary by cubic

Removed vitest from peerDependencies and peerDependenciesMeta in packages/better-auth to prevent it from being installed in production. Resolves #9083 by avoiding npm v7+ peer auto-install during npm ci --omit=dev.

  • Bug Fixes
    • Before: optional peer caused vitest to be installed if present in root devDependencies.
    • After: npm ci --omit=dev no longer pulls vitest with better-auth.

Written for commit e549f6b901. Summary will update on new commits.


🔄 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/9094 **Author:** [@Divyansh200102](https://github.com/Divyansh200102) **Created:** 4/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `9083` --- ### 📝 Commits (1) - [`e549f6b`](https://github.com/better-auth/better-auth/commit/e549f6b901acaf2025fcfc080972fd7bd17328b7) fix: remove vitest from optional peer dependency ### 📊 Changes **1 file changed** (+0 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/package.json` (+0 -4) </details> ### 📄 Description Fixes: #9083 Changes Dropped vitest from peerDependencies and peerDependenciesMeta in packages/better-auth/package.json. Why npm v7+ automatically resolves peer dependencies. Because vitest was listed as an optional peer, running npm ci --omit=dev for a production build would still install it if the user already had it in their root devDependencies. This was dragging the testing framework in production deployments. Testing Verified locally. Packed the package , installed it in an isolated test repo with vitest as a dev dependency, and confirmed npm ci --omit=dev successfully ignores it now. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Removed `vitest` from `peerDependencies` and `peerDependenciesMeta` in `packages/better-auth` to prevent it from being installed in production. Resolves #9083 by avoiding npm v7+ peer auto-install during `npm ci --omit=dev`. - **Bug Fixes** - Before: optional peer caused `vitest` to be installed if present in root devDependencies. - After: `npm ci --omit=dev` no longer pulls `vitest` with `better-auth`. <sup>Written for commit e549f6b901acaf2025fcfc080972fd7bd17328b7. Summary will update on new commits.</sup> <!-- 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-15 22:50:30 -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#25334