Skip to content
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

fix: install all dependencies to fix building within NPM workspaces #8715

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

beyondkmp
Copy link
Collaborator

@beyondkmp beyondkmp commented Dec 1, 2024

fix #7103.

If node_modules doesn't exist at all, I think we can directly install all packages, not just the production ones. Even if we reinstall all packages under the workspace again, it shouldn't cause any issues.

At most, this approach would just take some extra time but won't lead to any problems.

Copy link

changeset-bot bot commented Dec 1, 2024

🦋 Changeset detected

Latest commit: 43375bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-builder Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

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

@mmaietta
Copy link
Collaborator

mmaietta commented Dec 3, 2024

Is there a test project I can verify locally or unit test we could set up for this? (If it's too complex, then no worries, just wanted to double check though)

@mmaietta
Copy link
Collaborator

mmaietta commented Dec 3, 2024

Can you check this? The main issue I think I see here is with the default configuration of electron-builder, where it includes all files in the project directory https://www.electron.build/contents#files. This means for projects already using electron-builder, this could lead to a dramatic increase in app size if they are relying on electron-builder to install their app dependencies as this PR will cause non-production dependencies to be packaged with it.

@beyondkmp
Copy link
Collaborator Author

@beyondkmp
Copy link
Collaborator Author

Can you check this? The main issue I think I see here is with the default configuration of electron-builder, where it includes all files in the project directory https://www.electron.build/contents#files. This means for projects already using electron-builder, this could lead to a dramatic increase in app size if they are relying on electron-builder to install their app dependencies as this PR will cause non-production dependencies to be packaged with it.

This shouldn't increase, when we copy node modules to asar, we filter for production dependencies and only copy those. Dev dependencies won't be copied, so it won't have any impact even if everything is installed.

@mmaietta
Copy link
Collaborator

mmaietta commented Dec 6, 2024

Nice work!

@mmaietta mmaietta changed the title fix: does not work with NPM workspaces fix: install all dependencies to fix building within NPM workspaces Dec 6, 2024
@mmaietta mmaietta merged commit 4c394d5 into electron-userland:master Dec 6, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work with NPM workspaces
2 participants