vp migrate rewrites catalog: specs in a Bun project whose workspaces.packages is empty
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- bun, typescript
- Área
- build-system, cli
Línea de trabajo
Empieza con bunWorkspaceDeclaresPackages() en packages/cli/src/migration/migrator/vite-plus-bootstrap.ts y comprueba cómo gestiona las formas de array y objeto del campo raíz workspaces. Reproduce el problema con Bun 1.4.4 usando los comandos package.json y vp migrate del issue. La migración se considera correcta cuando deja intactas las referencias del catálogo y overrides si el campo raíz del workspace contiene una lista de paquetes vacía.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.6k
- Forks
- 303
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 224
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de voidzero-dev/vite-plus
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
voidzero-dev/vite-plus#3381 ·
Los mantenedores suelen responder en 1 día
-
`vp env pin`: says "Created .node-version" when overwriting an existing filePosiblemente ocupada @CheHyeonYeong la tomó hoy. Abiertocontribution welcome documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
voidzero-dev/vite-plus#3370 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
triage: not actionable
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
voidzero-dev/vite-plus#3296 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
pending triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
voidzero-dev/vite-plus#3235 ·
Los mantenedores suelen responder en 1 día
-
Docker guide: the runtime stage needs libatomic1 for Node.js 25 and laterPosiblemente ocupada @kshanxs la tomó hace 14 días. Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
voidzero-dev/vite-plus#3219 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de voidzero-dev/vite-plus
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
langchain-ai/langchainjs#12157 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
activescott/home-infra-k8s-flux#511 ·
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
lingdojo/kana-dojo#33753 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
android:player
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
follow-up needs-triage S3: minor
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
manaflow-ai/cmux#38032 · 1 comentario ·
Los mantenedores suelen responder en 1 día