Skip to content

Commit 871d8d3

Browse files
fengmk2claude
andcommitted
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

CLAUDE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,29 @@ vite dev # runs dev script from package.json
7979

8080
- Run `cargo test` to execute all tests
8181
- You never need to run `pnpm install` in the test fixtures dir, vite-plus should able to load and parse the workspace without `pnpm install`.
82+
83+
## Build
84+
85+
- Run `pnpm bootstrap-cli` from the project root to build all packages and install the global CLI
86+
- This builds all `@voidzero-dev/*` packages
87+
- Compiles the Rust NAPI bindings
88+
- Installs the CLI globally via npm
89+
90+
## Snap Tests
91+
92+
Snap tests are located in `packages/global/snap-tests/`. Each test case is a directory containing:
93+
94+
- `package.json` - Package configuration for the test
95+
- `steps.json` - Commands to run and environment variables
96+
- `src/` - Source files for the test
97+
- `snap.txt` - Expected output (generated/updated by running the test)
98+
99+
```bash
100+
# Run all snap tests
101+
pnpm -F @voidzero-dev/global snap-test
102+
103+
# Run a specific snap test by name filter
104+
pnpm -F @voidzero-dev/global snap-test migration-skip-vite-peer-dependency
105+
```
106+
107+
The snap test will automatically generate/update the `snap.txt` file with the command outputs.

0 commit comments

Comments
 (0)