0.1.0-1-alpha.2-fix.2

This commit is contained in:
2026-09-17 00:25:37 +02:00
parent f8b93050d8
commit 37a00b3c2b
35 changed files with 620 additions and 181 deletions

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env python3
# file: scripts/build_reflex_tauri_wasm.py
# version: 1
# version: 2
"""Build the Reflex WASM adapter and generate browser bindings for the local Tauri frontend."""
"""Build the dedicated Reflex WASM adapter for the Vite/Tauri frontend."""
from __future__ import annotations
@@ -12,15 +12,15 @@ import sys
def main() -> int:
"""Build the WASM library and run wasm-bindgen into the committed Tauri frontend directory."""
"""Build the WASM crate and generate browser bindings inside the Tauri frontend."""
root = pathlib.Path(__file__).resolve().parent.parent
target_dir = root.parent / "builds" / "sasedev-games" / "target"
wasm_path = target_dir / "wasm32-unknown-unknown" / "debug" / "game_reflex_poc_tauri.wasm"
output_dir = root / "Tauri" / "game-reflex-poc" / "frontend"
wasm_path = target_dir / "wasm32-unknown-unknown" / "debug" / "game_reflex_poc_wasm.wasm"
output_dir = root / "crates" / "apps" / "game-reflex-poc-tauri" / "frontend" / "wasm"
build = subprocess.run(
["cargo", "build", "-p", "game-reflex-poc-tauri", "--lib", "--target", "wasm32-unknown-unknown"],
["cargo", "build", "-p", "game-reflex-poc-wasm", "--target", "wasm32-unknown-unknown"],
cwd=root,
check=False,
)
@@ -30,6 +30,7 @@ def main() -> int:
print(f"WASM artifact not found: {wasm_path}", file=sys.stderr)
return 2
output_dir.mkdir(parents=True, exist_ok=True)
bindings = subprocess.run(
[
"wasm-bindgen",
@@ -39,8 +40,7 @@ def main() -> int:
"--out-dir",
str(output_dir),
"--out-name",
"game_reflex_poc_tauri",
"--no-typescript",
"game_reflex_poc_wasm",
],
cwd=root,
check=False,
@@ -48,7 +48,7 @@ def main() -> int:
if bindings.returncode != 0:
return bindings.returncode
print(f"Reflex Tauri WASM frontend generated in {output_dir}")
print(f"Reflex WASM bindings generated in {output_dir}")
return 0