Browser host, screenshots, docs, CI, README, LICENSE

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
SpriteandClaude Sonnet 5.5 committed 2026-11-24 23:47:51 +00:00
1 parent e0bde1d150
commit de8abfaa26
17 files changed
+1019 -13

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
/** Loader for browsers: fetches the jco output under <base>/build/. */
export function webLoader(base) {
return async (name) => {
const r = await fetch(`${base}/build/components/${name}.meta.json`);
if (!r.ok) throw new Error(`cannot load ${name}.meta.json: HTTP ${r.status}`);
const meta = await r.json();
const dir = `${base}/build/jco/${name}`;
const mod = await import(`${dir}/${name}.js`);
const getCoreModule = async (p) => {
const res = await fetch(`${dir}/${p}`);
if (!res.ok) throw new Error(`cannot fetch ${p}: HTTP ${res.status}`);
return WebAssembly.compile(await res.arrayBuffer());
};
return { meta, instantiate: (imports) => mod.instantiate(getCoreModule, imports) };
};
}