From bb2f424756037323759ae5254ef359e8caad6a6d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 5 Aug 2023 23:36:26 +1000 Subject: [PATCH] Add `cargo-binstall` support to `wasm-bindgen` (#3544) Signed-off-by: Jiahao XU --- CHANGELOG.md | 3 +++ README.md | 20 +++++++++++++++++++- crates/cli/Cargo.toml | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 037b64526e1..cb435f8dd9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ * Add bindings for `WorkerGlobalScope.performance`. [#3506](https://github.com/rustwasm/wasm-bindgen/pull/3506) +* Add support for installing pre-built artifacts of `wasm-bindgen-cli` + via `cargo binstall wasm-bindgen-cli`. + ### Changed * Updated the WebGPU WebIDL. diff --git a/README.md b/README.md index cf5dafcfd7e..be034243c61 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,24 @@ Built with 🦀🕸 by The Rust and WebAssembly Working Group +## Install `wasm-bindgen-cli` + +You can install it using `cargo install`: + +``` +cargo install wasm-bindgen-cli +``` + +Or, you can download it from the +[release page](https://github.com/rustwasm/wasm-bindgen/releases). + +If you have [`cargo-binstall`](https://crates.io/crates/cargo-binstall) installed, +then you can install the pre-built artifacts by running: + +``` +cargo binstall wasm-bindgen-cli +``` + ## Example Import JavaScript things into Rust and export Rust things to JavaScript. @@ -110,4 +128,4 @@ Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. -[contributing]: https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html \ No newline at end of file +[contributing]: https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 1152af1a014..e010e1d9cd8 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -15,6 +15,10 @@ edition = '2018' default-run = 'wasm-bindgen' rust-version = "1.56" +[package.metadata.binstall] +pkg-url = "https://github.com/rustwasm/wasm-bindgen/releases/download/{ version }/wasm-bindgen-{ version }-{ target }{ archive-suffix }" +bin-dir = "wasm-bindgen-{ version }-{ target }/{ bin }{ binary-ext }" + [dependencies] docopt = "1.0" env_logger = "0.8"