vp migrate rewrites catalog: specs in a Bun project whose workspaces.packages is empty
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- bun, typescript
- 領域
- build-system, cli
調査の方向性
packages/cli/src/migration/migrator/vite-plus-bootstrap.ts の bunWorkspaceDeclaresPackages() から始め、ルートの workspaces フィールドの配列形式とオブジェクト形式をどのように処理するか確認してください。Issue に記載された package.json と vp migrate のコマンドを使い、Bun 1.4.4 で再現してください。ルートの workspace フィールドに空のパッケージリストがある場合、移行によってカタログ参照と overrides が変更されなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
In a single-package Bun project that keeps its toolchain in workspaces.catalog with an empty workspaces.packages array, vp migrate handles the project as if it had no catalog support. It replaces every catalog: reference in devDependencies, and the catalog-valued entries in overrides, with concrete versions. workspaces.catalog stays in package.json, but nothing references it anymore.
Bun resolves this setup: bun install succeeds and vite resolves to @voidzero-dev/vite-plus-core. Bun only needs the root package.json to have a workspaces field; without one it fails with catalogs require a "workspaces" field in the root package.json. "workspaces": [] and "workspaces": { "packages": [] } both work.
The check that rejects this setup is bunWorkspaceDeclaresPackages() in packages/cli/src/migration/migrator/vite-plus-bootstrap.ts, which requires a non-empty package list. The comment above it says Bun resolves catalog: references only inside a workspace whose root package.json declares a non-empty workspaces. Bun 1.4.4 does not behave that way.
Reproduction
package.json:
{
"name": "bun-root-catalog",
"private": true,
"type": "module",
"packageManager": "[email protected]",
"devDependencies": {
"@vitest/coverage-v8": "catalog:",
"vite": "catalog:",
"vite-plus": "catalog:",
"vitest": "catalog:"
},
"workspaces": {
"packages": [],
"catalog": {
"@vitest/coverage-v8": "5.1.0",
"vite": "npm:@voidzero-dev/[email protected]",
"vite-plus": "1.5.0",
"vitest": "5.1.0"
}
},
"overrides": {
"vite": "catalog:",
"vitest": "catalog:"
}
}
printf 'node_modules\n' > .gitignore
bun install
git init && git add -A && git commit -m init
vp migrate --no-interactive --no-hooks --no-agent --no-editor
git diff package.json
Actual: bun install succeeds before the migration. Afterwards devDependencies become "@vitest/coverage-v8": "5.1.0", "vite": "npm:@voidzero-dev/[email protected]", "vite-plus": "1.5.0" and "vitest": "5.1.0", and overrides become "vite": "npm:@voidzero-dev/[email protected]" and "vitest": "5.1.0". The catalog is left unused.
Expected: no changes. With only "packages": [] changed to "packages": ["packages/*"], and no packages directory at all, the same command prints This project is already using Vite+! Happy coding! and leaves package.json as it is.
Suggested fix
For Bun, treat any root workspaces field (array or object form) as catalog support, which matches the check Bun itself applies, instead of requiring a non-empty package list.
Environment
- vite-plus 1.5.0 (global and local)
- Bun 1.4.4
- Node 26.13.0
- macOS arm64
Related, but different: #1247 (object-form workspaces, fixed in #1250) and #2309 (vp up rewriting catalog: specs in a monorepo). I have not checked Bun versions older than 1.4.4.
- 主要言語
- TypeScript
- スター
- 6.6k
- フォーク
- 303
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 224
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
voidzero-dev/vite-plus のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
voidzero-dev/vite-plus#3381 ·
メンテナーはふだん 1 日以内に返信
-
`vp env pin`: says "Created .node-version" when overwriting an existing file対応中かも @CheHyeonYeong が今日担当しました。 オープンcontribution welcome documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
voidzero-dev/vite-plus#3370 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
triage: not actionable
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
voidzero-dev/vite-plus#3296 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
pending triage
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
voidzero-dev/vite-plus#3235 ·
メンテナーはふだん 1 日以内に返信
-
Docker guide: the runtime stage needs libatomic1 for Node.js 25 and later対応中かも @kshanxs が 14 日前に担当しました。 オープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
voidzero-dev/vite-plus#3219 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
voidzero-dev/vite-plus の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
langchain-ai/langchainjs#12157 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
activescott/home-infra-k8s-flux#511 ·
メンテナーはふだん 1 日以内に返信
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
lingdojo/kana-dojo#33753 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
android:player
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
follow-up needs-triage S3: minor
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
manaflow-ai/cmux#38032 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信