-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: optimize workspace package resolution in dependency tree #8958
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
🦋 Changeset detectedLatest commit: 1998b64 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 |
Do we need to add a new fixture or at minimum, not commit the node_modules to the repo? Is it possible to use an existing fixture? Seems like we could simply use
With this to save the lockfile
|
The modification of package.json is incorrectly targeting the project's root package.json instead of the one in packages/test-app directory. This appears to be a bug. |
@mmaietta I concatenated it manually. The unit test issues have been resolved. Please help review it when you have time.
|
Not a bug, it's designed to work with both one-package.json and two-package.json setups but with the electron-builder/test/src/helpers/packTester.ts Lines 546 to 547 in 7ba4fea
Much cleaner diff now though, thank you for making the modifications! |
Thank you, @beyondkmp 🥇 |
fix #8956
Root Cause
The module in the workspace uses scoped naming convention like @packages/app, while the root directory is ended with packages/app. This mismatch results in returning empty and consequently leads to no dependencies being found.
electron-builder/packages/app-builder-lib/src/node-module-collector/nodeModulesCollector.ts
Lines 150 to 152 in 7ba4fea
How to fix
Read the name from package.json in the root directory and compare it with the keys in dependencies, this way it can match even with arbitrary scoped names (@xxx/yyyy).