- Add spec-explorer-data-by-slug helper with _SPEC_SLUG_MAP - _find_spec_file searches spec/, web/, shared/sx/ref/ directories - defpage specs-explore-page uses :data for server-side data fetch - test_evaluator_renders_in_browser: failing test for client-side rendering (client re-evaluates defpage content, find-spec unavailable — pre-existing) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
786 B
JavaScript
19 lines
786 B
JavaScript
const path = require("path");
|
|
const fs = require("fs");
|
|
require(path.join(__dirname, "../_build/default/browser/sx_browser.bc.js"));
|
|
require(path.join(__dirname, "sx-platform.js"));
|
|
const K = globalThis.SxKernel;
|
|
for (const n of ["signals","deps","page-helpers","router","adapter-html"])
|
|
K.loadSource(fs.readFileSync(path.join(__dirname,`../../../web/${n}.sx`),"utf8"));
|
|
K.loadSource(fs.readFileSync("/tmp/comp_defs.txt","utf8"));
|
|
|
|
const pageSx = fs.readFileSync("/tmp/page_sx.txt","utf8");
|
|
const parsed = K.parse(pageSx);
|
|
const html = K.renderToHtml(parsed[0]);
|
|
if (typeof html === "string" && !html.startsWith("Error:")) {
|
|
console.log("SUCCESS! Rendered", html.length, "chars of HTML");
|
|
console.log("Preview:", html.substring(0, 200));
|
|
} else {
|
|
console.log("Error:", html);
|
|
}
|