diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 0000000..3eb1314 --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,27 @@ +name: Playwright Tests +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install dependencies + run: npm ci + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Run Playwright tests + run: npx playwright test + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 diff --git a/.gitignore b/.gitignore index 0cccd58..c2c6b60 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,11 @@ node_modules dist # no need to include @material/web bundled in the repo -md-web \ No newline at end of file +# md-web + +# Playwright +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ +/playwright/.auth/ diff --git a/Cargo.lock b/Cargo.lock index 01c4993..b228a6a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -59,6 +59,12 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +[[package]] +name = "boolinator" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" + [[package]] name = "builder" version = "0.1.0" @@ -722,6 +728,15 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +[[package]] +name = "matdemo" +version = "0.1.0" +dependencies = [ + "material-yew", + "wasm-bindgen", + "yew", +] + [[package]] name = "material-yew" version = "0.1.0" @@ -1236,6 +1251,7 @@ dependencies = [ "quote", "syn 2.0.58", "textwrap", + "wasm-bindgen", "yew", "yew-router", ] @@ -1346,7 +1362,8 @@ dependencies = [ [[package]] name = "yew" version = "0.21.0" -source = "git+https://github.com/yewstack/yew#e9739fc9ce4944ba93c77a32072551ab771a2cda" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f1a03f255c70c7aa3e9c62e15292f142ede0564123543c1cc0c7a4f31660cac" dependencies = [ "console_error_panic_hook", "futures", @@ -1370,8 +1387,10 @@ dependencies = [ [[package]] name = "yew-macro" version = "0.21.0" -source = "git+https://github.com/yewstack/yew#e9739fc9ce4944ba93c77a32072551ab771a2cda" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fd8ca5166d69e59f796500a2ce432ff751edecbbb308ca59fd3fe4d0343de2" dependencies = [ + "boolinator", "once_cell", "prettyplease", "proc-macro-error", @@ -1383,7 +1402,8 @@ dependencies = [ [[package]] name = "yew-router" version = "0.18.0" -source = "git+https://github.com/yewstack/yew#e9739fc9ce4944ba93c77a32072551ab771a2cda" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca1d5052c96e6762b4d6209a8aded597758d442e6c479995faf0c7b5538e0c6" dependencies = [ "gloo 0.10.0", "js-sys", @@ -1401,7 +1421,8 @@ dependencies = [ [[package]] name = "yew-router-macro" version = "0.18.0" -source = "git+https://github.com/yewstack/yew#e9739fc9ce4944ba93c77a32072551ab771a2cda" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42bfd190a07ca8cfde7cd4c52b3ac463803dc07323db8c34daa697e86365978c" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 2a9814c..32b2247 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,16 +9,18 @@ edition = "2021" indexmap = "2.0.2" js-sys = "0.3.64" wasm-bindgen = "0.2.87" -yew = { git = "https://github.com/yewstack/yew", features = ["csr"] } +yew = { version = "0.21", features = ["csr"] } [dependencies.web-sys] version = "0.3.64" features = [ - "HtmlFormElement" + "HtmlFormElement", + "CustomEvent" ] [workspace] members = [ "build", - "usages" + "usages", + "matdemo" ] diff --git a/build/README.md b/build/README.md index a05c1cd..18d3217 100644 --- a/build/README.md +++ b/build/README.md @@ -5,8 +5,8 @@ Generates Rust wrapper for a component from material-web. ## Updating material web submodule 1. Update the submodule to the latest version: `git submodule update --recursive --remote build/material-web` -2. Checkout the new tag: `cd build/material-web && git checkout v1.4.0` -3. Update the submodule reference in the main repository: `git add build/material-web && git commit -m "pin build/material web to v1.4.0"` +2. Checkout the new tag: `cd build/material-web && git checkout v2.4.0` +3. Update the submodule reference in the main repository: `git add build/material-web && git commit -m "pin build/material web to v2.4.0"` 4. Update build/package.json with the tag used in step 2 5. Run `npm install` in the build directory 6. Run `npm run build` in the build directory diff --git a/build/index.html b/build/index.html index 40245e0..2358b74 100644 --- a/build/index.html +++ b/build/index.html @@ -6,7 +6,7 @@ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">