The installer pages need to be postprocessed a bit to have the latest
version on them, so this updates them to ensure that we're shipping the
postprocessed version at `/installer` instead of the raw versions
This commit kicks off the addition of installers for wasm-pack, with the main
goals of being:
* Users should have a one-click (ideally) solution to download and install
wasm-pack.
* We should ideally not have to worry about picking up "heavy" dependencies in
wasm-pack like C++ or C code (if necessary).
The general idea here is very similar to rustup (and in fact a good deal of code
is copied from them!). The installation worklow for wasm-pack in theory after
this commit looks like:
1. First, a users visits the installer landing page. A preview is available at
https://alexcrichton.github.io/wasm-pack/installer/. Clearly this page needs
a better stylesheet!
2. The user performs the instructions presented on the page. The website
automatically detects what platform you're running on, basically giving you a
curl/sh script or a Windows installer. There's various options for seeing
other installers as well, and the fallback of `cargo install` is presented if
we don't recognize the platform (or if we don't think we have precompiled
binaries).
3a. On Unix, users execute a curl/sh script like:
```
curl https://alexcrichton.github.io/wasm-pack/installer/init.sh -sSf | sh
```
This command will download the shell script included in this PR, which will
in turn do some further platform detection (like OSX vs Linux) and then
download the most recent version of `wasm-pack` from GitHub releases. This
is then extracted, the `wasm-pack` binary is renamed to `wasm-pack-init`,
and then that binary is run. The binary will refuse by default to overwrite
a previous installation, but that can be overridden with the `-f` flag.
3b. On Windows users download a binary. This binary, when run, will pop up a
console window. This window will have the same output as the shell script
installer, and will wait at the end of its execution to ensure the user has
time to read everything.
And... that's it! The deployment process for all this looks like so:
* All CI builds will update the website and shell script (published to
gh-pages). A small script at `docs/installer/build-installer.rs` fills in the
current version number inferred from `Cargo.toml`.
* Tagged CI builds will publish releases, as usual.
* "Pushing a release" is done by bumping the version number in `Cargo.toml`.
When bumped all online installers will now point to the new release. There
will be a window of time, though, when the version number is bumped and the
release hasn't finished building on CI. In this case users will get errors
(unfortunately).
This is all still a work-in-progress and feedback is definitely appreicated and
welcome on all this!
This does a few things, remove Cargo.lock from tracking to make sure
when compiled the newest version is used in a fresh repo. Testing on
one's own will require running an 'rm tests/fixtures/*/Cargo.lock' if
wanting to bump to the newest version of wasm-bindgen. This also sets
all tests to use the latest version of wasm-bindgen in 0.2. This shows
that we support that version (0.2.x) but bumping it to 0.3 means we've
opted for that kind of change, but for now it's not been bumped to that.