vp migrate rewrites catalog: specs in a Bun project whose workspaces.packages is empty
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- bun, typescript
- Lĩnh vực
- build-system, cli
Hướng nghiên cứu
Bắt đầu với bunWorkspaceDeclaresPackages() trong packages/cli/src/migration/migrator/vite-plus-bootstrap.ts và kiểm tra cách hàm xử lý các dạng mảng và đối tượng của trường gốc workspaces. Tái hiện lỗi bằng Bun 1.4.4 với các lệnh package.json và vp migrate trong issue. Hoàn thành khi quá trình migration giữ nguyên các tham chiếu đến catalog và overrides nếu trường workspace gốc có danh sách package rỗng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 6.6k
- Fork
- 303
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 224
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của voidzero-dev/vite-plus
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
voidzero-dev/vite-plus#3381 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`vp env pin`: says "Created .node-version" when overwriting an existing fileCó thể đã có người làm @CheHyeonYeong đã nhận hôm nay. Đang mởcontribution welcome documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
voidzero-dev/vite-plus#3370 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage: not actionable
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
voidzero-dev/vite-plus#3296 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pending triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
voidzero-dev/vite-plus#3235 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Docker guide: the runtime stage needs libatomic1 for Node.js 25 and laterCó thể đã có người làm @kshanxs đã nhận 14 ngày trước. Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
voidzero-dev/vite-plus#3219 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của voidzero-dev/vite-plus
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
langchain-ai/langchainjs#12157 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
activescott/home-infra-k8s-flux#511 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
lingdojo/kana-dojo#33753 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
android:player
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
follow-up needs-triage S3: minor
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
manaflow-ai/cmux#38032 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày