Commit bdba45d
committed
refactor(create): fold findWorkspaceRoot to a single pass + small cleanups
Post-simplify cleanup:
- `findWorkspaceRoot` now uses a single walk with a deferred `.git`
match. The two-pass version walked the entire ancestry twice in the
no-marker case; now we record the first `.git` seen and return it
only after the walk exhausts without finding a monorepo marker.
Same "markers win globally" semantics, half the I/O.
- Export `hasViteConfig` and use it in `getConfiguredDefaultTemplate`
instead of the degenerate `findViteConfigUp(x, x)` (start == stop
meant it only checked the single directory anyway).
- Drop the dead `?? 'template'` fallback in `bin.ts` —
`bundledEntryName` is always set whenever `isBundledTemplate` is true
(both come from the same `resolved.kind === 'bundled'` branch).
- `fetchNpmResource` init type is now `Omit<RequestInit, 'signal'>`
so callers can't accidentally pass a `signal` that the
`AbortSignal.timeout(timeoutMs)` inside would silently override.
- Tighten `expandNpmrcValue` JSDoc to list the four `.npmrc` features
we do NOT handle (backslash escapes, `${VAR-default}`, inline `;`
comments, `key[]=` lists).1 parent 24425dc commit bdba45d
4 files changed
Lines changed: 22 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | | - | |
| 636 | + | |
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
53 | 50 | | |
54 | 51 | | |
55 | | - | |
56 | | - | |
| 52 | + | |
| 53 | + | |
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
| |||
72 | 69 | | |
73 | 70 | | |
74 | 71 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 72 | + | |
| 73 | + | |
87 | 74 | | |
88 | 75 | | |
89 | 76 | | |
90 | 77 | | |
91 | 78 | | |
92 | 79 | | |
93 | 80 | | |
94 | | - | |
| 81 | + | |
95 | 82 | | |
96 | 83 | | |
97 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
170 | | - | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
0 commit comments