Commit 01f1254
committed
fix(cli/create): pin packageManager and yarn linker before migrate install
The remote-template migrate flow was breaking on npm/yarn/bun because
`vp install` couldn't honor `--package-manager`:
- `vite_install`'s `prompt_package_manager_selection` hardcodes pnpm
in CI / non-TTY environments when no `packageManager` field, no
workspace file, and no lockfile are present. create-vite scaffolds
without a `packageManager` field, so every non-pnpm path silently
switched to pnpm at install #1 — leaving the wrong lockfile for
install #2 and tripping ERR_PNPM_NO_MATCHING_VERSION on CI's local
tarballs.
- Yarn Berry's default Plug'n'Play stores deps inside .yarn/cache/*.zip.
`@oxlint/migrate` calls fileURLToPath over zip entries and throws
MODULE_NOT_FOUND on `@eslint/js`.
Before install #1 in the migrate-gated branches (standalone + monorepo):
- Call `setPackageManager(fullPath, downloadPackageManager)` so
`vp install` picks up the `--package-manager` choice from the field.
- For yarn, write a minimal `.yarnrc.yml` with `nodeLinker: node-modules`
so the install produces a classic `node_modules/` that
`@oxlint/migrate` can resolve.
Export `setPackageManager` from migrator.ts for reuse from create/bin.ts.
Verified end-to-end locally: all four package managers
(pnpm / npm / yarn / bun) now migrate `vite@9.0.5 --template react-ts`
cleanly — eslint.config.js removed, `.oxlintrc.json` merged into
vite.config.ts, packageManager pinned to the chosen PM. Drop the CI
matrix `exclude` that previously scoped this entry to pnpm.1 parent f745218 commit 01f1254
3 files changed
Lines changed: 31 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 154 | | |
172 | 155 | | |
173 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
989 | 991 | | |
990 | 992 | | |
991 | 993 | | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
992 | 1008 | | |
993 | 1009 | | |
994 | 1010 | | |
| |||
1015 | 1031 | | |
1016 | 1032 | | |
1017 | 1033 | | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1018 | 1048 | | |
1019 | 1049 | | |
1020 | 1050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2367 | 2367 | | |
2368 | 2368 | | |
2369 | 2369 | | |
2370 | | - | |
| 2370 | + | |
2371 | 2371 | | |
2372 | 2372 | | |
2373 | 2373 | | |
| |||
0 commit comments