Expose a JavaScript command API for the browser app (#1713)

Thanks @olup.
This commit is contained in:
Olup authored and GitHub committed 2026-10-17 06:54:16 -04:00
1 parent 40bdc1132e
commit 4193ea26ac
6 files changed
+260 -1

No files matched your search

+5
View File
@@ -60,6 +60,7 @@ commands:
web-offline [DIR]
write the web build's service worker (sw.js: offline use, updates); run by
Trunk after release builds of apps/solidcraft-web, or on a built site in DIR
web-api-test [--site DIR] Test the command API in a real browser build (default: dist/web)
web-offline-test [--site DIR]
check in headless Chrome that the web app works offline and updates to a new
build (a stand-in app, or the web build in DIR such as dist/web)
@@ -97,6 +98,10 @@ fn main() -> ExitCode {
let site = rest.iter().position(|a| *a == "--site").and_then(|i| rest.get(i + 1)).copied();
web_offline_test::run(&root(), site, true)
}
Some("web-api-test") => {
let site = rest.iter().position(|a| *a == "--site").and_then(|i| rest.get(i + 1)).copied().unwrap_or("dist/web");
web_offline_test::run_api(site)
}
Some("-h" | "--help" | "help") | None => {
print!("{USAGE}");
Ok(())