diff --git a/Makefile b/Makefile index 98ae61a4..8c86e3ec 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,9 @@ clippy-fix: fmt: docker compose -f docker/docker-compose.yaml run yew-ui bash -c "cd /app/yew-ui && cargo fmt" - docker compose -f docker/docker-compose.yaml run websocket-api bash -c "cd /app/actix-api && cargo fmt" + docker compose -f docker/docker-compose.yaml run websocket-api bash -c "cd /app/actix-api && cargo fmt"" check: docker compose -f docker/docker-compose.yaml run websocket-api bash -c "cd /app/actix-api && cargo clippy --all -- --deny warnings && cargo fmt --check" docker compose -f docker/docker-compose.yaml run yew-ui bash -c "cd /app/yew-ui && cargo clippy --all -- --deny warnings && cargo fmt --check" + # docker compose -f docker/docker-compose.yaml run website bash -c "cd /app/leptos-website && cargo clippy --features ssr --all -- --deny warnings" \ No newline at end of file diff --git a/docker/Dockerfile.website.dev b/docker/Dockerfile.website.dev new file mode 100644 index 00000000..5e3ddc98 --- /dev/null +++ b/docker/Dockerfile.website.dev @@ -0,0 +1,16 @@ +FROM rust:1.80-slim-bookworm as builder + +RUN rustup default nightly-2024-08-21 +RUN rustup target add wasm32-unknown-unknown + +RUN apt-get update && apt-get install -y \ + libssl-dev \ + pkg-config \ + g++ \ + && rm -rf /var/lib/apt/lists/* + +RUN cargo install cargo-leptos --version 0.2.20 + +WORKDIR /app + + diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 7c8ee548..5fdc7d1a 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -9,8 +9,6 @@ services: - /app/target - rustlemania-yew-ui-cargo-registry-cache:/usr/local/cargo/registry - rustlemania-yew-ui-cache:/app/yew-ui/target - - build: dockerfile: ../docker/Dockerfile.yew working_dir: /app/yew-ui @@ -29,6 +27,23 @@ services: ports: - "${TRUNK_SERVE_PORT:-80}:${TRUNK_SERVE_PORT:-80}" + website: + volumes: + - type: bind + source: ../ + target: /app + - /app/target + - rustlemania-leptos-ui-cargo-registry-cache:/usr/local/cargo/registry + - rustlemania-leptos-ui-cache:/app/leptos-website/target + build: + dockerfile: ../docker/Dockerfile.website.dev + working_dir: /app/leptos-website + command: bash -c "trunk serve --address 0.0.0.0 --port ${TRUNK_SERVE_PORT:-80}" + environment: + - LEPTOS_SITE_ADDR="0.0.0.0:91" + ports: + - "91:91" + websocket-api: build: dockerfile: ../docker/Dockerfile.actix @@ -117,3 +132,5 @@ volumes: rustlemania-actix-web-target-cache: rustlemania-actix-webtransport-cache: rustlemania-yew-ui-cache: + rustlemania-leptos-ui-cargo-registry-cache: + rustlemania-leptos-ui-cache: diff --git a/leptos-website/rust-toolchain.toml b/leptos-website/rust-toolchain.toml new file mode 100644 index 00000000..55b2509b --- /dev/null +++ b/leptos-website/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly-2023-12-01" \ No newline at end of file diff --git a/leptos-website/src/app.rs b/leptos-website/src/app.rs index fe7175c9..28229350 100644 --- a/leptos-website/src/app.rs +++ b/leptos-website/src/app.rs @@ -21,7 +21,6 @@ pub fn App() -> impl IntoView { - - } } diff --git a/leptos-website/src/components/HeroHeader.rs b/leptos-website/src/components/HeroHeader.rs index 3065f75b..980c8862 100644 --- a/leptos-website/src/components/HeroHeader.rs +++ b/leptos-website/src/components/HeroHeader.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use crate::components::SphereLogo::*; use leptos::*; use leptos_meta::Style; diff --git a/leptos-website/src/error_template.rs b/leptos-website/src/error_template.rs index 6f6c133e..df257b56 100644 --- a/leptos-website/src/error_template.rs +++ b/leptos-website/src/error_template.rs @@ -1,5 +1,4 @@ use crate::errors::TodoAppError; -use cfg_if::cfg_if; use leptos::{Errors, *}; #[cfg(feature = "ssr")] use leptos_axum::ResponseOptions; diff --git a/leptos-website/src/pages/Home.rs b/leptos-website/src/pages/Home.rs index 480a5c41..913dee2f 100644 --- a/leptos-website/src/pages/Home.rs +++ b/leptos-website/src/pages/Home.rs @@ -1,11 +1,5 @@ -use crate::components::CodeExample::*; -use crate::components::ExampleServerFunction::*; -use crate::components::ExampleTailwind::*; -use crate::components::FeatureList::*; use crate::components::HeroHeader::*; -use crate::components::InteractiveCodeExample::*; use crate::components::Page::*; -use crate::components::SpeedStats::*; use leptos::*; use leptos_meta::*; diff --git a/yew-ui/index.html b/yew-ui/index.html index 438f8be4..48cbb73f 100644 --- a/yew-ui/index.html +++ b/yew-ui/index.html @@ -2,7 +2,7 @@ - Rusty Conf + VideoCall.rs @@ -12,7 +12,6 @@ var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["setDocumentTitle", document.domain + "/" + document.title]); - _paq.push(["setCookieDomain", "*.videocall.rs"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { diff --git a/yew-ui/src/components/matomo.rs b/yew-ui/src/components/matomo.rs index 2d3fefdd..23e9d525 100644 --- a/yew-ui/src/components/matomo.rs +++ b/yew-ui/src/components/matomo.rs @@ -1,3 +1,5 @@ +#![allow(non_upper_case_globals)] + use gloo_utils::window; use js_sys::Array; use js_sys::Reflect; @@ -8,7 +10,7 @@ use web_sys::js_sys; #[wasm_bindgen] extern "C" { #[wasm_bindgen(js_namespace = window)] - static _PAQ: Array; + static _paq: Array; } pub struct MatomoTracker {} @@ -19,7 +21,7 @@ impl MatomoTracker { } pub fn push(&self, args: &JsValue) { - let method: js_sys::Function = js_sys::Reflect::get(&_PAQ, &"push".into()).unwrap().into(); + let method: js_sys::Function = js_sys::Reflect::get(&_paq, &"push".into()).unwrap().into(); let _ = method.call1(&JsValue::NULL, args); } diff --git a/yew-ui/static/tailwind.css b/yew-ui/static/tailwind.css index e2831f37..4f8287ff 100644 --- a/yew-ui/static/tailwind.css +++ b/yew-ui/static/tailwind.css @@ -1,5 +1,5 @@ /* -! tailwindcss v3.4.7 | MIT License | https://tailwindcss.com +! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com */ /*