-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Ship to NPM and other registries with flag? #100
Comments
this is how i've done it in the past: https://github.com/rustwasm/wasm-pack/tree/master/npm which is sorta similar to rust-to-npm. definitely on the roadmap! |
rust-to-npm relies on the user building the binary, which is a lot to ask. Another way of doing it, which as far as I know was pioneered by esbuild, is to publish a separate package for each supported platform/architecture, and then a package which relies on each of those packages with There's a writeup of the approach here. I've used it myself in this project so people with node already installed can send/receive files with A nice touch is to have the main package have a postinstall script which replaces the shim with the actual binary, so that subsequent invocations can skip the shim. You could also put that code in the shim itself and do without the postinstall, I imagine. People do a similar trick in Python, though Python wheels let you specify different files for different platforms directly instead of needing separate packages. |
@bakkot I agree on the above, I think Rust-to-npm is still a valid entry for certain groups on security aspects requiring the files to compile instead of trusting a binary. |
The version ashley proposed will be shipping in 0.0.6 ~today
|
@Gankra looks good! I noticed theres not a uninstall file set for removing the binary. |
Do you have examples/requirements for that? I don't think I've ever seen someone use |
@Gankra the |
@j-mendez the implementation we went with (which i've used before) handles the clean up :) you can test yourself using the
|
@ashleygwilliams lovely! I am about to add a section towards the other project highlighting the differences so people can be directed to the right project. Big fan of having the option to execute from node simply from the binary installation without having to rebuild on the machine. Thanks again! |
@j-mendez that's rad! thanks so much and of course- if you run into anything please don't hesitate to open up a new issue, even if its just a question :) |
chore(deps): bump clap from 4.5.1 to 4.5.2
Is this crate set to be the center to take the shipping process for other package registries with the correct way to start the binaries?
If so, there is this project rust-to-npm that has the option to handle Rust/cargo -> Node/npm. I think adding this could benefit CLIs.
The text was updated successfully, but these errors were encountered: