From 150a679687b4ce3e016eebab32e98e09ae41ddc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Eizedev?=
<6794362+eizedev@users.noreply.github.com>
Date: Wed, 25 Nov 2026 21:06:46 +0100
Subject: [PATCH 1/4] test: docs guards for lists, screenshots, descriptions,
release names and README links
- build/docs-files.js defines the docs files once (site pages, READMEs, current-state docs);
the growth guard and the llms.txt test use it
- tests/js/docs-pages.test.js: a blank line before every list, a description on every page,
no release of pivotkit or a module named outside an explicit list of places
- tests/js/screenshots.test.js: every screenshot shown, light/dark pairs, alt text, the theme
fragment on the site; the three single demo.md screenshots are listed until #213 retakes them
- build/check-readme-links.js checks README links against the built site in docs.yml
- getting-started.md: step 2 of the update list rendered as text; a blank line fixes it
Refs #217
Co-Authored-By: Claude Opus 5.5
---
.github/workflows/docs.yml | 3 +
build/check-readme-links.js | 71 ++++++++++++++
build/docs-files.js | 60 ++++++++++++
build/growth.js | 20 +---
docs/getting-started.md | 1 +
tests/js/ci.test.js | 12 +++
tests/js/docs-pages.test.js | 168 +++++++++++++++++++++++++++++++++
tests/js/llms-sections.test.js | 17 +---
tests/js/readme-links.test.js | 36 +++++++
tests/js/screenshots.test.js | 98 +++++++++++++++++++
10 files changed, 457 insertions(+), 29 deletions(-)
create mode 100644 build/check-readme-links.js
create mode 100644 build/docs-files.js
create mode 100644 tests/js/docs-pages.test.js
create mode 100644 tests/js/readme-links.test.js
create mode 100644 tests/js/screenshots.test.js
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 09fb3c6..1e4bae0 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -34,6 +34,9 @@ jobs:
run: ./docs/site/Build-Site.ps1
# the shared design and the pinned Zensical version (eizedev/brand, docs-site/); the site lands in site/
- uses: eizedev/brand/docs-site@8d8d554bf72868842330a40a61e843ec631edcf5 # v1.0.0
+ # every link from a README into the site names a page and anchor of this build
+ - name: README links
+ run: node build/check-readme-links.js site
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site
diff --git a/build/check-readme-links.js b/build/check-readme-links.js
new file mode 100644
index 0000000..e3646d4
--- /dev/null
+++ b/build/check-readme-links.js
@@ -0,0 +1,71 @@
+// Checks that every link to the documentation site in the READMEs (the root's and each module's) points
+// at a page and heading anchor that exist in a built site. A published module carries its README, so
+// these paths and anchors are a contract: a page or heading they name keeps its address. A link counts
+// in Markdown, [text](url), and in HTML, href="url". The docs workflow runs it after the site build;
+// it uses Node's own modules only, as that job runs no `npm ci`.
+//
+// node build/check-readme-links.js site # the directory `zensical build` wrote
+//
+// eizedev/pivotkit checks its READMEs the same way (scripts/check-readme-links.js).
+import { existsSync, readFileSync } from "node:fs";
+import { join } from "node:path";
+import { fileURLToPath } from "node:url";
+import { readmes, root } from "./docs-files.js";
+
+/** The site's address from `site_url` in zensical.toml, without a trailing slash. */
+export function siteUrl(dir = root) {
+ const url = /^site_url\s*=\s*"([^"]+)"/m.exec(readFileSync(join(dir, "zensical.toml"), "utf8"))?.[1];
+ if (!url) throw new Error("check-readme-links: zensical.toml has no site_url");
+ return url.replace(/\/$/, "");
+}
+
+/**
+ * The links to `site` in a README's text, each once.
+ * @param {string} text
+ * @param {string} site the site's address, without a trailing slash
+ * @returns {string[]}
+ */
+export function siteLinks(text, site) {
+ const escaped = site.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
+ // the site's address, then a path or an anchor: never a longer host name that starts the same
+ const pattern = new RegExp(`\\]\\((${escaped}(?:[/#][^)\\s]*)?)\\)|href="(${escaped}(?:[/#][^"\\s]*)?)"`, "g");
+ return [...new Set([...text.matchAll(pattern)].map((m) => m[1] ?? m[2]))];
+}
+
+/**
+ * What is wrong with a link to the site, read from the built site, or null.
+ * @param {string} url
+ * @param {string} site
+ * @param {string} siteDir the built site
+ * @returns {string | null}
+ */
+export function linkProblem(url, site, siteDir) {
+ const [path, anchor] = url.slice(site.length).split("#");
+ const file = join(siteDir, path === "" || path.endsWith("/") ? join(path, "index.html") : path);
+ if (!existsSync(file)) return `no page for ${url}`;
+ if (anchor && !readFileSync(file, "utf8").includes(`id="${anchor}"`)) return `no anchor for ${url}`;
+ return null;
+}
+
+if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
+ const siteDir = process.argv[2];
+ if (!siteDir || !existsSync(join(siteDir, "index.html"))) {
+ console.error("usage: node build/check-readme-links.js ");
+ process.exit(2);
+ }
+ const site = siteUrl();
+ let checked = 0;
+ const problems = [];
+ for (const readme of readmes()) {
+ for (const url of siteLinks(readFileSync(join(root, readme), "utf8"), site)) {
+ checked++;
+ const problem = linkProblem(url, site, siteDir);
+ if (problem) problems.push(`${readme}: ${problem}`);
+ }
+ }
+ console.log(`${checked} links to ${site} checked`);
+ if (problems.length) {
+ console.error(problems.join("\n"));
+ process.exit(1);
+ }
+}
diff --git a/build/docs-files.js b/build/docs-files.js
new file mode 100644
index 0000000..eb06a73
--- /dev/null
+++ b/build/docs-files.js
@@ -0,0 +1,60 @@
+// The Markdown files of the documentation, defined once for the growth guards (build/growth.js), the
+// docs checks in tests/js/ and the README link check (build/check-readme-links.js): the pages of the
+// site, the READMEs, and the files a reader takes as the current state. No imports beyond Node's own:
+// the docs workflow runs the link check without `npm ci`.
+import { existsSync, readdirSync } from "node:fs";
+import { join, relative, sep } from "node:path";
+import { fileURLToPath } from "node:url";
+
+/** The repository's root directory. */
+export const root = fileURLToPath(new URL("../", import.meta.url));
+
+/** A path relative to `base`, with forward slashes. */
+const posix = (base, path) => relative(base, path).split(sep).join("/");
+
+/**
+ * The pages of the docs site, relative to docs/ ("pivot/views.md"), sorted. docs/site/ builds the site
+ * (exclude_docs in zensical.toml) and holds no pages.
+ * @param {string} [dir] the repository
+ * @returns {string[]}
+ */
+export function sitePages(dir = root) {
+ const docs = join(dir, "docs");
+ return readdirSync(docs, { recursive: true, withFileTypes: true })
+ .filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
+ .map((entry) => posix(docs, join(entry.parentPath, entry.name)))
+ .filter((page) => !page.startsWith("site/"))
+ .sort();
+}
+
+/**
+ * The READMEs a reader of the repository or a module sees: the root's and each module's, as
+ * repository paths.
+ * @param {string} [dir] the repository
+ * @returns {string[]}
+ */
+export function readmes(dir = root) {
+ const modules = readdirSync(join(dir, "modules"), { withFileTypes: true })
+ .filter((entry) => entry.isDirectory())
+ .map((entry) => `modules/${entry.name}/README.md`)
+ .sort();
+ return ["README.md", ...modules].filter((path) => existsSync(join(dir, path)));
+}
+
+/** The guides at the root that describe the repository as it is now. */
+const GUIDES = ["CONTRIBUTING.md", "PRODUCT.md", "RELEASING.md", "SECURITY.md", "ACCESSIBILITY.md", "AGENTS.md"];
+
+/**
+ * The Markdown a reader takes as the current state, as repository paths: the READMEs, the root's
+ * guides and the site's pages outside docs/decisions/. Changelogs and decision records keep history,
+ * so they are not here.
+ * @param {string} [dir] the repository
+ * @returns {string[]}
+ */
+export function currentStateDocs(dir = root) {
+ return [
+ ...readmes(dir),
+ ...GUIDES.filter((path) => existsSync(join(dir, path))),
+ ...sitePages(dir).filter((page) => !page.startsWith("decisions/")).map((page) => `docs/${page}`),
+ ];
+}
diff --git a/build/growth.js b/build/growth.js
index 1f2c4d6..fd3f5e1 100644
--- a/build/growth.js
+++ b/build/growth.js
@@ -16,9 +16,10 @@
// entry by itself. Raising one is --accept-growth, and the pull request says why.
// eizedev/pivotkit has the same guards in scripts/growth.js; both work alike.
import { spawnSync } from "node:child_process";
-import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
+import { existsSync, readFileSync, writeFileSync } from "node:fs";
import { basename, join, relative, sep } from "node:path";
import { fileURLToPath } from "node:url";
+import { readmes, sitePages } from "./docs-files.js";
import { LANGUAGE_OPTIONS, SOURCES } from "./javascript-sources.js";
const root = fileURLToPath(new URL("../", import.meta.url));
@@ -167,24 +168,13 @@ export function docsKind(page) {
const lineCount = (text) => text.split("\n").length - (text.endsWith("\n") ? 1 : 0);
/**
- * Lines of every docs page (docs/**\/*.md without docs/site/, which builds the site) and every README
- * (the repository's and each module's), as repository path -> lines.
+ * Lines of every docs page and every README (build/docs-files.js), as repository path -> lines.
* @param {string} [dir] the repository
* @returns {Record}
*/
export function docsPages(dir = root) {
- const pages = {};
- const add = (path) => {
- if (existsSync(join(dir, path))) pages[path] = lineCount(readFileSync(join(dir, path), "utf8"));
- };
- for (const entry of readdirSync(join(dir, "docs"), { recursive: true, withFileTypes: true })) {
- if (!entry.isFile() || !entry.name.endsWith(".md")) continue;
- const path = posix(join(entry.parentPath, entry.name), dir);
- if (!path.startsWith("docs/site/")) add(path);
- }
- add("README.md");
- for (const module of readdirSync(join(dir, "modules"), { withFileTypes: true })) if (module.isDirectory()) add(`modules/${module.name}/README.md`);
- return pages;
+ const paths = [...sitePages(dir).map((page) => `docs/${page}`), ...readmes(dir)];
+ return Object.fromEntries(paths.map((path) => [path, lineCount(readFileSync(join(dir, path), "utf8"))]));
}
/**
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 6478307..7f8f601 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -30,6 +30,7 @@ when a page uses it.
`Install-PSResource` puts the new version in a folder of its own, next to the old one. From a release
zip, copy the new `` folder next to the old one in `Modules//`.
+
2. Restart PSU. PowerShell imports the newest version it finds in the folder, but a process that has
already imported the module keeps that version.
3. Readers reload their open pages. The bundle's file name holds a hash of its content, so a reload
diff --git a/tests/js/ci.test.js b/tests/js/ci.test.js
index 9cd56ca..3384132 100644
--- a/tests/js/ci.test.js
+++ b/tests/js/ci.test.js
@@ -147,3 +147,15 @@ test("the release needs the tagged commit on main and a green CI run of it, befo
assert.equal(prepare.if, undefined, "prepare runs only under a condition");
assert.deepEqual(prepare.permissions, { contents: "read", actions: "read" }, "prepare needs actions: read for the gate, and nothing more");
});
+
+// The READMEs travel with each module: their links into the site are checked against the site the
+// docs workflow just built, before it is published
+test("the docs workflow checks the README links against the built site, after building it", () => {
+ const steps = jobOf("docs.yml", "build").steps;
+ const build = steps.findIndex((step) => String(step.uses ?? "").startsWith("eizedev/brand/docs-site@"));
+ const check = stepRunning(steps, "node build/check-readme-links.js site");
+ assert.ok(build !== -1, "docs.yml builds no site with eizedev/brand/docs-site");
+ assert.ok(check > build, "docs.yml checks no README links against the built site after building it");
+ const upload = steps.findIndex((step) => String(step.uses ?? "").startsWith("actions/upload-pages-artifact@"));
+ assert.ok(check < upload, "docs.yml uploads the site before checking the README links");
+});
diff --git a/tests/js/docs-pages.test.js b/tests/js/docs-pages.test.js
new file mode 100644
index 0000000..ab49b9e
--- /dev/null
+++ b/tests/js/docs-pages.test.js
@@ -0,0 +1,168 @@
+// Checks every docs page and README must pass, beyond what the site build checks: a list starts after a
+// blank line, every page has a description, and the current-state docs name no release of pivotkit or
+// of a module. eizedev/pivotkit has the same checks (tests/docs-lists.test.js, tests/ci.test.js).
+import { test } from "node:test";
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+import { join } from "node:path";
+import { currentStateDocs, root, sitePages } from "../../build/docs-files.js";
+
+const read = (path) => readFileSync(join(root, path), "utf8");
+
+// A list needs a blank line before it. Python-Markdown (Zensical) lets no list interrupt a paragraph:
+// a "- " or "1. " line right after a paragraph that is not a list item, such as an indented paragraph
+// inside an item, becomes part of that paragraph's text. The strict build does not warn. A line right
+// after a table becomes another table row. Inside a blockquote, the check reads the lines without
+// their "> ". It does not follow a blockquote's lazy lines that have no "> ".
+const LIST_ITEM = /^\s*(?:[-*+]|\d+\.)\s+\S/;
+const FENCE = /^\s*(`{3,}|~{3,})/;
+// Lines that are a block of their own, so the next line starts a new block: a heading, an
+// admonition's or a content tab's title, an HTML line or a rule.
+const OWN_BLOCK = /^\s*(?:#|!!!|\?\?\?|===|<|(?:-{3,}|\*{3,}|_{3,})\s*$)/;
+const QUOTE = /^\s*(?:>\s?)+/;
+
+/**
+ * The list items of a Markdown text that follow a paragraph or a table row without a blank line, as
+ * 1-based line numbers. Code fences and front matter are skipped.
+ * @param {string} text
+ * @returns {number[]}
+ */
+function swallowedListItems(text) {
+ const found = [];
+ let fence = null;
+ /** The first line of the paragraph the previous line belongs to, or null after a block's end. */
+ let paragraphStart = null;
+ const lines = text.split("\n");
+ const bodyStart = lines[0] === "---" ? lines.indexOf("---", 1) + 1 : 0;
+ lines.forEach((source, index) => {
+ if (index < bodyStart) return;
+ const line = source.replace(QUOTE, "");
+ const marker = line.match(FENCE)?.[1];
+ if (fence) {
+ if (marker && marker[0] === fence[0] && marker.length >= fence.length) fence = null;
+ return;
+ }
+ if (marker) {
+ fence = marker;
+ paragraphStart = null;
+ return;
+ }
+ if (!line.trim() || OWN_BLOCK.test(line)) {
+ paragraphStart = null;
+ return;
+ }
+ if (LIST_ITEM.test(line)) {
+ if (paragraphStart !== null && !LIST_ITEM.test(paragraphStart)) found.push(index + 1);
+ paragraphStart = line;
+ return;
+ }
+ paragraphStart ??= line;
+ });
+ return found;
+}
+
+/** Each case: a Markdown text and the line numbers swallowedListItems reports. */
+const LIST_CASES = [
+ { name: "a list right after a paragraph", lines: ["Intro:", "- item"], found: [2] },
+ { name: "a numbered list right after a paragraph", lines: ["Intro:", "1. item"], found: [2] },
+ { name: "a list after a blank line", lines: ["Intro:", "", "- item", "1. item"], found: [] },
+ { name: "an item with a wrapped line and a nested list", lines: ["- item", " wrapped", " - nested"], found: [] },
+ { name: "an item after an indented paragraph in the item above", lines: ["- item", "", " Indented paragraph", "- next item"], found: [4] },
+ { name: "a list right after a heading", lines: ["## Heading", "- item"], found: [] },
+ { name: "a list in a code fence", lines: ["Text", "```", "text", "- in code", "```"], found: [] },
+ { name: "a list in an admonition", lines: ["!!! note", " - item", " 1. numbered"], found: [] },
+ { name: "a list in a fold", lines: ['', "More", "- item"], found: [] },
+ { name: "a list after a table", lines: ["| a | b |", "| --- | --- |", "| 1 | 2 |", "", "- item"], found: [] },
+ // Python-Markdown takes the line as another table row.
+ { name: "a list right after a table", lines: ["| a | b |", "| --- | --- |", "- item"], found: [3] },
+ { name: "a list right after a paragraph in a blockquote", lines: ["> Intro:", "> - item"], found: [2] },
+ { name: "a list in a blockquote after a blank line", lines: ["> Intro:", ">", "> - item"], found: [] },
+ { name: "front matter", lines: ["---", "title: Page", "hide:", " - toc", "---"], found: [] },
+ // Flagged on purpose: the page shows it as text, but the source reads like a list. Rewrap the line.
+ { name: "a wrapped line that starts with a number and a dot", lines: ["Since version", "2. it works"], found: [2] },
+];
+
+for (const { name, lines, found } of LIST_CASES) {
+ test(`swallowedListItems: ${name}`, () => {
+ assert.deepEqual(swallowedListItems(lines.join("\n")), found);
+ });
+}
+
+test("every list in the docs starts after a blank line", () => {
+ const pages = sitePages();
+ assert.ok(pages.includes("index.md") && pages.includes("pivot/reference.md"), "the page list misses known pages");
+ const problems = pages.flatMap((page) => swallowedListItems(read(`docs/${page}`)).map((line) => `docs/${page}:${line}`));
+ assert.deepEqual(problems, [], "add a blank line before these list items");
+});
+
+/**
+ * The description in a page's front matter, or undefined.
+ * @param {string} text
+ */
+function descriptionOf(text) {
+ const front = /^---\n([\s\S]*?)\n---\n/.exec(text)?.[1];
+ return front && /^description:[ \t]*(\S.*)$/m.exec(front)?.[1];
+}
+
+test("descriptionOf reads the description of the front matter only", () => {
+ assert.equal(descriptionOf("---\ntitle: T\ndescription: What the page covers.\n---\n\n# T\n"), "What the page covers.");
+ assert.equal(descriptionOf("---\ndescription:\n---\n"), undefined);
+ assert.equal(descriptionOf("# T\n\ndescription: not front matter\n"), undefined);
+});
+
+// The description goes into the page's meta and Open Graph tags (overrides/main.html) and llms.txt;
+// without one, search engines and link previews show the site's description for every page.
+test("every page of the site has a description in its front matter", () => {
+ assert.deepEqual(sitePages().filter((page) => !descriptionOf(read(`docs/${page}`))), []);
+});
+
+// A release named as a fact of the present ("pivotkit 0.8 does not know it") is wrong for the next
+// reader, and a release leaves it behind. The docs say what a feature needs as one minimum
+// ("pivotkit-server 0.4.0 or later") and otherwise describe what an older version does, without its
+// number. The pattern names pivotkit and its packages, the modules by their full name, "Pivot" and
+// " module"; "ECharts 6.1" or "Perspective 5.7" name a bundled library, not a module.
+const RELEASE_NAME = /\b(?:pivotkit(?:-[a-z]+)?|PowerShellUniversal\.Component\.[A-Za-z.]*[A-Za-z]|Pivot|(?:ECharts|Perspective|Pivot) module)[ @]\(?v?\d+\.\d+(?:\.\d+)?(?!\.?\d)(?!\)?\s+or\s+(?:later|newer))/g;
+
+/**
+ * Where a current-state page may name releases: the whole file, or one section of it (its "## "
+ * heading). Changelogs, decision records and the reference generated from the commands' help are
+ * not current-state pages (build/docs-files.js).
+ */
+const RELEASE_NAMES_ALLOWED = [
+ { file: "docs/versioning.md" },
+ // the versions the modules were tested with
+ { file: "docs/index.md", section: "Requirements" },
+];
+
+/**
+ * The release names in a text, without the allowed sections.
+ * @param {string} text
+ * @param {string[]} [sections] the "## " headings whose sections may name releases
+ * @returns {string[]}
+ */
+function releaseNames(text, sections = []) {
+ const kept = text.split(/^(?=## )/m).filter((part) => !sections.some((s) => part.startsWith(`## ${s}\n`)));
+ return kept.flatMap((part) => [...part.matchAll(RELEASE_NAME)].map((m) => m[0]));
+}
+
+test("releaseNames finds a release named as a fact and leaves minimums and allowed sections alone", () => {
+ assert.deepEqual(releaseNames("pivotkit 0.8 does not know it. Pivot 0.10.0 changed it."), ["pivotkit 0.8", "Pivot 0.10.0"]);
+ assert.deepEqual(releaseNames("Tag pivotkit-server@0.4.0 or PowerShellUniversal.Component.Pivot.Demo 0.3."), ["pivotkit-server@0.4.0", "PowerShellUniversal.Component.Pivot.Demo 0.3"]);
+ assert.deepEqual(releaseNames("needs pivotkit-server 0.4.0 or\nlater; a pivotkit-server (0.3.0 or later)"), []);
+ assert.deepEqual(releaseNames("Apache ECharts 6.1 and Perspective 5.7, the ECharts module 0.3"), ["ECharts module 0.3"]);
+ assert.deepEqual(releaseNames("## Requirements\n\nTested with pivotkit-cli 0.6.0.\n\n## Next\n\npivotkit 0.9\n", ["Requirements"]), ["pivotkit 0.9"]);
+});
+
+test("current-state docs name no release of pivotkit or a module outside the allowed places", () => {
+ const docs = currentStateDocs();
+ for (const { file, section } of RELEASE_NAMES_ALLOWED) {
+ assert.ok(docs.includes(file), `${file} is no current-state page: update RELEASE_NAMES_ALLOWED`);
+ if (section) assert.ok(read(file).includes(`\n## ${section}\n`), `${file} has no section "## ${section}": update RELEASE_NAMES_ALLOWED`);
+ }
+ const problems = docs.flatMap((file) => {
+ const allowed = RELEASE_NAMES_ALLOWED.filter((a) => a.file === file);
+ if (allowed.some((a) => !a.section)) return [];
+ return releaseNames(read(file), allowed.map((a) => a.section)).map((name) => `${file}: ${name}`);
+ });
+ assert.deepEqual(problems, [], "say what the feature needs as a minimum (\"0.4.0 or later\") or what an older version does, without its number");
+});
diff --git a/tests/js/llms-sections.test.js b/tests/js/llms-sections.test.js
index 1f3167c..c6b6cd5 100644
--- a/tests/js/llms-sections.test.js
+++ b/tests/js/llms-sections.test.js
@@ -2,12 +2,10 @@
// section names: a new page that no section matches would be missing from both without a warning.
import { test } from "node:test";
import assert from "node:assert/strict";
-import { readFileSync, readdirSync } from "node:fs";
-import { join, relative, sep } from "node:path";
-import { fileURLToPath } from "node:url";
+import { readFileSync } from "node:fs";
+import { sitePages } from "../../build/docs-files.js";
const root = new URL("../../", import.meta.url);
-const docs = fileURLToPath(new URL("docs/", root));
/** The patterns of the llmstxt sections, in the order they are written; each section is a one-line array. */
function sectionPatterns() {
@@ -23,22 +21,13 @@ function sectionPatterns() {
});
}
-/** The Markdown pages of the site; docs/site/ is the site's build tooling (exclude_docs), not pages. */
-function pages(dir = docs) {
- return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
- const path = join(dir, entry.name);
- if (entry.isDirectory()) return dir === docs && entry.name === "site" ? [] : pages(path);
- return entry.name.endsWith(".md") ? [relative(docs, path).split(sep).join("/")] : [];
- });
-}
-
// fnmatch as the plugin uses it: "*" matches any characters, "/" included
const matcher = (pattern) => new RegExp(`^${pattern.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*")}$`);
test("every page of the site is in exactly one llms.txt section", () => {
const patterns = sectionPatterns().map((p) => ({ p, re: matcher(p) }));
assert.ok(patterns.length > 0, "no section patterns found");
- const all = pages();
+ const all = sitePages();
assert.ok(all.includes("index.md") && all.includes("pivot/reference.md"), "the page list misses known pages");
for (const page of all) {
const hits = patterns.filter(({ re }) => re.test(page)).map(({ p }) => p);
diff --git a/tests/js/readme-links.test.js b/tests/js/readme-links.test.js
new file mode 100644
index 0000000..e8dfcd1
--- /dev/null
+++ b/tests/js/readme-links.test.js
@@ -0,0 +1,36 @@
+// build/check-readme-links.js: which links of a README it reads and how it checks them against a built
+// site. The docs workflow runs it on the real site (.github/workflows/docs.yml).
+import { test } from "node:test";
+import assert from "node:assert/strict";
+import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { linkProblem, siteLinks, siteUrl } from "../../build/check-readme-links.js";
+
+const SITE = "https://docs.example.org";
+
+test("siteLinks reads Markdown and HTML links to the site, each once, and no other host", () => {
+ const text = [
+ `[a](${SITE}/pivot/) and [b](${SITE}/#requirements) and [a again](${SITE}/pivot/)`,
+ `c and [root](${SITE})`,
+ `[other](https://docs.example.org.evil/x) [plain](https://example.org/)`,
+ ].join("\n");
+ assert.deepEqual(siteLinks(text, SITE), [`${SITE}/pivot/`, `${SITE}/#requirements`, `${SITE}/echarts/data/#tables`, `${SITE}`]);
+});
+
+test("linkProblem finds a missing page and a missing anchor in a built site", (t) => {
+ const dir = mkdtempSync(join(tmpdir(), "readme-links-"));
+ t.after(() => rmSync(dir, { recursive: true, force: true }));
+ mkdirSync(join(dir, "pivot"));
+ writeFileSync(join(dir, "index.html"), '
");
+ assert.equal(linkProblem(`${SITE}/#requirements`, SITE, dir), null);
+ assert.equal(linkProblem(SITE, SITE, dir), null);
+ assert.equal(linkProblem(`${SITE}/pivot/`, SITE, dir), null);
+ assert.equal(linkProblem(`${SITE}/pivot/#views`, SITE, dir), `no anchor for ${SITE}/pivot/#views`);
+ assert.equal(linkProblem(`${SITE}/echarts/`, SITE, dir), `no page for ${SITE}/echarts/`);
+});
+
+test("siteUrl is the site_url of zensical.toml without its trailing slash", () => {
+ assert.match(siteUrl(), /^https:\/\/[^/]+$/);
+});
diff --git a/tests/js/screenshots.test.js b/tests/js/screenshots.test.js
new file mode 100644
index 0000000..abed6ff
--- /dev/null
+++ b/tests/js/screenshots.test.js
@@ -0,0 +1,98 @@
+// The screenshots of the docs and the READMEs: every one is shown somewhere, comes as a light and a dark
+// one, and is shown with alt text. On the site each one carries the fragment that shows it in its theme
+// only (#only-light, #only-dark); a README shows a pair as a whose holds the dark one.
+// eizedev/pivotkit has the same checks (tests/screenshots.test.js).
+//
+// The screenshots live in two places: docs/assets/ (the pages and the READMEs show them from there) and
+// assets/screenshot-* (the README's quick start and the showcase app; docs/site/Build-Site.ps1 copies
+// them into docs/assets/images/ for the site, which is build output and not committed).
+import { test } from "node:test";
+import assert from "node:assert/strict";
+import { existsSync, readFileSync, readdirSync } from "node:fs";
+import { dirname, join, relative, sep } from "node:path";
+import { readmes, root, sitePages } from "../../build/docs-files.js";
+
+const IMAGE = /\.(png|webp|jpe?g|gif|svg|avif)$/i;
+const posix = (path) => relative(root, path).split(sep).join("/");
+
+/** Every screenshot of the repository, as repository paths. */
+const files = [
+ // docs/assets/ also holds examples.css, and after a site build site.css, charts/ and images/
+ ...readdirSync(join(root, "docs/assets"), { withFileTypes: true }).filter((e) => e.isFile() && IMAGE.test(e.name)).map((e) => `docs/assets/${e.name}`),
+ ...readdirSync(join(root, "assets")).filter((name) => name.startsWith("screenshot-")).map((name) => `assets/${name}`),
+];
+
+// Single screenshots of the ECharts showcase app (docs/demo.md). Their partners need new screenshots
+// from the app on a PowerShell Universal instance: #213. The site shows them without a theme fragment,
+// so they stay visible in both themes. Remove an entry when its partner is there; the test fails until then.
+const SINGLES = new Set(["assets/screenshot-data-platform-dark.png", "assets/screenshot-ticket-report-dark.png", "assets/screenshot-service-review-light.png"]);
+
+/**
+ * The repository path an image address of `page` points to, or null for an image elsewhere (a badge).
+ * A page's assets/images/ is the copy of the root's assets/ that Build-Site.ps1 makes.
+ * @param {string} page repository path
+ * @param {string} src
+ */
+function resolve(page, src) {
+ if (/^[a-z]+:/i.test(src)) return null;
+ const path = posix(join(root, dirname(page), src.split("#")[0]));
+ return path.startsWith("docs/assets/images/") ? `assets/${path.slice("docs/assets/images/".length)}` : path;
+}
+
+/** The Markdown images of a text: { src, alt, fragment }. */
+const markdownImages = (text) => [...text.matchAll(/!\[([^\]]*)\]\(([^)\s#]+)(#[\w-]+)?\)/g)].map((m) => ({ alt: m[1], src: m[2], fragment: m[3] ?? "" }));
+
+/** The elements of a text: { dark, light, alt } from its srcset and its . */
+const pictures = (text) =>
+ [...text.matchAll(/([\s\S]*?)<\/picture>/g)].map((m) => ({
+ dark: /]*src="([^"]+)"/.exec(m[1])?.[1] ?? "",
+ alt: /]*alt="([^"]*)"/.exec(m[1])?.[1] ?? "",
+ }));
+
+const pages = sitePages().map((page) => `docs/${page}`);
+/** Every screenshot shown: { file, page, alt, fragment, picture }. */
+const shown = [...pages, ...readmes()].flatMap((page) => {
+ const text = readFileSync(join(root, page), "utf8");
+ const images = markdownImages(text).map((image) => ({ ...image, file: resolve(page, image.src), page }));
+ const fromPictures = pictures(text).flatMap(({ dark, light, alt }) => [
+ { file: resolve(page, dark), page, alt, fragment: "", picture: "dark" },
+ { file: resolve(page, light), page, alt, fragment: "", picture: "light" },
+ ]);
+ return [...images, ...fromPictures].filter((s) => s.file && /^(docs\/)?assets\//.test(s.file) && IMAGE.test(s.file));
+});
+
+/** "light" or "dark" from a screenshot's name, or undefined. */
+const themeOf = (file) => /-(light|dark)\.\w+$/.exec(file)?.[1];
+
+test("the screenshot list and the shown screenshots are found", () => {
+ assert.ok(files.includes("docs/assets/pivot-weather-light.png") && files.includes("assets/screenshot-quickstart-dark.png"), "known screenshots missing");
+ assert.ok(shown.some((s) => s.page === "README.md" && s.picture) && shown.some((s) => s.page === "docs/index.md"), "known shown screenshots missing");
+});
+
+test("every screenshot is shown on a page or in a README", () => {
+ const used = new Set(shown.map((s) => s.file));
+ assert.deepEqual(files.filter((f) => !used.has(f)), [], "show these screenshots or delete them");
+});
+
+test("every screenshot comes as a light and a dark one, apart from the listed singles", () => {
+ const pairs = new Map();
+ for (const f of files) {
+ assert.ok(themeOf(f), `${f}: name it -light or -dark`);
+ const name = f.replace(/-(light|dark)(\.\w+)$/, "$2");
+ pairs.set(name, [...(pairs.get(name) ?? []), f]);
+ }
+ const unpaired = [...pairs.values()].filter((group) => group.length !== 2).flat();
+ assert.deepEqual(unpaired.filter((f) => !SINGLES.has(f)), [], "add the other theme's screenshot");
+ assert.deepEqual([...SINGLES].filter((f) => !unpaired.includes(f)), [], "these singles have a partner or are gone: remove them from SINGLES");
+});
+
+test("a shown screenshot exists and has alt text; on the site it carries the fragment of its theme", () => {
+ const wrong = shown.filter((s) => {
+ if (!existsSync(join(root, s.file)) || s.alt.trim() === "") return true;
+ if (s.picture) return themeOf(s.file) !== s.picture;
+ if (!s.page.startsWith("docs/")) return false;
+ return s.fragment !== (SINGLES.has(s.file) ? "" : `#only-${themeOf(s.file)}`);
+ });
+ assert.deepEqual(wrong.map((s) => `${s.page}: ${s.file}${s.fragment}${s.picture ? ` ( ${s.picture})` : ""}`), []);
+});
From a8eab96c236cc9085fcb045d1ca58629c69c4715 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Eizedev?=
<6794362+eizedev@users.noreply.github.com>
Date: Wed, 25 Nov 2026 21:11:58 +0100
Subject: [PATCH 2/4] test: release names in backticks and screenshots in
the docs guards
Refs #217
Co-Authored-By: Claude Opus 5.5
---
tests/js/docs-pages.test.js | 9 +++++----
tests/js/screenshots.test.js | 12 ++++++++++--
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/tests/js/docs-pages.test.js b/tests/js/docs-pages.test.js
index ab49b9e..ed04b12 100644
--- a/tests/js/docs-pages.test.js
+++ b/tests/js/docs-pages.test.js
@@ -1,6 +1,6 @@
-// Checks every docs page and README must pass, beyond what the site build checks: a list starts after a
-// blank line, every page has a description, and the current-state docs name no release of pivotkit or
-// of a module. eizedev/pivotkit has the same checks (tests/docs-lists.test.js, tests/ci.test.js).
+// Checks beyond what the site build checks: on every page of the site, a list starts after a blank line
+// and the front matter has a description; the current-state docs (READMEs, guides and pages outside
+// docs/decisions/) name no release of pivotkit or of a module. eizedev/pivotkit has the same checks (tests/docs-lists.test.js, tests/ci.test.js).
import { test } from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
@@ -121,7 +121,7 @@ test("every page of the site has a description in its front matter", () => {
// ("pivotkit-server 0.4.0 or later") and otherwise describe what an older version does, without its
// number. The pattern names pivotkit and its packages, the modules by their full name, "Pivot" and
// " module"; "ECharts 6.1" or "Perspective 5.7" name a bundled library, not a module.
-const RELEASE_NAME = /\b(?:pivotkit(?:-[a-z]+)?|PowerShellUniversal\.Component\.[A-Za-z.]*[A-Za-z]|Pivot|(?:ECharts|Perspective|Pivot) module)[ @]\(?v?\d+\.\d+(?:\.\d+)?(?!\.?\d)(?!\)?\s+or\s+(?:later|newer))/g;
+const RELEASE_NAME = /\b(?:pivotkit(?:-[a-z]+)?|PowerShellUniversal\.Component\.[A-Za-z.]*[A-Za-z]|Pivot|(?:ECharts|Perspective|Pivot) module)`?[ @]\(?v?\d+\.\d+(?:\.\d+)?(?!\.?\d)(?!\)?\s+or\s+(?:later|newer))/g;
/**
* Where a current-state page may name releases: the whole file, or one section of it (its "## "
@@ -148,6 +148,7 @@ function releaseNames(text, sections = []) {
test("releaseNames finds a release named as a fact and leaves minimums and allowed sections alone", () => {
assert.deepEqual(releaseNames("pivotkit 0.8 does not know it. Pivot 0.10.0 changed it."), ["pivotkit 0.8", "Pivot 0.10.0"]);
assert.deepEqual(releaseNames("Tag pivotkit-server@0.4.0 or PowerShellUniversal.Component.Pivot.Demo 0.3."), ["pivotkit-server@0.4.0", "PowerShellUniversal.Component.Pivot.Demo 0.3"]);
+ assert.deepEqual(releaseNames("Since `pivotkit-cli` 0.8 it works."), ["pivotkit-cli` 0.8"]);
assert.deepEqual(releaseNames("needs pivotkit-server 0.4.0 or\nlater; a pivotkit-server (0.3.0 or later)"), []);
assert.deepEqual(releaseNames("Apache ECharts 6.1 and Perspective 5.7, the ECharts module 0.3"), ["ECharts module 0.3"]);
assert.deepEqual(releaseNames("## Requirements\n\nTested with pivotkit-cli 0.6.0.\n\n## Next\n\npivotkit 0.9\n", ["Requirements"]), ["pivotkit 0.9"]);
diff --git a/tests/js/screenshots.test.js b/tests/js/screenshots.test.js
index abed6ff..9166f25 100644
--- a/tests/js/screenshots.test.js
+++ b/tests/js/screenshots.test.js
@@ -1,7 +1,8 @@
// The screenshots of the docs and the READMEs: every one is shown somewhere, comes as a light and a dark
// one, and is shown with alt text. On the site each one carries the fragment that shows it in its theme
// only (#only-light, #only-dark); a README shows a pair as a whose holds the dark one.
-// eizedev/pivotkit has the same checks (tests/screenshots.test.js).
+// Images count as Markdown images, , and ; reference-style images are not
+// read (the docs use none). eizedev/pivotkit has the same checks (tests/screenshots.test.js).
//
// The screenshots live in two places: docs/assets/ (the pages and the READMEs show them from there) and
// assets/screenshot-* (the README's quick start and the showcase app; docs/site/Build-Site.ps1 copies
@@ -42,6 +43,13 @@ function resolve(page, src) {
/** The Markdown images of a text: { src, alt, fragment }. */
const markdownImages = (text) => [...text.matchAll(/!\[([^\]]*)\]\(([^)\s#]+)(#[\w-]+)?\)/g)].map((m) => ({ alt: m[1], src: m[2], fragment: m[3] ?? "" }));
+/** The elements outside a : { src, alt, fragment }. */
+const htmlImages = (text) =>
+ [...text.replace(/[\s\S]*?<\/picture>/g, "").matchAll(/]*>/g)].map(([tag]) => {
+ const [src, fragment = ""] = (/src="([^"]+)"/.exec(tag)?.[1] ?? "").split(/(?=#)/);
+ return { src, alt: /alt="([^"]*)"/.exec(tag)?.[1] ?? "", fragment };
+ });
+
/** The elements of a text: { dark, light, alt } from its srcset and its . */
const pictures = (text) =>
[...text.matchAll(/([\s\S]*?)<\/picture>/g)].map((m) => ({
@@ -54,7 +62,7 @@ const pages = sitePages().map((page) => `docs/${page}`);
/** Every screenshot shown: { file, page, alt, fragment, picture }. */
const shown = [...pages, ...readmes()].flatMap((page) => {
const text = readFileSync(join(root, page), "utf8");
- const images = markdownImages(text).map((image) => ({ ...image, file: resolve(page, image.src), page }));
+ const images = [...markdownImages(text), ...htmlImages(text)].map((image) => ({ ...image, file: resolve(page, image.src), page }));
const fromPictures = pictures(text).flatMap(({ dark, light, alt }) => [
{ file: resolve(page, dark), page, alt, fragment: "", picture: "dark" },
{ file: resolve(page, light), page, alt, fragment: "", picture: "light" },
From a594c08022f3f54751e616cb61f1a9c4399f1190 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Eizedev?=
<6794362+eizedev@users.noreply.github.com>
Date: Wed, 25 Nov 2026 21:25:47 +0100
Subject: [PATCH 3/4] docs: compatibility and security pages
- docs/compatibility.md: the PowerShell Universal, PowerShell and browser versions the modules
support and were tested with, and how; the start page's Requirements and the READMEs link it,
and tests/js/compatibility.test.js holds it to every manifest's PowerShellVersion
- docs/security.md: what runs on the server and in the browser, what the modules treat as
untrusted (moved from SECURITY.md, which links it), their network requests, and the links to
each module's security notes
Refs #217
Co-Authored-By: Claude Opus 5.5
---
ACCESSIBILITY.md | 2 +-
README.md | 2 +-
SECURITY.md | 12 ++---
docs/compatibility.md | 23 ++++++++
docs/index.md | 6 +--
docs/security.md | 52 +++++++++++++++++++
docs/versioning.md | 2 +-
.../README.md | 2 +-
.../README.md | 2 +-
.../README.md | 2 +-
tests/js/compatibility.test.js | 20 +++++++
tests/js/docs-pages.test.js | 4 +-
zensical.toml | 4 +-
13 files changed, 111 insertions(+), 22 deletions(-)
create mode 100644 docs/compatibility.md
create mode 100644 docs/security.md
create mode 100644 tests/js/compatibility.test.js
diff --git a/ACCESSIBILITY.md b/ACCESSIBILITY.md
index 668db27..878418e 100644
--- a/ACCESSIBILITY.md
+++ b/ACCESSIBILITY.md
@@ -32,7 +32,7 @@ No module claims a WCAG conformance level. Colours that an app's theme sets are
## Supported environments
The PowerShell Universal versions and browsers under
-[Requirements](https://powershell-universal-components.eize.dev/#requirements).
+[Compatibility](https://powershell-universal-components.eize.dev/compatibility/).
## Known limitations
diff --git a/README.md b/README.md
index f3e419e..a31071e 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@
-**[Documentation](https://powershell-universal-components.eize.dev/)** · [Getting started](https://powershell-universal-components.eize.dev/getting-started/) · [Requirements](https://powershell-universal-components.eize.dev/#requirements) · [Releases](https://github.com/eizedev/powershell-universal-components/releases)
+**[Documentation](https://powershell-universal-components.eize.dev/)** · [Getting started](https://powershell-universal-components.eize.dev/getting-started/) · [Compatibility](https://powershell-universal-components.eize.dev/compatibility/) · [Releases](https://github.com/eizedev/powershell-universal-components/releases)
> [!NOTE]
> The modules are 0.x. A minor release can break things, so read the module's `CHANGELOG.md` before
diff --git a/SECURITY.md b/SECURITY.md
index 941dec6..1bd8647 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -4,18 +4,12 @@
The PowerShell modules and JavaScript bundles in this repository, the demo modules included.
-The modules treat these as untrusted:
-
-- the data (`-Data`): the components show its values as text and never run them as HTML or code
-- what comes back from the browser: a view from a link, the address bar or a save, and `$EventData`
- (which the app checks as well)
-- view files, from `-TemplatePath` or a template store
-- a file a reader loads into a pivot report (`-AllowImport`)
-- the request headers the pivot module takes the origin of a view file's `$schema` from
+What the modules treat as untrusted, what runs where and which requests they make:
+[Security](https://powershell-universal-components.eize.dev/security/) on the docs site.
Report a way to:
-- run script in the browser, or PowerShell on the server, from any of them
+- run script in the browser, or PowerShell on the server, from any of these untrusted inputs
- make a template store read or write outside its folder
- make an exported or downloaded file (CSV, XLSX, HTML report, SVG) dangerous to open
- leak a request, header or token into an error, `$Error`, a log line or an event
diff --git a/docs/compatibility.md b/docs/compatibility.md
new file mode 100644
index 0000000..65e2cec
--- /dev/null
+++ b/docs/compatibility.md
@@ -0,0 +1,23 @@
+---
+title: Compatibility
+description: Which versions of PowerShell Universal and PowerShell and which browsers the modules work with, and how each was tested.
+---
+
+# Compatibility
+
+What the modules work with, and how that was tested. A version not named here may work, but nobody
+has checked it.
+
+| Works with | Supported | Tested with | How |
+| --- | --- | --- | --- |
+| PowerShell Universal | 2026.2 and 2026.3 | 2026.2.5 and 2026.3.4 | the showcase apps and the browser tests on PSU test instances in Linux containers, by hand before a component change is done |
+| PowerShell | 7.4 or later, in the PSU environment the app runs in | the runner's PowerShell 7 in CI | Pester tests and loading each built module in a new process, on every pull request |
+| Browsers | browsers built on Chromium, Firefox and WebKit | Chromium, Firefox and WebKit, the engine of Safari | Playwright: the components on this site on every pull request, the showcase apps on PSU by hand |
+| pivotkit's command line (`Invoke-UDPivotReport -Engine Node`) | pivotkit-cli 0.2.1 or later, with Node 24 or later | pivotkit-cli 0.5.0 and 0.6.0 | the pivot module's opt-in tests against the real command line ([Development](development/index.md#report-command-against-the-real-pivotkit)) |
+
+Not tested: the Safari app, iOS and Android browsers. Windows PowerShell 5.1 does not load the
+modules.
+
+The lowest supported versions of PowerShell Universal and PowerShell are public interface: raising
+one is a breaking change ([Versioning](versioning.md#what-is-public-interface)). What a pivot feature
+needs from a pivotkit-server is on its page, such as [Rows from a server](pivot/server-rows.md).
diff --git a/docs/index.md b/docs/index.md
index fc51d02..07db3b0 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -84,10 +84,8 @@ New-UDPivotReport -Id 'python' -Data (Invoke-RestMethod 'https://endoflife.date/
## Requirements
-- PowerShell Universal 2026.2 or 2026.3, with PowerShell 7.4 or later.
-- Tested on PowerShell Universal 2026.2.5 and 2026.3.4.
-- `Invoke-UDPivotReport -Engine Node` tested with pivotkit-cli 0.5.0 and 0.6.0 ([what it needs](pivot/reports.md#two-engines)).
-- Tested in Chromium, Firefox and WebKit, the engine of Safari. The Safari app and iOS are not tested.
+PowerShell Universal with PowerShell 7 in the app's environment, and a current browser. The versions
+the modules support and were tested with: [Compatibility](compatibility.md).
## Questions and stability
diff --git a/docs/security.md b/docs/security.md
new file mode 100644
index 0000000..00300c6
--- /dev/null
+++ b/docs/security.md
@@ -0,0 +1,52 @@
+---
+title: Security
+description: What runs on the PowerShell Universal server and what in the browser, what the modules treat as untrusted, and which network requests they make; with links to each module's security notes.
+---
+
+# Security
+
+For app authors and PSU admins who decide what an app may show and do. Each module's page has the
+details; how to report a vulnerability is in
+[SECURITY.md](https://github.com/eizedev/powershell-universal-components/blob/HEAD/SECURITY.md).
+
+## What runs where
+
+| Where | What |
+| --- | --- |
+| PSU server, in the app's PowerShell | the module's commands: they convert the data, read files the app names (themes, view files, template stores) and return what PSU sends to the browser |
+| Browser | the module's JavaScript bundle, served by PSU: it draws the component, filters, exports and copies from the rows it got |
+
+Every row in `-Data` reaches the browser, with every column. Select what a reader may see first
+(`Select-Object`, the SQL query). The bundles bring their libraries along and load no code from
+elsewhere.
+
+## What the modules treat as untrusted
+
+- the data (`-Data`): the components show its values as text and never run them as HTML or code
+- what comes back from the browser: a view from a link, the address bar or a save, and `$EventData`
+ (which the app checks as well)
+- view files, from `-TemplatePath` or a template store
+- a file a reader loads into a pivot report (`-AllowImport`)
+- the request headers the pivot module takes the origin of a view file's `$schema` from
+
+What the modules trust because it comes from the app author, such as `-Options` or a theme, and
+what is not a vulnerability by design:
+[SECURITY.md](https://github.com/eizedev/powershell-universal-components/blob/HEAD/SECURITY.md#scope).
+
+## Network requests
+
+- **ECharts** makes none: neither its commands nor its bundle request anything.
+- **Perspective** makes none, except the base map tiles of the map charts a reader can pick in the
+ editor, which the browser loads from map tile servers
+ ([Security notes](perspective/events.md#security-notes)).
+- **Pivot** makes requests from the PSU server only, to addresses the app's script names: a
+ `-Schema` address, a pivotkit-server and its token endpoint
+ ([Network requests](pivot/events.md#network-requests)).
+- **The showcase apps** call public web services from the PSU server on their public and live data
+ pages ([ECharts showcase](demo.md), [Pivot showcase](pivot/demo.md#public-data-offline-or-live)).
+
+## Each module
+
+- [ECharts: security and limits](echarts/security.md)
+- [Perspective: events, security and limits](perspective/events.md#security-notes)
+- [Pivot: events, security and limits](pivot/events.md#security-notes)
diff --git a/docs/versioning.md b/docs/versioning.md
index 673bab5..7296a4e 100644
--- a/docs/versioning.md
+++ b/docs/versioning.md
@@ -50,7 +50,7 @@ These are the parts a break can hit:
`Get-UDElement`.
- Environment variables, such as `PSU_COMPONENT_PIVOT_SCHEMA_URL`.
- The addresses of the showcase apps' pages where the docs name them.
-- The lowest supported versions of PowerShell Universal and PowerShell ([requirements](index.md#requirements)).
+- The lowest supported versions of PowerShell Universal and PowerShell ([compatibility](compatibility.md)).
These are not public interface and can change in any release:
diff --git a/modules/PowerShellUniversal.Component.ECharts/README.md b/modules/PowerShellUniversal.Component.ECharts/README.md
index 3bae985..fbc28d7 100644
--- a/modules/PowerShellUniversal.Component.ECharts/README.md
+++ b/modules/PowerShellUniversal.Component.ECharts/README.md
@@ -9,7 +9,7 @@ events, light and dark theme and CSV/Excel export.
New-UDEChart -Data (Get-Process | Sort-Object CPU -Descending | Select-Object -First 10 Name, CPU) -Type bar -X Name -Y CPU
```
-Supported and tested versions: [Requirements](https://powershell-universal-components.eize.dev/#requirements).
+Supported and tested versions: [Compatibility](https://powershell-universal-components.eize.dev/compatibility/).
**Documentation: [powershell-universal-components.eize.dev](https://powershell-universal-components.eize.dev/echarts/)** - every chart type with
live examples next to their code, and the parameter reference.
diff --git a/modules/PowerShellUniversal.Component.Perspective/README.md b/modules/PowerShellUniversal.Component.Perspective/README.md
index bbc23ad..589b371 100644
--- a/modules/PowerShellUniversal.Component.Perspective/README.md
+++ b/modules/PowerShellUniversal.Component.Perspective/README.md
@@ -10,7 +10,7 @@ thousands of rows stay fast.
New-UDPerspective -Data (Invoke-Sqlcmd -Query 'SELECT * FROM Tickets') -GroupBy Team -SplitBy Priority -Columns Id -Aggregates @{ Id = 'count' }
```
-Supported and tested versions: [Requirements](https://powershell-universal-components.eize.dev/#requirements).
+Supported and tested versions: [Compatibility](https://powershell-universal-components.eize.dev/compatibility/).
**Documentation: [powershell-universal-components.eize.dev](https://powershell-universal-components.eize.dev/perspective/)** - data and types, the
starting view, events, security notes, with live examples.
diff --git a/modules/PowerShellUniversal.Component.Pivot/README.md b/modules/PowerShellUniversal.Component.Pivot/README.md
index 1962697..1809c57 100644
--- a/modules/PowerShellUniversal.Component.Pivot/README.md
+++ b/modules/PowerShellUniversal.Component.Pivot/README.md
@@ -16,7 +16,7 @@ New-UDPivotReport -Id 'tickets' -Data (Invoke-Sqlcmd -Query 'SELECT * FROM Ticke
New-UDPivotReport -Id 'own-data' -Data @() -AllowImport -TemplateStore Browser # the reader's own file
```
-Supported and tested versions: [Requirements](https://powershell-universal-components.eize.dev/#requirements).
+Supported and tested versions: [Compatibility](https://powershell-universal-components.eize.dev/compatibility/).
**Documentation: [powershell-universal-components.eize.dev](https://powershell-universal-components.eize.dev/pivot/)** - data and dates, views and
templates, events, security notes, with live examples.
diff --git a/tests/js/compatibility.test.js b/tests/js/compatibility.test.js
new file mode 100644
index 0000000..17af4dc
--- /dev/null
+++ b/tests/js/compatibility.test.js
@@ -0,0 +1,20 @@
+// docs/compatibility.md names the lowest PowerShell version the modules support; each module's
+// manifest enforces it as PowerShellVersion. Both must say the same, so raising one raises the other.
+import { test } from "node:test";
+import assert from "node:assert/strict";
+import { readFileSync, readdirSync } from "node:fs";
+
+const root = new URL("../../", import.meta.url);
+
+test("the PowerShell version on the compatibility page is every manifest's PowerShellVersion", () => {
+ const page = readFileSync(new URL("docs/compatibility.md", root), "utf8");
+ const documented = /^\| PowerShell \| (\d+\.\d+) or later\b/m.exec(page)?.[1];
+ assert.ok(documented, 'docs/compatibility.md has no row "| PowerShell | or later"');
+ const modules = readdirSync(new URL("modules/", root), { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
+ assert.ok(modules.length > 0, "no modules found");
+ const versions = Object.fromEntries(modules.map((name) => {
+ const manifest = readFileSync(new URL(`modules/${name}/${name}.psd1`, root), "utf8");
+ return [name, /^\s*PowerShellVersion\s*=\s*'([^']+)'/m.exec(manifest)?.[1]];
+ }));
+ assert.deepEqual(versions, Object.fromEntries(modules.map((name) => [name, documented])), "raise the version in docs/compatibility.md and every manifest together");
+});
diff --git a/tests/js/docs-pages.test.js b/tests/js/docs-pages.test.js
index ed04b12..ef9944c 100644
--- a/tests/js/docs-pages.test.js
+++ b/tests/js/docs-pages.test.js
@@ -130,8 +130,8 @@ const RELEASE_NAME = /\b(?:pivotkit(?:-[a-z]+)?|PowerShellUniversal\.Component\.
*/
const RELEASE_NAMES_ALLOWED = [
{ file: "docs/versioning.md" },
- // the versions the modules were tested with
- { file: "docs/index.md", section: "Requirements" },
+ // the versions the modules support and were tested with
+ { file: "docs/compatibility.md" },
];
/**
diff --git a/zensical.toml b/zensical.toml
index 108a140..45993f7 100644
--- a/zensical.toml
+++ b/zensical.toml
@@ -18,6 +18,8 @@ nav = [
{ "Overview" = "index.md" },
{ "Getting started" = "getting-started.md" },
{ "Versioning" = "versioning.md" },
+ { "Compatibility" = "compatibility.md" },
+ { "Security" = "security.md" },
{ "ECharts" = [
{ "Overview" = "echarts/index.md" },
{ "Showcase app (demo)" = "demo.md" },
@@ -116,7 +118,7 @@ PowerShell objects. Not affiliated with Devolutions. llms-full.txt holds every p
"""
[project.plugins.llmstxt.sections]
-"Start" = ["index.md", "getting-started.md", "versioning.md"]
+"Start" = ["index.md", "getting-started.md", "versioning.md", "compatibility.md", "security.md"]
"ECharts module" = ["echarts/*.md", "demo.md"]
"Perspective module" = ["perspective/*.md"]
"Pivot module" = ["pivot/*.md"]
From 236ec9ad25d44a8e349822e7017065c5dfc491ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Eizedev?=
<6794362+eizedev@users.noreply.github.com>
Date: Wed, 25 Nov 2026 21:28:52 +0100
Subject: [PATCH 4/4] docs: compatibility and security pages after review
Refs #217
Co-Authored-By: Claude Opus 5.5
---
SECURITY.md | 7 ++++---
docs/compatibility.md | 8 ++++----
docs/index.md | 4 ++--
docs/security.md | 5 +++--
tests/js/compatibility.test.js | 16 ++++++++++++++--
5 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/SECURITY.md b/SECURITY.md
index 1bd8647..a4a23e8 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -4,12 +4,13 @@
The PowerShell modules and JavaScript bundles in this repository, the demo modules included.
-What the modules treat as untrusted, what runs where and which requests they make:
-[Security](https://powershell-universal-components.eize.dev/security/) on the docs site.
+The modules treat as untrusted: the data, what comes back from the browser (views and `$EventData`),
+view files, a reader's own files and request headers. The full list, what runs where and which
+requests the modules make: [Security](https://powershell-universal-components.eize.dev/security/).
Report a way to:
-- run script in the browser, or PowerShell on the server, from any of these untrusted inputs
+- run script in the browser, or PowerShell on the server, from any untrusted input
- make a template store read or write outside its folder
- make an exported or downloaded file (CSV, XLSX, HTML report, SVG) dangerous to open
- leak a request, header or token into an error, `$Error`, a log line or an event
diff --git a/docs/compatibility.md b/docs/compatibility.md
index 65e2cec..51874f7 100644
--- a/docs/compatibility.md
+++ b/docs/compatibility.md
@@ -10,10 +10,10 @@ has checked it.
| Works with | Supported | Tested with | How |
| --- | --- | --- | --- |
-| PowerShell Universal | 2026.2 and 2026.3 | 2026.2.5 and 2026.3.4 | the showcase apps and the browser tests on PSU test instances in Linux containers, by hand before a component change is done |
-| PowerShell | 7.4 or later, in the PSU environment the app runs in | the runner's PowerShell 7 in CI | Pester tests and loading each built module in a new process, on every pull request |
-| Browsers | browsers built on Chromium, Firefox and WebKit | Chromium, Firefox and WebKit, the engine of Safari | Playwright: the components on this site on every pull request, the showcase apps on PSU by hand |
-| pivotkit's command line (`Invoke-UDPivotReport -Engine Node`) | pivotkit-cli 0.2.1 or later, with Node 24 or later | pivotkit-cli 0.5.0 and 0.6.0 | the pivot module's opt-in tests against the real command line ([Development](development/index.md#report-command-against-the-real-pivotkit)) |
+| PowerShell Universal | 2026.2 and 2026.3 | 2026.2.5 and 2026.3.4 | by hand on PSU test instances, in a browser, before a change to a component is done ([Development](development/index.md#browser-tests-on-psu)) |
+| PowerShell | 7.4 or later, in the PSU environment the app runs in | the PowerShell 7 of GitHub's runner, not pinned; 7.4 itself is not tested | Pester tests on every pull request, and each built component module loaded in a new process |
+| Browsers | desktop browsers built on Chromium, Firefox and WebKit | Chromium, Firefox and WebKit, the engine of Safari | Playwright: the components on this site on every pull request, the showcase apps on PSU by hand |
+| pivotkit's command line, for `Invoke-UDPivotReport -Engine Node` | what [Two engines](pivot/reports.md#two-engines) names | pivotkit-cli 0.5.0 and 0.6.0 | the pivot module's opt-in tests against the real command line ([Development](development/index.md#report-command-against-the-real-pivotkit)) |
Not tested: the Safari app, iOS and Android browsers. Windows PowerShell 5.1 does not load the
modules.
diff --git a/docs/index.md b/docs/index.md
index 07db3b0..6390ce8 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -84,8 +84,8 @@ New-UDPivotReport -Id 'python' -Data (Invoke-RestMethod 'https://endoflife.date/
## Requirements
-PowerShell Universal with PowerShell 7 in the app's environment, and a current browser. The versions
-the modules support and were tested with: [Compatibility](compatibility.md).
+PowerShell Universal 2026.2 or 2026.3 with PowerShell 7.4 or later, and a desktop browser built on
+Chromium, Firefox or WebKit (Safari). What was tested and how: [Compatibility](compatibility.md).
## Questions and stability
diff --git a/docs/security.md b/docs/security.md
index 00300c6..ddb9a30 100644
--- a/docs/security.md
+++ b/docs/security.md
@@ -42,8 +42,9 @@ what is not a vulnerability by design:
- **Pivot** makes requests from the PSU server only, to addresses the app's script names: a
`-Schema` address, a pivotkit-server and its token endpoint
([Network requests](pivot/events.md#network-requests)).
-- **The showcase apps** call public web services from the PSU server on their public and live data
- pages ([ECharts showcase](demo.md), [Pivot showcase](pivot/demo.md#public-data-offline-or-live)).
+- **The showcase apps**, from the PSU server: the ECharts showcase's Public data page calls five public
+ web services ([ECharts showcase](demo.md)); the Pivot showcase only when its Live data switch is on
+ ([Pivot showcase](pivot/demo.md#public-data-offline-or-live)).
## Each module
diff --git a/tests/js/compatibility.test.js b/tests/js/compatibility.test.js
index 17af4dc..1bda6a3 100644
--- a/tests/js/compatibility.test.js
+++ b/tests/js/compatibility.test.js
@@ -1,5 +1,6 @@
-// docs/compatibility.md names the lowest PowerShell version the modules support; each module's
-// manifest enforces it as PowerShellVersion. Both must say the same, so raising one raises the other.
+// docs/compatibility.md names the versions the modules support; each module's manifest enforces the
+// lowest PowerShell as PowerShellVersion, and the start page's Requirements sum them up in one line.
+// All must say the same, so raising one raises the others.
import { test } from "node:test";
import assert from "node:assert/strict";
import { readFileSync, readdirSync } from "node:fs";
@@ -18,3 +19,14 @@ test("the PowerShell version on the compatibility page is every manifest's Power
}));
assert.deepEqual(versions, Object.fromEntries(modules.map((name) => [name, documented])), "raise the version in docs/compatibility.md and every manifest together");
});
+
+test("the start page's Requirements name the versions of the compatibility page", () => {
+ const page = readFileSync(new URL("docs/compatibility.md", root), "utf8");
+ const psu = /^\| PowerShell Universal \| (\S+) and (\S+) \|/m.exec(page);
+ const powershell = /^\| PowerShell \| (\d+\.\d+) or later\b/m.exec(page)?.[1];
+ assert.ok(psu && powershell, "docs/compatibility.md: the PowerShell Universal or PowerShell row is not found");
+ const start = readFileSync(new URL("docs/index.md", root), "utf8");
+ const requirements = start.slice(start.indexOf("\n## Requirements\n"), start.indexOf("\n## ", start.indexOf("\n## Requirements\n") + 1));
+ assert.ok(requirements.includes(`PowerShell Universal ${psu[1]} or ${psu[2]}`), `docs/index.md, Requirements: name PowerShell Universal ${psu[1]} or ${psu[2]}`);
+ assert.ok(requirements.includes(`PowerShell ${powershell} or later`), `docs/index.md, Requirements: name PowerShell ${powershell} or later`);
+});