voidzero-dev / voidzero-dev/vite-plus

fix(migrate): tolerate nested npm overrides during bootstrap detection

Abierto
#2,002 0 comentarios 0 reacciones 1 asignado Reclamado por @fengmk2 Ver en GitHub
bug
Lenguaje dominante
Rust
Estrellas
5.8k
Forks
262
Merge medio
1 d 34 min
PR fusionados (30 d)
135

Descripción

`detectVitePlusBootstrapPending` assumes npm `overrides` values are strings, but npm supports nested override objects. A valid package.json such as this can throw during migration because the bootstrap detection calls string methods like `.startsWith()` on the override value:

```json
{
"overrides": {
"vite": {
"rollup": "..."
}
}
}
```

Expected behavior:

- Migration should not crash when `overrides.vite` or `overrides.vitest` is a nested object.
- Non-string override values should be treated as not satisfying the Vite+ override and then handled safely by the migration rewrite logic.
- Add a regression test covering a nested npm override under a managed key.

Suggested test:

Create an npm fixture with nested overrides:

```json
{
"devDependencies": {
"vite-plus": "0.1.x"
},
"overrides": {
"vite": {
"rollup": "^4.0.0"
}
}
}
```

Run:

```bash
vp migrate --no-interactive
```

Assert that migration completes or reports an actionable migration error, but does not throw a TypeError from bootstrap detection.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.