vite:monorepo template declares catalog entries that no workspace package uses

オープン 初心者向け
#3,381 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
build-system

調査の方向性

まず packages/cli/templates/monorepo/pnpm-workspace.yaml を確認し、そのカタログエントリを生成されたパッケージマニフェスト、特に packages/utils/package.json と apps/website/package.json と比較してください。monorepoテンプレートの生成テストまたは検証テストを確認し、テンプレートで catalog: 参照を使うべきか、未使用のエントリを削除すべきかを判断したうえで、該当するテストを実行してください。生成されたカタログエントリが使用され、そのバージョンが一致しているか、未使用のエントリが存在しない状態になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Describe the bug

A project created with vp create vite:monorepo declares two pnpm catalog entries that no workspace package uses, and one of them does not match the version the packages actually pin.

The template's pnpm-workspace.yaml (packages/cli/templates/monorepo/pnpm-workspace.yaml) sets catalogMode: prefer and declares:

catalog:
  "@types/node": ^24
  typescript: ^7.0.0

The generated workspace packages do not reference these entries with catalog:. They pin direct ranges instead:

packages/utils/package.json   "@types/node": "^26.6.5", "typescript": "^7.0.2"
apps/website/package.json     "typescript": "^7.0.2"

What I expect: the generated packages use "typescript": "catalog:" and "@types/node": "catalog:", so the catalog is the single source of the versions, or the template leaves out catalog entries that are not used. The @types/node range should also agree between the catalog (^24) and the package (^26.6.5).

What happens: the catalog entries are dead, and a dead-code checker such as Knip reports them on a new project. vp check passes, so nothing inside Vite+ points this out.

Related: #1835 is about vp add writing catalog: references. This report is about the manifests the template itself generates.

Reproduction

No separate repository: the bug reproduces with the single vp create command under "Steps to reproduce", on a clean directory.

Steps to reproduce
vp create vite:monorepo --directory repro --no-interactive --git --package-manager pnpm
cd repro
grep -n "catalog" pnpm-workspace.yaml
grep -rn '"typescript"\|"@types/node"' apps/*/package.json packages/*/package.json
pnpm dlx [email protected]

Knip prints:

Unused catalog entries (2)
@types/node  default  pnpm-workspace.yaml:9:4
typescript   default  pnpm-workspace.yaml:10:3
System Info
$ vp env current
Node.js:
  Version    26.13.0
  Source     engines.node
  Installed  true
  Mode       managed

Package Manager:
  Name       pnpm
  Version    12.18.0
  Source     devEngines.packageManager
  Installed  true
  Mode       managed

$ vp --version
vp v1.5.0

Local vite-plus:
  vite-plus  v1.5.0

Tools:
  vite             v8.3.5
  rolldown         v1.2.16
  vitest           v5.1.0
  oxfmt            v0.76.0
  oxlint           v1.91.0
  oxlint-tsgolint  v7.0.2005
  tsdown           v0.23.4

The vp --version output is from the project's local vp (1.5.0); vp env current ran through the global binary (1.2.0), because the local one refuses env. Binary paths are removed.

Used Package Manager

pnpm

Logs

Not needed; the steps above reproduce it without any error output.

Validations
主要言語
TypeScript
スター
6.6k
フォーク
303
平均マージ
1日 4時間
マージ済み PR(30日)
224

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/vite-plus のほかの issue

voidzero-dev/vite-plus の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。