electron-builder
electron-builder copied to clipboard
feat: switch app-builder-bin to node-module-collector to get all production node modules
change app-builder-bin to node-module-collector(typescript)
Design
- Get node modules tree from "npm list"(npm & yarn) or "pnpm list"
- Transform the tree to dependency graph
- Transform the graph to hoisted tree
- Hoisted tree to node modules array
Support
- [x] npm
- [x] pnpm
- [x] pnpm with hosited
- [x] yarn1
- [x] yarn berry(with node-modules)
Performance vs app-builder-bin
This is an IO-intensive task, primarily involving reading files and traversing the entire dependency tree. Node.js is capable of handling such IO-intensive tasks without issues.
Based on my personal testing, there's essentially no difference in performance
Advantages
- Perfectly supports pnpm
- Optimize packages in the node_modules within the asar file unlike the previous app-builder-bin which only searched for all node_modules without optimizing. For example, if a module has one version in the dev node_modules dependencies, another in the root node_modules, and yet another version with multiple dependencies in the production node_modules, it results in multiple duplicate modules in the production node_modules. Now, hoisting is applied in such situations, reducing these duplicate packages.
⚠️ No Changeset found
Latest commit: 1995c187eddcf9588d79442e5e48d058ef510fbf
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Deploy Preview for car-park-attendant-cleat-11576 failed.
| Name | Link |
|---|---|
| Latest commit | d02d442fc96133151cb8ce6530291fbfc7221c59 |
| Latest deploy log | https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/67218d5652a4a10008d82240 |
ready for review. @mmaietta Please help review when you have time.
@mmaietta Please help review again.
Note: There's some util functions already existing in
builder-util/src/utilandbuilder-util/src/fsthat we could leverage to reduce duplicated code and improve debug logging
Excellent suggestions, all changes have been implemented.