Expand document collections with Pretext tutorial and simplify library navigation
Verify and deploy Tabularium / verify-and-deploy (push) Successful in 5m47s

This commit is contained in:
2026-10-28 13:42:51 +08:00
parent 1f3ab5a7ee
commit 2b3b3a1ae4
28 changed files with 1174 additions and 761 deletions
+15 -2
View File
@@ -141,6 +141,9 @@ async function main() {
"/",
"/docs/00-endor-concepts-draft",
"/figures/endor-architecture.svg",
"/docs/pretext/01-chapter",
"/materials/pretext/verify.cjs",
"/materials/pretext/results.chrome156.json",
`/_next/data/${buildId}/index.json`,
`/_next/data/${buildId}/docs/00-endor-concepts-draft.json`,
]) {
@@ -155,7 +158,7 @@ async function main() {
path,
);
}
for (const path of ["/api/private", "/api/unknown"])
for (const path of ["/api/private", "/api/unknown", "/api/search"])
assert.equal((await request(path)).status, 401, path);
assert.equal(
(
@@ -176,13 +179,18 @@ async function main() {
const headers = {
Authorization: "Bearer " + signSession(config, undefined, 600),
};
const searchResponse = await request("/api/search", { headers });
assert.equal(searchResponse.status, 200);
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 = "";
for (const route of routes) {
const response = await request(route, { headers });
assert.equal(response.status, 200, route);
if (route === "/") home = await response.text();
}
assert.ok(home.includes("TABULARIUM"));
assert.ok(home.includes("资料库"));
assert.ok(home.includes("/docs/pretext/00-overview"));
const assets = new Set(
[...home.matchAll(/(?:src|href)="(\/_next\/static\/[^" ]+)"/g)].map((m) =>
m[1].replaceAll("&", "&"),
@@ -191,6 +199,11 @@ async function main() {
assert.ok(assets.size);
for (const path of assets)
assert.equal((await request(path, { headers })).status, 200, path);
for (const name of ["verify.cjs", "results.chrome156.json"]) {
const response = await request("/materials/pretext/" + name, { headers });
assert.equal(response.status, 200, name);
assert.ok((await response.text()).length > 100);
}
for (const name of readdirSync(join(__dirname, "public/figures"))) {
if (!name.endsWith(".svg")) continue;
const response = await request("/figures/" + name, { headers });