Skip to content

Commit

Permalink
Add cargo-binstall support to wasm-bindgen (#3544)
Browse files Browse the repository at this point in the history
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
  • Loading branch information
NobodyXu committed Aug 5, 2023
1 parent f0d1009 commit bb2f424
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@
<sub>Built with 🦀🕸 by <a href="https://rustwasm.github.io/">The Rust and WebAssembly Working Group</a></sub>
</div>

## 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.
Expand Down Expand Up @@ -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
[contributing]: https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html
4 changes: 4 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bb2f424

Please sign in to comment.