Document reusable review capabilities and publish compressed comic

This commit is contained in:
2026-10-28 18:02:37 +08:00
parent 8be53c1e25
commit c08371647d
13 changed files with 179 additions and 8 deletions
+18
View File
@@ -141,6 +141,7 @@ async function main() {
"/",
"/docs/00-endor-concepts-draft",
"/figures/endor-architecture.svg",
"/figures/endor-review-gate.webp",
"/docs/pretext/01-chapter",
"/materials/pretext/verify.cjs",
"/materials/pretext/results.chrome156.json",
@@ -184,13 +185,30 @@ async function main() {
const searchIndex = await searchResponse.json();
assert.ok(searchIndex.some((doc: { slug: string; searchText: string }) => doc.slug === "pretext/04-chapter" && doc.searchText.includes("getSegmentMetrics")));
let home = "";
let purpose = "";
for (const route of routes) {
const response = await request(route, { headers });
assert.equal(response.status, 200, route);
if (route === "/") home = await response.text();
if (route === "/docs/04-endor-purpose-draft") purpose = await response.text();
}
assert.ok(home.includes("资料库"));
assert.ok(home.includes("/docs/pretext/00-overview"));
// Inline preview and zoom dialog must both use the compressed browser asset.
assert.equal(
[...purpose.matchAll(/<img\b[^>]*\bsrc="\/figures\/endor-review-gate\.webp"/g)].length,
2,
"The comic preview and lightbox must use WebP",
);
assert.ok(!purpose.includes("endor-review-gate.png"));
const comic = await request("/figures/endor-review-gate.webp", { headers });
assert.equal(comic.status, 200);
assert.match(comic.headers.get("content-type") || "", /image\/webp/);
assert.deepEqual(
Buffer.from(await comic.arrayBuffer()),
readFileSync(join(__dirname, "public/figures/endor-review-gate.webp")),
);
assert.equal((await request("/figures/endor-review-gate.png", { headers })).status, 404);
const assets = new Set(
[...home.matchAll(/(?:src|href)="(\/_next\/static\/[^" ]+)"/g)].map((m) =>
m[1].replaceAll("&amp;", "&"),