Skip to content

Commit bb2f424

Browse files
authored
Add cargo-binstall support to wasm-bindgen (#3544)
Signed-off-by: Jiahao XU <[email protected]>
1 parent f0d1009 commit bb2f424

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
* Add bindings for `WorkerGlobalScope.performance`.
2424
[#3506](https://github.com/rustwasm/wasm-bindgen/pull/3506)
2525

26+
* Add support for installing pre-built artifacts of `wasm-bindgen-cli`
27+
via `cargo binstall wasm-bindgen-cli`.
28+
2629
### Changed
2730

2831
* Updated the WebGPU WebIDL.

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,24 @@
2626
<sub>Built with 🦀🕸 by <a href="https://rustwasm.github.io/">The Rust and WebAssembly Working Group</a></sub>
2727
</div>
2828

29+
## Install `wasm-bindgen-cli`
30+
31+
You can install it using `cargo install`:
32+
33+
```
34+
cargo install wasm-bindgen-cli
35+
```
36+
37+
Or, you can download it from the
38+
[release page](https://github.com/rustwasm/wasm-bindgen/releases).
39+
40+
If you have [`cargo-binstall`](https://crates.io/crates/cargo-binstall) installed,
41+
then you can install the pre-built artifacts by running:
42+
43+
```
44+
cargo binstall wasm-bindgen-cli
45+
```
46+
2947
## Example
3048

3149
Import JavaScript things into Rust and export Rust things to JavaScript.
@@ -110,4 +128,4 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
110128
for inclusion in this project by you, as defined in the Apache-2.0 license,
111129
shall be dual licensed as above, without any additional terms or conditions.
112130

113-
[contributing]: https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html
131+
[contributing]: https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html

crates/cli/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ edition = '2018'
1515
default-run = 'wasm-bindgen'
1616
rust-version = "1.56"
1717

18+
[package.metadata.binstall]
19+
pkg-url = "https://github.com/rustwasm/wasm-bindgen/releases/download/{ version }/wasm-bindgen-{ version }-{ target }{ archive-suffix }"
20+
bin-dir = "wasm-bindgen-{ version }-{ target }/{ bin }{ binary-ext }"
21+
1822
[dependencies]
1923
docopt = "1.0"
2024
env_logger = "0.8"

0 commit comments

Comments
 (0)