Commit 84ebcd8
authored
feat(migrate): rewrite triple-slash reference types during migration (#660)
Add regex-based rewriting of `/// <reference types="..." />` directives
in the migration tool. These cannot be handled by ast-grep because
triple-slash references are parsed as comment nodes, not AST nodes.
Supports all the same mapping rules as import/declare-module rewriting:
- vite → vite-plus
- vitest/config → vite-plus (special case)
- vitest → vite-plus/test
- `@vitest/*` → vite-plus/test/*
Respects SkipPackages logic for peerDependencies/dependencies.
closes VP-1301 parent 01d0c5c commit 84ebcd8
7 files changed
Lines changed: 749 additions & 0 deletions
File tree
- crates/vite_migration
- src
- packages/cli/snap-tests-global/migration-rewrite-reference-types
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
0 commit comments