@mark1russell7/site-pages 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/build/cli.js +20 -8
- package/build/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -171,6 +171,7 @@ site-pages cue --out dist
|
|
|
171
171
|
- A code block that is wider than its box shows a fade at the edge with more content. A block that is not wider shows no cue.
|
|
172
172
|
- A block with `data-overflow-ok` or with the class `scroll-cue` stays as it is. The text of `script`, `style` and `textarea` does not change.
|
|
173
173
|
- In a browser with no scroll timelines, a small script gives `--scroll-cue-bg` the background color of the block. Thus the block keeps the color of its theme.
|
|
174
|
+
- A script of a page can make a code block in the browser, for example from Markdown. Thus a page with a script of its own also gets the style and a small script. That script gives the cue to each code block that the page makes, by the same rules.
|
|
174
175
|
- The command can start two times on one folder. The second start gives the same pages.
|
|
175
176
|
|
|
176
177
|
In `reusable-pages.yml`, the input `scroll-cue` (default `true`) starts the command before the site check and the upload.
|
package/build/cli.js
CHANGED
|
@@ -232,6 +232,10 @@ function runBarCli(argv, io) {
|
|
|
232
232
|
* occurs also on a site that does not use the rehype plugin of site-pages. A box with no overflow has no active scroll
|
|
233
233
|
* timeline, so it shows no cue.
|
|
234
234
|
*
|
|
235
|
+
* A script of the page can make a code block after the load, for example from Markdown or from a template string. Thus
|
|
236
|
+
* each page with a script of its own also gets the style and a script. That script gives the cue to each code block
|
|
237
|
+
* that the page adds.
|
|
238
|
+
*
|
|
235
239
|
* A block with `data-overflow-ok` or with the class `scroll-cue` stays as it is. The text of `script`, `style` and
|
|
236
240
|
* `textarea` elements does not change.
|
|
237
241
|
*/
|
|
@@ -246,12 +250,15 @@ function cueCss() {
|
|
|
246
250
|
return readFileSync(new URL("../../styles/scroll-cue.css", import.meta.url), "utf8");
|
|
247
251
|
}
|
|
248
252
|
/**
|
|
249
|
-
* The script of
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
+
* The script of the cue in the browser. It has two jobs.
|
|
254
|
+
*
|
|
255
|
+
* - It gives the cue to each code block that a script of the page makes, at the start and after it. The rules of
|
|
256
|
+
* `cueAttributes` apply: a block with `data-overflow-ok` or with the class `scroll-cue` of the page stays as it is.
|
|
257
|
+
* - In a browser with no scroll timelines, the style gives the box the background color `--scroll-cue-bg`. The script
|
|
258
|
+
* sets that variable to the color of each block with the mark. When the block has no color, the script uses the color
|
|
259
|
+
* of its first ancestor with a color. Thus the block keeps the color of its theme.
|
|
253
260
|
*/
|
|
254
|
-
const CUE_SCRIPT = `(() => {
|
|
261
|
+
const CUE_SCRIPT = `(() => { const old = !!window.CSS && !CSS.supports("animation-timeline: scroll()"); const paint = (box) => { box.classList.remove("scroll-cue"); let node = box; let color = ""; while (node) { color = getComputedStyle(node).backgroundColor; if (color !== "transparent" && !/^rgba\\(.*,\\s*0\\)\$/.test(color)) break; node = node.parentElement; } box.classList.add("scroll-cue"); if (node) box.style.setProperty("--scroll-cue-bg", color); }; const cue = (box) => { if (box.hasAttribute("data-overflow-ok")) return; if (!box.hasAttribute("${CUE_ATTRIBUTE}")) { if (box.classList.contains("scroll-cue")) return; box.classList.add("scroll-cue"); if (!box.hasAttribute("tabindex")) box.tabIndex = 0; box.setAttribute("${CUE_ATTRIBUTE}", ""); } if (old) paint(box); }; const scan = (root) => { if (root.nodeType !== 1) return; if (root.matches("pre")) cue(root); for (const box of root.querySelectorAll("pre")) cue(box); }; scan(document.documentElement); new MutationObserver((records) => { for (const record of records) for (const node of record.addedNodes) scan(node); }).observe(document.documentElement, { childList: true, subtree: true }); })();`;
|
|
255
262
|
const CLASS_PATTERN = /\sclass\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/i;
|
|
256
263
|
/**
|
|
257
264
|
* This function gives the attributes of one `pre` start tag with the cue. It gives `undefined` when the tag keeps its
|
|
@@ -269,10 +276,14 @@ function cueAttributes(attributes) {
|
|
|
269
276
|
}
|
|
270
277
|
/** The text of these elements is not HTML, so the step does not change it. */
|
|
271
278
|
const RAW_TEXT = /<(script|style|textarea)\b[\s\S]*?<\/\1\s*>/gi;
|
|
279
|
+
/** A script element that can make a code block: each script, but not a JSON data block. */
|
|
280
|
+
const PAGE_SCRIPT = /<script\b(?![^>]*\btype\s*=\s*["']?application\/(?:ld\+)?json)[^>]*>/i;
|
|
272
281
|
/**
|
|
273
282
|
* This function writes the cue into the HTML of one page, and gives the HTML and the number of code blocks that it
|
|
274
283
|
* changed. The style comes last in `<head>`, and the script comes last in `<body>`. A style and a script of an earlier
|
|
275
|
-
* start go away, so the function can start two times on one page.
|
|
284
|
+
* start go away, so the function can start two times on one page. The script of a page can make a code block. Thus a
|
|
285
|
+
* page with a script of its own gets the style and the script also with no changed block. A page with no changed block
|
|
286
|
+
* and no script gets no style.
|
|
276
287
|
*/
|
|
277
288
|
function injectCue(html, css) {
|
|
278
289
|
let boxes = 0;
|
|
@@ -290,7 +301,7 @@ function injectCue(html, css) {
|
|
|
290
301
|
at = raw.index + raw[0].length;
|
|
291
302
|
}
|
|
292
303
|
out += edit(source.slice(at));
|
|
293
|
-
if (!(boxes > 0 || source.includes(` data-scroll-cue`))) return {
|
|
304
|
+
if (!(boxes > 0 || source.includes(` data-scroll-cue`) || PAGE_SCRIPT.test(source))) return {
|
|
294
305
|
html,
|
|
295
306
|
boxes: 0
|
|
296
307
|
};
|
|
@@ -329,7 +340,8 @@ const CUE_HELP = `Usage: site-pages cue --out <dir>
|
|
|
329
340
|
Gives each code block (pre) of each HTML page of the built site folder the class scroll-cue and a
|
|
330
341
|
place in the tab order, and writes the style scroll-cue.css into each changed page. A code block that
|
|
331
342
|
is wider than its box then shows a fade at the edge with more content. A block with the attribute
|
|
332
|
-
data-overflow-ok or the class scroll-cue stays as it is.
|
|
343
|
+
data-overflow-ok or the class scroll-cue stays as it is. A page with a script also gets a script that
|
|
344
|
+
gives the cue to each code block that the page makes in the browser.
|
|
333
345
|
|
|
334
346
|
Options:
|
|
335
347
|
--out <dir> The built site folder
|
package/build/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":["STYLE_ID","STYLE_PATTERN"],"sources":["../src/bar/bar.ts","../src/bar/cue.ts","../src/check/browser.ts","../src/check/measure.ts","../src/check/serve.ts","../src/check/check.ts","../src/check/nav.ts","../src/cli.ts"],"sourcesContent":["/**\n * The shared site bar (`site-pages bar`). The Pages workflow writes one bar into each built HTML page of a site.\n * Thus each page of each site has the same way to each other page, and no site writes its own bar.\n *\n * The bar has the portfolio of the owner and the name of the site. It also has a link to each page of the site, to\n * GitHub and to npm. The link of the current page has `aria-current=\"page\"`. The bar works at 360 px: its rows wrap.\n * Its CSS has its own class names and variables, so the CSS of a site does not change it.\n */\n\nimport { readdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport { parseArgs } from \"node:util\";\nimport { escapeHtml, safeUrl } from \"../render/html.ts\";\n\n/** One link of the bar to a page of the site. */\nexport interface BarPage {\n readonly label: string;\n /** The path from the site home, for example `docs/`. The home is an empty text. */\n readonly path: string;\n}\n\n/** The content of the bar. */\nexport interface BarOptions {\n /** \"owner/name\" of the repository on GitHub. */\n readonly repository: string;\n /** The path of the site home, with a `/` at the start and at the end. */\n readonly base: string;\n /** The name of the site. The default is the name of the repository. */\n readonly siteName?: string | undefined;\n /** The pages of the site, after the home and before Releases and Status. */\n readonly pages: readonly BarPage[];\n /** True when the site has the Releases page and the Status page of site-pages. */\n readonly sitePages: boolean;\n /** The npm name of the package of the site, or undefined for no npm link. */\n readonly npm?: string | undefined;\n /** The URL of the portfolio of the owner, or undefined for no portfolio link. */\n readonly portfolio?: string | undefined;\n}\n\n/** The marker attribute of the bar. The navigation crawl looks for it. */\nexport const BAR_ATTRIBUTE = \"data-site-bar\";\n\n/** The CSS of the bar. Each rule starts with `.spb`, so it changes only the bar. */\nexport const BAR_CSS = `\n.spb{--spb-bg:#ffffff;--spb-fg:#151c2e;--spb-muted:#5f6880;--spb-rule:#d6dbe5;--spb-accent:#2346c4;--spb-wash:#e7ecfd;\ncolor-scheme:light;position:relative;z-index:2147483000;display:block;margin:0;padding:0;background:var(--spb-bg);color:var(--spb-fg);\nborder-bottom:1px solid var(--spb-rule);font:400 14px/1.4 system-ui,-apple-system,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif;\ntext-align:left;letter-spacing:normal;text-transform:none}\n@media (prefers-color-scheme:dark){.spb{--spb-bg:#151a2b;--spb-fg:#e6e9f3;--spb-muted:#a3abc2;--spb-rule:#2b3350;--spb-accent:#93abff;--spb-wash:#1f2a4f;color-scheme:dark}}\n:root[data-theme=\"dark\"] .spb,:root.dark .spb{--spb-bg:#151a2b;--spb-fg:#e6e9f3;--spb-muted:#a3abc2;--spb-rule:#2b3350;--spb-accent:#93abff;--spb-wash:#1f2a4f;color-scheme:dark}\n:root[data-theme=\"light\"] .spb,:root.light .spb{--spb-bg:#ffffff;--spb-fg:#151c2e;--spb-muted:#5f6880;--spb-rule:#d6dbe5;--spb-accent:#2346c4;--spb-wash:#e7ecfd;color-scheme:light}\n.spb *{box-sizing:border-box;margin:0;padding:0;font:inherit;letter-spacing:inherit}\n.spb-in{max-width:80rem;margin:0 auto;padding:6px 12px;display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px}\n.spb-id{display:flex;align-items:center;gap:6px;min-width:0;margin-right:auto}\n.spb-id a{color:var(--spb-fg);text-decoration:none;border-radius:4px;overflow-wrap:anywhere}\n.spb-owner{color:var(--spb-muted)!important}\n.spb-site{font-weight:700}\n.spb-id a:hover,.spb-links a:hover{text-decoration:underline;text-underline-offset:3px}\n.spb-sep{color:var(--spb-muted)}\n.spb-links{display:flex;flex-wrap:wrap;align-items:center;gap:2px;list-style:none}\n.spb-links a{display:inline-block;padding:4px 8px;min-height:32px;line-height:24px;border-radius:6px;color:var(--spb-accent);text-decoration:none;white-space:nowrap}\n.spb-links a[aria-current=\"page\"]{background:var(--spb-wash);color:var(--spb-fg);font-weight:600}\n.spb-out{color:var(--spb-muted)!important}\n.spb a:focus-visible{outline:2px solid var(--spb-accent);outline-offset:1px}\n@media print{.spb{display:none}}\n`;\n\n/** This function gives the path of a page from the site home, with no `index.html`. The home is an empty text. */\nexport function pagePath(file: string): string {\n return file.split(sep).join(\"/\").replace(/(^|\\/)index\\.html$/, \"$1\");\n}\n\n/**\n * This function gives the link of the bar that is the current page: the link with the longest path that starts the\n * page path. The home link is current only on the home page.\n */\nexport function currentLink(links: readonly BarPage[], path: string): BarPage | undefined {\n let best: BarPage | undefined;\n for (const entry of links) {\n const match = entry.path === \"\" ? path === \"\" : path === entry.path || (entry.path.endsWith(\"/\") && path.startsWith(entry.path));\n if (match && (best === undefined || entry.path.length > best.path.length)) best = entry;\n }\n return best;\n}\n\n/** This function gives the links of the bar to the pages of the site, in order: the home, the pages, Releases and Status. */\nexport function barPages(options: BarOptions): BarPage[] {\n const pages: BarPage[] = [{ label: \"Home\", path: \"\" }, ...options.pages.filter((entry) => entry.path !== \"\")];\n if (options.sitePages) pages.push({ label: \"Releases\", path: \"releases/\" }, { label: \"Status\", path: \"status/\" });\n const seen = new Set<string>();\n return pages.filter((entry) => {\n if (seen.has(entry.path)) return false;\n seen.add(entry.path);\n return true;\n });\n}\n\n/** This function gives the HTML of the bar for the page at `path`. */\nexport function barHtml(options: BarOptions, path: string): string {\n const [owner = \"\", name = \"\"] = options.repository.split(\"/\");\n const href = (page: string) => escapeHtml(`${options.base}${page}`);\n const pages = barPages(options);\n const current = currentLink(pages, path);\n const portfolio = options.portfolio === undefined ? undefined : safeUrl(options.portfolio);\n const id = [\n portfolio ? `<a class=\"spb-owner\" href=\"${escapeHtml(portfolio)}\">${escapeHtml(owner)}</a><span class=\"spb-sep\" aria-hidden=\"true\">/</span>` : \"\",\n `<a class=\"spb-site\" href=\"${href(\"\")}\">${escapeHtml(options.siteName ?? name)}</a>`,\n ].join(\"\");\n const links = pages.map((entry) => {\n const mark = entry === current ? ' aria-current=\"page\"' : \"\";\n return `<li><a href=\"${href(entry.path)}\" target=\"_self\"${mark}>${escapeHtml(entry.label)}</a></li>`;\n });\n links.push(`<li><a class=\"spb-out\" href=\"https://github.com/${escapeHtml(options.repository)}\">GitHub</a></li>`);\n if (options.npm) links.push(`<li><a class=\"spb-out\" href=\"https://www.npmjs.com/package/${escapeHtml(options.npm)}\">npm</a></li>`);\n return `<nav class=\"spb\" ${BAR_ATTRIBUTE} aria-label=\"Site\"><div class=\"spb-in\"><div class=\"spb-id\">${id}</div><ul class=\"spb-links\">${links.join(\"\")}</ul></div></nav>`;\n}\n\nconst BAR_PATTERN = /\\n?<nav class=\"spb\" data-site-bar[\\s\\S]*?<\\/ul><\\/div><\\/nav>/;\nconst STYLE_ID = \"site-bar-css\";\nconst STYLE_PATTERN = /<style id=\"site-bar-css\">[\\s\\S]*?<\\/style>/;\n// The header of the Releases page and the Status page of site-pages. The bar takes its place.\nconst SP_HEADER_PATTERN = /<header class=\"sp-header\">[\\s\\S]*?<\\/header>\\n?/;\n\n/**\n * This function writes the bar into the HTML of one page. The bar comes first in `<body>`, and its CSS comes last in\n * `<head>`. A bar from an earlier start goes away, so the function can start two times on one page. The header of a\n * page of site-pages also goes away. The function gives the HTML with no change when the page has no `<body>`.\n */\nexport function injectBar(html: string, bar: string): string {\n const body = /<body\\b[^>]*>/i.exec(html);\n if (body === null) return html;\n let out = html.replace(STYLE_PATTERN, \"\").replace(BAR_PATTERN, \"\").replace(SP_HEADER_PATTERN, \"\");\n const style = `<style id=\"${STYLE_ID}\">${BAR_CSS}</style>`;\n out = /<\\/head>/i.test(out) ? out.replace(/<\\/head>/i, `${style}</head>`) : out.replace(/<body\\b[^>]*>/i, (tag) => `${style}${tag}`);\n return out.replace(/<body\\b[^>]*>/i, (tag) => `${tag}\\n${bar}`);\n}\n\n/** This function gives the HTML files of a folder, as paths from the folder, in a stable order. */\nexport function htmlFiles(root: string): string[] {\n const files: string[] = [];\n const walk = (folder: string) => {\n for (const entry of readdirSync(folder, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {\n const full = join(folder, entry.name);\n if (entry.isDirectory()) walk(full);\n else if (entry.isFile() && entry.name.endsWith(\".html\")) files.push(relative(root, full));\n }\n };\n walk(root);\n return files;\n}\n\n/** This function writes the bar into each HTML page of the built site folder, and gives the number of pages. */\nexport function applyBar(out: string, options: BarOptions): number {\n const files = htmlFiles(out);\n for (const file of files) {\n const full = join(out, file);\n const html = readFileSync(full, \"utf8\");\n const next = injectBar(html, barHtml(options, pagePath(file)));\n if (next !== html) writeFileSync(full, next);\n }\n return files.length;\n}\n\n/** The input and output of the CLI. */\nexport interface BarIo {\n cwd: string;\n env: NodeJS.ProcessEnv;\n stdout: (text: string) => void;\n stderr: (text: string) => void;\n}\n\nexport const BAR_HELP = `Usage: site-pages bar --out <dir> [options]\n\nWrites the shared site bar into each HTML page of the built site folder. The bar comes first in the\nbody of the page. It has the portfolio of the owner, the name of the site, a link to each page of\nthe site, GitHub and npm. The bar takes the place of the header of the pages of site-pages.\n\nOptions:\n --out <dir> The built site folder\n --repo <owner/name> The GitHub repository (default: $GITHUB_REPOSITORY)\n --base </name/> The path of the site home (default: \"/<name>/\", or \"/\" for <owner>.github.io)\n --site-name <name> The name of the site in the bar (default: the name of the repository)\n --pages <list> The pages of the site after the home, as label=path pairs separated by\n commas, for example \"Demo=demo/,Docs=docs/\"\n --site-pages Adds the links to releases/ and status/\n --npm <name> The npm name of the package, for the npm link\n --portfolio <url> The portfolio of the owner (default: https://<owner>.github.io/, and no\n portfolio link on the site <owner>.github.io)\n --help Shows this text\n`;\n\n/** This function parses the value of `--pages`. It gives an Error for a pair with no label or no path. */\nexport function parsePages(text: string): BarPage[] | Error {\n const pages: BarPage[] = [];\n for (const pair of text.split(\",\").map((entry) => entry.trim()).filter(Boolean)) {\n const at = pair.indexOf(\"=\");\n const label = at < 0 ? \"\" : pair.slice(0, at).trim();\n const path = at < 0 ? \"\" : pair.slice(at + 1).trim().replace(/^\\/+/, \"\");\n if (label === \"\" || path === \"\" || path.includes(\":\") || path.includes(\"\\\\\")) return new Error(`\"${pair}\" is not a pair of a label and a path from the site home, for example Docs=docs/`);\n pages.push({ label, path });\n }\n return pages;\n}\n\n/** This function starts the `bar` command with its arguments, without the word `bar`. */\nexport function runBarCli(argv: readonly string[], io: BarIo): number {\n let values: Record<string, string | boolean | undefined>;\n try {\n ({ values } = parseArgs({\n args: [...argv],\n allowPositionals: false,\n options: {\n out: { type: \"string\" },\n repo: { type: \"string\" },\n base: { type: \"string\" },\n \"site-name\": { type: \"string\" },\n pages: { type: \"string\" },\n \"site-pages\": { type: \"boolean\" },\n npm: { type: \"string\" },\n portfolio: { type: \"string\" },\n help: { type: \"boolean\" },\n },\n }));\n } catch (error) {\n io.stderr(`site-pages bar: ${error instanceof Error ? error.message : String(error)}\\n\\n${BAR_HELP}`);\n return 2;\n }\n if (values[\"help\"]) {\n io.stdout(BAR_HELP);\n return 0;\n }\n const usage = (message: string) => {\n io.stderr(`site-pages bar: ${message}\\n\\n${BAR_HELP}`);\n return 2;\n };\n const text = (key: string) => (typeof values[key] === \"string\" && values[key] !== \"\" ? (values[key] as string) : undefined);\n const out = text(\"out\");\n if (out === undefined) return usage(\"give --out\");\n const repository = text(\"repo\") ?? io.env[\"GITHUB_REPOSITORY\"] ?? \"\";\n const [owner = \"\", name = \"\"] = repository.split(\"/\");\n if (owner === \"\" || name === \"\") return usage(\"give --repo <owner/name> or set GITHUB_REPOSITORY\");\n const ownerSite = name.toLowerCase() === `${owner.toLowerCase()}.github.io`;\n const rawBase = text(\"base\") ?? (ownerSite ? \"/\" : `/${name}/`);\n const base = `/${rawBase.replace(/^\\/+|\\/+$/g, \"\")}/`.replace(/^\\/\\/$/, \"/\");\n const pages = parsePages(text(\"pages\") ?? \"\");\n if (pages instanceof Error) return usage(pages.message);\n const portfolio = text(\"portfolio\") ?? (ownerSite ? undefined : `https://${owner.toLowerCase()}.github.io/`);\n const options: BarOptions = { repository, base, siteName: text(\"site-name\"), pages, sitePages: values[\"site-pages\"] === true, npm: text(\"npm\"), portfolio };\n const folder = isAbsolute(out) ? out : resolve(io.cwd, out);\n const count = applyBar(folder, options);\n if (count === 0) {\n io.stderr(`site-pages bar: ${out} has no HTML page\\n`);\n return 1;\n }\n io.stdout(`site-pages bar: the bar is in ${count} pages, with ${barPages(options).map((entry) => entry.label).join(\", \")}.\\n`);\n return 0;\n}\n","/**\n * The scroll cue of the built pages (`site-pages cue`). The Pages workflow changes each code block (`pre`) of each\n * built HTML page. Each block gets the class `scroll-cue` and a place in the tab order. The page gets the style\n * `scroll-cue.css`. Thus a code block that is wider than its box shows a fade at the edge with more content. This\n * occurs also on a site that does not use the rehype plugin of site-pages. A box with no overflow has no active scroll\n * timeline, so it shows no cue.\n *\n * A block with `data-overflow-ok` or with the class `scroll-cue` stays as it is. The text of `script`, `style` and\n * `textarea` elements does not change.\n */\n\nimport { readFileSync, writeFileSync } from \"node:fs\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { parseArgs } from \"node:util\";\nimport { htmlFiles, type BarIo } from \"./bar.ts\";\n\n/** The attribute of each code block that the step changed. The script of the fallback finds the blocks with it. */\nexport const CUE_ATTRIBUTE = \"data-scroll-cue\";\nconst STYLE_ID = \"site-cue-css\";\nconst SCRIPT_ID = \"site-cue-js\";\nconst STYLE_PATTERN = /<style id=\"site-cue-css\">[\\s\\S]*?<\\/style>/;\nconst SCRIPT_PATTERN = /<script id=\"site-cue-js\">[\\s\\S]*?<\\/script>/;\n\n/** This function reads `scroll-cue.css` of the package, the one source of the style of the cue. */\nexport function cueCss(): string {\n return readFileSync(new URL(\"../../styles/scroll-cue.css\", import.meta.url), \"utf8\");\n}\n\n/**\n * The script of a browser with no scroll timelines. In such a browser, the style gives the box the background color\n * `--scroll-cue-bg`. The script sets that variable to the color of the code block. When the block has no color, the\n * script uses the color of its first ancestor with a color. Thus the block keeps the color of its theme. A browser with\n * scroll timelines does not need the script.\n */\nexport const CUE_SCRIPT: string =\n '(() => { if (!window.CSS || CSS.supports(\"animation-timeline: scroll()\")) return; ' +\n `for (const box of document.querySelectorAll(\"pre[${CUE_ATTRIBUTE}]\")) { box.classList.remove(\"scroll-cue\"); ` +\n 'let node = box; let color = \"\"; ' +\n \"while (node) { color = getComputedStyle(node).backgroundColor; if (color !== \\\"transparent\\\" && !/^rgba\\\\(.*,\\\\s*0\\\\)$/.test(color)) break; node = node.parentElement; } \" +\n 'box.classList.add(\"scroll-cue\"); if (node) box.style.setProperty(\"--scroll-cue-bg\", color); } })();';\n\nconst CLASS_PATTERN = /\\sclass\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'>]+))/i;\n\n/**\n * This function gives the attributes of one `pre` start tag with the cue. It gives `undefined` when the tag keeps its\n * attributes: the tag has `data-overflow-ok`, or it already has the class `scroll-cue`.\n */\nexport function cueAttributes(attributes: string): string | undefined {\n if (/\\sdata-overflow-ok\\b/i.test(attributes)) return undefined;\n const match = CLASS_PATTERN.exec(attributes);\n const classes = match === null ? \"\" : (match[1] ?? match[2] ?? match[3] ?? \"\");\n if (classes.split(/\\s+/).includes(\"scroll-cue\")) return undefined;\n const named = `class=\"${`${classes.trim()} scroll-cue`.trim()}\"`;\n let next = match === null ? `${attributes} ${named}` : attributes.replace(CLASS_PATTERN, ` ${named}`);\n if (!/\\stabindex\\s*=/i.test(next)) next += ' tabindex=\"0\"';\n return `${next} ${CUE_ATTRIBUTE}`;\n}\n\n/** The text of these elements is not HTML, so the step does not change it. */\nconst RAW_TEXT = /<(script|style|textarea)\\b[\\s\\S]*?<\\/\\1\\s*>/gi;\n\n/**\n * This function writes the cue into the HTML of one page, and gives the HTML and the number of code blocks that it\n * changed. The style comes last in `<head>`, and the script comes last in `<body>`. A style and a script of an earlier\n * start go away, so the function can start two times on one page. A page with no changed block gets no style.\n */\nexport function injectCue(html: string, css: string): { html: string; boxes: number } {\n let boxes = 0;\n const source = html.replace(STYLE_PATTERN, \"\").replace(SCRIPT_PATTERN, \"\");\n const edit = (part: string) =>\n part.replace(/<pre\\b([^>]*)>/gi, (tag, attributes: string) => {\n const next = cueAttributes(attributes);\n if (next === undefined) return tag;\n boxes++;\n return `<pre${next}>`;\n });\n let out = \"\";\n let at = 0;\n for (const raw of source.matchAll(RAW_TEXT)) {\n out += edit(source.slice(at, raw.index)) + raw[0];\n at = raw.index + raw[0].length;\n }\n out += edit(source.slice(at));\n const marked = boxes > 0 || source.includes(` ${CUE_ATTRIBUTE}`);\n if (!marked) return { html, boxes: 0 };\n const style = `<style id=\"${STYLE_ID}\">${css}</style>`;\n const script = `<script id=\"${SCRIPT_ID}\">${CUE_SCRIPT}</script>`;\n out = /<\\/head>/i.test(out) ? out.replace(/<\\/head>/i, `${style}</head>`) : `${style}${out}`;\n out = /<\\/body>/i.test(out) ? out.replace(/<\\/body>(?![\\s\\S]*<\\/body>)/i, `${script}</body>`) : `${out}${script}`;\n return { html: out, boxes };\n}\n\n/** This function writes the cue into each HTML page of the built site folder, and gives the number of pages and of code blocks. */\nexport function applyCue(out: string, css: string): { pages: number; changed: number; boxes: number } {\n const files = htmlFiles(out);\n let changed = 0;\n let boxes = 0;\n for (const file of files) {\n const full = join(out, file);\n const html = readFileSync(full, \"utf8\");\n const next = injectCue(html, css);\n boxes += next.boxes;\n if (next.html !== html) {\n writeFileSync(full, next.html);\n changed++;\n }\n }\n return { pages: files.length, changed, boxes };\n}\n\nexport const CUE_HELP = `Usage: site-pages cue --out <dir>\n\nGives each code block (pre) of each HTML page of the built site folder the class scroll-cue and a\nplace in the tab order, and writes the style scroll-cue.css into each changed page. A code block that\nis wider than its box then shows a fade at the edge with more content. A block with the attribute\ndata-overflow-ok or the class scroll-cue stays as it is.\n\nOptions:\n --out <dir> The built site folder\n --help Shows this text\n`;\n\n/** This function starts the `cue` command with its arguments, without the word `cue`. */\nexport function runCueCli(argv: readonly string[], io: BarIo, css: () => string = cueCss): number {\n let values: Record<string, string | boolean | undefined>;\n try {\n ({ values } = parseArgs({ args: [...argv], allowPositionals: false, options: { out: { type: \"string\" }, help: { type: \"boolean\" } } }));\n } catch (error) {\n io.stderr(`site-pages cue: ${error instanceof Error ? error.message : String(error)}\\n\\n${CUE_HELP}`);\n return 2;\n }\n if (values[\"help\"]) {\n io.stdout(CUE_HELP);\n return 0;\n }\n const out = typeof values[\"out\"] === \"string\" && values[\"out\"] !== \"\" ? values[\"out\"] : undefined;\n if (out === undefined) {\n io.stderr(`site-pages cue: give --out\\n\\n${CUE_HELP}`);\n return 2;\n }\n const result = applyCue(isAbsolute(out) ? out : resolve(io.cwd, out), css());\n if (result.pages === 0) {\n io.stderr(`site-pages cue: ${out} has no HTML page\\n`);\n return 1;\n }\n io.stdout(`site-pages cue: ${result.boxes} code blocks in ${result.changed} of ${result.pages} pages got the scroll cue.\\n`);\n return 0;\n}\n","/**\n * A small client of the Chrome DevTools protocol for the `check` command. It starts a Chromium\n * browser (Chrome, Edge or the Chromium of Playwright) in headless mode and drives one page. It\n * uses only Node.js, so the check needs no package install.\n */\n\nimport { spawn, type ChildProcess } from \"node:child_process\";\nimport { existsSync, mkdtempSync, readdirSync, readFileSync, rmSync } from \"node:fs\";\nimport { homedir, tmpdir } from \"node:os\";\nimport { delimiter, join } from \"node:path\";\n\n/** The paths that `findBrowser` examines after the option and the Playwright folder. */\nfunction systemBrowsers(platform: NodeJS.Platform, env: NodeJS.ProcessEnv): string[] {\n if (platform === \"win32\") {\n const roots = [env[\"PROGRAMFILES\"], env[\"PROGRAMFILES(X86)\"], env[\"LOCALAPPDATA\"]].filter((root): root is string => !!root);\n return roots.flatMap((root) => [join(root, \"Google/Chrome/Application/chrome.exe\"), join(root, \"Microsoft/Edge/Application/msedge.exe\")]);\n }\n if (platform === \"darwin\") {\n return [\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\", \"/Applications/Chromium.app/Contents/MacOS/Chromium\", \"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge\"];\n }\n const names = [\"google-chrome\", \"google-chrome-stable\", \"chromium\", \"chromium-browser\", \"microsoft-edge\"];\n const dirs = (env[\"PATH\"] ?? \"\").split(delimiter).filter(Boolean);\n return names.flatMap((name) => dirs.map((dir) => join(dir, name)));\n}\n\n/** The Chromium of the newest `chromium-<n>` folder of Playwright, or undefined. */\nfunction playwrightChromium(platform: NodeJS.Platform, env: NodeJS.ProcessEnv): string | undefined {\n const root =\n env[\"PLAYWRIGHT_BROWSERS_PATH\"] ||\n (platform === \"win32\" ? join(env[\"LOCALAPPDATA\"] ?? homedir(), \"ms-playwright\") : platform === \"darwin\" ? join(homedir(), \"Library/Caches/ms-playwright\") : join(homedir(), \".cache/ms-playwright\"));\n if (!existsSync(root)) return undefined;\n const builds = readdirSync(root)\n .map((name) => /^chromium-(\\d+)$/.exec(name))\n .filter((match): match is RegExpExecArray => match !== null)\n .sort((a, b) => Number(b[1]) - Number(a[1]));\n for (const [folder] of builds) {\n for (const sub of readdirSync(join(root, folder))) {\n const candidates =\n platform === \"win32\"\n ? [join(root, folder, sub, \"chrome.exe\")]\n : platform === \"darwin\"\n ? [join(root, folder, sub, \"Chromium.app/Contents/MacOS/Chromium\"), join(root, folder, sub, \"Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing\")]\n : [join(root, folder, sub, \"chrome\")];\n const found = candidates.find((file) => existsSync(file));\n if (found) return found;\n }\n }\n return undefined;\n}\n\n/**\n * This function finds a Chromium browser. It examines the given path, then `$SITE_CHECK_BROWSER`,\n * then the newest Chromium of Playwright, then a Chrome or an Edge of the system.\n *\n * @returns the path of the executable, or undefined when there is none\n */\nexport function findBrowser(given?: string, env: NodeJS.ProcessEnv = process.env, platform: NodeJS.Platform = process.platform): string | undefined {\n const named = given || env[\"SITE_CHECK_BROWSER\"];\n if (named) return named;\n return playwrightChromium(platform, env) ?? systemBrowsers(platform, env).find((file) => existsSync(file));\n}\n\n/** A message of the DevTools protocol. */\ninterface Message {\n id?: number;\n method?: string;\n params?: Record<string, unknown>;\n result?: Record<string, unknown>;\n error?: { message: string };\n}\n\n/** An event handler of a page. */\ntype Listener = (params: Record<string, unknown>) => void;\n\n/** The reply of `Runtime.evaluate` and `Runtime.callFunctionOn` with `returnByValue`. */\ninterface Reply {\n result?: { value?: unknown };\n exceptionDetails?: { text?: string; exception?: { description?: string } };\n}\n\n/** One page of a started browser. */\nexport interface Page {\n /** This function sends a command of the protocol and returns its result. */\n send(method: string, params?: Record<string, unknown>): Promise<Record<string, unknown>>;\n /** This function calls the listener on each event of the method. */\n on(method: string, listener: Listener): void;\n /** This function calls the listener on the next event of the method, or rejects after `ms`. */\n once(method: string, ms: number): Promise<Record<string, unknown>>;\n /** This function evaluates the expression in the page, and waits for a promise. */\n evaluate<T>(expression: string): Promise<T>;\n /**\n * This function calls the function `source` in the page with the values `args`, and waits for a promise. The values go\n * to the page as the arguments of the call (`Runtime.callFunctionOn`), not as text of the code. Thus a value from a URL\n * or from a page cannot change the code.\n */\n call<T>(source: string, ...args: readonly CallValue[]): Promise<T>;\n}\n\n/** A value that {@link Page.call} gives to a function in the page. It goes to the page as JSON. */\nexport type CallValue = string | number | boolean | null | readonly CallValue[] | { readonly [key: string]: CallValue };\n\n/** A started browser. */\nexport interface Browser {\n page: Page;\n /** This function stops the browser and removes its profile. */\n close(): Promise<void>;\n}\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\n/**\n * This function starts the browser in headless mode with a new profile, and connects to its page.\n * The browser picks a free port, so two checks can run at the same time.\n *\n * @throws Error when the browser does not start in `timeoutMs`\n */\nexport async function launch(executable: string, timeoutMs = 30_000): Promise<Browser> {\n const profile = mkdtempSync(join(tmpdir(), \"site-check-\"));\n const args = [\n \"--headless=new\",\n \"--remote-debugging-port=0\",\n `--user-data-dir=${profile}`,\n \"--no-first-run\",\n \"--no-default-browser-check\",\n \"--disable-gpu\",\n \"--disable-extensions\",\n \"--disable-background-networking\",\n \"--disable-sync\",\n \"--hide-scrollbars\",\n \"--mute-audio\",\n // The sandbox of Chromium needs user namespaces, which Ubuntu 24.04 refuses to a browser that the\n // system did not install. Playwright also starts Chromium with no sandbox.\n ...(process.platform === \"linux\" ? [\"--no-sandbox\"] : []),\n \"about:blank\",\n ];\n const child: ChildProcess = spawn(executable, args, { stdio: \"ignore\" });\n let exited: string | undefined;\n child.once(\"exit\", (code, signal) => (exited = `the browser stopped (code ${code}, signal ${signal})`));\n child.once(\"error\", (error) => (exited = `the browser did not start: ${error.message}`));\n const stop = async () => {\n if (child.exitCode === null && child.signalCode === null) {\n child.kill();\n await Promise.race([new Promise((resolve) => child.once(\"exit\", resolve)), sleep(5000)]);\n }\n rmSync(profile, { recursive: true, force: true, maxRetries: 5, retryDelay: 200 });\n };\n try {\n const portFile = join(profile, \"DevToolsActivePort\");\n const end = Date.now() + timeoutMs;\n let port = \"\";\n while (port === \"\") {\n if (exited !== undefined) throw new Error(`${executable}: ${exited}`);\n if (Date.now() > end) throw new Error(`${executable}: no DevTools port after ${timeoutMs} ms`);\n if (existsSync(portFile)) port = readFileSync(portFile, \"utf8\").split(\"\\n\")[0]?.trim() ?? \"\";\n if (port === \"\") await sleep(100);\n }\n let target: { type: string; webSocketDebuggerUrl: string } | undefined;\n while (target === undefined) {\n const list = (await (await fetch(`http://127.0.0.1:${port}/json/list`)).json()) as { type: string; webSocketDebuggerUrl: string }[];\n target = list.find((entry) => entry.type === \"page\");\n if (target === undefined) {\n if (Date.now() > end) throw new Error(`${executable}: no page target after ${timeoutMs} ms`);\n await sleep(100);\n }\n }\n const page = await connect(target.webSocketDebuggerUrl);\n return {\n page: page.page,\n close: async () => {\n page.close();\n await stop();\n },\n };\n } catch (error) {\n await stop();\n throw error;\n }\n}\n\nasync function connect(url: string): Promise<{ page: Page; close: () => void }> {\n const socket = new WebSocket(url);\n await new Promise<void>((resolve, reject) => {\n socket.addEventListener(\"open\", () => resolve(), { once: true });\n socket.addEventListener(\"error\", () => reject(new Error(`no connection to ${url}`)), { once: true });\n });\n let sequence = 0;\n const pending = new Map<number, { resolve: (value: Record<string, unknown>) => void; reject: (error: Error) => void }>();\n const listeners = new Map<string, Listener[]>();\n socket.addEventListener(\"message\", (event) => {\n const message = JSON.parse(String(event.data)) as Message;\n if (message.id !== undefined) {\n const call = pending.get(message.id);\n pending.delete(message.id);\n if (message.error) call?.reject(new Error(message.error.message));\n else call?.resolve(message.result ?? {});\n } else if (message.method) {\n for (const listener of listeners.get(message.method) ?? []) listener(message.params ?? {});\n }\n });\n socket.addEventListener(\"close\", () => {\n for (const call of pending.values()) call.reject(new Error(\"the browser closed the connection\"));\n pending.clear();\n });\n const page: Page = {\n send: (method, params = {}) =>\n new Promise((resolve, reject) => {\n const id = ++sequence;\n pending.set(id, { resolve, reject });\n socket.send(JSON.stringify({ id, method, params }));\n }),\n on: (method, listener) => listeners.set(method, [...(listeners.get(method) ?? []), listener]),\n once: (method, ms) =>\n new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n remove();\n reject(new Error(`no ${method} after ${ms} ms`));\n }, ms);\n const listener: Listener = (params) => {\n clearTimeout(timer);\n remove();\n resolve(params);\n };\n const remove = () => listeners.set(method, (listeners.get(method) ?? []).filter((entry) => entry !== listener));\n page.on(method, listener);\n }),\n evaluate: async <T>(expression: string): Promise<T> => {\n const reply = (await page.send(\"Runtime.evaluate\", { expression, awaitPromise: true, returnByValue: true })) as Reply;\n if (reply.exceptionDetails) throw new Error(reply.exceptionDetails.exception?.description ?? reply.exceptionDetails.text ?? \"the expression failed\");\n return reply.result?.value as T;\n },\n call: async <T>(source: string, ...args: readonly CallValue[]): Promise<T> => {\n // The global object of the page is the target of the call. A new page after a navigation has a new one.\n const target = (await page.send(\"Runtime.evaluate\", { expression: \"globalThis\" })) as { result?: { objectId?: string } };\n const reply = (await page.send(\"Runtime.callFunctionOn\", {\n functionDeclaration: source,\n objectId: target.result?.objectId,\n arguments: args.map((value) => ({ value })),\n awaitPromise: true,\n returnByValue: true,\n })) as Reply;\n if (reply.exceptionDetails) throw new Error(reply.exceptionDetails.exception?.description ?? reply.exceptionDetails.text ?? \"the function failed\");\n return reply.result?.value as T;\n },\n };\n return { page, close: () => socket.close() };\n}\n","/**\n * The measurements that the `check` command makes in the page. Each is a string of JavaScript that\n * the browser evaluates, so the code can use only the APIs of the page.\n */\n\n/** Text past the edge of a box that cuts it: an entry of `Measure.cut`. */\nexport interface Cut {\n /**\n * The kind of the box:\n * - `clip`: the box has `overflow-x: hidden` or `clip`, so a visitor cannot reach the text,\n * - `table`: the box scrolls, and the text is in a table,\n * - `code`: the box scrolls, and the text is in a code block (`pre`).\n */\n kind: \"clip\" | \"table\" | \"code\";\n /** The box. */\n box: string;\n /** The table, the code block, or the element of the text. */\n element: string;\n /** The width of the content of the box, in CSS pixels. */\n scrollWidth: number;\n /** The visible width of the box, in CSS pixels. */\n clientWidth: number;\n /** The start of the first text past the edge. */\n text: string;\n /** True when the box has the class `scroll-cue`, and the served CSS gives it no animation and no shade. */\n deadCue?: boolean;\n}\n\n/** The result of `MEASURE`. */\nexport interface Measure {\n innerWidth: number;\n scrollWidth: number;\n /** The height of the document, for the screenshot. */\n height: number;\n /** The number of characters of visible text. */\n text: number;\n /** The outermost elements that go past the right edge of the screen, at most 8. */\n past: string[];\n /** The text areas that hide a part of their text, at most 8. */\n clipped: string[];\n /** The boxes that cut text at their right edge, at most 8. `cutProblems` of `check.ts` tells which ones are problems. */\n cut: Cut[];\n}\n\n/**\n * This expression measures the page. An element counts as past the edge when its right side is\n * more than half a pixel past the width of the document. These elements do not count:\n * - an element in a container that scrolls or clips (`overflow-x` other than `visible`, below `body`),\n * - an element of zero size, a hidden element, or a fixed element that is fully past the edge (a closed drawer),\n * - an element in a fixed element, or that fixed element itself, with no text and no image past the edge. The screen cuts only an empty part of the box,\n * - an element in `.sr`, `.sr-only`, `.visually-hidden` or `.skip` (text for screen readers and skip links),\n * - an element in a `pre`, other than the `pre` itself.\n * Of a chain of elements past the edge, only the outermost one counts.\n *\n * `past` skips each element in a container that scrolls or clips, so `cut` examines those containers.\n * A box is the nearest element around a text, below `body`, with `overflow-x` other than `visible`. Its content is wider\n * than the box by more than 1 px. An element with `overflow-x: clip` is always a box, because it can report no overflow.\n * The text counts when a line of it ends more than 1 px past the right edge of the box.\n *\n * A box that scrolls counts only for text in a table (`table`, `role=\"table\"` or `role=\"grid\"`) or in a code block (`pre`).\n * A hex view, a row of tabs and a carousel in such a box are meant to scroll, and they do not count.\n * A box that clips counts for each text, because a visitor cannot reach that text. These texts do not count:\n * - a text in a box with `text-overflow` other than `clip` (a person chose the ellipsis),\n * - a text in an element with `data-overflow-ok`, or in that element itself (a person chose the overflow),\n * - a text in a box that scrolls with the class `scroll-cue`, and with an animation or a background image for its shade,\n * - a text in `.sr`, `.sr-only`, `.visually-hidden`, `.skip`, `[aria-hidden=\"true\"]`, `select`, `textarea` or `svg`,\n * - a text in a fixed element, which the box does not clip,\n * - a text that is not visible, or with an element around it of 1 px or less or with `opacity: 0`.\n * Only the first text of a box counts. An element with no text does not count. Vertical overflow does not count.\n */\nexport const MEASURE = `(() => {\n const root = document.documentElement;\n const w = root.clientWidth;\n const name = (e) => e.tagName.toLowerCase() + (e.id ? \"#\" + e.id : \"\") + (typeof e.className === \"string\" && e.className.trim() ? \".\" + e.className.trim().split(/\\\\s+/).slice(0, 3).join(\".\") : \"\");\n const inScroller = (e) => {\n for (let p = e.parentElement; p && p !== document.body && p !== root; p = p.parentElement) {\n if (getComputedStyle(p).overflowX !== \"visible\") return true;\n }\n return false;\n };\n const inFixed = (e) => {\n for (let p = e; p && p !== document.body && p !== root; p = p.parentElement) {\n if (getComputedStyle(p).position === \"fixed\") return true;\n }\n return false;\n };\n const contentPast = (e) => {\n for (const m of e.querySelectorAll(\"img,svg,canvas,video\")) if (m.getBoundingClientRect().right > w + 0.5) return true;\n const walker = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);\n const range = document.createRange();\n while (walker.nextNode()) {\n if (walker.currentNode.textContent.trim() === \"\") continue;\n range.selectNodeContents(walker.currentNode);\n for (const b of range.getClientRects()) if (b.width > 0 && b.right > w + 0.5) return true;\n }\n return false;\n };\n const counts = (e) => {\n const r = e.getBoundingClientRect();\n if (r.width === 0 || r.height === 0 || r.right <= w + 0.5) return false;\n if (e.closest(\".sr,.sr-only,.visually-hidden,.skip\")) return false;\n if (e.closest(\"pre\") && e.tagName !== \"PRE\") return false;\n const s = getComputedStyle(e);\n if (s.visibility === \"hidden\" || s.display === \"none\") return false;\n if (s.position === \"fixed\" && r.left >= w) return false;\n if (inFixed(e) && !contentPast(e)) return false;\n return !inScroller(e);\n };\n const over = new Set([...document.querySelectorAll(\"body *\")].filter(counts));\n const past = [...over]\n .filter((e) => { for (let p = e.parentElement; p; p = p.parentElement) if (over.has(p)) return false; return true; })\n .map((e) => name(e) + \" right=\" + Math.round(e.getBoundingClientRect().right));\n const clipped = [...document.querySelectorAll(\"textarea\")]\n .filter((e) => { const s = getComputedStyle(e); return (s.overflowY === \"hidden\" || s.overflowY === \"clip\") && e.getBoundingClientRect().height > 0 && e.scrollHeight > e.clientHeight + 1; })\n .map((e) => name(e) + \" \" + e.scrollHeight + \">\" + e.clientHeight);\n const boxOf = (e) => {\n for (let p = e; p && p !== document.body && p !== root; p = p.parentElement) {\n const s = getComputedStyle(p);\n if (s.overflowX === \"clip\" || (s.overflowX !== \"visible\" && p.scrollWidth > p.clientWidth + 1)) return p;\n if (s.position === \"fixed\") return undefined;\n }\n return undefined;\n };\n const shown = (e) => {\n if (e.closest(\".sr,.sr-only,.visually-hidden,.skip,[aria-hidden=true],select,textarea,svg\")) return false;\n if (getComputedStyle(e).visibility !== \"visible\") return false;\n for (let p = e; p && p !== root; p = p.parentElement) {\n const s = getComputedStyle(p);\n if (s.opacity === \"0\") return false;\n if (s.display === \"contents\") continue;\n const r = p.getBoundingClientRect();\n if (r.width <= 1 || r.height <= 1) return false;\n }\n return true;\n };\n const cueShows = (box) => { const s = getComputedStyle(box); return s.animationName !== \"none\" || s.backgroundImage !== \"none\"; };\n const cuts = new Map();\n const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);\n const range = document.createRange();\n for (let t = walker.nextNode(); t; t = walker.nextNode()) {\n const e = t.parentElement;\n if (!e || !t.data.trim()) continue;\n const box = boxOf(e);\n if (!box || cuts.has(box)) continue;\n const s = getComputedStyle(box);\n if (s.textOverflow !== \"clip\") continue;\n const scrolls = s.overflowX === \"auto\" || s.overflowX === \"scroll\";\n const table = e.closest(\"table,[role=table],[role=grid]\");\n const code = e.closest(\"pre\");\n const inTable = !!table && box.contains(table);\n const inCode = !inTable && !!code && box.contains(code);\n if (scrolls && !inTable && !inCode) continue;\n const left = box.getBoundingClientRect().left + box.clientLeft;\n range.selectNodeContents(t);\n const end = Math.max(...[...range.getClientRects()].filter((r) => r.width > 0).map((r) => r.right));\n if (end <= left + box.clientWidth + 1) continue;\n const hasCue = scrolls && box.classList.contains(\"scroll-cue\");\n if (e.closest(\"[data-overflow-ok]\") || (hasCue && cueShows(box)) || !shown(e)) continue;\n cuts.set(box, { ...(hasCue ? { deadCue: true } : {}), kind: scrolls ? (inTable ? \"table\" : \"code\") : \"clip\", box: name(box), element: name(scrolls ? (inTable ? table : code) : e), scrollWidth: Math.max(box.scrollWidth, Math.ceil(end - left)), clientWidth: box.clientWidth, text: t.data.trim().replace(/\\\\s+/g, \" \").slice(0, 40) });\n }\n return {\n innerWidth,\n scrollWidth: root.scrollWidth,\n height: Math.max(root.scrollHeight, document.body ? document.body.scrollHeight : 0),\n text: (document.body ? document.body.innerText : \"\").trim().length,\n past: past.slice(0, 8),\n clipped: clipped.slice(0, 8),\n cut: [...cuts.values()].slice(0, 8),\n };\n})()`;\n\n/** One check of a probe. */\nexport interface ProbeCheck {\n name: string;\n ok: boolean;\n detail?: string;\n}\n\n/**\n * This function wraps the code of a probe file into an expression. The code is the body of an async\n * function with these names:\n * - `check(name, ok, detail)` records a check,\n * - `wait(ms)` waits,\n * - `until(fn, ms)` waits until `fn()` gives a true value, at most `ms` (default 5000), and returns the value,\n * - `$(selector)` and `$$(selector)` find elements,\n * - `type(element, text)` writes the text into an input or a text area, with an `input` event,\n * - `click(element)` clicks an element, or the first element of a selector.\n * An exception stops the probe, and it counts as a failed check.\n */\nexport function probeExpression(code: string): string {\n return `(async () => {\n const __checks = [];\n const __text = (v) => { if (v === undefined) return undefined; if (typeof v === \"string\") return v; try { return JSON.stringify(v); } catch { return String(v); } };\n const check = (name, ok, detail) => { __checks.push({ name: String(name), ok: !!ok, ...(ok ? {} : { detail: __text(detail) }) }); return !!ok; };\n const wait = (ms) => new Promise((r) => setTimeout(r, ms));\n const until = async (fn, ms = 5000) => { const end = Date.now() + ms; for (;;) { const v = await fn(); if (v) return v; if (Date.now() > end) return v; await wait(50); } };\n const $ = (s) => document.querySelector(s);\n const $$ = (s) => [...document.querySelectorAll(s)];\n const __el = (e) => { const el = typeof e === \"string\" ? document.querySelector(e) : e; if (!el) throw new Error(\"no element: \" + e); return el; };\n const type = (e, text) => { const el = __el(e); el.focus(); el.value = text; el.dispatchEvent(new Event(\"input\", { bubbles: true })); el.dispatchEvent(new Event(\"change\", { bubbles: true })); };\n const click = (e) => __el(e).click();\n try {\n await (async () => {\n${code}\n })();\n } catch (e) {\n __checks.push({ name: \"the probe runs to its end\", ok: false, detail: String((e && e.stack) || e) });\n }\n return __checks;\n})()`;\n}\n","/**\n * A static file server for the `check` command. It serves a built site folder at the path of the\n * site home, as GitHub Pages does. Thus the links of the site work as on the live site.\n */\n\nimport { createReadStream, existsSync, statSync } from \"node:fs\";\nimport { createServer, type Server } from \"node:http\";\nimport { extname, join, normalize, resolve, sep } from \"node:path\";\n\nconst TYPES: Record<string, string> = {\n \".html\": \"text/html; charset=utf-8\",\n \".js\": \"text/javascript; charset=utf-8\",\n \".mjs\": \"text/javascript; charset=utf-8\",\n \".css\": \"text/css; charset=utf-8\",\n \".json\": \"application/json; charset=utf-8\",\n \".svg\": \"image/svg+xml\",\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".gif\": \"image/gif\",\n \".webp\": \"image/webp\",\n \".avif\": \"image/avif\",\n \".ico\": \"image/x-icon\",\n \".woff\": \"font/woff\",\n \".woff2\": \"font/woff2\",\n \".ttf\": \"font/ttf\",\n \".otf\": \"font/otf\",\n \".wasm\": \"application/wasm\",\n \".txt\": \"text/plain; charset=utf-8\",\n \".md\": \"text/markdown; charset=utf-8\",\n \".xml\": \"application/xml\",\n \".webmanifest\": \"application/manifest+json\",\n \".map\": \"application/json; charset=utf-8\",\n};\n\n/**\n * This function maps the path of a request to a file of the folder, as GitHub Pages does. A folder\n * gives its `index.html`. For a path with no extension, the function also tries `<path>.html`.\n *\n * @returns the absolute file, or undefined when the path is outside the base or the file is missing\n */\nexport function resolveFile(root: string, base: string, pathname: string): string | undefined {\n let decoded: string;\n try {\n decoded = decodeURIComponent(pathname);\n } catch {\n return undefined;\n }\n const home = base.endsWith(\"/\") ? base : `${base}/`;\n if (decoded === home.slice(0, -1)) decoded = home;\n if (!decoded.startsWith(home)) return undefined;\n const top = resolve(root);\n const file = normalize(join(top, decoded.slice(home.length)));\n if (file !== top && !file.startsWith(top + sep)) return undefined;\n const candidates = [file, join(file, \"index.html\"), `${file}.html`];\n return candidates.find((candidate) => existsSync(candidate) && statSync(candidate).isFile());\n}\n\n/** A started server. */\nexport interface StaticServer {\n /** The URL of the site home, for example `http://127.0.0.1:50123/client/`. */\n url: string;\n close(): Promise<void>;\n}\n\n/**\n * This function serves the folder at `base` on a free port of 127.0.0.1. A missing file gives the\n * status 404 with the `404.html` of the folder, when it has one.\n */\nexport async function serve(root: string, base: string): Promise<StaticServer> {\n const server: Server = createServer((request, response) => {\n const pathname = new URL(request.url ?? \"/\", \"http://localhost\").pathname;\n const home = base.endsWith(\"/\") ? base : `${base}/`;\n if (pathname === home.slice(0, -1) && home !== \"/\") {\n response.writeHead(301, { location: home }).end();\n return;\n }\n const file = resolveFile(root, base, pathname);\n const missing = join(resolve(root), \"404.html\");\n const send = file ?? (existsSync(missing) ? missing : undefined);\n if (send === undefined) {\n response.writeHead(404, { \"content-type\": \"text/plain; charset=utf-8\" }).end(`404: ${pathname}\\n`);\n return;\n }\n response.writeHead(file ? 200 : 404, { \"content-type\": TYPES[extname(send).toLowerCase()] ?? \"application/octet-stream\", \"cache-control\": \"no-store\" });\n createReadStream(send).pipe(response);\n });\n await new Promise<void>((done, fail) => {\n server.once(\"error\", fail);\n server.listen(0, \"127.0.0.1\", () => done());\n });\n const address = server.address();\n if (address === null || typeof address === \"string\") throw new Error(\"the server has no port\");\n return {\n url: `http://127.0.0.1:${address.port}${base.endsWith(\"/\") ? base : `${base}/`}`,\n close: () => new Promise((done) => server.close(() => done())),\n };\n}\n","/**\n * The `site-pages check` command. It opens the pages of a built site (or of a live URL) in a\n * headless Chromium at phone and desktop widths, in the light and the dark scheme.\n *\n * A view fails when the page is wider than the screen or an element goes past the right edge. It\n * also fails when a text area hides its text, a box cuts text (`cutProblems`) or the page shows no text. A console error, an\n * exception and a failed request of the site also fail it. A script that does not load and a failed check of the probe\n * fail it too. The command\n * writes a screenshot of each view.\n */\n\nimport { appendFileSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { parseArgs } from \"node:util\";\nimport { findBrowser, launch, type Browser, type Page } from \"./browser.ts\";\nimport { MEASURE, probeExpression, type Cut, type Measure, type ProbeCheck } from \"./measure.ts\";\nimport { probeScript, TYPESCRIPT_PROBE } from \"./probe.ts\";\nimport { serve } from \"./serve.ts\";\n\n/** A view narrower than this width in CSS pixels is a phone. */\nexport const PHONE_WIDTH = 768;\n\n/** The options of `checkSite`. */\nexport interface CheckOptions {\n /** The built site folder. Give `out` or `url`. */\n out?: string | undefined;\n /** The path of the site home, for `out`, for example `/client/`. */\n base?: string | undefined;\n /** The URL of a live site home. Give `out` or `url`. */\n url?: string | undefined;\n /** The pages, from the site home, for example `/` and `/releases/`. */\n pages: readonly string[];\n /** The widths in CSS pixels. A width under `PHONE_WIDTH` is a phone. */\n widths: readonly number[];\n /** The color schemes. */\n schemes: readonly (\"light\" | \"dark\")[];\n /** The code of a probe: the body of an async function (see `probeExpression`). It runs on the first page, in the light scheme, at each width. */\n probe?: string | undefined;\n /**\n * The probe of each page: a map from a page of `pages` to the code of its probe. Each probe operates on its page, in the first\n * scheme, at each width. A page with no entry has no probe. The first page takes `probe` or an entry of this map, not both.\n */\n probes?: Readonly<Record<string, string>> | undefined;\n /** The folder for the screenshots, `report.json` and `summary.md`. */\n shots?: string | undefined;\n /** The browser executable. */\n browser?: string | undefined;\n /** The time to wait after the load event, for the scripts of the page. */\n settleMs: number;\n /** The time limit of a page load. */\n timeoutMs: number;\n /** The time limit of the scroll and of the islands of a view, for `revealExpression`. The default is `ISLAND_LIMIT_MS`. */\n islandMs?: number | undefined;\n log?: ((line: string) => void) | undefined;\n}\n\n/** The default time limit of the scroll and of the islands of a view, in milliseconds. */\nexport const ISLAND_LIMIT_MS = 10_000;\n\n/**\n * This function gives a page expression that scrolls the page to its end, one screen at a time, and then back to the top.\n * Thus each part that starts when it comes into view starts before the measure. Examples are an Astro island with\n * `client:visible` and an image with `loading=\"lazy\"`. Then the expression waits until no Astro island waits to start.\n * An island that the page does not show and an island of a media query that does not match do not count.\n * The expression gives the islands that did not start in `limitMs`.\n */\nexport function revealExpression(limitMs: number): string {\n return `(async () => {\n const end = performance.now() + ${String(limitMs)};\n const frame = () => new Promise((done) => requestAnimationFrame(() => setTimeout(done, 0)));\n const root = document.scrollingElement ?? document.documentElement;\n const step = Math.max(Math.round(innerHeight * 0.8), 100);\n for (let top = 0; top < root.scrollHeight && performance.now() < end; top += step) {\n scrollTo({ top, behavior: \"instant\" });\n await frame();\n await frame();\n }\n scrollTo({ top: root.scrollHeight, behavior: \"instant\" });\n await frame();\n const waiting = () => [...document.querySelectorAll(\"astro-island[ssr]\")].filter((island) => {\n const client = island.getAttribute(\"client\") ?? \"\";\n if (client === \"media\") {\n try {\n const query = JSON.parse(island.getAttribute(\"opts\") ?? \"{}\").value;\n if (typeof query === \"string\" && !matchMedia(query).matches) return false;\n } catch {}\n }\n if (client === \"visible\" && ![...island.children].some((child) => child.getClientRects().length > 0)) return false;\n return true;\n });\n while (waiting().length > 0 && performance.now() < end) await new Promise((done) => setTimeout(done, 50));\n scrollTo({ top: 0, behavior: \"instant\" });\n await frame();\n await frame();\n return waiting().map((island) => (island.getAttribute(\"component-url\") ?? \"\").split(\"/\").pop() + \" (client:\" + (island.getAttribute(\"client\") ?? \"\") + \")\");\n})()`;\n}\n\n/** The result of one page at one width and scheme. */\nexport interface ViewResult {\n page: string;\n width: number;\n scheme: \"light\" | \"dark\";\n ok: boolean;\n /** What failed. */\n problems: string[];\n measure?: Measure | undefined;\n probe?: ProbeCheck[] | undefined;\n /** The file of the screenshot. */\n shot?: string | undefined;\n}\n\n/** The result of `checkSite`. */\nexport interface CheckResult {\n ok: boolean;\n url: string;\n browser: string;\n views: ViewResult[];\n}\n\n/**\n * This function gives the problems of the cuts of a view with the given width. A box that clips text is a problem at each width.\n * A table or a code block in a box that scrolls is a problem only on a phone. A phone shows no scroll bar, but a desktop shows one.\n * The summary and the log give the page of each problem.\n */\nexport function cutProblems(cuts: readonly Cut[], width: number): string[] {\n const widths = (cut: Cut) => `${cut.element} in ${cut.box}: content of ${cut.scrollWidth} px in a box of ${cut.clientWidth} px, \"${cut.text}\"`;\n return cuts.flatMap((cut) => {\n if (cut.kind === \"clip\") return [`a box cuts text at ${width} px: ${widths(cut)}. Make the content fit, or add data-overflow-ok to the box.`];\n const what = cut.kind === \"code\" ? \"a code block\" : \"a table\";\n if (cut.deadCue === true) return width < PHONE_WIDTH ? [`${what} goes out of view at ${width} px: ${widths(cut)}. The box has the class scroll-cue, but its computed style has no animation and no shade. Read the served CSS.`] : [];\n if (width < PHONE_WIDTH) return [`${what} goes out of view at ${width} px: ${widths(cut)}. Make ${cut.kind === \"code\" ? \"the lines\" : \"the table\"} fit, give the box the class scroll-cue, or add data-overflow-ok to the box.`];\n return [];\n });\n}\n\n/** This function gives the file name part of a page: `/` is `home`, `/releases/` is `releases`. */\nexport function pageSlug(page: string): string {\n const slug = page.replace(/^\\/+|\\/+$/g, \"\").replace(/[^A-Za-z0-9._-]+/g, \"_\");\n return slug === \"\" ? \"home\" : slug;\n}\n\n/**\n * This function gives the code of the probe of each page of `pages`, in the same order. A page with no probe gives undefined.\n * `probe` goes to the first page, and each entry of `probes` goes to its page.\n *\n * @throws Error when a key of `probes` is not a page, or when the first page has `probe` and an entry of `probes`\n */\nexport function pageProbes(options: Pick<CheckOptions, \"pages\" | \"probe\" | \"probes\">): (string | undefined)[] {\n const probes = options.probes ?? {};\n const unknown = Object.keys(probes).filter((page) => !options.pages.includes(page));\n if (unknown.length > 0) throw new Error(`a probe names a page that the check does not open: ${unknown.join(\", \")}. The pages are ${options.pages.join(\", \")}.`);\n const first = options.pages[0];\n if (options.probe !== undefined && first !== undefined && Object.hasOwn(probes, first)) throw new Error(`the first page ${first} has two probes: give it probe or an entry of probes, not both`);\n return options.pages.map((page, index) => (Object.hasOwn(probes, page) ? probes[page] : index === 0 ? options.probe : undefined));\n}\n\n/**\n * This function checks the site. It starts one browser and, for `out`, one server, and stops both at\n * the end.\n *\n * @throws Error when there is no browser, or the browser does not start\n */\nexport async function checkSite(options: CheckOptions): Promise<CheckResult> {\n const log = options.log ?? (() => {});\n const executable = findBrowser(options.browser);\n if (executable === undefined) throw new Error(\"no Chromium browser was found: give --browser, set SITE_CHECK_BROWSER, or install the Chromium of Playwright\");\n if (options.pages.length === 0) throw new Error(\"no page to check\");\n const probes = pageProbes(options);\n if (options.out === undefined && options.url === undefined) throw new Error(\"give out or url\");\n const server = options.out !== undefined ? await serve(options.out, options.base ?? \"/\") : undefined;\n const views: ViewResult[] = [];\n let homeUrl: URL;\n let browser: Browser | undefined;\n // The server stops also when the browser does not start. An open server keeps the process alive, and the check does not end.\n try {\n const home = server?.url ?? options.url ?? \"\";\n homeUrl = new URL(home.endsWith(\"/\") ? home : `${home}/`);\n browser = await launch(executable, options.timeoutMs);\n const { page } = browser;\n const events = watch(page, homeUrl.origin);\n await Promise.all([page.send(\"Page.enable\"), page.send(\"Runtime.enable\"), page.send(\"Network.enable\")]);\n await page.send(\"Page.addScriptToEvaluateOnNewDocument\", { source: LOAD_WATCH });\n if (options.shots) mkdirSync(options.shots, { recursive: true });\n for (const [index, path] of options.pages.entries()) {\n const target = new URL(path.replace(/^\\/+/, \"\"), homeUrl).href;\n for (const width of options.widths) {\n for (const scheme of options.schemes) {\n const probe = scheme === options.schemes[0] ? probes[index] : undefined;\n const view = await checkView(page, events, { target, path, width, scheme, probe, options });\n views.push(view);\n log(`${view.ok ? \"PASS\" : \"FAIL\"} ${path} ${width} ${scheme}${view.measure ? ` scrollWidth=${view.measure.scrollWidth} innerWidth=${view.measure.innerWidth}` : \"\"}${view.probe ? ` probe ${view.probe.filter((c) => c.ok).length}/${view.probe.length}` : \"\"}${view.problems.length > 0 ? `\\n - ${view.problems.join(\"\\n - \")}` : \"\"}`);\n }\n }\n }\n } finally {\n await browser?.close();\n await server?.close();\n }\n const result: CheckResult = { ok: views.length > 0 && views.every((view) => view.ok), url: homeUrl.href, browser: executable, views };\n if (options.shots) {\n writeFileSync(join(options.shots, \"report.json\"), `${JSON.stringify(result, null, 2)}\\n`);\n writeFileSync(join(options.shots, \"summary.md\"), summary(result));\n }\n return result;\n}\n\n/**\n * A script that each page starts before its own scripts. A script or a style sheet that does not load fires `error` on its\n * element. This script writes that event as a console error. Thus a module script whose imports do not load is a problem too.\n * Such a script throws no exception. Its failed request can go to another origin, for example `node:perf_hooks` in a page bundle.\n */\nexport const LOAD_WATCH = `addEventListener(\"error\", (event) => {\n const element = event.target;\n if (!(element instanceof HTMLScriptElement || element instanceof HTMLLinkElement)) return;\n console.error(\"failed to load \" + element.tagName.toLowerCase() + \": \" + (element.getAttribute(\"src\") ?? element.getAttribute(\"href\") ?? \"(inline)\"));\n}, true);`;\n\n/** This expression reads the pattern of the paths that other sites of the origin serve. An empty text means no pattern. */\nconst OTHER_PATHS = `document.querySelector('meta[name=\"site-check-other-paths\"]')?.content ?? \"\"`;\n\n/** The problems that the events of the page gave, since the last `reset`. */\ninterface Events {\n reset(): void;\n /** This function gives the problems. A refused request to a path that `other` matches is not a problem. */\n problems(other?: RegExp): string[];\n}\n\nfunction watch(page: Page, origin: string): Events {\n let problems: string[] = [];\n let refused: { url: string; status: number }[] = [];\n const urls = new Map<string, string>();\n const own = (url: string) => {\n try {\n const parsed = new URL(url);\n // A browser asks for /favicon.ico on its own, also for a site under a path.\n return parsed.origin === origin && parsed.pathname !== \"/favicon.ico\";\n } catch {\n return false;\n }\n };\n page.on(\"Runtime.exceptionThrown\", (params) => {\n const details = params[\"exceptionDetails\"] as { text?: string; exception?: { description?: string } };\n problems.push(`exception: ${(details.exception?.description ?? details.text ?? \"\").split(\"\\n\")[0]}`);\n });\n page.on(\"Runtime.consoleAPICalled\", (params) => {\n if (params[\"type\"] !== \"error\" && params[\"type\"] !== \"assert\") return;\n const args = (params[\"args\"] as { value?: unknown; description?: string }[]) ?? [];\n problems.push(`console.error: ${args.map((arg) => String(arg.value ?? arg.description ?? \"\")).join(\" \").slice(0, 300)}`);\n });\n page.on(\"Network.requestWillBeSent\", (params) => {\n urls.set(String(params[\"requestId\"]), String((params[\"request\"] as { url: string }).url));\n });\n page.on(\"Network.responseReceived\", (params) => {\n const response = params[\"response\"] as { url: string; status: number };\n if (response.status >= 400 && own(response.url)) refused.push(response);\n });\n page.on(\"Network.loadingFailed\", (params) => {\n const url = urls.get(String(params[\"requestId\"])) ?? \"\";\n // A script of any origin counts: without it, the page does not work.\n if ((own(url) || params[\"type\"] === \"Script\") && params[\"canceled\"] !== true) problems.push(`request failed (${String(params[\"errorText\"])}): ${url}`);\n });\n return {\n reset: () => {\n problems = [];\n refused = [];\n },\n problems: (other) => {\n const shown = refused.filter((response) => other?.test(new URL(response.url).pathname) !== true);\n return [...new Set([...problems, ...shown.map((response) => `HTTP ${response.status}: ${response.url}`)])];\n },\n };\n}\n\ninterface ViewInput {\n target: string;\n path: string;\n width: number;\n scheme: \"light\" | \"dark\";\n /** The code of the probe of this view, or undefined for no probe. */\n probe: string | undefined;\n options: CheckOptions;\n}\n\nasync function checkView(page: Page, events: Events, input: ViewInput): Promise<ViewResult> {\n const { target, path, width, scheme, probe, options } = input;\n const view: ViewResult = { page: path, width, scheme, ok: false, problems: [] };\n let other: RegExp | undefined;\n try {\n await page.send(\"Emulation.setDeviceMetricsOverride\", { width, height: 900, deviceScaleFactor: 1, mobile: width < PHONE_WIDTH });\n await page.send(\"Emulation.setEmulatedMedia\", { features: [{ name: \"prefers-color-scheme\", value: scheme }] });\n events.reset();\n const loaded = page.once(\"Page.loadEventFired\", options.timeoutMs);\n const navigation = (await page.send(\"Page.navigate\", { url: target })) as { errorText?: string };\n if (navigation.errorText) {\n loaded.catch(() => {});\n throw new Error(`the page did not open: ${navigation.errorText}`);\n }\n await loaded;\n await page.evaluate(\"document.fonts ? document.fonts.ready.then(() => true) : true\");\n await new Promise((done) => setTimeout(done, options.settleMs));\n const islandMs = options.islandMs ?? ISLAND_LIMIT_MS;\n const stuck = await page.evaluate<string[]>(revealExpression(islandMs));\n for (const island of stuck) view.problems.push(`an island did not start in ${String(islandMs)} ms after a scroll to the end: ${island}`);\n const pattern = await page.evaluate<string>(OTHER_PATHS);\n if (pattern !== \"\") other = new RegExp(pattern);\n const measure = await page.evaluate<Measure>(MEASURE);\n view.measure = measure;\n // The screen width, not innerWidth: a phone browser can zoom out a page that is too wide.\n if (measure.scrollWidth > width) view.problems.push(`the page is wider than the screen: ${measure.scrollWidth} > ${width}`);\n for (const past of measure.past) view.problems.push(`past the right edge: ${past}`);\n for (const clipped of measure.clipped) view.problems.push(`a text area hides its text: ${clipped}`);\n view.problems.push(...cutProblems(measure.cut, width));\n if (measure.text === 0) view.problems.push(\"the page shows no text\");\n if (options.shots) {\n const file = join(options.shots, `${pageSlug(path)}-${width}-${scheme}.png`);\n const height = Math.min(Math.max(measure.height, 1), 8000);\n const shot = (await page.send(\"Page.captureScreenshot\", { format: \"png\", captureBeyondViewport: true, clip: { x: 0, y: 0, width, height, scale: 1 } })) as { data: string };\n writeFileSync(file, Buffer.from(shot.data, \"base64\"));\n view.shot = file;\n }\n if (probe !== undefined) {\n const checks = (await page.evaluate<ProbeCheck[] | undefined>(probeExpression(probe))) ?? [];\n view.probe = checks;\n if (checks.length === 0) view.problems.push(\"the probe made no check\");\n for (const check of checks.filter((entry) => !entry.ok)) view.problems.push(`probe: ${check.name}${check.detail ? ` (${check.detail})` : \"\"}`);\n }\n } catch (error) {\n view.problems.push(error instanceof Error ? error.message : String(error));\n }\n view.problems.push(...events.problems(other));\n view.ok = view.problems.length === 0;\n return view;\n}\n\n/** This function makes a text safe for a cell of a Markdown table. It escapes `\\`, `|`, `<` and `>`. It changes each new line to a space. */\nexport function cell(text: string): string {\n return text.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\|/g, \"\\\\|\").replace(/</g, \"<\").replace(/>/g, \">\").replace(/\\r?\\n/g, \" \");\n}\n\n/** This function gives the Markdown summary of a result, for the job summary of a workflow. */\nexport function summary(result: CheckResult): string {\n const failed = result.views.filter((view) => !view.ok);\n const lines = [\n `### Site check: ${result.ok ? \"passed\" : \"failed\"}`,\n \"\",\n `${result.views.length - failed.length} of ${result.views.length} views passed, at ${result.url}.`,\n \"\",\n \"| Page | Width | Scheme | Result | Problems |\",\n \"| --- | ---: | --- | --- | --- |\",\n ...result.views.map(\n (view) =>\n `| \\`${view.page}\\` | ${view.width} | ${view.scheme} | ${view.ok ? \"pass\" : \"**fail**\"}${view.probe ? ` (probe ${view.probe.filter((c) => c.ok).length}/${view.probe.length})` : \"\"} | ${view.problems.map(cell).join(\"<br>\")} |`,\n ),\n \"\",\n ];\n return lines.join(\"\\n\");\n}\n\n/** The input and output of the CLI. */\nexport interface CheckIo {\n cwd: string;\n env: NodeJS.ProcessEnv;\n stdout: (text: string) => void;\n stderr: (text: string) => void;\n}\n\nexport const CHECK_HELP = `Usage: site-pages check (--out <dir> | --url <url>) [options]\n\nOpens the pages of the site in a headless Chromium at phone and desktop widths, in the light and\nthe dark scheme, and fails when a page is wider than the screen, an element goes past the right\nedge, a text area hides its text, a box cuts text, a table goes out of view on a phone, a page\nshows no text, or on a console error, an exception, a failed request of the site, a script that\ndoes not load or a failed check of the probe. Add data-overflow-ok to a box that is meant to\nscroll or to clip.\n\nOptions:\n --out <dir> The built site folder. The check serves it at --base.\n --url <url> The URL of a live site home, in place of --out\n --repo <owner/name> The GitHub repository, for the default base (default: $GITHUB_REPOSITORY)\n --base </name/> The path of the site home (default: \"/<name>/\", or \"/\" for <owner>.github.io)\n --pages <paths> The pages, from the site home, separated by commas (default: /)\n --widths <px> The widths, separated by commas (default: 360,400,1280)\n --schemes <list> light, dark or both (default: light,dark)\n --probe <file> A JavaScript file: the body of an async function with check(name, ok, detail),\n wait, until, $, $$, type and click. It runs on the first page, in the first\n scheme, at each width. A .ts, .mts or .cts file is TypeScript: the check\n removes its types and its line export {}.\n --page-probe <page>=<file>\n The probe of one page of --pages, for example /structures/=probe.ts. Give\n the option one time for each page. A page with no probe has none. The\n first page takes --probe or --page-probe, not both.\n --shots <dir> The folder for the screenshots, report.json and summary.md\n --browser <file> The Chromium executable (default: $SITE_CHECK_BROWSER, the Chromium of\n Playwright, else Chrome or Edge)\n --settle <ms> The wait after the load event (default: 1500)\n --timeout <ms> The time limit of a page load (default: 30000)\n --help Shows this text\n\nWith $GITHUB_STEP_SUMMARY, the check adds its table to the job summary.\n`;\n\n/** This function runs the `check` command with its arguments, without the word `check`. */\nexport async function runCheckCli(argv: readonly string[], io: CheckIo): Promise<number> {\n let values: Record<string, string | boolean | string[] | undefined>;\n try {\n ({ values } = parseArgs({\n args: [...argv],\n allowPositionals: false,\n options: {\n out: { type: \"string\" },\n url: { type: \"string\" },\n repo: { type: \"string\" },\n base: { type: \"string\" },\n pages: { type: \"string\" },\n widths: { type: \"string\" },\n schemes: { type: \"string\" },\n probe: { type: \"string\" },\n \"page-probe\": { type: \"string\", multiple: true },\n shots: { type: \"string\" },\n browser: { type: \"string\" },\n settle: { type: \"string\" },\n timeout: { type: \"string\" },\n help: { type: \"boolean\" },\n },\n }));\n } catch (error) {\n io.stderr(`site-pages check: ${error instanceof Error ? error.message : String(error)}\\n\\n${CHECK_HELP}`);\n return 2;\n }\n if (values[\"help\"]) {\n io.stdout(CHECK_HELP);\n return 0;\n }\n const usage = (message: string) => {\n io.stderr(`site-pages check: ${message}\\n\\n${CHECK_HELP}`);\n return 2;\n };\n const text = (key: string) => (typeof values[key] === \"string\" ? (values[key] as string) : undefined);\n const list = (key: string, fallback: string) => (text(key) ?? fallback).split(\",\").map((entry) => entry.trim()).filter(Boolean);\n const out = text(\"out\");\n const url = text(\"url\");\n if ((out === undefined) === (url === undefined)) return usage(\"give --out or --url, not both\");\n const widths = list(\"widths\", \"360,400,1280\").map(Number);\n if (widths.length === 0 || widths.some((width) => !Number.isInteger(width) || width < 200 || width > 4000)) return usage(\"--widths must be whole numbers from 200 to 4000\");\n const schemes = list(\"schemes\", \"light,dark\");\n if (schemes.length === 0 || schemes.some((scheme) => scheme !== \"light\" && scheme !== \"dark\")) return usage(\"--schemes must be light, dark or both\");\n const pages = list(\"pages\", \"/\");\n if (pages.length === 0) return usage(\"--pages has no page\");\n // Git Bash changes a bare \"/\" into \"C:/Program Files/Git/\". A page is a path, with no scheme or drive.\n const notPath = pages.find((entry) => entry.includes(\":\") || entry.includes(\"\\\\\"));\n if (notPath !== undefined) return usage(`a page is a path from the site home, not \"${notPath}\" (in Git Bash, set MSYS_NO_PATHCONV=1)`);\n const settleMs = Number(text(\"settle\") ?? 1500);\n const timeoutMs = Number(text(\"timeout\") ?? 30000);\n if (!(settleMs >= 0) || !(timeoutMs > 0)) return usage(\"--settle and --timeout must be numbers of milliseconds\");\n let base = text(\"base\");\n if (out !== undefined && base === undefined) {\n const name = (text(\"repo\") ?? io.env[\"GITHUB_REPOSITORY\"] ?? \"\").split(\"/\")[1];\n if (!name) return usage(\"give --base, --repo or set GITHUB_REPOSITORY\");\n base = /\\.github\\.io$/i.test(name) ? \"/\" : `/${name}/`;\n }\n if (base !== undefined) base = `/${base.replace(/^\\/+|\\/+$/g, \"\")}/`.replace(/^\\/\\/$/, \"/\");\n const at = (file: string) => (isAbsolute(file) ? file : resolve(io.cwd, file));\n /** This function reads a probe file. A TypeScript file loses its types. A file that cannot be read gives an Error. */\n const readProbe = (file: string): string | Error => {\n let code: string;\n try {\n code = readFileSync(at(file), \"utf8\");\n } catch (error) {\n return new Error(`the probe file ${file} cannot be read: ${error instanceof Error ? error.message : String(error)}`);\n }\n if (!TYPESCRIPT_PROBE.test(file)) return code;\n try {\n return probeScript(code);\n } catch (error) {\n return new Error(`the types of the probe file ${file} cannot be removed: ${error instanceof Error ? error.message : String(error)}`);\n }\n };\n const probeFile = text(\"probe\");\n let probe: string | undefined;\n if (probeFile !== undefined) {\n const code = readProbe(probeFile);\n if (code instanceof Error) return usage(code.message);\n probe = code;\n }\n const probes: Record<string, string> = {};\n for (const entry of (values[\"page-probe\"] as string[] | undefined) ?? []) {\n const split = entry.indexOf(\"=\");\n const page = entry.slice(0, split).trim();\n const file = entry.slice(split + 1).trim();\n if (split <= 0 || file === \"\") return usage(`--page-probe must be <page>=<file>, not \"${entry}\"`);\n if (Object.hasOwn(probes, page)) return usage(`--page-probe gives two probes for the page ${page}`);\n const code = readProbe(file);\n if (code instanceof Error) return usage(code.message);\n probes[page] = code;\n }\n try {\n pageProbes({ pages, probe, probes });\n } catch (error) {\n return usage(error instanceof Error ? error.message : String(error));\n }\n const shots = text(\"shots\");\n const result = await checkSite({\n out: out === undefined ? undefined : at(out),\n base,\n url,\n pages,\n widths,\n schemes: schemes as (\"light\" | \"dark\")[],\n probe,\n probes,\n shots: shots === undefined ? undefined : at(shots),\n browser: text(\"browser\"),\n settleMs,\n timeoutMs,\n log: (line) => io.stdout(`${line}\\n`),\n });\n const failed = result.views.filter((view) => !view.ok).length;\n io.stdout(`site-pages check: ${result.views.length - failed} of ${result.views.length} views passed (${result.browser}).\\n`);\n const step = io.env[\"GITHUB_STEP_SUMMARY\"];\n if (step) appendFileSync(step, summary(result));\n return result.ok ? 0 : 1;\n}\n","/**\n * The navigation check of a site (`site-pages nav`). It opens the home page in a headless Chromium.\n * It follows the links that the browser shows, and counts the clicks from home to each page.\n * The check fails when a page of the sitemap is more than `maxClicks` clicks from home.\n * It also fails when a page has no visible link back to home, or when a link of the site opens a new tab.\n * A link to a missing page fails too.\n *\n * The check clicks each link to the Releases page and the Status page.\n * A single-page application can catch such a click and show its own page in place of the page of site-pages.\n * The rules are functions with no I/O, so the tests call them with no browser.\n */\n\nimport { appendFileSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { parseArgs } from \"node:util\";\nimport { barHtml, injectBar, parsePages, type BarOptions } from \"../bar/bar.ts\";\nimport { findBrowser, launch, type Page } from \"./browser.ts\";\nimport { cell, PHONE_WIDTH, pageSlug, type CheckIo } from \"./check.ts\";\nimport { serve } from \"./serve.ts\";\n\n/** One link of a page, as the browser shows it. */\nexport interface NavLink {\n /** The absolute URL of the link, with no fragment. */\n readonly href: string;\n /** The text of the link, or its label. */\n readonly text: string;\n /** The value of the attribute `target`, or an empty text. */\n readonly target: string;\n /** True when the link has a size and the page does not hide it. */\n readonly visible: boolean;\n}\n\n/** One page that the crawl opened. */\nexport interface NavPage {\n /** The path of the page from the site home, for example `releases/`. The home is an empty text. */\n readonly path: string;\n /** The number of clicks from home. */\n readonly clicks: number;\n /** The HTTP status of the document. */\n readonly status: number;\n /** The path of the page that linked to this page first, or undefined for the home. */\n readonly from: string | undefined;\n /** The links of the page at the desktop width. */\n readonly links: readonly NavLink[];\n /** True when the page shows a link to home at the phone width. */\n readonly homeAtPhone: boolean;\n /** True when the page has the shared site bar (`[data-site-bar]`). */\n readonly bar: boolean;\n}\n\n/** The result of a click on a link to a page of site-pages. */\nexport interface NavClick {\n /** The page with the link. */\n readonly from: string;\n /** The path of the link. */\n readonly to: string;\n /** The path of the page after the click. */\n readonly landed: string;\n /** True when the page after the click has the header of site-pages (`.sp-header`) or the site bar. */\n readonly shown: boolean;\n}\n\n/** The options of `crawlSite`. */\nexport interface NavOptions {\n /** The built site folder. The crawl serves it at `base`. */\n readonly out?: string | undefined;\n /** The URL of a live site home, in place of `out`. */\n readonly url?: string | undefined;\n /** The path of the site home, for `out`. */\n readonly base?: string | undefined;\n /** The largest number of clicks from home to a page. */\n readonly maxClicks: number;\n /** The largest number of pages to open. */\n readonly maxPages: number;\n /** True: each page must have the shared site bar. */\n readonly requireBar: boolean;\n /** A folder for the screenshots, report.json and summary.md. */\n readonly shots?: string | undefined;\n /** The paths of the pages to take screenshots of, from the site home. */\n readonly shotPages: readonly string[];\n readonly browser?: string | undefined;\n readonly settleMs: number;\n readonly timeoutMs: number;\n readonly log?: ((line: string) => void) | undefined;\n /**\n * The content of a bar for a preview, or undefined for no preview. The browser writes this bar into each page of\n * the site as it loads, as the Pages workflow does after the build. Thus the crawl shows a live site with the bar.\n */\n readonly previewBar?: BarOptions | undefined;\n}\n\n/** The result of `crawlSite`. */\nexport interface NavResult {\n readonly ok: boolean;\n readonly home: string;\n readonly pages: readonly NavPage[];\n /** The paths of the sitemap, or an empty list when the site has no sitemap. */\n readonly sitemap: readonly string[];\n readonly clicks: readonly NavClick[];\n readonly problems: readonly string[];\n /**\n * The paths that the crawl did not open, because it stopped at the limit `maxPages`. A path of this list is a no-read: the\n * crawl does not know its problems. A result with a no-read is not `ok`.\n */\n readonly unread: readonly string[];\n}\n\n/**\n * This function gives the no-reads of a crawl: the paths left in its queue, and each path of the sitemap that it did not\n * open. A crawl with an empty queue read each page that a link reaches, so it has no no-read.\n */\nexport function navUnread(queue: readonly string[], pages: readonly Pick<NavPage, \"path\">[], sitemap: readonly string[]): string[] {\n if (queue.length === 0) return [];\n const opened = new Set(pages.map((page) => page.path));\n return [...new Set([...queue, ...sitemap.filter((path) => !opened.has(path))])];\n}\n\n/** The phone width of the check of the way back. */\nexport const NAV_PHONE_WIDTH = 360;\n/** The desktop width of the crawl. */\nexport const NAV_DESKTOP_WIDTH = 1280;\n\n/**\n * This function gives the path of a URL from the site home, or undefined when the URL is not a page\n * of the site. A file with an extension other than `.html` is not a page. `index.html` is its folder.\n */\nexport function sitePath(href: string, home: URL): string | undefined {\n let url: URL;\n try {\n url = new URL(href, home);\n } catch {\n return undefined;\n }\n if (url.origin !== home.origin || !url.pathname.startsWith(home.pathname)) return undefined;\n const path = url.pathname.slice(home.pathname.length).replace(/(^|\\/)index\\.html$/, \"$1\");\n const last = path.split(\"/\").at(-1) ?? \"\";\n if (last.includes(\".\") && !last.endsWith(\".html\")) return undefined;\n return path;\n}\n\n/** This function gives the paths of the `<loc>` entries of a sitemap that are pages of the site. */\nexport function sitemapPaths(xml: string, home: URL): string[] {\n const paths = [...xml.matchAll(/<loc>\\s*([^<\\s]+)\\s*<\\/loc>/g)].map((match) => sitePath(match[1] ?? \"\", home));\n return [...new Set(paths.filter((path): path is string => path !== undefined))];\n}\n\n/** The name of a page in a message: its path, or \"the home page\". */\nconst named = (path: string) => (path === \"\" ? \"the home page\" : `/${path}`);\n\n/** This function gives the problems of a crawl. It reads no file and opens no page. */\nexport function navProblems(result: Pick<NavResult, \"pages\" | \"sitemap\" | \"clicks\"> & { readonly unread?: readonly string[] }, home: URL, options: Pick<NavOptions, \"maxClicks\" | \"requireBar\">): string[] {\n const problems: string[] = [];\n const byPath = new Map(result.pages.map((page) => [page.path, page]));\n const unread = new Set(result.unread ?? []);\n for (const path of result.sitemap) {\n const page = byPath.get(path);\n // A page that the crawl did not open is a no-read, not a problem (refer to `navUnread`)\n if (page === undefined && unread.has(path)) continue;\n if (page === undefined) problems.push(`${named(path)} is in the sitemap, and no chain of links from home reaches it`);\n else if (page.clicks > options.maxClicks) problems.push(`${named(path)} is ${page.clicks} clicks from home, over the limit of ${options.maxClicks}`);\n }\n for (const page of result.pages) {\n if (page.status >= 400) {\n problems.push(`a link of ${named(page.from ?? \"\")} goes to ${named(page.path)}, which gives HTTP ${page.status}`);\n continue;\n }\n if (page.path !== \"\") {\n const back = page.links.some((link) => link.visible && sitePath(link.href, home) === \"\");\n if (!back) problems.push(`${named(page.path)} shows no link back to home at ${NAV_DESKTOP_WIDTH} px`);\n else if (!page.homeAtPhone) problems.push(`${named(page.path)} shows no link back to home at ${NAV_PHONE_WIDTH} px`);\n }\n if (options.requireBar && !page.bar) problems.push(`${named(page.path)} has no site bar`);\n for (const link of page.links) {\n if (link.target !== \"\" && link.target !== \"_self\" && sitePath(link.href, home) !== undefined) {\n problems.push(`the link \"${link.text}\" of ${named(page.path)} opens ${named(sitePath(link.href, home) ?? \"\")} in a new tab, so the back button of the browser does not go back`);\n }\n }\n }\n for (const click of result.clicks) {\n if (click.landed !== click.to) problems.push(`a click on the link to ${named(click.to)} of ${named(click.from)} shows ${named(click.landed)}`);\n else if (!click.shown) problems.push(`a click on the link to ${named(click.to)} of ${named(click.from)} does not show that page: the site shows its own page at that path`);\n }\n return [...new Set(problems)];\n}\n\n/**\n * The function that clicks the first link of the page to the path in its argument, in the same tab. It gives true when\n * the page has such a link. The path is an argument of the call, so it is not a part of the code.\n */\nconst CLICK_LINK = `function (pathname) {\n const a = [...document.querySelectorAll(\"a[href]\")].find((el) => new URL(el.getAttribute(\"href\"), location.href).pathname === pathname);\n if (a) { a.removeAttribute(\"target\"); a.click(); }\n return Boolean(a);\n}`;\n\n/** The expression that gives the links of the page and the marks of its header. */\nexport const NAV_SCAN = `(() => {\n const shown = (el) => {\n const box = el.getBoundingClientRect();\n if (box.width < 1 || box.height < 1) return false;\n for (let node = el; node; node = node.parentElement) {\n const style = getComputedStyle(node);\n if (style.visibility === \"hidden\" || style.display === \"none\" || Number(style.opacity) === 0) return false;\n }\n return box.right > 0 && box.left < innerWidth;\n };\n const links = [...document.querySelectorAll(\"a[href]\")].map((a) => {\n const url = new URL(a.getAttribute(\"href\"), location.href);\n url.hash = \"\";\n const text = (a.textContent || a.getAttribute(\"aria-label\") || a.getAttribute(\"title\") || \"\").replace(/\\\\s+/g, \" \").trim().slice(0, 80);\n return { href: url.href, text, target: a.getAttribute(\"target\") || \"\", visible: shown(a) };\n });\n return { links, bar: document.querySelector(\"[data-site-bar]\") !== null, spHeader: document.querySelector(\".sp-header\") !== null, path: location.pathname };\n})()`;\n\ninterface Scan {\n links: NavLink[];\n bar: boolean;\n spHeader: boolean;\n path: string;\n}\n\nasync function open(page: Page, target: string, width: number, options: NavOptions): Promise<{ status: number; scan: Scan }> {\n await page.send(\"Emulation.setDeviceMetricsOverride\", { width, height: 900, deviceScaleFactor: 1, mobile: width < PHONE_WIDTH });\n const loaded = page.once(\"Page.loadEventFired\", options.timeoutMs);\n const navigation = (await page.send(\"Page.navigate\", { url: target })) as { errorText?: string };\n if (navigation.errorText) {\n loaded.catch(() => {});\n return { status: 0, scan: { links: [], bar: false, spHeader: false, path: \"\" } };\n }\n await loaded;\n await new Promise((done) => setTimeout(done, options.settleMs));\n return { status: await documentStatus(target), scan: await page.evaluate<Scan>(NAV_SCAN) };\n}\n\n/** This function gives the HTTP status of the document at the URL, or 0 when the request fails. */\nasync function documentStatus(target: string): Promise<number> {\n try {\n const response = await fetch(target, { redirect: \"follow\" });\n await response.body?.cancel();\n return response.status;\n } catch {\n return 0;\n }\n}\n\nasync function shot(page: Page, file: string, width: number): Promise<void> {\n const height = Math.min(Math.max(await page.evaluate<number>(\"document.documentElement.scrollHeight\"), 1), 3000);\n const data = (await page.send(\"Page.captureScreenshot\", { format: \"png\", captureBeyondViewport: true, clip: { x: 0, y: 0, width, height, scale: 1 } })) as { data: string };\n writeFileSync(file, Buffer.from(data.data, \"base64\"));\n}\n\n/** The fields of the event `Fetch.requestPaused` of a response. */\ninterface PausedResponse {\n requestId: string;\n request: { url: string };\n responseStatusCode?: number;\n responseHeaders?: { name: string; value: string }[];\n}\n\n/**\n * This function makes the browser write the bar into each HTML document of the site, at the response stage of the\n * request. A response that is not HTML, or a redirect, goes on with no change.\n */\nasync function previewBar(page: Page, home: URL, bar: BarOptions): Promise<void> {\n const fulfill = async (paused: PausedResponse) => {\n const status = paused.responseStatusCode ?? 200;\n const headers = paused.responseHeaders ?? [];\n const type = headers.find((header) => header.name.toLowerCase() === \"content-type\")?.value ?? \"\";\n if (!type.includes(\"text/html\") || (status >= 300 && status < 400)) {\n await page.send(\"Fetch.continueRequest\", { requestId: paused.requestId });\n return;\n }\n const body = (await page.send(\"Fetch.getResponseBody\", { requestId: paused.requestId })) as { body: string; base64Encoded: boolean };\n const html = body.base64Encoded ? Buffer.from(body.body, \"base64\").toString(\"utf8\") : body.body;\n const next = injectBar(html, barHtml(bar, sitePath(paused.request.url, home) ?? \"\"));\n await page.send(\"Fetch.fulfillRequest\", {\n requestId: paused.requestId,\n responseCode: status,\n responseHeaders: headers.filter((header) => !/^(content-length|content-encoding)$/i.test(header.name)),\n body: Buffer.from(next, \"utf8\").toString(\"base64\"),\n });\n };\n page.on(\"Fetch.requestPaused\", (params) => {\n const paused = params as unknown as PausedResponse;\n fulfill(paused).catch(() => page.send(\"Fetch.continueRequest\", { requestId: paused.requestId }).catch(() => {}));\n });\n await page.send(\"Fetch.enable\", { patterns: [{ urlPattern: `${home.origin}${home.pathname}*`, resourceType: \"Document\", requestStage: \"Response\" }] });\n}\n\n/**\n * This function gives the repository of a site of GitHub Pages from the URL of its home, for example `owner/name`\n * for `https://owner.github.io/name/`. It gives undefined for a URL of another host.\n */\nexport function repositoryOfUrl(url: string): string | undefined {\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n return undefined;\n }\n const owner = /^([a-z0-9-]+)\\.github\\.io$/i.exec(parsed.hostname)?.[1];\n if (owner === undefined) return undefined;\n const name = parsed.pathname.split(\"/\").filter(Boolean)[0];\n return `${owner}/${name ?? `${owner}.github.io`}`;\n}\n\n/** This function crawls the site, clicks the links to the pages of site-pages, and gives the result. */\nexport async function crawlSite(options: NavOptions): Promise<NavResult> {\n const log = options.log ?? (() => {});\n const executable = findBrowser(options.browser);\n if (executable === undefined) throw new Error(\"no Chromium browser was found: give --browser, set SITE_CHECK_BROWSER, or install the Chromium of Playwright\");\n const server = options.out !== undefined ? await serve(options.out, options.base ?? \"/\") : undefined;\n const start = server?.url ?? options.url;\n if (start === undefined) throw new Error(\"give out or url\");\n const home = new URL(start.endsWith(\"/\") ? start : `${start}/`);\n const browser = await launch(executable, options.timeoutMs);\n const pages: NavPage[] = [];\n const clicks: NavClick[] = [];\n let sitemap: string[] = [];\n let left: string[] = [];\n try {\n const { page } = browser;\n await Promise.all([page.send(\"Page.enable\"), page.send(\"Runtime.enable\")]);\n if (options.previewBar !== undefined) await previewBar(page, home, options.previewBar);\n try {\n const response = await fetch(new URL(\"sitemap.xml\", home));\n if (response.ok) sitemap = sitemapPaths(await response.text(), home);\n } catch {\n sitemap = [];\n }\n if (options.shots) mkdirSync(options.shots, { recursive: true });\n const queue: { path: string; clicks: number; from: string | undefined }[] = [{ path: \"\", clicks: 0, from: undefined }];\n const seen = new Set<string>([\"\"]);\n while (queue.length > 0 && pages.length < options.maxPages) {\n const next = queue.shift();\n if (next === undefined) break;\n const target = new URL(next.path, home).href;\n const desktop = await open(page, target, NAV_DESKTOP_WIDTH, options);\n const phone = await open(page, target, NAV_PHONE_WIDTH, options);\n const homeAtPhone = phone.scan.links.some((link) => link.visible && sitePath(link.href, home) === \"\");\n const entry: NavPage = { path: next.path, clicks: next.clicks, status: desktop.status, from: next.from, links: desktop.scan.links, homeAtPhone, bar: desktop.scan.bar };\n pages.push(entry);\n log(`${next.clicks} ${named(next.path)} HTTP ${desktop.status}, ${desktop.scan.links.length} links${homeAtPhone ? \"\" : \", no home link at 360 px\"}`);\n if (desktop.status >= 400) continue;\n for (const link of desktop.scan.links) {\n const path = sitePath(link.href, home);\n if (path === undefined || seen.has(path)) continue;\n seen.add(path);\n queue.push({ path, clicks: next.clicks + 1, from: next.path });\n }\n }\n left = queue.map((entry) => entry.path);\n // A click on each link to a page of site-pages, from each page that the crawl opened at most one click from home.\n for (const from of pages.filter((entry) => entry.clicks <= 1 && entry.status < 400)) {\n const targets = [...new Set(from.links.map((link) => sitePath(link.href, home)).filter((path): path is string => path === \"releases/\" || path === \"status/\"))];\n for (const to of targets) {\n if (to === from.path) continue;\n await open(page, new URL(from.path, home).href, NAV_DESKTOP_WIDTH, options);\n const landed = page.once(\"Page.loadEventFired\", options.timeoutMs).catch(() => undefined);\n await page.call(CLICK_LINK, new URL(to, home).pathname);\n await Promise.race([landed, new Promise((done) => setTimeout(done, 3000))]);\n await new Promise((done) => setTimeout(done, options.settleMs));\n const scan = await page.evaluate<Scan>(NAV_SCAN);\n const click: NavClick = { from: from.path, to, landed: sitePath(new URL(scan.path, home).href, home) ?? scan.path, shown: scan.spHeader || scan.bar };\n clicks.push(click);\n log(`click ${named(from.path)} -> ${named(to)}: ${named(click.landed)}${click.shown ? \"\" : \", not the page of site-pages\"}`);\n }\n }\n if (options.shots) {\n for (const path of options.shotPages) {\n for (const width of [NAV_DESKTOP_WIDTH, NAV_PHONE_WIDTH]) {\n const clean = path.replace(/^\\/+/, \"\");\n await open(page, new URL(clean, home).href, width, options);\n await shot(page, join(options.shots, `${pageSlug(path)}-${width}.png`), width);\n }\n }\n }\n } finally {\n await browser.close();\n await server?.close();\n }\n const unread = navUnread(left, pages, sitemap);\n const problems = navProblems({ pages, sitemap, clicks, unread }, home, options);\n const result: NavResult = { ok: problems.length === 0 && unread.length === 0, home: home.href, pages, sitemap, clicks, problems, unread };\n if (options.shots) {\n writeFileSync(join(options.shots, \"report.json\"), `${JSON.stringify(result, null, 2)}\\n`);\n writeFileSync(join(options.shots, \"summary.md\"), navSummary(result));\n }\n return result;\n}\n\n/** This function gives the text of the no-reads of a crawl, with their count and the first 10 paths. */\nexport function navUnreadText(result: Pick<NavResult, \"pages\" | \"unread\">): string {\n const first = result.unread.slice(0, 10).map(named).join(\", \");\n const more = result.unread.length > 10 ? `, and ${String(result.unread.length - 10)} more` : \"\";\n return `the crawl stopped at the limit of ${result.pages.length} ${result.pages.length === 1 ? \"page\" : \"pages\"}, so it did not read ${result.unread.length} ${result.unread.length === 1 ? \"page\" : \"pages\"}: ${first}${more}.`;\n}\n\n/** This function gives the summary of a crawl as Markdown. */\nexport function navSummary(result: NavResult): string {\n const lines = [`### Navigation of ${result.home}`, \"\", `${result.pages.length} ${result.pages.length === 1 ? \"page\" : \"pages\"} opened, ${result.sitemap.length} in the sitemap, ${result.problems.length} ${result.problems.length === 1 ? \"problem\" : \"problems\"}.`, \"\"];\n if (result.unread.length > 0) lines.push(`**No read:** ${navUnreadText(result)}`, \"\");\n for (const problem of result.problems) lines.push(`- ${cell(problem)}`);\n lines.push(\"\", \"| Clicks | Page | HTTP | Home link at 360 px | Site bar |\", \"|---|---|---|---|---|\");\n for (const page of result.pages) lines.push(`| ${page.clicks} | ${named(page.path)} | ${page.status} | ${page.homeAtPhone ? \"yes\" : \"no\"} | ${page.bar ? \"yes\" : \"no\"} |`);\n return `${lines.join(\"\\n\")}\\n`;\n}\n\nexport const NAV_HELP = `Usage: site-pages nav (--out <dir> | --url <url>) [options]\n\nOpens the home page of the site in a headless Chromium and follows the links that the page shows,\npage by page. It fails when a page of sitemap.xml is more than --max-clicks clicks from home, when\na page shows no link back to home at 1280 px or at 360 px, when a link of the site opens a new tab,\nor when a link goes to a missing page. It clicks each link to releases/ and status/, and fails when\nthe page after the click does not have the header of site-pages.\n\nOptions:\n --out <dir> The built site folder. The crawl serves it at --base.\n --url <url> The URL of a live site home, in place of --out\n --repo <owner/name> The GitHub repository, for the default base (default: $GITHUB_REPOSITORY)\n --base </name/> The path of the site home (default: \"/<name>/\", or \"/\" for <owner>.github.io)\n --max-clicks <n> The largest number of clicks from home to a page (default: 2)\n --max-pages <n> The largest number of pages to open (default: 60)\n --require-bar Each page must have the shared site bar ([data-site-bar])\n --preview-bar The browser writes the shared site bar into each page of the site as it\n loads, with Releases and Status. Thus a live site shows the bar before its\n Pages workflow adds it. The repository comes from a github.io URL, or --repo.\n --bar-pages <list> The pages of the preview bar, as label=path pairs separated by commas\n --bar-npm <name> The npm name of the package, for the npm link of the preview bar\n --shots <dir> The folder for the screenshots, report.json and summary.md\n --shot-pages <list> The pages to take screenshots of, separated by commas (default: /,releases/,status/)\n --browser <file> The Chromium executable (default: $SITE_CHECK_BROWSER, the Chromium of\n Playwright, else Chrome or Edge)\n --settle <ms> The wait after the load event (default: 800)\n --timeout <ms> The time limit of a page load (default: 30000)\n --help Shows this text\n\nWith $GITHUB_STEP_SUMMARY, the crawl adds its table to the job summary.\n`;\n\n/** This function starts the `nav` command with its arguments, without the word `nav`. */\nexport async function runNavCli(argv: readonly string[], io: CheckIo): Promise<number> {\n let values: Record<string, string | boolean | undefined>;\n try {\n ({ values } = parseArgs({\n args: [...argv],\n allowPositionals: false,\n options: {\n out: { type: \"string\" },\n url: { type: \"string\" },\n repo: { type: \"string\" },\n base: { type: \"string\" },\n \"max-clicks\": { type: \"string\" },\n \"max-pages\": { type: \"string\" },\n \"require-bar\": { type: \"boolean\" },\n \"preview-bar\": { type: \"boolean\" },\n \"bar-pages\": { type: \"string\" },\n \"bar-npm\": { type: \"string\" },\n shots: { type: \"string\" },\n \"shot-pages\": { type: \"string\" },\n browser: { type: \"string\" },\n settle: { type: \"string\" },\n timeout: { type: \"string\" },\n help: { type: \"boolean\" },\n },\n }));\n } catch (error) {\n io.stderr(`site-pages nav: ${error instanceof Error ? error.message : String(error)}\\n\\n${NAV_HELP}`);\n return 2;\n }\n if (values[\"help\"]) {\n io.stdout(NAV_HELP);\n return 0;\n }\n const usage = (message: string) => {\n io.stderr(`site-pages nav: ${message}\\n\\n${NAV_HELP}`);\n return 2;\n };\n const text = (key: string) => (typeof values[key] === \"string\" ? (values[key] as string) : undefined);\n const out = text(\"out\");\n const url = text(\"url\");\n if ((out === undefined) === (url === undefined)) return usage(\"give --out or --url, not both\");\n const maxClicks = Number(text(\"max-clicks\") ?? 2);\n const maxPages = Number(text(\"max-pages\") ?? 60);\n if (!Number.isInteger(maxClicks) || maxClicks < 1 || !Number.isInteger(maxPages) || maxPages < 1) return usage(\"--max-clicks and --max-pages must be whole numbers of 1 or more\");\n const settleMs = Number(text(\"settle\") ?? 800);\n const timeoutMs = Number(text(\"timeout\") ?? 30000);\n if (!(settleMs >= 0) || !(timeoutMs > 0)) return usage(\"--settle and --timeout must be numbers of milliseconds\");\n const shotPages = (text(\"shot-pages\") ?? \"/,releases/,status/\").split(\",\").map((entry) => entry.trim()).filter(Boolean);\n const notPath = shotPages.find((entry) => entry.includes(\":\") || entry.includes(\"\\\\\"));\n if (notPath !== undefined) return usage(`a page is a path from the site home, not \"${notPath}\" (in Git Bash, set MSYS_NO_PATHCONV=1)`);\n let base = text(\"base\");\n if (out !== undefined && base === undefined) {\n const name = (text(\"repo\") ?? io.env[\"GITHUB_REPOSITORY\"] ?? \"\").split(\"/\")[1];\n if (!name) return usage(\"give --base, --repo or set GITHUB_REPOSITORY\");\n base = /\\.github\\.io$/i.test(name) ? \"/\" : `/${name}/`;\n }\n if (base !== undefined) base = `/${base.replace(/^\\/+|\\/+$/g, \"\")}/`.replace(/^\\/\\/$/, \"/\");\n let preview: BarOptions | undefined;\n if (values[\"preview-bar\"] === true) {\n const repository = text(\"repo\") ?? (url === undefined ? io.env[\"GITHUB_REPOSITORY\"] : repositoryOfUrl(url));\n if (repository === undefined || !repository.includes(\"/\")) return usage(\"--preview-bar needs --repo for a site that is not on github.io\");\n const pages = parsePages(text(\"bar-pages\") ?? \"\");\n if (pages instanceof Error) return usage(pages.message);\n const previewBase = base ?? (url === undefined ? \"/\" : new URL(url.endsWith(\"/\") ? url : `${url}/`).pathname);\n const [owner = \"\"] = repository.split(\"/\");\n const ownerSite = repository.toLowerCase() === `${owner.toLowerCase()}/${owner.toLowerCase()}.github.io`;\n preview = { repository, base: previewBase, pages, sitePages: true, npm: text(\"bar-npm\"), portfolio: ownerSite ? undefined : `https://${owner.toLowerCase()}.github.io/` };\n }\n const shots = text(\"shots\");\n const result = await crawlSite({\n out: out === undefined ? undefined : isAbsolute(out) ? out : resolve(io.cwd, out),\n url,\n base,\n maxClicks,\n maxPages,\n requireBar: values[\"require-bar\"] === true,\n previewBar: preview,\n shots: shots === undefined ? undefined : isAbsolute(shots) ? shots : resolve(io.cwd, shots),\n shotPages,\n browser: text(\"browser\"),\n settleMs,\n timeoutMs,\n log: (line) => io.stdout(`${line}\\n`),\n });\n for (const problem of result.problems) io.stdout(`FAIL ${problem}\\n`);\n if (result.unread.length > 0) io.stdout(`NO READ ${navUnreadText(result)}\\n`);\n io.stdout(`site-pages nav: ${result.pages.length} ${result.pages.length === 1 ? \"page\" : \"pages\"}, ${result.problems.length} ${result.problems.length === 1 ? \"problem\" : \"problems\"}, ${result.unread.length} ${result.unread.length === 1 ? \"page\" : \"pages\"} not read.\\n`);\n const step = io.env[\"GITHUB_STEP_SUMMARY\"];\n if (step) appendFileSync(step, navSummary(result));\n return result.ok ? 0 : 1;\n}\n","#!/usr/bin/env node\n// The bin `site-pages`. The work is in build.ts, bar/bar.ts, bar/cue.ts, check/check.ts, check/freshness.ts and check/nav.ts, so a test can run the same CLI with its own fetch.\nimport { runBarCli } from \"./bar/bar.ts\";\nimport { runCueCli } from \"./bar/cue.ts\";\nimport { runCli } from \"./build.ts\";\nimport { runCheckCli } from \"./check/check.ts\";\nimport { runFreshnessCli } from \"./check/freshness.ts\";\nimport { runNavCli } from \"./check/nav.ts\";\n\nconst argv = process.argv.slice(2);\nconst io = {\n cwd: process.cwd(),\n env: process.env,\n stdout: (text: string) => process.stdout.write(text),\n stderr: (text: string) => process.stderr.write(text),\n};\n(argv[0] === \"check\" ? runCheckCli(argv.slice(1), io) : argv[0] === \"freshness\" ? runFreshnessCli(argv.slice(1), io) : argv[0] === \"nav\" ? runNavCli(argv.slice(1), io) : argv[0] === \"bar\" ? Promise.resolve(runBarCli(argv.slice(1), io)) : argv[0] === \"cue\" ? Promise.resolve(runCueCli(argv.slice(1), io)) : runCli(argv, io)).then(\n (code) => {\n process.exitCode = code;\n },\n (error: unknown) => {\n process.stderr.write(`site-pages: ${error instanceof Error ? (error.stack ?? error.message) : String(error)}\\n`);\n process.exitCode = 1;\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,MAAa,gBAAgB;;AAG7B,MAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;AAyBvB,SAAgB,SAAS,MAAsB;CAC7C,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,QAAQ,sBAAsB,IAAI;AACrE;;;;;AAMA,SAAgB,YAAY,OAA2B,MAAmC;CACxF,IAAI;CACJ,KAAK,MAAM,SAAS,OAElB,KADc,MAAM,SAAS,KAAK,SAAS,KAAK,SAAS,MAAM,QAAS,MAAM,KAAK,SAAS,GAAG,KAAK,KAAK,WAAW,MAAM,IAAI,OAChH,SAAS,KAAA,KAAa,MAAM,KAAK,SAAS,KAAK,KAAK,SAAS,OAAO;CAEpF,OAAO;AACT;;AAGA,SAAgB,SAAS,SAAgC;CACvD,MAAM,QAAmB,CAAC;EAAE,OAAO;EAAQ,MAAM;CAAG,GAAG,GAAG,QAAQ,MAAM,QAAQ,UAAU,MAAM,SAAS,EAAE,CAAC;CAC5G,IAAI,QAAQ,WAAW,MAAM,KAAK;EAAE,OAAO;EAAY,MAAM;CAAY,GAAG;EAAE,OAAO;EAAU,MAAM;CAAU,CAAC;CAChH,MAAM,uBAAO,IAAI,IAAY;CAC7B,OAAO,MAAM,QAAQ,UAAU;EAC7B,IAAI,KAAK,IAAI,MAAM,IAAI,GAAG,OAAO;EACjC,KAAK,IAAI,MAAM,IAAI;EACnB,OAAO;CACT,CAAC;AACH;;AAGA,SAAgB,QAAQ,SAAqB,MAAsB;CACjE,MAAM,CAAC,QAAQ,IAAI,OAAO,MAAM,QAAQ,WAAW,MAAM,GAAG;CAC5D,MAAM,QAAQ,SAAiB,WAAW,GAAG,QAAQ,OAAO,MA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AAM,CAAC,GAAG,EAAE,IAAI,KAAK,OAAO,QAAQ,QAAQ,QAAQ,UAAU,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,OAAO,QAAQ,QAAQ,QAAQ,UAAU,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,OAAO,MAAM,EAAE,EAAA,CAAG,MACjU,SAAS;CACR,QAAQ,WAAW;AACrB,IACC,UAAmB;CAClB,QAAQ,OAAO,MAAM,eAAe,iBAAiB,QAAS,MAAM,SAAS,MAAM,UAAW,OAAO,KAAK,EAAE,GAAG;CAC/G,QAAQ,WAAW;AACrB,CACF"}
|
|
1
|
+
{"version":3,"file":"cli.js","names":["STYLE_ID","STYLE_PATTERN"],"sources":["../src/bar/bar.ts","../src/bar/cue.ts","../src/check/browser.ts","../src/check/measure.ts","../src/check/serve.ts","../src/check/check.ts","../src/check/nav.ts","../src/cli.ts"],"sourcesContent":["/**\n * The shared site bar (`site-pages bar`). The Pages workflow writes one bar into each built HTML page of a site.\n * Thus each page of each site has the same way to each other page, and no site writes its own bar.\n *\n * The bar has the portfolio of the owner and the name of the site. It also has a link to each page of the site, to\n * GitHub and to npm. The link of the current page has `aria-current=\"page\"`. The bar works at 360 px: its rows wrap.\n * Its CSS has its own class names and variables, so the CSS of a site does not change it.\n */\n\nimport { readdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport { parseArgs } from \"node:util\";\nimport { escapeHtml, safeUrl } from \"../render/html.ts\";\n\n/** One link of the bar to a page of the site. */\nexport interface BarPage {\n readonly label: string;\n /** The path from the site home, for example `docs/`. The home is an empty text. */\n readonly path: string;\n}\n\n/** The content of the bar. */\nexport interface BarOptions {\n /** \"owner/name\" of the repository on GitHub. */\n readonly repository: string;\n /** The path of the site home, with a `/` at the start and at the end. */\n readonly base: string;\n /** The name of the site. The default is the name of the repository. */\n readonly siteName?: string | undefined;\n /** The pages of the site, after the home and before Releases and Status. */\n readonly pages: readonly BarPage[];\n /** True when the site has the Releases page and the Status page of site-pages. */\n readonly sitePages: boolean;\n /** The npm name of the package of the site, or undefined for no npm link. */\n readonly npm?: string | undefined;\n /** The URL of the portfolio of the owner, or undefined for no portfolio link. */\n readonly portfolio?: string | undefined;\n}\n\n/** The marker attribute of the bar. The navigation crawl looks for it. */\nexport const BAR_ATTRIBUTE = \"data-site-bar\";\n\n/** The CSS of the bar. Each rule starts with `.spb`, so it changes only the bar. */\nexport const BAR_CSS = `\n.spb{--spb-bg:#ffffff;--spb-fg:#151c2e;--spb-muted:#5f6880;--spb-rule:#d6dbe5;--spb-accent:#2346c4;--spb-wash:#e7ecfd;\ncolor-scheme:light;position:relative;z-index:2147483000;display:block;margin:0;padding:0;background:var(--spb-bg);color:var(--spb-fg);\nborder-bottom:1px solid var(--spb-rule);font:400 14px/1.4 system-ui,-apple-system,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif;\ntext-align:left;letter-spacing:normal;text-transform:none}\n@media (prefers-color-scheme:dark){.spb{--spb-bg:#151a2b;--spb-fg:#e6e9f3;--spb-muted:#a3abc2;--spb-rule:#2b3350;--spb-accent:#93abff;--spb-wash:#1f2a4f;color-scheme:dark}}\n:root[data-theme=\"dark\"] .spb,:root.dark .spb{--spb-bg:#151a2b;--spb-fg:#e6e9f3;--spb-muted:#a3abc2;--spb-rule:#2b3350;--spb-accent:#93abff;--spb-wash:#1f2a4f;color-scheme:dark}\n:root[data-theme=\"light\"] .spb,:root.light .spb{--spb-bg:#ffffff;--spb-fg:#151c2e;--spb-muted:#5f6880;--spb-rule:#d6dbe5;--spb-accent:#2346c4;--spb-wash:#e7ecfd;color-scheme:light}\n.spb *{box-sizing:border-box;margin:0;padding:0;font:inherit;letter-spacing:inherit}\n.spb-in{max-width:80rem;margin:0 auto;padding:6px 12px;display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px}\n.spb-id{display:flex;align-items:center;gap:6px;min-width:0;margin-right:auto}\n.spb-id a{color:var(--spb-fg);text-decoration:none;border-radius:4px;overflow-wrap:anywhere}\n.spb-owner{color:var(--spb-muted)!important}\n.spb-site{font-weight:700}\n.spb-id a:hover,.spb-links a:hover{text-decoration:underline;text-underline-offset:3px}\n.spb-sep{color:var(--spb-muted)}\n.spb-links{display:flex;flex-wrap:wrap;align-items:center;gap:2px;list-style:none}\n.spb-links a{display:inline-block;padding:4px 8px;min-height:32px;line-height:24px;border-radius:6px;color:var(--spb-accent);text-decoration:none;white-space:nowrap}\n.spb-links a[aria-current=\"page\"]{background:var(--spb-wash);color:var(--spb-fg);font-weight:600}\n.spb-out{color:var(--spb-muted)!important}\n.spb a:focus-visible{outline:2px solid var(--spb-accent);outline-offset:1px}\n@media print{.spb{display:none}}\n`;\n\n/** This function gives the path of a page from the site home, with no `index.html`. The home is an empty text. */\nexport function pagePath(file: string): string {\n return file.split(sep).join(\"/\").replace(/(^|\\/)index\\.html$/, \"$1\");\n}\n\n/**\n * This function gives the link of the bar that is the current page: the link with the longest path that starts the\n * page path. The home link is current only on the home page.\n */\nexport function currentLink(links: readonly BarPage[], path: string): BarPage | undefined {\n let best: BarPage | undefined;\n for (const entry of links) {\n const match = entry.path === \"\" ? path === \"\" : path === entry.path || (entry.path.endsWith(\"/\") && path.startsWith(entry.path));\n if (match && (best === undefined || entry.path.length > best.path.length)) best = entry;\n }\n return best;\n}\n\n/** This function gives the links of the bar to the pages of the site, in order: the home, the pages, Releases and Status. */\nexport function barPages(options: BarOptions): BarPage[] {\n const pages: BarPage[] = [{ label: \"Home\", path: \"\" }, ...options.pages.filter((entry) => entry.path !== \"\")];\n if (options.sitePages) pages.push({ label: \"Releases\", path: \"releases/\" }, { label: \"Status\", path: \"status/\" });\n const seen = new Set<string>();\n return pages.filter((entry) => {\n if (seen.has(entry.path)) return false;\n seen.add(entry.path);\n return true;\n });\n}\n\n/** This function gives the HTML of the bar for the page at `path`. */\nexport function barHtml(options: BarOptions, path: string): string {\n const [owner = \"\", name = \"\"] = options.repository.split(\"/\");\n const href = (page: string) => escapeHtml(`${options.base}${page}`);\n const pages = barPages(options);\n const current = currentLink(pages, path);\n const portfolio = options.portfolio === undefined ? undefined : safeUrl(options.portfolio);\n const id = [\n portfolio ? `<a class=\"spb-owner\" href=\"${escapeHtml(portfolio)}\">${escapeHtml(owner)}</a><span class=\"spb-sep\" aria-hidden=\"true\">/</span>` : \"\",\n `<a class=\"spb-site\" href=\"${href(\"\")}\">${escapeHtml(options.siteName ?? name)}</a>`,\n ].join(\"\");\n const links = pages.map((entry) => {\n const mark = entry === current ? ' aria-current=\"page\"' : \"\";\n return `<li><a href=\"${href(entry.path)}\" target=\"_self\"${mark}>${escapeHtml(entry.label)}</a></li>`;\n });\n links.push(`<li><a class=\"spb-out\" href=\"https://github.com/${escapeHtml(options.repository)}\">GitHub</a></li>`);\n if (options.npm) links.push(`<li><a class=\"spb-out\" href=\"https://www.npmjs.com/package/${escapeHtml(options.npm)}\">npm</a></li>`);\n return `<nav class=\"spb\" ${BAR_ATTRIBUTE} aria-label=\"Site\"><div class=\"spb-in\"><div class=\"spb-id\">${id}</div><ul class=\"spb-links\">${links.join(\"\")}</ul></div></nav>`;\n}\n\nconst BAR_PATTERN = /\\n?<nav class=\"spb\" data-site-bar[\\s\\S]*?<\\/ul><\\/div><\\/nav>/;\nconst STYLE_ID = \"site-bar-css\";\nconst STYLE_PATTERN = /<style id=\"site-bar-css\">[\\s\\S]*?<\\/style>/;\n// The header of the Releases page and the Status page of site-pages. The bar takes its place.\nconst SP_HEADER_PATTERN = /<header class=\"sp-header\">[\\s\\S]*?<\\/header>\\n?/;\n\n/**\n * This function writes the bar into the HTML of one page. The bar comes first in `<body>`, and its CSS comes last in\n * `<head>`. A bar from an earlier start goes away, so the function can start two times on one page. The header of a\n * page of site-pages also goes away. The function gives the HTML with no change when the page has no `<body>`.\n */\nexport function injectBar(html: string, bar: string): string {\n const body = /<body\\b[^>]*>/i.exec(html);\n if (body === null) return html;\n let out = html.replace(STYLE_PATTERN, \"\").replace(BAR_PATTERN, \"\").replace(SP_HEADER_PATTERN, \"\");\n const style = `<style id=\"${STYLE_ID}\">${BAR_CSS}</style>`;\n out = /<\\/head>/i.test(out) ? out.replace(/<\\/head>/i, `${style}</head>`) : out.replace(/<body\\b[^>]*>/i, (tag) => `${style}${tag}`);\n return out.replace(/<body\\b[^>]*>/i, (tag) => `${tag}\\n${bar}`);\n}\n\n/** This function gives the HTML files of a folder, as paths from the folder, in a stable order. */\nexport function htmlFiles(root: string): string[] {\n const files: string[] = [];\n const walk = (folder: string) => {\n for (const entry of readdirSync(folder, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {\n const full = join(folder, entry.name);\n if (entry.isDirectory()) walk(full);\n else if (entry.isFile() && entry.name.endsWith(\".html\")) files.push(relative(root, full));\n }\n };\n walk(root);\n return files;\n}\n\n/** This function writes the bar into each HTML page of the built site folder, and gives the number of pages. */\nexport function applyBar(out: string, options: BarOptions): number {\n const files = htmlFiles(out);\n for (const file of files) {\n const full = join(out, file);\n const html = readFileSync(full, \"utf8\");\n const next = injectBar(html, barHtml(options, pagePath(file)));\n if (next !== html) writeFileSync(full, next);\n }\n return files.length;\n}\n\n/** The input and output of the CLI. */\nexport interface BarIo {\n cwd: string;\n env: NodeJS.ProcessEnv;\n stdout: (text: string) => void;\n stderr: (text: string) => void;\n}\n\nexport const BAR_HELP = `Usage: site-pages bar --out <dir> [options]\n\nWrites the shared site bar into each HTML page of the built site folder. The bar comes first in the\nbody of the page. It has the portfolio of the owner, the name of the site, a link to each page of\nthe site, GitHub and npm. The bar takes the place of the header of the pages of site-pages.\n\nOptions:\n --out <dir> The built site folder\n --repo <owner/name> The GitHub repository (default: $GITHUB_REPOSITORY)\n --base </name/> The path of the site home (default: \"/<name>/\", or \"/\" for <owner>.github.io)\n --site-name <name> The name of the site in the bar (default: the name of the repository)\n --pages <list> The pages of the site after the home, as label=path pairs separated by\n commas, for example \"Demo=demo/,Docs=docs/\"\n --site-pages Adds the links to releases/ and status/\n --npm <name> The npm name of the package, for the npm link\n --portfolio <url> The portfolio of the owner (default: https://<owner>.github.io/, and no\n portfolio link on the site <owner>.github.io)\n --help Shows this text\n`;\n\n/** This function parses the value of `--pages`. It gives an Error for a pair with no label or no path. */\nexport function parsePages(text: string): BarPage[] | Error {\n const pages: BarPage[] = [];\n for (const pair of text.split(\",\").map((entry) => entry.trim()).filter(Boolean)) {\n const at = pair.indexOf(\"=\");\n const label = at < 0 ? \"\" : pair.slice(0, at).trim();\n const path = at < 0 ? \"\" : pair.slice(at + 1).trim().replace(/^\\/+/, \"\");\n if (label === \"\" || path === \"\" || path.includes(\":\") || path.includes(\"\\\\\")) return new Error(`\"${pair}\" is not a pair of a label and a path from the site home, for example Docs=docs/`);\n pages.push({ label, path });\n }\n return pages;\n}\n\n/** This function starts the `bar` command with its arguments, without the word `bar`. */\nexport function runBarCli(argv: readonly string[], io: BarIo): number {\n let values: Record<string, string | boolean | undefined>;\n try {\n ({ values } = parseArgs({\n args: [...argv],\n allowPositionals: false,\n options: {\n out: { type: \"string\" },\n repo: { type: \"string\" },\n base: { type: \"string\" },\n \"site-name\": { type: \"string\" },\n pages: { type: \"string\" },\n \"site-pages\": { type: \"boolean\" },\n npm: { type: \"string\" },\n portfolio: { type: \"string\" },\n help: { type: \"boolean\" },\n },\n }));\n } catch (error) {\n io.stderr(`site-pages bar: ${error instanceof Error ? error.message : String(error)}\\n\\n${BAR_HELP}`);\n return 2;\n }\n if (values[\"help\"]) {\n io.stdout(BAR_HELP);\n return 0;\n }\n const usage = (message: string) => {\n io.stderr(`site-pages bar: ${message}\\n\\n${BAR_HELP}`);\n return 2;\n };\n const text = (key: string) => (typeof values[key] === \"string\" && values[key] !== \"\" ? (values[key] as string) : undefined);\n const out = text(\"out\");\n if (out === undefined) return usage(\"give --out\");\n const repository = text(\"repo\") ?? io.env[\"GITHUB_REPOSITORY\"] ?? \"\";\n const [owner = \"\", name = \"\"] = repository.split(\"/\");\n if (owner === \"\" || name === \"\") return usage(\"give --repo <owner/name> or set GITHUB_REPOSITORY\");\n const ownerSite = name.toLowerCase() === `${owner.toLowerCase()}.github.io`;\n const rawBase = text(\"base\") ?? (ownerSite ? \"/\" : `/${name}/`);\n const base = `/${rawBase.replace(/^\\/+|\\/+$/g, \"\")}/`.replace(/^\\/\\/$/, \"/\");\n const pages = parsePages(text(\"pages\") ?? \"\");\n if (pages instanceof Error) return usage(pages.message);\n const portfolio = text(\"portfolio\") ?? (ownerSite ? undefined : `https://${owner.toLowerCase()}.github.io/`);\n const options: BarOptions = { repository, base, siteName: text(\"site-name\"), pages, sitePages: values[\"site-pages\"] === true, npm: text(\"npm\"), portfolio };\n const folder = isAbsolute(out) ? out : resolve(io.cwd, out);\n const count = applyBar(folder, options);\n if (count === 0) {\n io.stderr(`site-pages bar: ${out} has no HTML page\\n`);\n return 1;\n }\n io.stdout(`site-pages bar: the bar is in ${count} pages, with ${barPages(options).map((entry) => entry.label).join(\", \")}.\\n`);\n return 0;\n}\n","/**\n * The scroll cue of the built pages (`site-pages cue`). The Pages workflow changes each code block (`pre`) of each\n * built HTML page. Each block gets the class `scroll-cue` and a place in the tab order. The page gets the style\n * `scroll-cue.css`. Thus a code block that is wider than its box shows a fade at the edge with more content. This\n * occurs also on a site that does not use the rehype plugin of site-pages. A box with no overflow has no active scroll\n * timeline, so it shows no cue.\n *\n * A script of the page can make a code block after the load, for example from Markdown or from a template string. Thus\n * each page with a script of its own also gets the style and a script. That script gives the cue to each code block\n * that the page adds.\n *\n * A block with `data-overflow-ok` or with the class `scroll-cue` stays as it is. The text of `script`, `style` and\n * `textarea` elements does not change.\n */\n\nimport { readFileSync, writeFileSync } from \"node:fs\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { parseArgs } from \"node:util\";\nimport { htmlFiles, type BarIo } from \"./bar.ts\";\n\n/** The attribute of each code block that the step changed. The script of the fallback finds the blocks with it. */\nexport const CUE_ATTRIBUTE = \"data-scroll-cue\";\nconst STYLE_ID = \"site-cue-css\";\nconst SCRIPT_ID = \"site-cue-js\";\nconst STYLE_PATTERN = /<style id=\"site-cue-css\">[\\s\\S]*?<\\/style>/;\nconst SCRIPT_PATTERN = /<script id=\"site-cue-js\">[\\s\\S]*?<\\/script>/;\n\n/** This function reads `scroll-cue.css` of the package, the one source of the style of the cue. */\nexport function cueCss(): string {\n return readFileSync(new URL(\"../../styles/scroll-cue.css\", import.meta.url), \"utf8\");\n}\n\n/**\n * The script of the cue in the browser. It has two jobs.\n *\n * - It gives the cue to each code block that a script of the page makes, at the start and after it. The rules of\n * `cueAttributes` apply: a block with `data-overflow-ok` or with the class `scroll-cue` of the page stays as it is.\n * - In a browser with no scroll timelines, the style gives the box the background color `--scroll-cue-bg`. The script\n * sets that variable to the color of each block with the mark. When the block has no color, the script uses the color\n * of its first ancestor with a color. Thus the block keeps the color of its theme.\n */\nexport const CUE_SCRIPT: string =\n '(() => { const old = !!window.CSS && !CSS.supports(\"animation-timeline: scroll()\"); ' +\n 'const paint = (box) => { box.classList.remove(\"scroll-cue\"); let node = box; let color = \"\"; ' +\n \"while (node) { color = getComputedStyle(node).backgroundColor; if (color !== \\\"transparent\\\" && !/^rgba\\\\(.*,\\\\s*0\\\\)$/.test(color)) break; node = node.parentElement; } \" +\n 'box.classList.add(\"scroll-cue\"); if (node) box.style.setProperty(\"--scroll-cue-bg\", color); }; ' +\n `const cue = (box) => { if (box.hasAttribute(\"data-overflow-ok\")) return; if (!box.hasAttribute(\"${CUE_ATTRIBUTE}\")) { ` +\n 'if (box.classList.contains(\"scroll-cue\")) return; box.classList.add(\"scroll-cue\"); ' +\n `if (!box.hasAttribute(\"tabindex\")) box.tabIndex = 0; box.setAttribute(\"${CUE_ATTRIBUTE}\", \"\"); } if (old) paint(box); }; ` +\n 'const scan = (root) => { if (root.nodeType !== 1) return; if (root.matches(\"pre\")) cue(root); for (const box of root.querySelectorAll(\"pre\")) cue(box); }; ' +\n \"scan(document.documentElement); \" +\n \"new MutationObserver((records) => { for (const record of records) for (const node of record.addedNodes) scan(node); })\" +\n \".observe(document.documentElement, { childList: true, subtree: true }); })();\";\n\nconst CLASS_PATTERN = /\\sclass\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'>]+))/i;\n\n/**\n * This function gives the attributes of one `pre` start tag with the cue. It gives `undefined` when the tag keeps its\n * attributes: the tag has `data-overflow-ok`, or it already has the class `scroll-cue`.\n */\nexport function cueAttributes(attributes: string): string | undefined {\n if (/\\sdata-overflow-ok\\b/i.test(attributes)) return undefined;\n const match = CLASS_PATTERN.exec(attributes);\n const classes = match === null ? \"\" : (match[1] ?? match[2] ?? match[3] ?? \"\");\n if (classes.split(/\\s+/).includes(\"scroll-cue\")) return undefined;\n const named = `class=\"${`${classes.trim()} scroll-cue`.trim()}\"`;\n let next = match === null ? `${attributes} ${named}` : attributes.replace(CLASS_PATTERN, ` ${named}`);\n if (!/\\stabindex\\s*=/i.test(next)) next += ' tabindex=\"0\"';\n return `${next} ${CUE_ATTRIBUTE}`;\n}\n\n/** The text of these elements is not HTML, so the step does not change it. */\nconst RAW_TEXT = /<(script|style|textarea)\\b[\\s\\S]*?<\\/\\1\\s*>/gi;\n\n/** A script element that can make a code block: each script, but not a JSON data block. */\nconst PAGE_SCRIPT = /<script\\b(?![^>]*\\btype\\s*=\\s*[\"']?application\\/(?:ld\\+)?json)[^>]*>/i;\n\n/**\n * This function writes the cue into the HTML of one page, and gives the HTML and the number of code blocks that it\n * changed. The style comes last in `<head>`, and the script comes last in `<body>`. A style and a script of an earlier\n * start go away, so the function can start two times on one page. The script of a page can make a code block. Thus a\n * page with a script of its own gets the style and the script also with no changed block. A page with no changed block\n * and no script gets no style.\n */\nexport function injectCue(html: string, css: string): { html: string; boxes: number } {\n let boxes = 0;\n const source = html.replace(STYLE_PATTERN, \"\").replace(SCRIPT_PATTERN, \"\");\n const edit = (part: string) =>\n part.replace(/<pre\\b([^>]*)>/gi, (tag, attributes: string) => {\n const next = cueAttributes(attributes);\n if (next === undefined) return tag;\n boxes++;\n return `<pre${next}>`;\n });\n let out = \"\";\n let at = 0;\n for (const raw of source.matchAll(RAW_TEXT)) {\n out += edit(source.slice(at, raw.index)) + raw[0];\n at = raw.index + raw[0].length;\n }\n out += edit(source.slice(at));\n const marked = boxes > 0 || source.includes(` ${CUE_ATTRIBUTE}`) || PAGE_SCRIPT.test(source);\n if (!marked) return { html, boxes: 0 };\n const style = `<style id=\"${STYLE_ID}\">${css}</style>`;\n const script = `<script id=\"${SCRIPT_ID}\">${CUE_SCRIPT}</script>`;\n out = /<\\/head>/i.test(out) ? out.replace(/<\\/head>/i, `${style}</head>`) : `${style}${out}`;\n out = /<\\/body>/i.test(out) ? out.replace(/<\\/body>(?![\\s\\S]*<\\/body>)/i, `${script}</body>`) : `${out}${script}`;\n return { html: out, boxes };\n}\n\n/** This function writes the cue into each HTML page of the built site folder, and gives the number of pages and of code blocks. */\nexport function applyCue(out: string, css: string): { pages: number; changed: number; boxes: number } {\n const files = htmlFiles(out);\n let changed = 0;\n let boxes = 0;\n for (const file of files) {\n const full = join(out, file);\n const html = readFileSync(full, \"utf8\");\n const next = injectCue(html, css);\n boxes += next.boxes;\n if (next.html !== html) {\n writeFileSync(full, next.html);\n changed++;\n }\n }\n return { pages: files.length, changed, boxes };\n}\n\nexport const CUE_HELP = `Usage: site-pages cue --out <dir>\n\nGives each code block (pre) of each HTML page of the built site folder the class scroll-cue and a\nplace in the tab order, and writes the style scroll-cue.css into each changed page. A code block that\nis wider than its box then shows a fade at the edge with more content. A block with the attribute\ndata-overflow-ok or the class scroll-cue stays as it is. A page with a script also gets a script that\ngives the cue to each code block that the page makes in the browser.\n\nOptions:\n --out <dir> The built site folder\n --help Shows this text\n`;\n\n/** This function starts the `cue` command with its arguments, without the word `cue`. */\nexport function runCueCli(argv: readonly string[], io: BarIo, css: () => string = cueCss): number {\n let values: Record<string, string | boolean | undefined>;\n try {\n ({ values } = parseArgs({ args: [...argv], allowPositionals: false, options: { out: { type: \"string\" }, help: { type: \"boolean\" } } }));\n } catch (error) {\n io.stderr(`site-pages cue: ${error instanceof Error ? error.message : String(error)}\\n\\n${CUE_HELP}`);\n return 2;\n }\n if (values[\"help\"]) {\n io.stdout(CUE_HELP);\n return 0;\n }\n const out = typeof values[\"out\"] === \"string\" && values[\"out\"] !== \"\" ? values[\"out\"] : undefined;\n if (out === undefined) {\n io.stderr(`site-pages cue: give --out\\n\\n${CUE_HELP}`);\n return 2;\n }\n const result = applyCue(isAbsolute(out) ? out : resolve(io.cwd, out), css());\n if (result.pages === 0) {\n io.stderr(`site-pages cue: ${out} has no HTML page\\n`);\n return 1;\n }\n io.stdout(`site-pages cue: ${result.boxes} code blocks in ${result.changed} of ${result.pages} pages got the scroll cue.\\n`);\n return 0;\n}\n","/**\n * A small client of the Chrome DevTools protocol for the `check` command. It starts a Chromium\n * browser (Chrome, Edge or the Chromium of Playwright) in headless mode and drives one page. It\n * uses only Node.js, so the check needs no package install.\n */\n\nimport { spawn, type ChildProcess } from \"node:child_process\";\nimport { existsSync, mkdtempSync, readdirSync, readFileSync, rmSync } from \"node:fs\";\nimport { homedir, tmpdir } from \"node:os\";\nimport { delimiter, join } from \"node:path\";\n\n/** The paths that `findBrowser` examines after the option and the Playwright folder. */\nfunction systemBrowsers(platform: NodeJS.Platform, env: NodeJS.ProcessEnv): string[] {\n if (platform === \"win32\") {\n const roots = [env[\"PROGRAMFILES\"], env[\"PROGRAMFILES(X86)\"], env[\"LOCALAPPDATA\"]].filter((root): root is string => !!root);\n return roots.flatMap((root) => [join(root, \"Google/Chrome/Application/chrome.exe\"), join(root, \"Microsoft/Edge/Application/msedge.exe\")]);\n }\n if (platform === \"darwin\") {\n return [\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\", \"/Applications/Chromium.app/Contents/MacOS/Chromium\", \"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge\"];\n }\n const names = [\"google-chrome\", \"google-chrome-stable\", \"chromium\", \"chromium-browser\", \"microsoft-edge\"];\n const dirs = (env[\"PATH\"] ?? \"\").split(delimiter).filter(Boolean);\n return names.flatMap((name) => dirs.map((dir) => join(dir, name)));\n}\n\n/** The Chromium of the newest `chromium-<n>` folder of Playwright, or undefined. */\nfunction playwrightChromium(platform: NodeJS.Platform, env: NodeJS.ProcessEnv): string | undefined {\n const root =\n env[\"PLAYWRIGHT_BROWSERS_PATH\"] ||\n (platform === \"win32\" ? join(env[\"LOCALAPPDATA\"] ?? homedir(), \"ms-playwright\") : platform === \"darwin\" ? join(homedir(), \"Library/Caches/ms-playwright\") : join(homedir(), \".cache/ms-playwright\"));\n if (!existsSync(root)) return undefined;\n const builds = readdirSync(root)\n .map((name) => /^chromium-(\\d+)$/.exec(name))\n .filter((match): match is RegExpExecArray => match !== null)\n .sort((a, b) => Number(b[1]) - Number(a[1]));\n for (const [folder] of builds) {\n for (const sub of readdirSync(join(root, folder))) {\n const candidates =\n platform === \"win32\"\n ? [join(root, folder, sub, \"chrome.exe\")]\n : platform === \"darwin\"\n ? [join(root, folder, sub, \"Chromium.app/Contents/MacOS/Chromium\"), join(root, folder, sub, \"Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing\")]\n : [join(root, folder, sub, \"chrome\")];\n const found = candidates.find((file) => existsSync(file));\n if (found) return found;\n }\n }\n return undefined;\n}\n\n/**\n * This function finds a Chromium browser. It examines the given path, then `$SITE_CHECK_BROWSER`,\n * then the newest Chromium of Playwright, then a Chrome or an Edge of the system.\n *\n * @returns the path of the executable, or undefined when there is none\n */\nexport function findBrowser(given?: string, env: NodeJS.ProcessEnv = process.env, platform: NodeJS.Platform = process.platform): string | undefined {\n const named = given || env[\"SITE_CHECK_BROWSER\"];\n if (named) return named;\n return playwrightChromium(platform, env) ?? systemBrowsers(platform, env).find((file) => existsSync(file));\n}\n\n/** A message of the DevTools protocol. */\ninterface Message {\n id?: number;\n method?: string;\n params?: Record<string, unknown>;\n result?: Record<string, unknown>;\n error?: { message: string };\n}\n\n/** An event handler of a page. */\ntype Listener = (params: Record<string, unknown>) => void;\n\n/** The reply of `Runtime.evaluate` and `Runtime.callFunctionOn` with `returnByValue`. */\ninterface Reply {\n result?: { value?: unknown };\n exceptionDetails?: { text?: string; exception?: { description?: string } };\n}\n\n/** One page of a started browser. */\nexport interface Page {\n /** This function sends a command of the protocol and returns its result. */\n send(method: string, params?: Record<string, unknown>): Promise<Record<string, unknown>>;\n /** This function calls the listener on each event of the method. */\n on(method: string, listener: Listener): void;\n /** This function calls the listener on the next event of the method, or rejects after `ms`. */\n once(method: string, ms: number): Promise<Record<string, unknown>>;\n /** This function evaluates the expression in the page, and waits for a promise. */\n evaluate<T>(expression: string): Promise<T>;\n /**\n * This function calls the function `source` in the page with the values `args`, and waits for a promise. The values go\n * to the page as the arguments of the call (`Runtime.callFunctionOn`), not as text of the code. Thus a value from a URL\n * or from a page cannot change the code.\n */\n call<T>(source: string, ...args: readonly CallValue[]): Promise<T>;\n}\n\n/** A value that {@link Page.call} gives to a function in the page. It goes to the page as JSON. */\nexport type CallValue = string | number | boolean | null | readonly CallValue[] | { readonly [key: string]: CallValue };\n\n/** A started browser. */\nexport interface Browser {\n page: Page;\n /** This function stops the browser and removes its profile. */\n close(): Promise<void>;\n}\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\n/**\n * This function starts the browser in headless mode with a new profile, and connects to its page.\n * The browser picks a free port, so two checks can run at the same time.\n *\n * @throws Error when the browser does not start in `timeoutMs`\n */\nexport async function launch(executable: string, timeoutMs = 30_000): Promise<Browser> {\n const profile = mkdtempSync(join(tmpdir(), \"site-check-\"));\n const args = [\n \"--headless=new\",\n \"--remote-debugging-port=0\",\n `--user-data-dir=${profile}`,\n \"--no-first-run\",\n \"--no-default-browser-check\",\n \"--disable-gpu\",\n \"--disable-extensions\",\n \"--disable-background-networking\",\n \"--disable-sync\",\n \"--hide-scrollbars\",\n \"--mute-audio\",\n // The sandbox of Chromium needs user namespaces, which Ubuntu 24.04 refuses to a browser that the\n // system did not install. Playwright also starts Chromium with no sandbox.\n ...(process.platform === \"linux\" ? [\"--no-sandbox\"] : []),\n \"about:blank\",\n ];\n const child: ChildProcess = spawn(executable, args, { stdio: \"ignore\" });\n let exited: string | undefined;\n child.once(\"exit\", (code, signal) => (exited = `the browser stopped (code ${code}, signal ${signal})`));\n child.once(\"error\", (error) => (exited = `the browser did not start: ${error.message}`));\n const stop = async () => {\n if (child.exitCode === null && child.signalCode === null) {\n child.kill();\n await Promise.race([new Promise((resolve) => child.once(\"exit\", resolve)), sleep(5000)]);\n }\n rmSync(profile, { recursive: true, force: true, maxRetries: 5, retryDelay: 200 });\n };\n try {\n const portFile = join(profile, \"DevToolsActivePort\");\n const end = Date.now() + timeoutMs;\n let port = \"\";\n while (port === \"\") {\n if (exited !== undefined) throw new Error(`${executable}: ${exited}`);\n if (Date.now() > end) throw new Error(`${executable}: no DevTools port after ${timeoutMs} ms`);\n if (existsSync(portFile)) port = readFileSync(portFile, \"utf8\").split(\"\\n\")[0]?.trim() ?? \"\";\n if (port === \"\") await sleep(100);\n }\n let target: { type: string; webSocketDebuggerUrl: string } | undefined;\n while (target === undefined) {\n const list = (await (await fetch(`http://127.0.0.1:${port}/json/list`)).json()) as { type: string; webSocketDebuggerUrl: string }[];\n target = list.find((entry) => entry.type === \"page\");\n if (target === undefined) {\n if (Date.now() > end) throw new Error(`${executable}: no page target after ${timeoutMs} ms`);\n await sleep(100);\n }\n }\n const page = await connect(target.webSocketDebuggerUrl);\n return {\n page: page.page,\n close: async () => {\n page.close();\n await stop();\n },\n };\n } catch (error) {\n await stop();\n throw error;\n }\n}\n\nasync function connect(url: string): Promise<{ page: Page; close: () => void }> {\n const socket = new WebSocket(url);\n await new Promise<void>((resolve, reject) => {\n socket.addEventListener(\"open\", () => resolve(), { once: true });\n socket.addEventListener(\"error\", () => reject(new Error(`no connection to ${url}`)), { once: true });\n });\n let sequence = 0;\n const pending = new Map<number, { resolve: (value: Record<string, unknown>) => void; reject: (error: Error) => void }>();\n const listeners = new Map<string, Listener[]>();\n socket.addEventListener(\"message\", (event) => {\n const message = JSON.parse(String(event.data)) as Message;\n if (message.id !== undefined) {\n const call = pending.get(message.id);\n pending.delete(message.id);\n if (message.error) call?.reject(new Error(message.error.message));\n else call?.resolve(message.result ?? {});\n } else if (message.method) {\n for (const listener of listeners.get(message.method) ?? []) listener(message.params ?? {});\n }\n });\n socket.addEventListener(\"close\", () => {\n for (const call of pending.values()) call.reject(new Error(\"the browser closed the connection\"));\n pending.clear();\n });\n const page: Page = {\n send: (method, params = {}) =>\n new Promise((resolve, reject) => {\n const id = ++sequence;\n pending.set(id, { resolve, reject });\n socket.send(JSON.stringify({ id, method, params }));\n }),\n on: (method, listener) => listeners.set(method, [...(listeners.get(method) ?? []), listener]),\n once: (method, ms) =>\n new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n remove();\n reject(new Error(`no ${method} after ${ms} ms`));\n }, ms);\n const listener: Listener = (params) => {\n clearTimeout(timer);\n remove();\n resolve(params);\n };\n const remove = () => listeners.set(method, (listeners.get(method) ?? []).filter((entry) => entry !== listener));\n page.on(method, listener);\n }),\n evaluate: async <T>(expression: string): Promise<T> => {\n const reply = (await page.send(\"Runtime.evaluate\", { expression, awaitPromise: true, returnByValue: true })) as Reply;\n if (reply.exceptionDetails) throw new Error(reply.exceptionDetails.exception?.description ?? reply.exceptionDetails.text ?? \"the expression failed\");\n return reply.result?.value as T;\n },\n call: async <T>(source: string, ...args: readonly CallValue[]): Promise<T> => {\n // The global object of the page is the target of the call. A new page after a navigation has a new one.\n const target = (await page.send(\"Runtime.evaluate\", { expression: \"globalThis\" })) as { result?: { objectId?: string } };\n const reply = (await page.send(\"Runtime.callFunctionOn\", {\n functionDeclaration: source,\n objectId: target.result?.objectId,\n arguments: args.map((value) => ({ value })),\n awaitPromise: true,\n returnByValue: true,\n })) as Reply;\n if (reply.exceptionDetails) throw new Error(reply.exceptionDetails.exception?.description ?? reply.exceptionDetails.text ?? \"the function failed\");\n return reply.result?.value as T;\n },\n };\n return { page, close: () => socket.close() };\n}\n","/**\n * The measurements that the `check` command makes in the page. Each is a string of JavaScript that\n * the browser evaluates, so the code can use only the APIs of the page.\n */\n\n/** Text past the edge of a box that cuts it: an entry of `Measure.cut`. */\nexport interface Cut {\n /**\n * The kind of the box:\n * - `clip`: the box has `overflow-x: hidden` or `clip`, so a visitor cannot reach the text,\n * - `table`: the box scrolls, and the text is in a table,\n * - `code`: the box scrolls, and the text is in a code block (`pre`).\n */\n kind: \"clip\" | \"table\" | \"code\";\n /** The box. */\n box: string;\n /** The table, the code block, or the element of the text. */\n element: string;\n /** The width of the content of the box, in CSS pixels. */\n scrollWidth: number;\n /** The visible width of the box, in CSS pixels. */\n clientWidth: number;\n /** The start of the first text past the edge. */\n text: string;\n /** True when the box has the class `scroll-cue`, and the served CSS gives it no animation and no shade. */\n deadCue?: boolean;\n}\n\n/** The result of `MEASURE`. */\nexport interface Measure {\n innerWidth: number;\n scrollWidth: number;\n /** The height of the document, for the screenshot. */\n height: number;\n /** The number of characters of visible text. */\n text: number;\n /** The outermost elements that go past the right edge of the screen, at most 8. */\n past: string[];\n /** The text areas that hide a part of their text, at most 8. */\n clipped: string[];\n /** The boxes that cut text at their right edge, at most 8. `cutProblems` of `check.ts` tells which ones are problems. */\n cut: Cut[];\n}\n\n/**\n * This expression measures the page. An element counts as past the edge when its right side is\n * more than half a pixel past the width of the document. These elements do not count:\n * - an element in a container that scrolls or clips (`overflow-x` other than `visible`, below `body`),\n * - an element of zero size, a hidden element, or a fixed element that is fully past the edge (a closed drawer),\n * - an element in a fixed element, or that fixed element itself, with no text and no image past the edge. The screen cuts only an empty part of the box,\n * - an element in `.sr`, `.sr-only`, `.visually-hidden` or `.skip` (text for screen readers and skip links),\n * - an element in a `pre`, other than the `pre` itself.\n * Of a chain of elements past the edge, only the outermost one counts.\n *\n * `past` skips each element in a container that scrolls or clips, so `cut` examines those containers.\n * A box is the nearest element around a text, below `body`, with `overflow-x` other than `visible`. Its content is wider\n * than the box by more than 1 px. An element with `overflow-x: clip` is always a box, because it can report no overflow.\n * The text counts when a line of it ends more than 1 px past the right edge of the box.\n *\n * A box that scrolls counts only for text in a table (`table`, `role=\"table\"` or `role=\"grid\"`) or in a code block (`pre`).\n * A hex view, a row of tabs and a carousel in such a box are meant to scroll, and they do not count.\n * A box that clips counts for each text, because a visitor cannot reach that text. These texts do not count:\n * - a text in a box with `text-overflow` other than `clip` (a person chose the ellipsis),\n * - a text in an element with `data-overflow-ok`, or in that element itself (a person chose the overflow),\n * - a text in a box that scrolls with the class `scroll-cue`, and with an animation or a background image for its shade,\n * - a text in `.sr`, `.sr-only`, `.visually-hidden`, `.skip`, `[aria-hidden=\"true\"]`, `select`, `textarea` or `svg`,\n * - a text in a fixed element, which the box does not clip,\n * - a text that is not visible, or with an element around it of 1 px or less or with `opacity: 0`.\n * Only the first text of a box counts. An element with no text does not count. Vertical overflow does not count.\n */\nexport const MEASURE = `(() => {\n const root = document.documentElement;\n const w = root.clientWidth;\n const name = (e) => e.tagName.toLowerCase() + (e.id ? \"#\" + e.id : \"\") + (typeof e.className === \"string\" && e.className.trim() ? \".\" + e.className.trim().split(/\\\\s+/).slice(0, 3).join(\".\") : \"\");\n const inScroller = (e) => {\n for (let p = e.parentElement; p && p !== document.body && p !== root; p = p.parentElement) {\n if (getComputedStyle(p).overflowX !== \"visible\") return true;\n }\n return false;\n };\n const inFixed = (e) => {\n for (let p = e; p && p !== document.body && p !== root; p = p.parentElement) {\n if (getComputedStyle(p).position === \"fixed\") return true;\n }\n return false;\n };\n const contentPast = (e) => {\n for (const m of e.querySelectorAll(\"img,svg,canvas,video\")) if (m.getBoundingClientRect().right > w + 0.5) return true;\n const walker = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);\n const range = document.createRange();\n while (walker.nextNode()) {\n if (walker.currentNode.textContent.trim() === \"\") continue;\n range.selectNodeContents(walker.currentNode);\n for (const b of range.getClientRects()) if (b.width > 0 && b.right > w + 0.5) return true;\n }\n return false;\n };\n const counts = (e) => {\n const r = e.getBoundingClientRect();\n if (r.width === 0 || r.height === 0 || r.right <= w + 0.5) return false;\n if (e.closest(\".sr,.sr-only,.visually-hidden,.skip\")) return false;\n if (e.closest(\"pre\") && e.tagName !== \"PRE\") return false;\n const s = getComputedStyle(e);\n if (s.visibility === \"hidden\" || s.display === \"none\") return false;\n if (s.position === \"fixed\" && r.left >= w) return false;\n if (inFixed(e) && !contentPast(e)) return false;\n return !inScroller(e);\n };\n const over = new Set([...document.querySelectorAll(\"body *\")].filter(counts));\n const past = [...over]\n .filter((e) => { for (let p = e.parentElement; p; p = p.parentElement) if (over.has(p)) return false; return true; })\n .map((e) => name(e) + \" right=\" + Math.round(e.getBoundingClientRect().right));\n const clipped = [...document.querySelectorAll(\"textarea\")]\n .filter((e) => { const s = getComputedStyle(e); return (s.overflowY === \"hidden\" || s.overflowY === \"clip\") && e.getBoundingClientRect().height > 0 && e.scrollHeight > e.clientHeight + 1; })\n .map((e) => name(e) + \" \" + e.scrollHeight + \">\" + e.clientHeight);\n const boxOf = (e) => {\n for (let p = e; p && p !== document.body && p !== root; p = p.parentElement) {\n const s = getComputedStyle(p);\n if (s.overflowX === \"clip\" || (s.overflowX !== \"visible\" && p.scrollWidth > p.clientWidth + 1)) return p;\n if (s.position === \"fixed\") return undefined;\n }\n return undefined;\n };\n const shown = (e) => {\n if (e.closest(\".sr,.sr-only,.visually-hidden,.skip,[aria-hidden=true],select,textarea,svg\")) return false;\n if (getComputedStyle(e).visibility !== \"visible\") return false;\n for (let p = e; p && p !== root; p = p.parentElement) {\n const s = getComputedStyle(p);\n if (s.opacity === \"0\") return false;\n if (s.display === \"contents\") continue;\n const r = p.getBoundingClientRect();\n if (r.width <= 1 || r.height <= 1) return false;\n }\n return true;\n };\n const cueShows = (box) => { const s = getComputedStyle(box); return s.animationName !== \"none\" || s.backgroundImage !== \"none\"; };\n const cuts = new Map();\n const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);\n const range = document.createRange();\n for (let t = walker.nextNode(); t; t = walker.nextNode()) {\n const e = t.parentElement;\n if (!e || !t.data.trim()) continue;\n const box = boxOf(e);\n if (!box || cuts.has(box)) continue;\n const s = getComputedStyle(box);\n if (s.textOverflow !== \"clip\") continue;\n const scrolls = s.overflowX === \"auto\" || s.overflowX === \"scroll\";\n const table = e.closest(\"table,[role=table],[role=grid]\");\n const code = e.closest(\"pre\");\n const inTable = !!table && box.contains(table);\n const inCode = !inTable && !!code && box.contains(code);\n if (scrolls && !inTable && !inCode) continue;\n const left = box.getBoundingClientRect().left + box.clientLeft;\n range.selectNodeContents(t);\n const end = Math.max(...[...range.getClientRects()].filter((r) => r.width > 0).map((r) => r.right));\n if (end <= left + box.clientWidth + 1) continue;\n const hasCue = scrolls && box.classList.contains(\"scroll-cue\");\n if (e.closest(\"[data-overflow-ok]\") || (hasCue && cueShows(box)) || !shown(e)) continue;\n cuts.set(box, { ...(hasCue ? { deadCue: true } : {}), kind: scrolls ? (inTable ? \"table\" : \"code\") : \"clip\", box: name(box), element: name(scrolls ? (inTable ? table : code) : e), scrollWidth: Math.max(box.scrollWidth, Math.ceil(end - left)), clientWidth: box.clientWidth, text: t.data.trim().replace(/\\\\s+/g, \" \").slice(0, 40) });\n }\n return {\n innerWidth,\n scrollWidth: root.scrollWidth,\n height: Math.max(root.scrollHeight, document.body ? document.body.scrollHeight : 0),\n text: (document.body ? document.body.innerText : \"\").trim().length,\n past: past.slice(0, 8),\n clipped: clipped.slice(0, 8),\n cut: [...cuts.values()].slice(0, 8),\n };\n})()`;\n\n/** One check of a probe. */\nexport interface ProbeCheck {\n name: string;\n ok: boolean;\n detail?: string;\n}\n\n/**\n * This function wraps the code of a probe file into an expression. The code is the body of an async\n * function with these names:\n * - `check(name, ok, detail)` records a check,\n * - `wait(ms)` waits,\n * - `until(fn, ms)` waits until `fn()` gives a true value, at most `ms` (default 5000), and returns the value,\n * - `$(selector)` and `$$(selector)` find elements,\n * - `type(element, text)` writes the text into an input or a text area, with an `input` event,\n * - `click(element)` clicks an element, or the first element of a selector.\n * An exception stops the probe, and it counts as a failed check.\n */\nexport function probeExpression(code: string): string {\n return `(async () => {\n const __checks = [];\n const __text = (v) => { if (v === undefined) return undefined; if (typeof v === \"string\") return v; try { return JSON.stringify(v); } catch { return String(v); } };\n const check = (name, ok, detail) => { __checks.push({ name: String(name), ok: !!ok, ...(ok ? {} : { detail: __text(detail) }) }); return !!ok; };\n const wait = (ms) => new Promise((r) => setTimeout(r, ms));\n const until = async (fn, ms = 5000) => { const end = Date.now() + ms; for (;;) { const v = await fn(); if (v) return v; if (Date.now() > end) return v; await wait(50); } };\n const $ = (s) => document.querySelector(s);\n const $$ = (s) => [...document.querySelectorAll(s)];\n const __el = (e) => { const el = typeof e === \"string\" ? document.querySelector(e) : e; if (!el) throw new Error(\"no element: \" + e); return el; };\n const type = (e, text) => { const el = __el(e); el.focus(); el.value = text; el.dispatchEvent(new Event(\"input\", { bubbles: true })); el.dispatchEvent(new Event(\"change\", { bubbles: true })); };\n const click = (e) => __el(e).click();\n try {\n await (async () => {\n${code}\n })();\n } catch (e) {\n __checks.push({ name: \"the probe runs to its end\", ok: false, detail: String((e && e.stack) || e) });\n }\n return __checks;\n})()`;\n}\n","/**\n * A static file server for the `check` command. It serves a built site folder at the path of the\n * site home, as GitHub Pages does. Thus the links of the site work as on the live site.\n */\n\nimport { createReadStream, existsSync, statSync } from \"node:fs\";\nimport { createServer, type Server } from \"node:http\";\nimport { extname, join, normalize, resolve, sep } from \"node:path\";\n\nconst TYPES: Record<string, string> = {\n \".html\": \"text/html; charset=utf-8\",\n \".js\": \"text/javascript; charset=utf-8\",\n \".mjs\": \"text/javascript; charset=utf-8\",\n \".css\": \"text/css; charset=utf-8\",\n \".json\": \"application/json; charset=utf-8\",\n \".svg\": \"image/svg+xml\",\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".gif\": \"image/gif\",\n \".webp\": \"image/webp\",\n \".avif\": \"image/avif\",\n \".ico\": \"image/x-icon\",\n \".woff\": \"font/woff\",\n \".woff2\": \"font/woff2\",\n \".ttf\": \"font/ttf\",\n \".otf\": \"font/otf\",\n \".wasm\": \"application/wasm\",\n \".txt\": \"text/plain; charset=utf-8\",\n \".md\": \"text/markdown; charset=utf-8\",\n \".xml\": \"application/xml\",\n \".webmanifest\": \"application/manifest+json\",\n \".map\": \"application/json; charset=utf-8\",\n};\n\n/**\n * This function maps the path of a request to a file of the folder, as GitHub Pages does. A folder\n * gives its `index.html`. For a path with no extension, the function also tries `<path>.html`.\n *\n * @returns the absolute file, or undefined when the path is outside the base or the file is missing\n */\nexport function resolveFile(root: string, base: string, pathname: string): string | undefined {\n let decoded: string;\n try {\n decoded = decodeURIComponent(pathname);\n } catch {\n return undefined;\n }\n const home = base.endsWith(\"/\") ? base : `${base}/`;\n if (decoded === home.slice(0, -1)) decoded = home;\n if (!decoded.startsWith(home)) return undefined;\n const top = resolve(root);\n const file = normalize(join(top, decoded.slice(home.length)));\n if (file !== top && !file.startsWith(top + sep)) return undefined;\n const candidates = [file, join(file, \"index.html\"), `${file}.html`];\n return candidates.find((candidate) => existsSync(candidate) && statSync(candidate).isFile());\n}\n\n/** A started server. */\nexport interface StaticServer {\n /** The URL of the site home, for example `http://127.0.0.1:50123/client/`. */\n url: string;\n close(): Promise<void>;\n}\n\n/**\n * This function serves the folder at `base` on a free port of 127.0.0.1. A missing file gives the\n * status 404 with the `404.html` of the folder, when it has one.\n */\nexport async function serve(root: string, base: string): Promise<StaticServer> {\n const server: Server = createServer((request, response) => {\n const pathname = new URL(request.url ?? \"/\", \"http://localhost\").pathname;\n const home = base.endsWith(\"/\") ? base : `${base}/`;\n if (pathname === home.slice(0, -1) && home !== \"/\") {\n response.writeHead(301, { location: home }).end();\n return;\n }\n const file = resolveFile(root, base, pathname);\n const missing = join(resolve(root), \"404.html\");\n const send = file ?? (existsSync(missing) ? missing : undefined);\n if (send === undefined) {\n response.writeHead(404, { \"content-type\": \"text/plain; charset=utf-8\" }).end(`404: ${pathname}\\n`);\n return;\n }\n response.writeHead(file ? 200 : 404, { \"content-type\": TYPES[extname(send).toLowerCase()] ?? \"application/octet-stream\", \"cache-control\": \"no-store\" });\n createReadStream(send).pipe(response);\n });\n await new Promise<void>((done, fail) => {\n server.once(\"error\", fail);\n server.listen(0, \"127.0.0.1\", () => done());\n });\n const address = server.address();\n if (address === null || typeof address === \"string\") throw new Error(\"the server has no port\");\n return {\n url: `http://127.0.0.1:${address.port}${base.endsWith(\"/\") ? base : `${base}/`}`,\n close: () => new Promise((done) => server.close(() => done())),\n };\n}\n","/**\n * The `site-pages check` command. It opens the pages of a built site (or of a live URL) in a\n * headless Chromium at phone and desktop widths, in the light and the dark scheme.\n *\n * A view fails when the page is wider than the screen or an element goes past the right edge. It\n * also fails when a text area hides its text, a box cuts text (`cutProblems`) or the page shows no text. A console error, an\n * exception and a failed request of the site also fail it. A script that does not load and a failed check of the probe\n * fail it too. The command\n * writes a screenshot of each view.\n */\n\nimport { appendFileSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { parseArgs } from \"node:util\";\nimport { findBrowser, launch, type Browser, type Page } from \"./browser.ts\";\nimport { MEASURE, probeExpression, type Cut, type Measure, type ProbeCheck } from \"./measure.ts\";\nimport { probeScript, TYPESCRIPT_PROBE } from \"./probe.ts\";\nimport { serve } from \"./serve.ts\";\n\n/** A view narrower than this width in CSS pixels is a phone. */\nexport const PHONE_WIDTH = 768;\n\n/** The options of `checkSite`. */\nexport interface CheckOptions {\n /** The built site folder. Give `out` or `url`. */\n out?: string | undefined;\n /** The path of the site home, for `out`, for example `/client/`. */\n base?: string | undefined;\n /** The URL of a live site home. Give `out` or `url`. */\n url?: string | undefined;\n /** The pages, from the site home, for example `/` and `/releases/`. */\n pages: readonly string[];\n /** The widths in CSS pixels. A width under `PHONE_WIDTH` is a phone. */\n widths: readonly number[];\n /** The color schemes. */\n schemes: readonly (\"light\" | \"dark\")[];\n /** The code of a probe: the body of an async function (see `probeExpression`). It runs on the first page, in the light scheme, at each width. */\n probe?: string | undefined;\n /**\n * The probe of each page: a map from a page of `pages` to the code of its probe. Each probe operates on its page, in the first\n * scheme, at each width. A page with no entry has no probe. The first page takes `probe` or an entry of this map, not both.\n */\n probes?: Readonly<Record<string, string>> | undefined;\n /** The folder for the screenshots, `report.json` and `summary.md`. */\n shots?: string | undefined;\n /** The browser executable. */\n browser?: string | undefined;\n /** The time to wait after the load event, for the scripts of the page. */\n settleMs: number;\n /** The time limit of a page load. */\n timeoutMs: number;\n /** The time limit of the scroll and of the islands of a view, for `revealExpression`. The default is `ISLAND_LIMIT_MS`. */\n islandMs?: number | undefined;\n log?: ((line: string) => void) | undefined;\n}\n\n/** The default time limit of the scroll and of the islands of a view, in milliseconds. */\nexport const ISLAND_LIMIT_MS = 10_000;\n\n/**\n * This function gives a page expression that scrolls the page to its end, one screen at a time, and then back to the top.\n * Thus each part that starts when it comes into view starts before the measure. Examples are an Astro island with\n * `client:visible` and an image with `loading=\"lazy\"`. Then the expression waits until no Astro island waits to start.\n * An island that the page does not show and an island of a media query that does not match do not count.\n * The expression gives the islands that did not start in `limitMs`.\n */\nexport function revealExpression(limitMs: number): string {\n return `(async () => {\n const end = performance.now() + ${String(limitMs)};\n const frame = () => new Promise((done) => requestAnimationFrame(() => setTimeout(done, 0)));\n const root = document.scrollingElement ?? document.documentElement;\n const step = Math.max(Math.round(innerHeight * 0.8), 100);\n for (let top = 0; top < root.scrollHeight && performance.now() < end; top += step) {\n scrollTo({ top, behavior: \"instant\" });\n await frame();\n await frame();\n }\n scrollTo({ top: root.scrollHeight, behavior: \"instant\" });\n await frame();\n const waiting = () => [...document.querySelectorAll(\"astro-island[ssr]\")].filter((island) => {\n const client = island.getAttribute(\"client\") ?? \"\";\n if (client === \"media\") {\n try {\n const query = JSON.parse(island.getAttribute(\"opts\") ?? \"{}\").value;\n if (typeof query === \"string\" && !matchMedia(query).matches) return false;\n } catch {}\n }\n if (client === \"visible\" && ![...island.children].some((child) => child.getClientRects().length > 0)) return false;\n return true;\n });\n while (waiting().length > 0 && performance.now() < end) await new Promise((done) => setTimeout(done, 50));\n scrollTo({ top: 0, behavior: \"instant\" });\n await frame();\n await frame();\n return waiting().map((island) => (island.getAttribute(\"component-url\") ?? \"\").split(\"/\").pop() + \" (client:\" + (island.getAttribute(\"client\") ?? \"\") + \")\");\n})()`;\n}\n\n/** The result of one page at one width and scheme. */\nexport interface ViewResult {\n page: string;\n width: number;\n scheme: \"light\" | \"dark\";\n ok: boolean;\n /** What failed. */\n problems: string[];\n measure?: Measure | undefined;\n probe?: ProbeCheck[] | undefined;\n /** The file of the screenshot. */\n shot?: string | undefined;\n}\n\n/** The result of `checkSite`. */\nexport interface CheckResult {\n ok: boolean;\n url: string;\n browser: string;\n views: ViewResult[];\n}\n\n/**\n * This function gives the problems of the cuts of a view with the given width. A box that clips text is a problem at each width.\n * A table or a code block in a box that scrolls is a problem only on a phone. A phone shows no scroll bar, but a desktop shows one.\n * The summary and the log give the page of each problem.\n */\nexport function cutProblems(cuts: readonly Cut[], width: number): string[] {\n const widths = (cut: Cut) => `${cut.element} in ${cut.box}: content of ${cut.scrollWidth} px in a box of ${cut.clientWidth} px, \"${cut.text}\"`;\n return cuts.flatMap((cut) => {\n if (cut.kind === \"clip\") return [`a box cuts text at ${width} px: ${widths(cut)}. Make the content fit, or add data-overflow-ok to the box.`];\n const what = cut.kind === \"code\" ? \"a code block\" : \"a table\";\n if (cut.deadCue === true) return width < PHONE_WIDTH ? [`${what} goes out of view at ${width} px: ${widths(cut)}. The box has the class scroll-cue, but its computed style has no animation and no shade. Read the served CSS.`] : [];\n if (width < PHONE_WIDTH) return [`${what} goes out of view at ${width} px: ${widths(cut)}. Make ${cut.kind === \"code\" ? \"the lines\" : \"the table\"} fit, give the box the class scroll-cue, or add data-overflow-ok to the box.`];\n return [];\n });\n}\n\n/** This function gives the file name part of a page: `/` is `home`, `/releases/` is `releases`. */\nexport function pageSlug(page: string): string {\n const slug = page.replace(/^\\/+|\\/+$/g, \"\").replace(/[^A-Za-z0-9._-]+/g, \"_\");\n return slug === \"\" ? \"home\" : slug;\n}\n\n/**\n * This function gives the code of the probe of each page of `pages`, in the same order. A page with no probe gives undefined.\n * `probe` goes to the first page, and each entry of `probes` goes to its page.\n *\n * @throws Error when a key of `probes` is not a page, or when the first page has `probe` and an entry of `probes`\n */\nexport function pageProbes(options: Pick<CheckOptions, \"pages\" | \"probe\" | \"probes\">): (string | undefined)[] {\n const probes = options.probes ?? {};\n const unknown = Object.keys(probes).filter((page) => !options.pages.includes(page));\n if (unknown.length > 0) throw new Error(`a probe names a page that the check does not open: ${unknown.join(\", \")}. The pages are ${options.pages.join(\", \")}.`);\n const first = options.pages[0];\n if (options.probe !== undefined && first !== undefined && Object.hasOwn(probes, first)) throw new Error(`the first page ${first} has two probes: give it probe or an entry of probes, not both`);\n return options.pages.map((page, index) => (Object.hasOwn(probes, page) ? probes[page] : index === 0 ? options.probe : undefined));\n}\n\n/**\n * This function checks the site. It starts one browser and, for `out`, one server, and stops both at\n * the end.\n *\n * @throws Error when there is no browser, or the browser does not start\n */\nexport async function checkSite(options: CheckOptions): Promise<CheckResult> {\n const log = options.log ?? (() => {});\n const executable = findBrowser(options.browser);\n if (executable === undefined) throw new Error(\"no Chromium browser was found: give --browser, set SITE_CHECK_BROWSER, or install the Chromium of Playwright\");\n if (options.pages.length === 0) throw new Error(\"no page to check\");\n const probes = pageProbes(options);\n if (options.out === undefined && options.url === undefined) throw new Error(\"give out or url\");\n const server = options.out !== undefined ? await serve(options.out, options.base ?? \"/\") : undefined;\n const views: ViewResult[] = [];\n let homeUrl: URL;\n let browser: Browser | undefined;\n // The server stops also when the browser does not start. An open server keeps the process alive, and the check does not end.\n try {\n const home = server?.url ?? options.url ?? \"\";\n homeUrl = new URL(home.endsWith(\"/\") ? home : `${home}/`);\n browser = await launch(executable, options.timeoutMs);\n const { page } = browser;\n const events = watch(page, homeUrl.origin);\n await Promise.all([page.send(\"Page.enable\"), page.send(\"Runtime.enable\"), page.send(\"Network.enable\")]);\n await page.send(\"Page.addScriptToEvaluateOnNewDocument\", { source: LOAD_WATCH });\n if (options.shots) mkdirSync(options.shots, { recursive: true });\n for (const [index, path] of options.pages.entries()) {\n const target = new URL(path.replace(/^\\/+/, \"\"), homeUrl).href;\n for (const width of options.widths) {\n for (const scheme of options.schemes) {\n const probe = scheme === options.schemes[0] ? probes[index] : undefined;\n const view = await checkView(page, events, { target, path, width, scheme, probe, options });\n views.push(view);\n log(`${view.ok ? \"PASS\" : \"FAIL\"} ${path} ${width} ${scheme}${view.measure ? ` scrollWidth=${view.measure.scrollWidth} innerWidth=${view.measure.innerWidth}` : \"\"}${view.probe ? ` probe ${view.probe.filter((c) => c.ok).length}/${view.probe.length}` : \"\"}${view.problems.length > 0 ? `\\n - ${view.problems.join(\"\\n - \")}` : \"\"}`);\n }\n }\n }\n } finally {\n await browser?.close();\n await server?.close();\n }\n const result: CheckResult = { ok: views.length > 0 && views.every((view) => view.ok), url: homeUrl.href, browser: executable, views };\n if (options.shots) {\n writeFileSync(join(options.shots, \"report.json\"), `${JSON.stringify(result, null, 2)}\\n`);\n writeFileSync(join(options.shots, \"summary.md\"), summary(result));\n }\n return result;\n}\n\n/**\n * A script that each page starts before its own scripts. A script or a style sheet that does not load fires `error` on its\n * element. This script writes that event as a console error. Thus a module script whose imports do not load is a problem too.\n * Such a script throws no exception. Its failed request can go to another origin, for example `node:perf_hooks` in a page bundle.\n */\nexport const LOAD_WATCH = `addEventListener(\"error\", (event) => {\n const element = event.target;\n if (!(element instanceof HTMLScriptElement || element instanceof HTMLLinkElement)) return;\n console.error(\"failed to load \" + element.tagName.toLowerCase() + \": \" + (element.getAttribute(\"src\") ?? element.getAttribute(\"href\") ?? \"(inline)\"));\n}, true);`;\n\n/** This expression reads the pattern of the paths that other sites of the origin serve. An empty text means no pattern. */\nconst OTHER_PATHS = `document.querySelector('meta[name=\"site-check-other-paths\"]')?.content ?? \"\"`;\n\n/** The problems that the events of the page gave, since the last `reset`. */\ninterface Events {\n reset(): void;\n /** This function gives the problems. A refused request to a path that `other` matches is not a problem. */\n problems(other?: RegExp): string[];\n}\n\nfunction watch(page: Page, origin: string): Events {\n let problems: string[] = [];\n let refused: { url: string; status: number }[] = [];\n const urls = new Map<string, string>();\n const own = (url: string) => {\n try {\n const parsed = new URL(url);\n // A browser asks for /favicon.ico on its own, also for a site under a path.\n return parsed.origin === origin && parsed.pathname !== \"/favicon.ico\";\n } catch {\n return false;\n }\n };\n page.on(\"Runtime.exceptionThrown\", (params) => {\n const details = params[\"exceptionDetails\"] as { text?: string; exception?: { description?: string } };\n problems.push(`exception: ${(details.exception?.description ?? details.text ?? \"\").split(\"\\n\")[0]}`);\n });\n page.on(\"Runtime.consoleAPICalled\", (params) => {\n if (params[\"type\"] !== \"error\" && params[\"type\"] !== \"assert\") return;\n const args = (params[\"args\"] as { value?: unknown; description?: string }[]) ?? [];\n problems.push(`console.error: ${args.map((arg) => String(arg.value ?? arg.description ?? \"\")).join(\" \").slice(0, 300)}`);\n });\n page.on(\"Network.requestWillBeSent\", (params) => {\n urls.set(String(params[\"requestId\"]), String((params[\"request\"] as { url: string }).url));\n });\n page.on(\"Network.responseReceived\", (params) => {\n const response = params[\"response\"] as { url: string; status: number };\n if (response.status >= 400 && own(response.url)) refused.push(response);\n });\n page.on(\"Network.loadingFailed\", (params) => {\n const url = urls.get(String(params[\"requestId\"])) ?? \"\";\n // A script of any origin counts: without it, the page does not work.\n if ((own(url) || params[\"type\"] === \"Script\") && params[\"canceled\"] !== true) problems.push(`request failed (${String(params[\"errorText\"])}): ${url}`);\n });\n return {\n reset: () => {\n problems = [];\n refused = [];\n },\n problems: (other) => {\n const shown = refused.filter((response) => other?.test(new URL(response.url).pathname) !== true);\n return [...new Set([...problems, ...shown.map((response) => `HTTP ${response.status}: ${response.url}`)])];\n },\n };\n}\n\ninterface ViewInput {\n target: string;\n path: string;\n width: number;\n scheme: \"light\" | \"dark\";\n /** The code of the probe of this view, or undefined for no probe. */\n probe: string | undefined;\n options: CheckOptions;\n}\n\nasync function checkView(page: Page, events: Events, input: ViewInput): Promise<ViewResult> {\n const { target, path, width, scheme, probe, options } = input;\n const view: ViewResult = { page: path, width, scheme, ok: false, problems: [] };\n let other: RegExp | undefined;\n try {\n await page.send(\"Emulation.setDeviceMetricsOverride\", { width, height: 900, deviceScaleFactor: 1, mobile: width < PHONE_WIDTH });\n await page.send(\"Emulation.setEmulatedMedia\", { features: [{ name: \"prefers-color-scheme\", value: scheme }] });\n events.reset();\n const loaded = page.once(\"Page.loadEventFired\", options.timeoutMs);\n const navigation = (await page.send(\"Page.navigate\", { url: target })) as { errorText?: string };\n if (navigation.errorText) {\n loaded.catch(() => {});\n throw new Error(`the page did not open: ${navigation.errorText}`);\n }\n await loaded;\n await page.evaluate(\"document.fonts ? document.fonts.ready.then(() => true) : true\");\n await new Promise((done) => setTimeout(done, options.settleMs));\n const islandMs = options.islandMs ?? ISLAND_LIMIT_MS;\n const stuck = await page.evaluate<string[]>(revealExpression(islandMs));\n for (const island of stuck) view.problems.push(`an island did not start in ${String(islandMs)} ms after a scroll to the end: ${island}`);\n const pattern = await page.evaluate<string>(OTHER_PATHS);\n if (pattern !== \"\") other = new RegExp(pattern);\n const measure = await page.evaluate<Measure>(MEASURE);\n view.measure = measure;\n // The screen width, not innerWidth: a phone browser can zoom out a page that is too wide.\n if (measure.scrollWidth > width) view.problems.push(`the page is wider than the screen: ${measure.scrollWidth} > ${width}`);\n for (const past of measure.past) view.problems.push(`past the right edge: ${past}`);\n for (const clipped of measure.clipped) view.problems.push(`a text area hides its text: ${clipped}`);\n view.problems.push(...cutProblems(measure.cut, width));\n if (measure.text === 0) view.problems.push(\"the page shows no text\");\n if (options.shots) {\n const file = join(options.shots, `${pageSlug(path)}-${width}-${scheme}.png`);\n const height = Math.min(Math.max(measure.height, 1), 8000);\n const shot = (await page.send(\"Page.captureScreenshot\", { format: \"png\", captureBeyondViewport: true, clip: { x: 0, y: 0, width, height, scale: 1 } })) as { data: string };\n writeFileSync(file, Buffer.from(shot.data, \"base64\"));\n view.shot = file;\n }\n if (probe !== undefined) {\n const checks = (await page.evaluate<ProbeCheck[] | undefined>(probeExpression(probe))) ?? [];\n view.probe = checks;\n if (checks.length === 0) view.problems.push(\"the probe made no check\");\n for (const check of checks.filter((entry) => !entry.ok)) view.problems.push(`probe: ${check.name}${check.detail ? ` (${check.detail})` : \"\"}`);\n }\n } catch (error) {\n view.problems.push(error instanceof Error ? error.message : String(error));\n }\n view.problems.push(...events.problems(other));\n view.ok = view.problems.length === 0;\n return view;\n}\n\n/** This function makes a text safe for a cell of a Markdown table. It escapes `\\`, `|`, `<` and `>`. It changes each new line to a space. */\nexport function cell(text: string): string {\n return text.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\|/g, \"\\\\|\").replace(/</g, \"<\").replace(/>/g, \">\").replace(/\\r?\\n/g, \" \");\n}\n\n/** This function gives the Markdown summary of a result, for the job summary of a workflow. */\nexport function summary(result: CheckResult): string {\n const failed = result.views.filter((view) => !view.ok);\n const lines = [\n `### Site check: ${result.ok ? \"passed\" : \"failed\"}`,\n \"\",\n `${result.views.length - failed.length} of ${result.views.length} views passed, at ${result.url}.`,\n \"\",\n \"| Page | Width | Scheme | Result | Problems |\",\n \"| --- | ---: | --- | --- | --- |\",\n ...result.views.map(\n (view) =>\n `| \\`${view.page}\\` | ${view.width} | ${view.scheme} | ${view.ok ? \"pass\" : \"**fail**\"}${view.probe ? ` (probe ${view.probe.filter((c) => c.ok).length}/${view.probe.length})` : \"\"} | ${view.problems.map(cell).join(\"<br>\")} |`,\n ),\n \"\",\n ];\n return lines.join(\"\\n\");\n}\n\n/** The input and output of the CLI. */\nexport interface CheckIo {\n cwd: string;\n env: NodeJS.ProcessEnv;\n stdout: (text: string) => void;\n stderr: (text: string) => void;\n}\n\nexport const CHECK_HELP = `Usage: site-pages check (--out <dir> | --url <url>) [options]\n\nOpens the pages of the site in a headless Chromium at phone and desktop widths, in the light and\nthe dark scheme, and fails when a page is wider than the screen, an element goes past the right\nedge, a text area hides its text, a box cuts text, a table goes out of view on a phone, a page\nshows no text, or on a console error, an exception, a failed request of the site, a script that\ndoes not load or a failed check of the probe. Add data-overflow-ok to a box that is meant to\nscroll or to clip.\n\nOptions:\n --out <dir> The built site folder. The check serves it at --base.\n --url <url> The URL of a live site home, in place of --out\n --repo <owner/name> The GitHub repository, for the default base (default: $GITHUB_REPOSITORY)\n --base </name/> The path of the site home (default: \"/<name>/\", or \"/\" for <owner>.github.io)\n --pages <paths> The pages, from the site home, separated by commas (default: /)\n --widths <px> The widths, separated by commas (default: 360,400,1280)\n --schemes <list> light, dark or both (default: light,dark)\n --probe <file> A JavaScript file: the body of an async function with check(name, ok, detail),\n wait, until, $, $$, type and click. It runs on the first page, in the first\n scheme, at each width. A .ts, .mts or .cts file is TypeScript: the check\n removes its types and its line export {}.\n --page-probe <page>=<file>\n The probe of one page of --pages, for example /structures/=probe.ts. Give\n the option one time for each page. A page with no probe has none. The\n first page takes --probe or --page-probe, not both.\n --shots <dir> The folder for the screenshots, report.json and summary.md\n --browser <file> The Chromium executable (default: $SITE_CHECK_BROWSER, the Chromium of\n Playwright, else Chrome or Edge)\n --settle <ms> The wait after the load event (default: 1500)\n --timeout <ms> The time limit of a page load (default: 30000)\n --help Shows this text\n\nWith $GITHUB_STEP_SUMMARY, the check adds its table to the job summary.\n`;\n\n/** This function runs the `check` command with its arguments, without the word `check`. */\nexport async function runCheckCli(argv: readonly string[], io: CheckIo): Promise<number> {\n let values: Record<string, string | boolean | string[] | undefined>;\n try {\n ({ values } = parseArgs({\n args: [...argv],\n allowPositionals: false,\n options: {\n out: { type: \"string\" },\n url: { type: \"string\" },\n repo: { type: \"string\" },\n base: { type: \"string\" },\n pages: { type: \"string\" },\n widths: { type: \"string\" },\n schemes: { type: \"string\" },\n probe: { type: \"string\" },\n \"page-probe\": { type: \"string\", multiple: true },\n shots: { type: \"string\" },\n browser: { type: \"string\" },\n settle: { type: \"string\" },\n timeout: { type: \"string\" },\n help: { type: \"boolean\" },\n },\n }));\n } catch (error) {\n io.stderr(`site-pages check: ${error instanceof Error ? error.message : String(error)}\\n\\n${CHECK_HELP}`);\n return 2;\n }\n if (values[\"help\"]) {\n io.stdout(CHECK_HELP);\n return 0;\n }\n const usage = (message: string) => {\n io.stderr(`site-pages check: ${message}\\n\\n${CHECK_HELP}`);\n return 2;\n };\n const text = (key: string) => (typeof values[key] === \"string\" ? (values[key] as string) : undefined);\n const list = (key: string, fallback: string) => (text(key) ?? fallback).split(\",\").map((entry) => entry.trim()).filter(Boolean);\n const out = text(\"out\");\n const url = text(\"url\");\n if ((out === undefined) === (url === undefined)) return usage(\"give --out or --url, not both\");\n const widths = list(\"widths\", \"360,400,1280\").map(Number);\n if (widths.length === 0 || widths.some((width) => !Number.isInteger(width) || width < 200 || width > 4000)) return usage(\"--widths must be whole numbers from 200 to 4000\");\n const schemes = list(\"schemes\", \"light,dark\");\n if (schemes.length === 0 || schemes.some((scheme) => scheme !== \"light\" && scheme !== \"dark\")) return usage(\"--schemes must be light, dark or both\");\n const pages = list(\"pages\", \"/\");\n if (pages.length === 0) return usage(\"--pages has no page\");\n // Git Bash changes a bare \"/\" into \"C:/Program Files/Git/\". A page is a path, with no scheme or drive.\n const notPath = pages.find((entry) => entry.includes(\":\") || entry.includes(\"\\\\\"));\n if (notPath !== undefined) return usage(`a page is a path from the site home, not \"${notPath}\" (in Git Bash, set MSYS_NO_PATHCONV=1)`);\n const settleMs = Number(text(\"settle\") ?? 1500);\n const timeoutMs = Number(text(\"timeout\") ?? 30000);\n if (!(settleMs >= 0) || !(timeoutMs > 0)) return usage(\"--settle and --timeout must be numbers of milliseconds\");\n let base = text(\"base\");\n if (out !== undefined && base === undefined) {\n const name = (text(\"repo\") ?? io.env[\"GITHUB_REPOSITORY\"] ?? \"\").split(\"/\")[1];\n if (!name) return usage(\"give --base, --repo or set GITHUB_REPOSITORY\");\n base = /\\.github\\.io$/i.test(name) ? \"/\" : `/${name}/`;\n }\n if (base !== undefined) base = `/${base.replace(/^\\/+|\\/+$/g, \"\")}/`.replace(/^\\/\\/$/, \"/\");\n const at = (file: string) => (isAbsolute(file) ? file : resolve(io.cwd, file));\n /** This function reads a probe file. A TypeScript file loses its types. A file that cannot be read gives an Error. */\n const readProbe = (file: string): string | Error => {\n let code: string;\n try {\n code = readFileSync(at(file), \"utf8\");\n } catch (error) {\n return new Error(`the probe file ${file} cannot be read: ${error instanceof Error ? error.message : String(error)}`);\n }\n if (!TYPESCRIPT_PROBE.test(file)) return code;\n try {\n return probeScript(code);\n } catch (error) {\n return new Error(`the types of the probe file ${file} cannot be removed: ${error instanceof Error ? error.message : String(error)}`);\n }\n };\n const probeFile = text(\"probe\");\n let probe: string | undefined;\n if (probeFile !== undefined) {\n const code = readProbe(probeFile);\n if (code instanceof Error) return usage(code.message);\n probe = code;\n }\n const probes: Record<string, string> = {};\n for (const entry of (values[\"page-probe\"] as string[] | undefined) ?? []) {\n const split = entry.indexOf(\"=\");\n const page = entry.slice(0, split).trim();\n const file = entry.slice(split + 1).trim();\n if (split <= 0 || file === \"\") return usage(`--page-probe must be <page>=<file>, not \"${entry}\"`);\n if (Object.hasOwn(probes, page)) return usage(`--page-probe gives two probes for the page ${page}`);\n const code = readProbe(file);\n if (code instanceof Error) return usage(code.message);\n probes[page] = code;\n }\n try {\n pageProbes({ pages, probe, probes });\n } catch (error) {\n return usage(error instanceof Error ? error.message : String(error));\n }\n const shots = text(\"shots\");\n const result = await checkSite({\n out: out === undefined ? undefined : at(out),\n base,\n url,\n pages,\n widths,\n schemes: schemes as (\"light\" | \"dark\")[],\n probe,\n probes,\n shots: shots === undefined ? undefined : at(shots),\n browser: text(\"browser\"),\n settleMs,\n timeoutMs,\n log: (line) => io.stdout(`${line}\\n`),\n });\n const failed = result.views.filter((view) => !view.ok).length;\n io.stdout(`site-pages check: ${result.views.length - failed} of ${result.views.length} views passed (${result.browser}).\\n`);\n const step = io.env[\"GITHUB_STEP_SUMMARY\"];\n if (step) appendFileSync(step, summary(result));\n return result.ok ? 0 : 1;\n}\n","/**\n * The navigation check of a site (`site-pages nav`). It opens the home page in a headless Chromium.\n * It follows the links that the browser shows, and counts the clicks from home to each page.\n * The check fails when a page of the sitemap is more than `maxClicks` clicks from home.\n * It also fails when a page has no visible link back to home, or when a link of the site opens a new tab.\n * A link to a missing page fails too.\n *\n * The check clicks each link to the Releases page and the Status page.\n * A single-page application can catch such a click and show its own page in place of the page of site-pages.\n * The rules are functions with no I/O, so the tests call them with no browser.\n */\n\nimport { appendFileSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { parseArgs } from \"node:util\";\nimport { barHtml, injectBar, parsePages, type BarOptions } from \"../bar/bar.ts\";\nimport { findBrowser, launch, type Page } from \"./browser.ts\";\nimport { cell, PHONE_WIDTH, pageSlug, type CheckIo } from \"./check.ts\";\nimport { serve } from \"./serve.ts\";\n\n/** One link of a page, as the browser shows it. */\nexport interface NavLink {\n /** The absolute URL of the link, with no fragment. */\n readonly href: string;\n /** The text of the link, or its label. */\n readonly text: string;\n /** The value of the attribute `target`, or an empty text. */\n readonly target: string;\n /** True when the link has a size and the page does not hide it. */\n readonly visible: boolean;\n}\n\n/** One page that the crawl opened. */\nexport interface NavPage {\n /** The path of the page from the site home, for example `releases/`. The home is an empty text. */\n readonly path: string;\n /** The number of clicks from home. */\n readonly clicks: number;\n /** The HTTP status of the document. */\n readonly status: number;\n /** The path of the page that linked to this page first, or undefined for the home. */\n readonly from: string | undefined;\n /** The links of the page at the desktop width. */\n readonly links: readonly NavLink[];\n /** True when the page shows a link to home at the phone width. */\n readonly homeAtPhone: boolean;\n /** True when the page has the shared site bar (`[data-site-bar]`). */\n readonly bar: boolean;\n}\n\n/** The result of a click on a link to a page of site-pages. */\nexport interface NavClick {\n /** The page with the link. */\n readonly from: string;\n /** The path of the link. */\n readonly to: string;\n /** The path of the page after the click. */\n readonly landed: string;\n /** True when the page after the click has the header of site-pages (`.sp-header`) or the site bar. */\n readonly shown: boolean;\n}\n\n/** The options of `crawlSite`. */\nexport interface NavOptions {\n /** The built site folder. The crawl serves it at `base`. */\n readonly out?: string | undefined;\n /** The URL of a live site home, in place of `out`. */\n readonly url?: string | undefined;\n /** The path of the site home, for `out`. */\n readonly base?: string | undefined;\n /** The largest number of clicks from home to a page. */\n readonly maxClicks: number;\n /** The largest number of pages to open. */\n readonly maxPages: number;\n /** True: each page must have the shared site bar. */\n readonly requireBar: boolean;\n /** A folder for the screenshots, report.json and summary.md. */\n readonly shots?: string | undefined;\n /** The paths of the pages to take screenshots of, from the site home. */\n readonly shotPages: readonly string[];\n readonly browser?: string | undefined;\n readonly settleMs: number;\n readonly timeoutMs: number;\n readonly log?: ((line: string) => void) | undefined;\n /**\n * The content of a bar for a preview, or undefined for no preview. The browser writes this bar into each page of\n * the site as it loads, as the Pages workflow does after the build. Thus the crawl shows a live site with the bar.\n */\n readonly previewBar?: BarOptions | undefined;\n}\n\n/** The result of `crawlSite`. */\nexport interface NavResult {\n readonly ok: boolean;\n readonly home: string;\n readonly pages: readonly NavPage[];\n /** The paths of the sitemap, or an empty list when the site has no sitemap. */\n readonly sitemap: readonly string[];\n readonly clicks: readonly NavClick[];\n readonly problems: readonly string[];\n /**\n * The paths that the crawl did not open, because it stopped at the limit `maxPages`. A path of this list is a no-read: the\n * crawl does not know its problems. A result with a no-read is not `ok`.\n */\n readonly unread: readonly string[];\n}\n\n/**\n * This function gives the no-reads of a crawl: the paths left in its queue, and each path of the sitemap that it did not\n * open. A crawl with an empty queue read each page that a link reaches, so it has no no-read.\n */\nexport function navUnread(queue: readonly string[], pages: readonly Pick<NavPage, \"path\">[], sitemap: readonly string[]): string[] {\n if (queue.length === 0) return [];\n const opened = new Set(pages.map((page) => page.path));\n return [...new Set([...queue, ...sitemap.filter((path) => !opened.has(path))])];\n}\n\n/** The phone width of the check of the way back. */\nexport const NAV_PHONE_WIDTH = 360;\n/** The desktop width of the crawl. */\nexport const NAV_DESKTOP_WIDTH = 1280;\n\n/**\n * This function gives the path of a URL from the site home, or undefined when the URL is not a page\n * of the site. A file with an extension other than `.html` is not a page. `index.html` is its folder.\n */\nexport function sitePath(href: string, home: URL): string | undefined {\n let url: URL;\n try {\n url = new URL(href, home);\n } catch {\n return undefined;\n }\n if (url.origin !== home.origin || !url.pathname.startsWith(home.pathname)) return undefined;\n const path = url.pathname.slice(home.pathname.length).replace(/(^|\\/)index\\.html$/, \"$1\");\n const last = path.split(\"/\").at(-1) ?? \"\";\n if (last.includes(\".\") && !last.endsWith(\".html\")) return undefined;\n return path;\n}\n\n/** This function gives the paths of the `<loc>` entries of a sitemap that are pages of the site. */\nexport function sitemapPaths(xml: string, home: URL): string[] {\n const paths = [...xml.matchAll(/<loc>\\s*([^<\\s]+)\\s*<\\/loc>/g)].map((match) => sitePath(match[1] ?? \"\", home));\n return [...new Set(paths.filter((path): path is string => path !== undefined))];\n}\n\n/** The name of a page in a message: its path, or \"the home page\". */\nconst named = (path: string) => (path === \"\" ? \"the home page\" : `/${path}`);\n\n/** This function gives the problems of a crawl. It reads no file and opens no page. */\nexport function navProblems(result: Pick<NavResult, \"pages\" | \"sitemap\" | \"clicks\"> & { readonly unread?: readonly string[] }, home: URL, options: Pick<NavOptions, \"maxClicks\" | \"requireBar\">): string[] {\n const problems: string[] = [];\n const byPath = new Map(result.pages.map((page) => [page.path, page]));\n const unread = new Set(result.unread ?? []);\n for (const path of result.sitemap) {\n const page = byPath.get(path);\n // A page that the crawl did not open is a no-read, not a problem (refer to `navUnread`)\n if (page === undefined && unread.has(path)) continue;\n if (page === undefined) problems.push(`${named(path)} is in the sitemap, and no chain of links from home reaches it`);\n else if (page.clicks > options.maxClicks) problems.push(`${named(path)} is ${page.clicks} clicks from home, over the limit of ${options.maxClicks}`);\n }\n for (const page of result.pages) {\n if (page.status >= 400) {\n problems.push(`a link of ${named(page.from ?? \"\")} goes to ${named(page.path)}, which gives HTTP ${page.status}`);\n continue;\n }\n if (page.path !== \"\") {\n const back = page.links.some((link) => link.visible && sitePath(link.href, home) === \"\");\n if (!back) problems.push(`${named(page.path)} shows no link back to home at ${NAV_DESKTOP_WIDTH} px`);\n else if (!page.homeAtPhone) problems.push(`${named(page.path)} shows no link back to home at ${NAV_PHONE_WIDTH} px`);\n }\n if (options.requireBar && !page.bar) problems.push(`${named(page.path)} has no site bar`);\n for (const link of page.links) {\n if (link.target !== \"\" && link.target !== \"_self\" && sitePath(link.href, home) !== undefined) {\n problems.push(`the link \"${link.text}\" of ${named(page.path)} opens ${named(sitePath(link.href, home) ?? \"\")} in a new tab, so the back button of the browser does not go back`);\n }\n }\n }\n for (const click of result.clicks) {\n if (click.landed !== click.to) problems.push(`a click on the link to ${named(click.to)} of ${named(click.from)} shows ${named(click.landed)}`);\n else if (!click.shown) problems.push(`a click on the link to ${named(click.to)} of ${named(click.from)} does not show that page: the site shows its own page at that path`);\n }\n return [...new Set(problems)];\n}\n\n/**\n * The function that clicks the first link of the page to the path in its argument, in the same tab. It gives true when\n * the page has such a link. The path is an argument of the call, so it is not a part of the code.\n */\nconst CLICK_LINK = `function (pathname) {\n const a = [...document.querySelectorAll(\"a[href]\")].find((el) => new URL(el.getAttribute(\"href\"), location.href).pathname === pathname);\n if (a) { a.removeAttribute(\"target\"); a.click(); }\n return Boolean(a);\n}`;\n\n/** The expression that gives the links of the page and the marks of its header. */\nexport const NAV_SCAN = `(() => {\n const shown = (el) => {\n const box = el.getBoundingClientRect();\n if (box.width < 1 || box.height < 1) return false;\n for (let node = el; node; node = node.parentElement) {\n const style = getComputedStyle(node);\n if (style.visibility === \"hidden\" || style.display === \"none\" || Number(style.opacity) === 0) return false;\n }\n return box.right > 0 && box.left < innerWidth;\n };\n const links = [...document.querySelectorAll(\"a[href]\")].map((a) => {\n const url = new URL(a.getAttribute(\"href\"), location.href);\n url.hash = \"\";\n const text = (a.textContent || a.getAttribute(\"aria-label\") || a.getAttribute(\"title\") || \"\").replace(/\\\\s+/g, \" \").trim().slice(0, 80);\n return { href: url.href, text, target: a.getAttribute(\"target\") || \"\", visible: shown(a) };\n });\n return { links, bar: document.querySelector(\"[data-site-bar]\") !== null, spHeader: document.querySelector(\".sp-header\") !== null, path: location.pathname };\n})()`;\n\ninterface Scan {\n links: NavLink[];\n bar: boolean;\n spHeader: boolean;\n path: string;\n}\n\nasync function open(page: Page, target: string, width: number, options: NavOptions): Promise<{ status: number; scan: Scan }> {\n await page.send(\"Emulation.setDeviceMetricsOverride\", { width, height: 900, deviceScaleFactor: 1, mobile: width < PHONE_WIDTH });\n const loaded = page.once(\"Page.loadEventFired\", options.timeoutMs);\n const navigation = (await page.send(\"Page.navigate\", { url: target })) as { errorText?: string };\n if (navigation.errorText) {\n loaded.catch(() => {});\n return { status: 0, scan: { links: [], bar: false, spHeader: false, path: \"\" } };\n }\n await loaded;\n await new Promise((done) => setTimeout(done, options.settleMs));\n return { status: await documentStatus(target), scan: await page.evaluate<Scan>(NAV_SCAN) };\n}\n\n/** This function gives the HTTP status of the document at the URL, or 0 when the request fails. */\nasync function documentStatus(target: string): Promise<number> {\n try {\n const response = await fetch(target, { redirect: \"follow\" });\n await response.body?.cancel();\n return response.status;\n } catch {\n return 0;\n }\n}\n\nasync function shot(page: Page, file: string, width: number): Promise<void> {\n const height = Math.min(Math.max(await page.evaluate<number>(\"document.documentElement.scrollHeight\"), 1), 3000);\n const data = (await page.send(\"Page.captureScreenshot\", { format: \"png\", captureBeyondViewport: true, clip: { x: 0, y: 0, width, height, scale: 1 } })) as { data: string };\n writeFileSync(file, Buffer.from(data.data, \"base64\"));\n}\n\n/** The fields of the event `Fetch.requestPaused` of a response. */\ninterface PausedResponse {\n requestId: string;\n request: { url: string };\n responseStatusCode?: number;\n responseHeaders?: { name: string; value: string }[];\n}\n\n/**\n * This function makes the browser write the bar into each HTML document of the site, at the response stage of the\n * request. A response that is not HTML, or a redirect, goes on with no change.\n */\nasync function previewBar(page: Page, home: URL, bar: BarOptions): Promise<void> {\n const fulfill = async (paused: PausedResponse) => {\n const status = paused.responseStatusCode ?? 200;\n const headers = paused.responseHeaders ?? [];\n const type = headers.find((header) => header.name.toLowerCase() === \"content-type\")?.value ?? \"\";\n if (!type.includes(\"text/html\") || (status >= 300 && status < 400)) {\n await page.send(\"Fetch.continueRequest\", { requestId: paused.requestId });\n return;\n }\n const body = (await page.send(\"Fetch.getResponseBody\", { requestId: paused.requestId })) as { body: string; base64Encoded: boolean };\n const html = body.base64Encoded ? Buffer.from(body.body, \"base64\").toString(\"utf8\") : body.body;\n const next = injectBar(html, barHtml(bar, sitePath(paused.request.url, home) ?? \"\"));\n await page.send(\"Fetch.fulfillRequest\", {\n requestId: paused.requestId,\n responseCode: status,\n responseHeaders: headers.filter((header) => !/^(content-length|content-encoding)$/i.test(header.name)),\n body: Buffer.from(next, \"utf8\").toString(\"base64\"),\n });\n };\n page.on(\"Fetch.requestPaused\", (params) => {\n const paused = params as unknown as PausedResponse;\n fulfill(paused).catch(() => page.send(\"Fetch.continueRequest\", { requestId: paused.requestId }).catch(() => {}));\n });\n await page.send(\"Fetch.enable\", { patterns: [{ urlPattern: `${home.origin}${home.pathname}*`, resourceType: \"Document\", requestStage: \"Response\" }] });\n}\n\n/**\n * This function gives the repository of a site of GitHub Pages from the URL of its home, for example `owner/name`\n * for `https://owner.github.io/name/`. It gives undefined for a URL of another host.\n */\nexport function repositoryOfUrl(url: string): string | undefined {\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n return undefined;\n }\n const owner = /^([a-z0-9-]+)\\.github\\.io$/i.exec(parsed.hostname)?.[1];\n if (owner === undefined) return undefined;\n const name = parsed.pathname.split(\"/\").filter(Boolean)[0];\n return `${owner}/${name ?? `${owner}.github.io`}`;\n}\n\n/** This function crawls the site, clicks the links to the pages of site-pages, and gives the result. */\nexport async function crawlSite(options: NavOptions): Promise<NavResult> {\n const log = options.log ?? (() => {});\n const executable = findBrowser(options.browser);\n if (executable === undefined) throw new Error(\"no Chromium browser was found: give --browser, set SITE_CHECK_BROWSER, or install the Chromium of Playwright\");\n const server = options.out !== undefined ? await serve(options.out, options.base ?? \"/\") : undefined;\n const start = server?.url ?? options.url;\n if (start === undefined) throw new Error(\"give out or url\");\n const home = new URL(start.endsWith(\"/\") ? start : `${start}/`);\n const browser = await launch(executable, options.timeoutMs);\n const pages: NavPage[] = [];\n const clicks: NavClick[] = [];\n let sitemap: string[] = [];\n let left: string[] = [];\n try {\n const { page } = browser;\n await Promise.all([page.send(\"Page.enable\"), page.send(\"Runtime.enable\")]);\n if (options.previewBar !== undefined) await previewBar(page, home, options.previewBar);\n try {\n const response = await fetch(new URL(\"sitemap.xml\", home));\n if (response.ok) sitemap = sitemapPaths(await response.text(), home);\n } catch {\n sitemap = [];\n }\n if (options.shots) mkdirSync(options.shots, { recursive: true });\n const queue: { path: string; clicks: number; from: string | undefined }[] = [{ path: \"\", clicks: 0, from: undefined }];\n const seen = new Set<string>([\"\"]);\n while (queue.length > 0 && pages.length < options.maxPages) {\n const next = queue.shift();\n if (next === undefined) break;\n const target = new URL(next.path, home).href;\n const desktop = await open(page, target, NAV_DESKTOP_WIDTH, options);\n const phone = await open(page, target, NAV_PHONE_WIDTH, options);\n const homeAtPhone = phone.scan.links.some((link) => link.visible && sitePath(link.href, home) === \"\");\n const entry: NavPage = { path: next.path, clicks: next.clicks, status: desktop.status, from: next.from, links: desktop.scan.links, homeAtPhone, bar: desktop.scan.bar };\n pages.push(entry);\n log(`${next.clicks} ${named(next.path)} HTTP ${desktop.status}, ${desktop.scan.links.length} links${homeAtPhone ? \"\" : \", no home link at 360 px\"}`);\n if (desktop.status >= 400) continue;\n for (const link of desktop.scan.links) {\n const path = sitePath(link.href, home);\n if (path === undefined || seen.has(path)) continue;\n seen.add(path);\n queue.push({ path, clicks: next.clicks + 1, from: next.path });\n }\n }\n left = queue.map((entry) => entry.path);\n // A click on each link to a page of site-pages, from each page that the crawl opened at most one click from home.\n for (const from of pages.filter((entry) => entry.clicks <= 1 && entry.status < 400)) {\n const targets = [...new Set(from.links.map((link) => sitePath(link.href, home)).filter((path): path is string => path === \"releases/\" || path === \"status/\"))];\n for (const to of targets) {\n if (to === from.path) continue;\n await open(page, new URL(from.path, home).href, NAV_DESKTOP_WIDTH, options);\n const landed = page.once(\"Page.loadEventFired\", options.timeoutMs).catch(() => undefined);\n await page.call(CLICK_LINK, new URL(to, home).pathname);\n await Promise.race([landed, new Promise((done) => setTimeout(done, 3000))]);\n await new Promise((done) => setTimeout(done, options.settleMs));\n const scan = await page.evaluate<Scan>(NAV_SCAN);\n const click: NavClick = { from: from.path, to, landed: sitePath(new URL(scan.path, home).href, home) ?? scan.path, shown: scan.spHeader || scan.bar };\n clicks.push(click);\n log(`click ${named(from.path)} -> ${named(to)}: ${named(click.landed)}${click.shown ? \"\" : \", not the page of site-pages\"}`);\n }\n }\n if (options.shots) {\n for (const path of options.shotPages) {\n for (const width of [NAV_DESKTOP_WIDTH, NAV_PHONE_WIDTH]) {\n const clean = path.replace(/^\\/+/, \"\");\n await open(page, new URL(clean, home).href, width, options);\n await shot(page, join(options.shots, `${pageSlug(path)}-${width}.png`), width);\n }\n }\n }\n } finally {\n await browser.close();\n await server?.close();\n }\n const unread = navUnread(left, pages, sitemap);\n const problems = navProblems({ pages, sitemap, clicks, unread }, home, options);\n const result: NavResult = { ok: problems.length === 0 && unread.length === 0, home: home.href, pages, sitemap, clicks, problems, unread };\n if (options.shots) {\n writeFileSync(join(options.shots, \"report.json\"), `${JSON.stringify(result, null, 2)}\\n`);\n writeFileSync(join(options.shots, \"summary.md\"), navSummary(result));\n }\n return result;\n}\n\n/** This function gives the text of the no-reads of a crawl, with their count and the first 10 paths. */\nexport function navUnreadText(result: Pick<NavResult, \"pages\" | \"unread\">): string {\n const first = result.unread.slice(0, 10).map(named).join(\", \");\n const more = result.unread.length > 10 ? `, and ${String(result.unread.length - 10)} more` : \"\";\n return `the crawl stopped at the limit of ${result.pages.length} ${result.pages.length === 1 ? \"page\" : \"pages\"}, so it did not read ${result.unread.length} ${result.unread.length === 1 ? \"page\" : \"pages\"}: ${first}${more}.`;\n}\n\n/** This function gives the summary of a crawl as Markdown. */\nexport function navSummary(result: NavResult): string {\n const lines = [`### Navigation of ${result.home}`, \"\", `${result.pages.length} ${result.pages.length === 1 ? \"page\" : \"pages\"} opened, ${result.sitemap.length} in the sitemap, ${result.problems.length} ${result.problems.length === 1 ? \"problem\" : \"problems\"}.`, \"\"];\n if (result.unread.length > 0) lines.push(`**No read:** ${navUnreadText(result)}`, \"\");\n for (const problem of result.problems) lines.push(`- ${cell(problem)}`);\n lines.push(\"\", \"| Clicks | Page | HTTP | Home link at 360 px | Site bar |\", \"|---|---|---|---|---|\");\n for (const page of result.pages) lines.push(`| ${page.clicks} | ${named(page.path)} | ${page.status} | ${page.homeAtPhone ? \"yes\" : \"no\"} | ${page.bar ? \"yes\" : \"no\"} |`);\n return `${lines.join(\"\\n\")}\\n`;\n}\n\nexport const NAV_HELP = `Usage: site-pages nav (--out <dir> | --url <url>) [options]\n\nOpens the home page of the site in a headless Chromium and follows the links that the page shows,\npage by page. It fails when a page of sitemap.xml is more than --max-clicks clicks from home, when\na page shows no link back to home at 1280 px or at 360 px, when a link of the site opens a new tab,\nor when a link goes to a missing page. It clicks each link to releases/ and status/, and fails when\nthe page after the click does not have the header of site-pages.\n\nOptions:\n --out <dir> The built site folder. The crawl serves it at --base.\n --url <url> The URL of a live site home, in place of --out\n --repo <owner/name> The GitHub repository, for the default base (default: $GITHUB_REPOSITORY)\n --base </name/> The path of the site home (default: \"/<name>/\", or \"/\" for <owner>.github.io)\n --max-clicks <n> The largest number of clicks from home to a page (default: 2)\n --max-pages <n> The largest number of pages to open (default: 60)\n --require-bar Each page must have the shared site bar ([data-site-bar])\n --preview-bar The browser writes the shared site bar into each page of the site as it\n loads, with Releases and Status. Thus a live site shows the bar before its\n Pages workflow adds it. The repository comes from a github.io URL, or --repo.\n --bar-pages <list> The pages of the preview bar, as label=path pairs separated by commas\n --bar-npm <name> The npm name of the package, for the npm link of the preview bar\n --shots <dir> The folder for the screenshots, report.json and summary.md\n --shot-pages <list> The pages to take screenshots of, separated by commas (default: /,releases/,status/)\n --browser <file> The Chromium executable (default: $SITE_CHECK_BROWSER, the Chromium of\n Playwright, else Chrome or Edge)\n --settle <ms> The wait after the load event (default: 800)\n --timeout <ms> The time limit of a page load (default: 30000)\n --help Shows this text\n\nWith $GITHUB_STEP_SUMMARY, the crawl adds its table to the job summary.\n`;\n\n/** This function starts the `nav` command with its arguments, without the word `nav`. */\nexport async function runNavCli(argv: readonly string[], io: CheckIo): Promise<number> {\n let values: Record<string, string | boolean | undefined>;\n try {\n ({ values } = parseArgs({\n args: [...argv],\n allowPositionals: false,\n options: {\n out: { type: \"string\" },\n url: { type: \"string\" },\n repo: { type: \"string\" },\n base: { type: \"string\" },\n \"max-clicks\": { type: \"string\" },\n \"max-pages\": { type: \"string\" },\n \"require-bar\": { type: \"boolean\" },\n \"preview-bar\": { type: \"boolean\" },\n \"bar-pages\": { type: \"string\" },\n \"bar-npm\": { type: \"string\" },\n shots: { type: \"string\" },\n \"shot-pages\": { type: \"string\" },\n browser: { type: \"string\" },\n settle: { type: \"string\" },\n timeout: { type: \"string\" },\n help: { type: \"boolean\" },\n },\n }));\n } catch (error) {\n io.stderr(`site-pages nav: ${error instanceof Error ? error.message : String(error)}\\n\\n${NAV_HELP}`);\n return 2;\n }\n if (values[\"help\"]) {\n io.stdout(NAV_HELP);\n return 0;\n }\n const usage = (message: string) => {\n io.stderr(`site-pages nav: ${message}\\n\\n${NAV_HELP}`);\n return 2;\n };\n const text = (key: string) => (typeof values[key] === \"string\" ? (values[key] as string) : undefined);\n const out = text(\"out\");\n const url = text(\"url\");\n if ((out === undefined) === (url === undefined)) return usage(\"give --out or --url, not both\");\n const maxClicks = Number(text(\"max-clicks\") ?? 2);\n const maxPages = Number(text(\"max-pages\") ?? 60);\n if (!Number.isInteger(maxClicks) || maxClicks < 1 || !Number.isInteger(maxPages) || maxPages < 1) return usage(\"--max-clicks and --max-pages must be whole numbers of 1 or more\");\n const settleMs = Number(text(\"settle\") ?? 800);\n const timeoutMs = Number(text(\"timeout\") ?? 30000);\n if (!(settleMs >= 0) || !(timeoutMs > 0)) return usage(\"--settle and --timeout must be numbers of milliseconds\");\n const shotPages = (text(\"shot-pages\") ?? \"/,releases/,status/\").split(\",\").map((entry) => entry.trim()).filter(Boolean);\n const notPath = shotPages.find((entry) => entry.includes(\":\") || entry.includes(\"\\\\\"));\n if (notPath !== undefined) return usage(`a page is a path from the site home, not \"${notPath}\" (in Git Bash, set MSYS_NO_PATHCONV=1)`);\n let base = text(\"base\");\n if (out !== undefined && base === undefined) {\n const name = (text(\"repo\") ?? io.env[\"GITHUB_REPOSITORY\"] ?? \"\").split(\"/\")[1];\n if (!name) return usage(\"give --base, --repo or set GITHUB_REPOSITORY\");\n base = /\\.github\\.io$/i.test(name) ? \"/\" : `/${name}/`;\n }\n if (base !== undefined) base = `/${base.replace(/^\\/+|\\/+$/g, \"\")}/`.replace(/^\\/\\/$/, \"/\");\n let preview: BarOptions | undefined;\n if (values[\"preview-bar\"] === true) {\n const repository = text(\"repo\") ?? (url === undefined ? io.env[\"GITHUB_REPOSITORY\"] : repositoryOfUrl(url));\n if (repository === undefined || !repository.includes(\"/\")) return usage(\"--preview-bar needs --repo for a site that is not on github.io\");\n const pages = parsePages(text(\"bar-pages\") ?? \"\");\n if (pages instanceof Error) return usage(pages.message);\n const previewBase = base ?? (url === undefined ? \"/\" : new URL(url.endsWith(\"/\") ? url : `${url}/`).pathname);\n const [owner = \"\"] = repository.split(\"/\");\n const ownerSite = repository.toLowerCase() === `${owner.toLowerCase()}/${owner.toLowerCase()}.github.io`;\n preview = { repository, base: previewBase, pages, sitePages: true, npm: text(\"bar-npm\"), portfolio: ownerSite ? undefined : `https://${owner.toLowerCase()}.github.io/` };\n }\n const shots = text(\"shots\");\n const result = await crawlSite({\n out: out === undefined ? undefined : isAbsolute(out) ? out : resolve(io.cwd, out),\n url,\n base,\n maxClicks,\n maxPages,\n requireBar: values[\"require-bar\"] === true,\n previewBar: preview,\n shots: shots === undefined ? undefined : isAbsolute(shots) ? shots : resolve(io.cwd, shots),\n shotPages,\n browser: text(\"browser\"),\n settleMs,\n timeoutMs,\n log: (line) => io.stdout(`${line}\\n`),\n });\n for (const problem of result.problems) io.stdout(`FAIL ${problem}\\n`);\n if (result.unread.length > 0) io.stdout(`NO READ ${navUnreadText(result)}\\n`);\n io.stdout(`site-pages nav: ${result.pages.length} ${result.pages.length === 1 ? \"page\" : \"pages\"}, ${result.problems.length} ${result.problems.length === 1 ? \"problem\" : \"problems\"}, ${result.unread.length} ${result.unread.length === 1 ? \"page\" : \"pages\"} not read.\\n`);\n const step = io.env[\"GITHUB_STEP_SUMMARY\"];\n if (step) appendFileSync(step, navSummary(result));\n return result.ok ? 0 : 1;\n}\n","#!/usr/bin/env node\n// The bin `site-pages`. The work is in build.ts, bar/bar.ts, bar/cue.ts, check/check.ts, check/freshness.ts and check/nav.ts, so a test can run the same CLI with its own fetch.\nimport { runBarCli } from \"./bar/bar.ts\";\nimport { runCueCli } from \"./bar/cue.ts\";\nimport { runCli } from \"./build.ts\";\nimport { runCheckCli } from \"./check/check.ts\";\nimport { runFreshnessCli } from \"./check/freshness.ts\";\nimport { runNavCli } from \"./check/nav.ts\";\n\nconst argv = process.argv.slice(2);\nconst io = {\n cwd: process.cwd(),\n env: process.env,\n stdout: (text: string) => process.stdout.write(text),\n stderr: (text: string) => process.stderr.write(text),\n};\n(argv[0] === \"check\" ? runCheckCli(argv.slice(1), io) : argv[0] === \"freshness\" ? runFreshnessCli(argv.slice(1), io) : argv[0] === \"nav\" ? runNavCli(argv.slice(1), io) : argv[0] === \"bar\" ? Promise.resolve(runBarCli(argv.slice(1), io)) : argv[0] === \"cue\" ? Promise.resolve(runCueCli(argv.slice(1), io)) : runCli(argv, io)).then(\n (code) => {\n process.exitCode = code;\n },\n (error: unknown) => {\n process.stderr.write(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M,CAAC,GAAG,EAAE,IAAI,KAAK,OAAO,QAAQ,QAAQ,QAAQ,UAAU,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,OAAO,QAAQ,QAAQ,QAAQ,UAAU,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,OAAO,MAAM,EAAE,EAAA,CAAG,MACjU,SAAS;CACR,QAAQ,WAAW;AACrB,IACC,UAAmB;CAClB,QAAQ,OAAO,MAAM,eAAe,iBAAiB,QAAS,MAAM,SAAS,MAAM,UAAW,OAAO,KAAK,EAAE,GAAG;CAC/G,QAAQ,WAAW;AACrB,CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@mark1russell7/site-pages",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.5",
|
|
5
5
|
"description": "A release timeline page and a live status page for the site of a GitHub repository: JSON data and standalone HTML, made at deploy time.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"github-pages",
|