diff --git a/ci/build_examples.sh b/ci/build_examples.sh deleted file mode 100755 index 9a49eef1c19..00000000000 --- a/ci/build_examples.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -# Script to build all examples in yew/examples -# -# Not building yew-router nor yewtil examples - -# src: https://gist.github.com/fbucek/f986da3cc3a9bbbd1573bdcb23fed2e1 -set -e # error -> trap -> exit -function info() { echo -e "[\033[0;34m $@ \033[0m]"; } # blue: [ info message ] -function fail() { FAIL="true"; echo -e "[\033[0;31mFAIL\033[0m] $@"; } # red: [FAIL] -trap 'LASTRES=$?; LAST=$BASH_COMMAND; if [[ LASTRES -ne 0 ]]; then fail "Command: \"$LAST\" exited with exit code: $LASTRES"; elif [ "$FAIL" == "true" ]; then fail finished with error; else echo -e "[\033[0;32m Finished $@ \033[0m]";fi' EXIT -SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # this source dir - -cd $SRCDIR/../examples # switch to examples folder - -for EXAMPLE in * -do - if [[ $EXAMPLE == static ]] || [[ $EXAMPLE == server ]] || [[ $EXAMPLE == target ]]; then - echo -e "Skipping folder: $EXAMPLE" - elif [ -d ${EXAMPLE} ]; then - ./build.sh ${EXAMPLE} $@ - fi -done diff --git a/examples/.gitignore b/examples/.gitignore new file mode 100644 index 00000000000..3dd4131ef4b --- /dev/null +++ b/examples/.gitignore @@ -0,0 +1,5 @@ +*/static/package.json +*/static/wasm_bg.wasm +*/static/wasm_bg.d.ts +*/static/wasm.d.ts +*/static/wasm.js diff --git a/examples/README.md b/examples/README.md index 997b94c9201..c794b30ba5c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -16,8 +16,7 @@ Have a look at Yew's [starter templates](https://yew.rs/docs/getting-started/sta ```sh git clone https://github.com/yewstack/yew.git cd yew/examples -./build.sh minimal # example subfolder -cd static && python3 -m http.server # open localhost:8000 in browser +./run_example.sh minimal # builds and opens the "minimal" example in browser ``` diff --git a/examples/js_callback/static/index.html b/examples/js_callback/static/index.html index 8e47c484fcc..71c70493589 100644 --- a/examples/js_callback/static/index.html +++ b/examples/js_callback/static/index.html @@ -2,10 +2,13 @@
-