node-usb-detection icon indicating copy to clipboard operation
node-usb-detection copied to clipboard

Move prebuild system to `prebuildify` and `node-gyp-build`

Open mcous opened this issue 2 years ago • 3 comments

The prebuild-install dependency now advocates against its own use:

Instead of prebuild paired with prebuild-install, we recommend prebuildify paired with node-gyp-build.

The benefits touted by prebuildify and node-gyp-build seem like useful upgrades to the build system that could meaningfully reduce the number of issues faced by Electron users of this library (e.g. #153). I'm not sure, but it looks like there's a chance it could also make it easier / possible to start shipping a universal macOS prebuilt binary to resolve #141.

With prebuildify, all prebuilt binaries are shipped inside the package that is published to npm, which means there's no need for a separate download step like you find in prebuild. The irony of this approach is that it is faster to download all prebuilt binaries for every platform when they are bundled than it is to download a single prebuilt binary as an install script.

(Aside: I'm about to go on several weeks of vacation, and I intend to look into this when I'm back. Until that time, though, if someone else picked this ticket up, I would not be disappointed!)

mcous avatar Oct 20 '21 00:10 mcous

Thanks for the background and details here @mcous! The plan to migrate seems good to me 👍

Have a good vacation 🏖🏞

MadLittleMods avatar Oct 20 '21 00:10 MadLittleMods

We recently ported node-usb to prebuildify using prebuildify-cross, it may serve as inspiration.

Coupled with a port to node-addon-api it should fix most platform issues and future proof the library.

Shout if you want some help

thegecko avatar Nov 23 '21 18:11 thegecko

I would be concerned about how big a nan based package would end up being. It produces a rather long list of targets, which will only get worse if adding prebuildify-cross to the mix

I really need to finish up that node-api rewrite I started...

Julusian avatar Nov 23 '21 18:11 Julusian