Commit 0132c60
committed
fix(migrate): preserve protocol-prefixed vite-plus specs; gate vitest auto-add to migrations
Address review findings on the new vite-plus normalize path:
- Preserve protocol-prefixed specs (`catalog:named`, `workspace:*`, `link:`,
`file:`, `npm:`, `github:`, `git+`/`git:`, `http(s)://`) so deliberate
user pins survive `vp migrate`. Previously the new normalize rule
rewrote anything that wasn't literally `catalog:` — silently clobbering
named-catalog references, workspace and link protocols, and aliased pins.
- Split the vitest peer-dep auto-add back behind `needVitePlus` only. A
pure normalize pass (sub-package only needed its pinned `^x.y.z`
re-aligned to `catalog:`) must not also inject a `vitest` devDep just
because the project happens to have a `vitest-browser-*` peer.
- Drop the now-redundant `const version = canonicalVitePlusSpec` alias.
Also update `snap-tests-global/new-vite-monorepo-bun/snap.txt` to drop the
stripped `"vite": "catalog:"` line in apps/website (matches the cleanup in
`executeMonorepoTemplate`), and add an existsSync guard to the workflow's
node -e assertion so a missing sub-package package.json surfaces with a
targeted message instead of an opaque ENOENT.
Test coverage: yarn + bun catalog normalize, protocol-prefix preservation,
and "pure normalize must not auto-add vitest". 410 passed.1 parent f9bfde4 commit 0132c60
4 files changed
Lines changed: 67 additions & 11 deletions
File tree
- .github/workflows
- packages/cli
- snap-tests-global/new-vite-monorepo-bun
- src/migration
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
294 | 300 | | |
295 | 301 | | |
296 | 302 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
186 | 222 | | |
187 | 223 | | |
188 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1985 | 1985 | | |
1986 | 1986 | | |
1987 | 1987 | | |
1988 | | - | |
1989 | | - | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
1990 | 1992 | | |
1991 | 1993 | | |
1992 | 1994 | | |
1993 | 1995 | | |
1994 | | - | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
1995 | 2000 | | |
1996 | | - | |
1997 | | - | |
1998 | 2001 | | |
1999 | 2002 | | |
2000 | | - | |
| 2003 | + | |
2001 | 2004 | | |
2002 | | - | |
2003 | | - | |
2004 | | - | |
2005 | | - | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
2006 | 2013 | | |
2007 | 2014 | | |
2008 | 2015 | | |
| |||
2013 | 2020 | | |
2014 | 2021 | | |
2015 | 2022 | | |
| 2023 | + | |
2016 | 2024 | | |
2017 | 2025 | | |
2018 | 2026 | | |
2019 | 2027 | | |
2020 | 2028 | | |
2021 | 2029 | | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
2022 | 2037 | | |
2023 | 2038 | | |
2024 | 2039 | | |
| |||
0 commit comments