[PR #187] [MERGED] fix: use detected package manager in install error/hint messages #374

Closed
opened 2026-05-06 12:39:29 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/187
Author: @justinfinnn
Created: 2/28/2026
Status: Merged
Merged: 3/3/2026
Merged by: @southpolesteve

Base: mainHead: fix/use-detected-package-manager-in-error-messages


📝 Commits (2)

  • 95513d8 fix: use detected package manager in error/hint messages
  • 84e4670 fix: use detectPackageManager() in cli.ts per review feedback

📊 Changes

3 files changed (+10 additions, -8 deletions)

View changed files

📝 packages/vinext/src/check.ts (+2 -1)
📝 packages/vinext/src/cli.ts (+4 -4)
📝 packages/vinext/src/index.ts (+4 -3)

📄 Description

Problem

Error messages and install hints in index.ts, check.ts, and cli.ts were hardcoded to use npm install, even when the project uses Yarn, pnpm, or Bun.

For example, on a Yarn workspace project:

vinext: App Router detected but @vitejs/plugin-rsc is not installed.
Run: npm install -D @vitejs/plugin-rsc   ← wrong for Yarn users

Solution

Use the existing detectPackageManager() and detectPackageManagerName() utilities from utils/project.ts — which already correctly detect the package manager from lockfiles and are already used in deploy.ts.

After this fix (on a Yarn project):

vinext: App Router detected but @vitejs/plugin-rsc is not installed.
Run: yarn add -D @vitejs/plugin-rsc   ← correct!

Changes

  • src/index.ts — 3 error/warning messages: @vitejs/plugin-rsc not installed (×2), @mdx-js/rollup not installed
  • src/check.ts — install hint shown to users during vinext check
  • src/cli.ts — eslint/oxlint install suggestions

Closes #186
Relates to #109


🔄 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/cloudflare/vinext/pull/187 **Author:** [@justinfinnn](https://github.com/justinfinnn) **Created:** 2/28/2026 **Status:** ✅ Merged **Merged:** 3/3/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `fix/use-detected-package-manager-in-error-messages` --- ### 📝 Commits (2) - [`95513d8`](https://github.com/cloudflare/vinext/commit/95513d86f38151b7dbc21e42e2f0c5bb5ea8a94c) fix: use detected package manager in error/hint messages - [`84e4670`](https://github.com/cloudflare/vinext/commit/84e46702d4d204299e00d7ab859a1a69e15c0c0a) fix: use detectPackageManager() in cli.ts per review feedback ### 📊 Changes **3 files changed** (+10 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/check.ts` (+2 -1) 📝 `packages/vinext/src/cli.ts` (+4 -4) 📝 `packages/vinext/src/index.ts` (+4 -3) </details> ### 📄 Description ## Problem Error messages and install hints in `index.ts`, `check.ts`, and `cli.ts` were hardcoded to use `npm install`, even when the project uses Yarn, pnpm, or Bun. For example, on a Yarn workspace project: ``` vinext: App Router detected but @vitejs/plugin-rsc is not installed. Run: npm install -D @vitejs/plugin-rsc ← wrong for Yarn users ``` ## Solution Use the existing `detectPackageManager()` and `detectPackageManagerName()` utilities from `utils/project.ts` — which already correctly detect the package manager from lockfiles and are already used in `deploy.ts`. **After this fix (on a Yarn project):** ``` vinext: App Router detected but @vitejs/plugin-rsc is not installed. Run: yarn add -D @vitejs/plugin-rsc ← correct! ``` ## Changes - `src/index.ts` — 3 error/warning messages: `@vitejs/plugin-rsc` not installed (×2), `@mdx-js/rollup` not installed - `src/check.ts` — install hint shown to users during `vinext check` - `src/cli.ts` — eslint/oxlint install suggestions ## Related Closes #186 Relates to #109 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:29 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#374
No description provided.