From da670540087e653dea6e0032f6b85c9749f4c1ea Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 3 Aug 2023 16:02:32 +1000 Subject: [PATCH 1/4] Add `cargo-binstall` support to `wasm-bindgen` This would enable `cargo-binstall` to install the pre-built binaries from release artifacts. How to test this: ``` cargo binstall --manifest-path crates/cli wasm-bindgen-cli ``` --- crates/cli/Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) 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" From 8389769e1b483d10993d59be803743faa2bd4cfe Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 5 Aug 2023 23:14:28 +1000 Subject: [PATCH 2/4] Update changelog Signed-off-by: Jiahao XU --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdb6a1baad5..0de8b196af5 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. From 6c9b557cdbfc8e3db675ac2c46dc7295eb01cc7f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 5 Aug 2023 23:16:27 +1000 Subject: [PATCH 3/4] Update README Signed-off-by: Jiahao XU --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cf5dafcfd7e..c538077e0ff 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 either download it from the +[release](https://github.com/rustwasm/wasm-bindgen/releases) page or run: + +If you have [`cargo-binstall`](https://github.com/cargo-bins/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 From 4a5fa929528512173b9875fe4bf8d2fd81a339a1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 5 Aug 2023 23:33:13 +1000 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: daxpedda --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c538077e0ff..be034243c61 100644 --- a/README.md +++ b/README.md @@ -28,16 +28,16 @@ ## Install `wasm-bindgen-cli` -You can install it using `cargo-install`: +You can install it using `cargo install`: ``` cargo install wasm-bindgen-cli ``` -Or, you can either download it from the -[release](https://github.com/rustwasm/wasm-bindgen/releases) page or run: +Or, you can download it from the +[release page](https://github.com/rustwasm/wasm-bindgen/releases). -If you have [`cargo-binstall`](https://github.com/cargo-bins/cargo-binstall) installed, +If you have [`cargo-binstall`](https://crates.io/crates/cargo-binstall) installed, then you can install the pre-built artifacts by running: ```