Commit 871d8d3
feat(migration): skip rewriting vite imports when vite is in peerDependencies
When a project has vite in peerDependencies (like a Vite plugin), the
import rewriter now skips rewriting vite imports to avoid accidentally
bundling vite-plus into the library.
- Split AST-grep rules into separate VITE, VITEST, and TSDOWN rule sets
- Added get_skip_packages_from_root() to check root package.json for peerDependencies
- Apply rules conditionally based on which packages are in peerDependencies
- Added comprehensive unit tests for peerDependencies scenarios
- Added snap test: migration-skip-vite-peer-dependency
- Updated CLAUDE.md with build and snap-test instructions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 0971535 commit 871d8d3
6 files changed
Lines changed: 574 additions & 139 deletions
File tree
- crates/vite_migration/src
- packages/global/snap-tests/migration-skip-vite-peer-dependency
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
0 commit comments