forge-externals-plugin icon indicating copy to clipboard operation
forge-externals-plugin copied to clipboard

node modules following github packages naming weren't included

Open mghizzo opened this issue 4 years ago • 7 comments

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 avatar Aug 09 '21 15:08 mghizzo

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

mghizzo avatar Aug 09 '21 15:08 mghizzo

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?

timfish avatar Aug 09 '21 20:08 timfish

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?

mghizzo avatar Aug 09 '21 20:08 mghizzo

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.

timfish avatar Aug 09 '21 20:08 timfish

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.

mghizzo avatar Aug 09 '21 20:08 mghizzo

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.

bn3t avatar Aug 23 '21 07:08 bn3t

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

anfo000 avatar Nov 24 '21 06:11 anfo000