nft
nft copied to clipboard
Serialport prebuilds removed by NFT - PR coming soon
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.
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
Pull Request #415 submitted to fix this issue
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.