Add node native bindings and prebuild#83
Add node native bindings and prebuild#83itsame-luigi wants to merge 4 commits intobuttplugio:masterfrom
Conversation
|
I've made some progress on this, and done some additional cleanup on the js side. I've removed the parts of I've also reorganized the scripts in package.json to break things down by build task, and added some With these changes, the web output should be mostly unchanged from what it was prior to #80, except for a minor source path change as I moved I need to run a few more tests in NodeJS by installing the package on various OSes (probably by packing it into a tarball to avoid needing to publish to npm), but the overall design should be fairly solid now. |
|
Also, it seems the "Core Library + Nuget" builds are failing though I haven't made any changes that should be causing those errors. I'm not sure if its just because its a PR from a forked repository, or if there's some other reason for the failure. It does look like the CI setup needs to include a scenario for building/testing JS. |
|
@qdot, I think this is as ready as I can make it, if you're able to review. I can't test the new Nodejs bindings on MacOS, but I've tested it on Windows. I can try and see if it works on Linux via WSL, but I don't have any physical hardware with Linux+Bluetooth aside from WSL. |
|
Great, thanks for letting me know! Right now I'm neck deep in trying to release buttplug v5, but once that's done I'm hoping to take a look at this. I've got all 3 platforms running on dedicated hardware so I can test those too. |
This adds native bindings for NodeJS, instead of depending on a WASM build. The WASM build is still used for the browser. I also added a script to run on
npm installthat will fetch a specific release build (configured inpackage.jsonas"ffi-version").Also, it is no longer necessary to invoke
buttplugInit()in NodeJS (though it is still necessary in the browser).There are a few things that still need to be worked out and tested:
I could not get rust to build x64 dll on Windows for some reason, so the script currently fetches a release build. I'm not familiar enough with Rust to resolve this currently.