feat: support load package graph from yarn/npm workspaces#60
Merged
Conversation
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Apply automatic formatting from cargo fmt to improve code consistency. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for loading package graphs from yarn/npm workspaces in addition to the existing pnpm workspace support. The implementation extends the workspace detection logic to recognize package.json files with workspaces fields and adds comprehensive test coverage for various workspace scenarios.
- Refactored workspace detection to support npm/yarn workspaces alongside pnpm workspaces
- Added a helper function
open_exists_fileto reduce code duplication - Expanded test coverage with 13 new test cases covering single packages, different workspace types, edge cases, and dependency patterns
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/vite_package_manager/src/package_manager.rs | Added npm/yarn workspace support, refactored file opening logic, and updated tests |
| crates/vite_package_manager/src/lib.rs | Added NpmWorkspace struct, updated get_package_graph function to handle multiple workspace types, and added comprehensive test suite |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
wan9chi
reviewed
Aug 27, 2025
Comment on lines
+402
to
+415
|
|
||
| // Create packages directory | ||
| fs::create_dir_all(temp_dir.path().join("packages")).unwrap(); | ||
|
|
||
| // Create included package | ||
| fs::create_dir_all(temp_dir.path().join("packages/included")).unwrap(); | ||
| let included = serde_json::json!({ | ||
| "name": "included-pkg" | ||
| }); | ||
| fs::write(temp_dir.path().join("packages/included/package.json"), included.to_string()) | ||
| .unwrap(); | ||
|
|
||
| // Create excluded package | ||
| fs::create_dir_all(temp_dir.path().join("packages/excluded-test")).unwrap(); |
Member
There was a problem hiding this comment.
We could really use snapshot testing 😂
58e609c to
b02419e
Compare
fengmk2
added a commit
that referenced
this pull request
Jul 9, 2026
fengmk2
added a commit
that referenced
this pull request
Jul 9, 2026
Bumps the pinned `voidzero-dev/pkg-pr-registry-bridge` publish action in `publish-preview.yml` from `4fbc413` (bridge #60) to `f57eaa9` (bridge #61). The bridge removed its `PKG_PR_NEW_BASE` var and the Worker's on-demand pkg.pr.new fallback; it now serves preview artifacts only from R2. The action's inputs are unchanged and this step packs locally, so publish behavior here is identical. This just keeps the pin in sync with the deployed bridge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code