-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: ensure correct dependency graph extraction order and yarn berry _dependencies support #9439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…_dependencies support - Change npm dependency graph extraction from parallel to sequential processing to ensure consistent ordering - Add _dependencies field check in yarn berry isProdDependency for proper production dependency detection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 02ff806 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request makes two improvements to dependency graph extraction for Node.js module collectors:
Summary:
This PR refactors the npm dependency graph extraction logic to ensure sequential, predictable processing order and extends Yarn Berry's production dependency detection to handle all dependency field types.
Key Changes:
- Refactored
extractProductionDependencyGraphin npm collector from a parallel promise pattern to a sequential loop, preventing potential race conditions when processing shared state - Added
_dependenciesanddependenciesfield checks to Yarn Berry'sisProdDependencymethod for comprehensive production dependency detection
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/app-builder-lib/src/node-module-collector/npmNodeModulesCollector.ts | Simplified dependency extraction loop to sequential processing, improving code clarity and preventing race conditions on shared productionGraph state |
| packages/app-builder-lib/src/node-module-collector/yarnBerryNodeModulesCollector.ts | Extended production dependency detection to check _dependencies, dependencies, and optionalDependencies fields for better Yarn Berry compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/app-builder-lib/src/node-module-collector/npmNodeModulesCollector.ts
Outdated
Show resolved
Hide resolved
packages/app-builder-lib/src/node-module-collector/yarnBerryNodeModulesCollector.ts
Show resolved
Hide resolved
…ector Add early check for resolvedDeps existence and use for...in loop instead of Object.entries() for better performance. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix #9394 (comment)
🤖 Generated with Claude Code