nft icon indicating copy to clipboard operation
nft copied to clipboard

Serialport prebuilds removed by NFT - PR coming soon

Open RogerHardiman opened this issue 9 months ago • 2 comments

Hi The nodeJS SerialPort module comes with a prebuilds folder with .node files for Windows, Mac, Linux (32 and 64 bit variants, and glibc and musl variants) Because it uses a runtime generated path to select which .node file to load, NFT will remove these files.

I've used the special-cases code to add in a rule for @serialport/bindings-cpp.

It is working great so I'll fork and do a Pull Request for you.

I noticed you had code to detect .node files from bind.js, but the paths that parses does not include a prebuilds, with sub folders for each OS, Arch and C Library, so think special-cases is the place to fix this.

RogerHardiman avatar May 03 '24 07:05 RogerHardiman

For info, my patch on the installed nft (ie in Javascript) is

    '@serialport/bindings-cpp'({ id, emitAssetDirectory }) {
        if (id.endsWith('@serialport/bindings-cpp/dist/index.js')) {
            // SerialPort ships with prebuilt .node files for multiple OS and Arch types
            emitAssetDirectory((0, path_1.resolve)((0, path_1.dirname)(id), '..', 'prebuilds'));
        }
    },

I'm off to add this at the Typescript level next

RogerHardiman avatar May 03 '24 08:05 RogerHardiman

Pull Request #415 submitted to fix this issue

RogerHardiman avatar May 03 '24 11:05 RogerHardiman

many thanks for merging in the PR. Also thanks for PKG and for NCC, both of which I've used in the past, so glad I could contribute something back.

RogerHardiman avatar May 08 '24 17:05 RogerHardiman