feat: implement glob pattern matching with last-match-wins semantics#63
Conversation
Boshen
left a comment
There was a problem hiding this comment.
Can you also test https://github.com/oxc-project/fast-glob
The amount of code is similar, but Glob parsing needs to be done every time, which would likely result in some performance degradation https://github.com/voidzero-dev/vite-plus/pull/67/files. |
8f8462f to
8de43b9
Compare
|
cursor review |
There was a problem hiding this comment.
Pull Request Overview
This PR implements efficient glob pattern matching with last-match-wins semantics for workspace exclusion patterns. The implementation follows gitignore-like behavior where negated patterns (!pattern) override earlier matches.
- Adds a new
vite_globcrate with aGlobPatternSetthat supports negated patterns - Replaces
compact_strusage withvite_str::Stracross multiple crates - Refactors workspace pattern handling to use the new glob system with proper last-match-wins semantics
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/vite_glob/src/lib.rs | New glob pattern matching implementation with comprehensive tests |
| crates/vite_glob/Cargo.toml | New crate configuration |
| crates/vite_package_manager/src/lib.rs | Refactored workspace glob handling to use new pattern system |
| crates/vite_package_manager/src/package.rs | Extracted PackageJson and related types from lib.rs |
| crates/vite_package_manager/Cargo.toml | Updated dependencies to include vite_glob and vite_str |
| crates/vite_task/src/config/workspace.rs | String type conversion updates |
| crates/vite_error/src/lib.rs | Removed compact_str dependency |
| crates/vite_error/Cargo.toml | Updated dependencies |
| Cargo.toml | Added vite_glob workspace dependency |
Comments suppressed due to low confidence (1)
crates/vite_package_manager/src/lib.rs:1
- The pattern cloning on lines 70 and 72 creates unnecessary allocations. Consider collecting patterns into inclusions and all vectors in a single pass without cloning, or use references where possible.
pub mod package;
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@branchseer Check if #63 and #68 can be merged, as vite install needs to pass through more default environment variables, and the functionality depends on these two PRs. |
8ea08d4 to
5942770
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
52104bf to
22bf70a
Compare
22bf70a to
427ad5e
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Add vite_glob crate for efficient glob pattern matching - Implement GlobPatternSet with support for negated patterns (!) - Follow gitignore-like semantics: last matching pattern wins - Support workspace exclusion patterns in pnpm/npm/yarn workspaces - Add comprehensive tests for various glob scenarios 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
427ad5e to
1031511
Compare

🤖 Generated with Claude Code