Synchronize, not sure how much is or isn't working

This commit is contained in:
2018-09-08 21:56:06 -04:00
parent 3809114c7f
commit ea9922fa5b
32 changed files with 1980668 additions and 542 deletions

View File

@ -1,3 +1,4 @@
node_modules/
Cargo.lock
target/
target/
dist/

View File

@ -3,6 +3,9 @@ name = "electron_percy_wasm"
version = "0.1.0"
authors = ["Bradlee Speice <bradlee@speice.io>"]
[lib]
crate-type = ["cdylib"]
[dependencies]
percy-webapis = "0.0.1"
virtual-dom-rs = "0.1"

View File

@ -1,4 +0,0 @@
*.wasm
*.bundle.js
bundle.js
electron_percy_wasm.js

View File

@ -1,11 +1,12 @@
DIR="$(dirname $0)"
WASM_DIR="$DIR/target/wasm32-unknown-unknown"
WASM_NAME="$(cat "$DIR/Cargo.toml" | grep name | sed 's/name = "//' | sed 's/"//g')"
APP_DIR="$DIR/app/"
APP_DIR="$DIR/dist/"
if [ ! -d "$APP_DIR" ]; then
mkdir "$APP_DIR"
fi
cp "$DIR/static/"* "$APP_DIR"
if [ -z "$(which cargo)" ]; then
echo 'Must install `cargo` before proceeding. Please see https://rustup.rs/ for more information.'
@ -20,6 +21,5 @@ fi
cargo +nightly build --target=wasm32-unknown-unknown && \
wasm-bindgen "$WASM_DIR/debug/$WASM_NAME.wasm" --out-dir "$APP_DIR" --no-typescript && \
# Have to use --mode=development so we can patch out the call to instantiateStreaming
"$DIR/node_modules/webpack-cli/bin/cli.js" --mode=development "$APP_DIR/app_loader.js" -o "$APP_DIR/bundle.js"
# Necessitated by https://github.com/webpack/webpack/issues/7918
sed -i '/.*instantiateStreaming.*/d' "$APP_DIR/bundle.js"
"$DIR/node_modules/webpack-cli/bin/cli.js" --mode=development "$APP_DIR/app_loader.js" -o "$APP_DIR/bundle.js" && \
sed -i 's/.*instantiateStreaming.*//g' "$APP_DIR/bundle.js"

View File

@ -3,9 +3,9 @@
"productName": "electron_percy_wasm",
"version": "1.0.0",
"description": "My Electron application description",
"main": "app/index.js",
"main": "dist/index.js",
"scripts": {
"prestart": "./build_wasm_bundle.sh",
"prestart": "./build.sh",
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",