Skip to content

node modules following github packages naming weren't included - #1

Open
mghizzo wants to merge 1 commit into
timfish:masterfrom
jexpe-apps:Github-Packages
Open

mghizzo wants to merge 1 commit into
timfish:masterfrom
jexpe-apps:Github-Packages

Conversation

@mghizzo

@mghizzo mghizzo commented Aug 9, 2021

Copy link
Copy Markdown

Github Packages naming conventions are mapped wrongly by Electron-Forge Ignore function.
Github Packages requires "@organization/package" name for libraries and Electron-Forge gives you just "node_modules/@organization".
If you want to open an issue on their GitHub feel free to do so.

@mghizzo

mghizzo commented Aug 9, 2021

Copy link
Copy Markdown
Author

Also I would appreciate if you can merge & npm publish asap. Thanks.

@timfish

timfish commented Aug 9, 2021

Copy link
Copy Markdown
Owner

It looks like this change would package everything under @org/ which could be including far too much.

Can you give me an example module that is currently failing to get packaged?

@mghizzo

mghizzo commented Aug 9, 2021

Copy link
Copy Markdown
Author

It looks like this change would package everything under @org/ which could be including far too much.

Can you give me an example module that is currently failing to get packaged?

I tried with my own module which is private. But you can try yourself with any package which has "@org/package".
I know that with my fix every "@org" package will be included. But the ignore function returns the package name wrong.
Since I only have a single "@org" package I fixed that way, but the real issue is in Electron Forge API I guess?

@timfish

timfish commented Aug 9, 2021

Copy link
Copy Markdown
Owner

Since I only have a single "@org" package I fixed that way, but the real issue is in Electron Forge API I guess?

The plan is to merge this functionality into forge so whatever the source of the issue I need to work out what's causing it so I can fix it.

@mghizzo

mghizzo commented Aug 9, 2021

Copy link
Copy Markdown
Author

Since I only have a single "@org" package I fixed that way, but the real issue is in Electron Forge API I guess?

The plan is to merge this functionality into forge so whatever the source of the issue I need to work out what's causing it so I can fix it.

Honestly it's the first time I've been working with Electron Forge and my package has a Native Node Addon (.node) which loads a dylib (or DLL depending on the OS). The only way I got it working was with this plugin and a small fix (the PR).
If you have any better solution let me know.

@bn3t

bn3t commented Aug 23, 2021

Copy link
Copy Markdown

The problem is really that electron-forge does not call the plugin with the correct package name. In case of a scoped package (@org) it's only providing /node_modules/@org, which is wrong. It should be providing /node_modules/@org/package-name.
The plugin tries to process the dependencies of the externals so including a whole scope would not be ideal. Some dependencies could fail to be included.

@anfo000

anfo000 commented Nov 24, 2021

Copy link
Copy Markdown

Exactly what I needed. Thank you. This library and the changes proposed works great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants