diff --git a/Cargo.toml b/Cargo.toml index 085ff98..4de839f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ crate-type = ["cdylib"] [dependencies] -seed = "^0.2.7" -wasm-bindgen = "^0.2.33" +seed = "^0.2.9" +wasm-bindgen = "^0.2.37" web-sys = "^0.3.6" # For serialization, eg sending requests to a server. Otherwise, not required. diff --git a/README.md b/README.md index c1c8969..2593456 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,31 @@ -# Seed Quickstart - -**To get started:** -- Clone this repo - -- If you don't have Rust and wasm-bindgen installed, [Download it](https://www.rust-lang.org/tools/install), and run the following commands: - -`rustup update` - -`rustup target add wasm32-unknown-unknown` - -`cargo install wasm-bindgen-cli` - -If you run into errors while installing `wasm-bindgen-cli`, you may need to install a C++ -build chain. On linux, run `sudo apt install build-essential`. On Windows, download and install -[Visual Studio 2017](https://visualstudio.microsoft.com/downloads/); when asked in the installer, -include the C++ workload. - - - Run `build.sh` or `build.ps1`, then then start a dev server that supports WASM. -For example, with [Python](https://www.python.org/downloads/) installed, run `python serve.py`. -(Linux users may need to run `python3 serve.py`.) - -If you run into permission errors on `build.sh`, try this command -to allow executing the file:`chmod +x build.sh`. If you run into persmission errors on `build.ps1`, open Powershell as an administrator, and enter this command: `Set-ExecutionPolicy RemoteSigned`. - -Once you rename the crate in `Cargo.toml` (The `name` field under `[Package]`), make the -following change: - -- Replace `appname` with your new name in either `build.sh`, or `build.ps1`, depending on your -operating system. - +# Seed Quickstart + +**To get started:** +- Clone this repo + +- If you don't have Rust and wasm-bindgen installed, [Download it](https://www.rust-lang.org/tools/install), and run the following commands: + +`rustup update` + +`rustup target add wasm32-unknown-unknown` + +`cargo install wasm-bindgen-cli` + +If you run into errors while installing `wasm-bindgen-cli`, you may need to install a C++ +build chain. On linux, run `sudo apt install build-essential`. On Windows, download and install +[Visual Studio 2017](https://visualstudio.microsoft.com/downloads/); when asked in the installer, +include the C++ workload. + + - Run `build.sh` or `build.ps1`, then then start a dev server that supports WASM. +For example, with [Python](https://www.python.org/downloads/) installed, run `python serve.py`. +(Linux users may need to run `python3 serve.py`.) + +If you run into permission errors on `build.sh`, try this command +to allow executing the file:`chmod +x build.sh`. If you run into persmission errors on `build.ps1`, open Powershell as an administrator, and enter this command: `Set-ExecutionPolicy RemoteSigned`. + +Once you rename the crate in `Cargo.toml` (The `name` field under `[Package]`), make the +following change: + +- Replace `appname` with your new name in either `build.sh`, or `build.ps1`, depending on your +operating system. + diff --git a/build.ps1 b/build.ps1 index 82d62be..a0aa590 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,2 +1,2 @@ -cargo build --target wasm32-unknown-unknown +cargo build --target wasm32-unknown-unknown wasm-bindgen target/wasm32-unknown-unknown/debug/appname.wasm --no-modules --out-dir ./pkg --out-name package \ No newline at end of file diff --git a/build.sh b/build.sh index 381a4af..409b955 100644 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ -#!/usr/bin/env bash -cargo build --target wasm32-unknown-unknown +#!/usr/bin/env bash +cargo build --target wasm32-unknown-unknown wasm-bindgen target/wasm32-unknown-unknown/debug/appname.wasm --no-modules --out-dir ./pkg --out-name package \ No newline at end of file diff --git a/index.html b/index.html index cde8f71..db82dba 100644 --- a/index.html +++ b/index.html @@ -1,36 +1,36 @@ - - -
- - - - - - - - - -