Commit 78dbe56
authored
feat(migration): add tsdown to vite lib migration support (#362)
- Add import rewriting: `import { defineConfig } from 'tsdown'` → `import { defineConfig } from '@voidzero-dev/vite-plus/lib'`
- Add declare module rewriting for tsdown
- Add script rewriting: `tsdown` → `vite lib`
- Add unit tests for tsdown import and declare module rewriting
- Add snap test fixture for migration-from-tsdown
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces automated migration from `tsdown` to Vite+.
>
> - Adds import/declare rewrite rules mapping `tsdown` to `@voidzero-dev/vite-plus/lib` with unit tests
> - New `merge_tsdown_config` (Rust core, NAPI binding, and JS export) imports `tsdown.config.*` into `vite.config.*` and injects `lib: tsdownConfig` (idempotent)
> - Migrator detects `tsdown.config.*`; merges JSON config content into `lib` and deletes the file, or adds an import for TS/JS; removes `tsdown` and replaces scripts via rules (`tsdown` → `vite lib`)
> - Updates CLI rules (`vite-tools.yml`) and adds snap tests for `migration-from-tsdown*`; minor scripts: adds `test:unit`
>
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f0e76cc. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 29897cd commit 78dbe56
23 files changed
Lines changed: 848 additions & 39 deletions
File tree
- crates/vite_migration/src
- packages/global
- binding
- src
- rules
- snap-tests
- migration-from-tsdown-json-config
- src
- migration-from-tsdown
- src
- src/migration
- __tests__/__snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
232 | 266 | | |
233 | 267 | | |
234 | 268 | | |
| |||
1393 | 1427 | | |
1394 | 1428 | | |
1395 | 1429 | | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
1396 | 1510 | | |
1397 | 1511 | | |
1398 | 1512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
0 commit comments