Repository navigation
Commit dc17982
authored
fix(init): generate .void types on install in scaffolded starters (#521)
Fixes #519
Add `"postinstall": "void prepare"` to the starter scripts. Init
installs after writing the starter, so a new scaffold gets the types at
that point, and a fresh clone gets them on install. This is the same
approach as `nuxt prepare`.
`EMPTY_PROJECT_ALLOWED_SCRIPTS` also allows `postinstall: void prepare`,
so running init again on a starter still sees it as an empty project.
Checked:
- `init.test.ts` (`postinstall` in the React + D1 starter, and the
deleted-starter check)
- a 1.1.12 starter cloned fresh with `postinstall` added: `pnpm install`
creates `.void/db.d.ts` and `routes.d.ts`, and `tsc` passes (it fails
without it)
16 tests in `init.test.ts` fail locally on main too. This PR adds no new
failures.1 parent e2dfa11 commit dc17982
3 files changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1205 | 1205 | | |
1206 | 1206 | | |
1207 | 1207 | | |
| 1208 | + | |
1208 | 1209 | | |
1209 | 1210 | | |
1210 | 1211 | | |
| |||
1321 | 1322 | | |
1322 | 1323 | | |
1323 | 1324 | | |
| 1325 | + | |
1324 | 1326 | | |
1325 | 1327 | | |
1326 | 1328 | | |
| |||
0 commit comments