Skip to content
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

Add cargo-binstall support to wasm-bindgen #3544

Merged
merged 4 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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`:
NobodyXu marked this conversation as resolved.
Show resolved Hide resolved

```
cargo install wasm-bindgen-cli
```

Or, you can either download it from the
[release](https://github.com/rustwasm/wasm-bindgen/releases) page or run:
NobodyXu marked this conversation as resolved.
Show resolved Hide resolved

If you have [`cargo-binstall`](https://github.com/cargo-bins/cargo-binstall) installed,
NobodyXu marked this conversation as resolved.
Show resolved Hide resolved
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