`wasm-bindgen` regressed and only generates move assertions for free functions,
not methods. While `wasm-bindgen` is fixing that regression, we are changing
this test fixture to be of the shape that will still generate move assertions.
Fixes#677.
* Renamed set_crate_path to get_crate_path
* If the path isn't specified in the call then use the current_dir and walk up the path try to find the manifest file.
* Specify the cwd for the build test so it doesn't walk up the path. The test needs to specify the path to build, otherwise because fixtures are run in a subdirectory of the source tree it will find the Cargo.toml from the wasm-pack source repository.
This commit fixes the `wasm-pack build --mode no-install` command from
unconditionally panicking as well as `--mode force`. These steps were
calling an `unwrap()` on an internal `Option<T>` which was supposed to
be set during `step_install_wasm_bindgen`, but that step wasn't run in
these modes. The mode configuration of steps has been refactored
slightly to ensure that more steps are shared between these modes to
reduce duplication.
This commit fixes an issue where if a library is renamed via the `name`
key in the `[lib]` section of the manifest then `wasm-pack` would try to
generate bindings for an noexistent wasm-file, generating an error.
The fix was to internally use `cargo_metadata` more aggressively and
move around where this data is generated. This ended up refactoring a
few locations, but this should also bring improved error messages for
`cargo metadata` as well as caching the resulting data more aggressively
to avoid recalculating it too much.
Closes#339
This commit switches wasm-pack to using a global cache for all download
binaries, living typically in a user's home directory. The intention
here is to aovid creating a `bin` folder in all wasm-pack projects and
additionally share downloads between projects to ensure that you're
downloading a minimal number of binaries from the network.
Along the way the downloading code was restructured to support a global
cache, but everything should largely be as it was before!
Closes#292