Uh oh!
There was an error while loading. Please reload this page.
feat: support load package graph from yarn/npm workspaces - #60
Conversation
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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>
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // 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(); |
There was a problem hiding this comment.
We could really use snapshot testing 😂
58e609c to
b02419eCompareUh oh!
There was an error while loading. Please reload this page.
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.
🤖 Generated with Claude Code