Commit 53b5b52
feat(migration): skip rewriting imports for packages in peerDependencies (#367)
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 <[email protected]>1 parent 6e4eef6 commit 53b5b52
24 files changed
Lines changed: 1027 additions & 148 deletions
File tree
- .github/workflows
- crates/vite_migration/src
- ecosystem-ci
- packages/global
- snap-tests
- migration-monorepo-pnpm
- migration-monorepo-skip-vite-peer-dependency
- packages/vite-plugin
- src
- migration-monorepo-yarn4
- migration-skip-vite-dependency
- src
- migration-skip-vite-peer-dependency
- src
- src/utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
99 | 107 | | |
100 | 108 | | |
101 | 109 | | |
| |||
| 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