From ec7356a9d8d0b8246127a2314f22f328b686ee35 Mon Sep 17 00:00:00 2001 From: Lann Martin Date: Sun, 6 Sep 2026 18:03:36 -0400 Subject: [PATCH 1/2] desktop: drop the bundle resource declaration so clippy runs before the component exists tauri-build fails if a declared bundle.resources path is missing, and `just check` runs before `just components`. The app is never bundled; `just desktop` already copies the component beside the binary, which is where resource_dir() points for an unbundled build. --- host/desktop/tauri.conf.json | 7 ------- justfile | 13 +++++-------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/host/desktop/tauri.conf.json b/host/desktop/tauri.conf.json index f3598d2..ef85ca9 100644 --- a/host/desktop/tauri.conf.json +++ b/host/desktop/tauri.conf.json @@ -12,12 +12,5 @@ "security": { "csp": "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src ipc: http://ipc.localhost; object-src 'none'; base-uri 'none'; form-action 'none'; frame-src 'none'" } - }, - "bundle": { - "active": true, - "targets": ["deb", "appimage"], - "resources": { - "../../build/dioxus-todomvc.component.wasm": "components/dioxus-todomvc.component.wasm" - } } } diff --git a/justfile b/justfile index 592ca86..f644b65 100644 --- a/justfile +++ b/justfile @@ -73,14 +73,11 @@ desktop-ui: deno run -A host/desktop/build.ts # Build the Tauri desktop app: the TodoMVC component it embeds, its -# frontend bundle, then the Rust binary. `resource_dir()` in an unbundled -# dev/CI build resolves to the binary's own directory (tauri-utils -# `platform::resource_dir`'s "cargo output directory" case), so the -# component the binary loads via `BaseDirectory::Resource` has to be -# copied there by hand rather than relying on `tauri.conf.json`'s -# `bundle.resources` (that only fires for `cargo tauri build`, which this -# recipe deliberately does not invoke — the dispatch names a plain -# `cargo build --release`). +# frontend bundle, then the Rust binary. The app is never bundled, so the +# component is copied beside the binary by hand: `resource_dir()` is the +# binary's own directory for an unbundled build, and a `bundle.resources` +# entry in tauri.conf.json would make tauri-build fail whenever the +# component has not been built yet (`just check` runs before it has). desktop: host-component desktop-ui cargo build --manifest-path host/Cargo.toml -p stream-dom-desktop --release mkdir -p host/target/release/components From e606260b4fd0462cfc55f10ada0b7ab243cd0299 Mon Sep 17 00:00:00 2001 From: Lann Martin Date: Sun, 6 Sep 2026 18:09:37 -0400 Subject: [PATCH 2/2] just check: bundle the desktop UI first; generate_context! needs frontendDist to exist --- justfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index f644b65..0500be6 100644 --- a/justfile +++ b/justfile @@ -3,9 +3,11 @@ default: check test -# Type-check and lint every workspace (Rust: both cargo workspaces, for the -# component target; TS: receiver + web). -check: +# Type-check and lint every workspace (Rust: the two component workspaces +# for the wasm target, the native host workspace; TS: receiver + web + +# desktop UI). Depends on desktop-ui because tauri's generate_context! +# refuses to compile without the frontendDist directory present. +check: desktop-ui cargo clippy --workspace --target wasm32-wasip2 -- -D warnings cargo clippy --manifest-path guests/web-sys/Cargo.toml --workspace --target wasm32-wasip2 -- -D warnings cargo clippy --manifest-path host/Cargo.toml --workspace -- -D warnings