ultra11y 5.58.0 → 5.58.1
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.opencode/plugins/ultra11y.js +1 -1
- package/README.md +20 -5
- package/package.json +1 -1
- package/scripts/ultra11y.mjs +125 -26
- package/skills/review-a11y/SKILL.md +1 -1
- package/skills/review-a11y/scripts/ultra11y.mjs +125 -26
- package/skills/ultra11y/SKILL.md +1 -1
- package/skills/ultra11y/references/ci.md +10 -2
- package/skills/ultra11y/scripts/ultra11y.mjs +125 -26
- package/skills/ultra11y/templates/gitlab-ci.yml +1 -1
- package/src/affected.ts +46 -2
- package/src/cli.ts +52 -10
- package/src/lite.ts +64 -10
- package/src/sample.ts +23 -1
- package/src/types.ts +9 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"name": "ultra11y",
|
|
11
11
|
"source": "./",
|
|
12
12
|
"description": "RGAA 4.1.2 accessibility audits on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports in Claude Code.",
|
|
13
|
-
"version": "5.58.
|
|
13
|
+
"version": "5.58.1",
|
|
14
14
|
"author": { "name": "maxgfr" },
|
|
15
15
|
"homepage": "https://github.com/SocialGouv/ultra11y",
|
|
16
16
|
"repository": "https://github.com/SocialGouv/ultra11y",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultra11y",
|
|
3
3
|
"description": "RGAA 4.1.2 accessibility audits, the French State's standard, on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports. Never declares conforming what it has not verified.",
|
|
4
|
-
"version": "5.58.
|
|
4
|
+
"version": "5.58.1",
|
|
5
5
|
"author": { "name": "maxgfr" },
|
|
6
6
|
"homepage": "https://github.com/SocialGouv/ultra11y",
|
|
7
7
|
"repository": "https://github.com/SocialGouv/ultra11y",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultra11y",
|
|
3
3
|
"description": "RGAA 4.1.2 accessibility audits, the French State's standard, on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports. Never declares conforming what it has not verified.",
|
|
4
|
-
"version": "5.58.
|
|
4
|
+
"version": "5.58.1",
|
|
5
5
|
"author": { "name": "maxgfr", "url": "https://github.com/maxgfr" },
|
|
6
6
|
"homepage": "https://github.com/SocialGouv/ultra11y",
|
|
7
7
|
"repository": "https://github.com/SocialGouv/ultra11y",
|
|
@@ -44,7 +44,7 @@ import { fileURLToPath } from "node:url";
|
|
|
44
44
|
// does not carry it, so a user's own ultra11y.js is never clobbered. Kept as text, not as
|
|
45
45
|
// an export (see above).
|
|
46
46
|
const ULTRA11Y_OPENCODE_PLUGIN = "ULTRA11Y_OPENCODE_PLUGIN";
|
|
47
|
-
const ULTRA11Y_PLUGIN_VERSION = "5.58.
|
|
47
|
+
const ULTRA11Y_PLUGIN_VERSION = "5.58.1";
|
|
48
48
|
const PLUGIN_ID = "ultra11y";
|
|
49
49
|
const SKILL_NAMES = ["ultra11y", "review-a11y"];
|
|
50
50
|
|
package/README.md
CHANGED
|
@@ -507,11 +507,23 @@ pull request:
|
|
|
507
507
|
- **only NEW findings fail** — the baseline keys a rendered finding on
|
|
508
508
|
`page|rule|criterion|normalized selector` (generated ids, hashes and digits folded), not on its
|
|
509
509
|
position in the serialized DOM, which moves whenever anything above it changes. A finding that
|
|
510
|
-
only moved is not new; a third `img` without `alt` on a page that had two is.
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
510
|
+
only moved is not new; a third `img` without `alt` on a page that had two is. The baseline lives
|
|
511
|
+
in the Actions cache: the push to the default branch audits every page and saves it under a key
|
|
512
|
+
carrying the SHA, and a pull request restores the one of its merge-base (else the closest by
|
|
513
|
+
prefix);
|
|
514
|
+
- **a new page is judged with no reference** — that push records every sample page, clean ones
|
|
515
|
+
included, so a page the merge-base's own baseline does not know was added by the pull request:
|
|
516
|
+
every finding on it at `fail-on` is new and fails, and the summary says the page is new. Only a
|
|
517
|
+
baseline that cannot speak for it only warns: none at all, one written by another ultra11y
|
|
518
|
+
version, or the closest entry by prefix (`--baseline-approximate`, set by the action). A page
|
|
519
|
+
the push was asked for, or that the sample declares, but that left no snapshot is recorded as
|
|
520
|
+
`skipped` in the baseline and never judged new;
|
|
521
|
+
- **a route nobody declared is named** — `affected` lists the route files the diff adds or changes
|
|
522
|
+
(Next.js App Router `page.*`, a `pages/` router — Next, Nuxt, Astro —, SvelteKit
|
|
523
|
+
`+page.svelte`) that no sample page declares in its `sources`, as `unsampled` and the action
|
|
524
|
+
output `affected-unsampled`. `--require-sampled` / `require-sampled: true` fails on them: declare
|
|
525
|
+
the page in `sample.pages`, or exempt it in `sample.exempt` with a reason. A router configured in
|
|
526
|
+
code (React Router, Vue Router) has no route files to recognise: declare those pages.
|
|
515
527
|
|
|
516
528
|
```jsonc
|
|
517
529
|
// .ultra11yrc.json
|
|
@@ -520,6 +532,8 @@ pull request:
|
|
|
520
532
|
// What no import says: the root layout, global styles, and what changes the rendered output
|
|
521
533
|
// from outside the source tree — dependencies (lockfile, patches), relative to this file.
|
|
522
534
|
"global": ["src/app/layout.tsx", "src/styles/**", "package.json", "../../pnpm-lock.yaml", "../../patches/**"],
|
|
535
|
+
// Routes deliberately outside the sample — a reason is required.
|
|
536
|
+
"exempt": [{ "path": "src/app/(mfa)/**", "reason": "behind MFA, unreachable from the capture" }],
|
|
523
537
|
"pages": [{ "id": "accueil", "name": "Accueil", "url": "http://localhost:3000/", "sources": ["src/app/page.tsx"] }]
|
|
524
538
|
}
|
|
525
539
|
}
|
|
@@ -546,6 +560,7 @@ jobs:
|
|
|
546
560
|
with:
|
|
547
561
|
mode: lite
|
|
548
562
|
step: affected
|
|
563
|
+
require-sampled: true # a new route no sample page declares fails here
|
|
549
564
|
# Your own capture, of those pages only. Here a Playwright suite whose tests call
|
|
550
565
|
# `checkA11y` and filter their routes on ULTRA11Y_PAGES (empty = every page).
|
|
551
566
|
- if: steps.affected.outputs.affected-none != 'true'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultra11y",
|
|
3
|
-
"version": "5.58.
|
|
3
|
+
"version": "5.58.1",
|
|
4
4
|
"description": "Audit d'accessibilité RGAA 4.1.2, le référentiel de l'État : rapport daté, grille des 106 critères, backlog et tickets. Moteur statique, navigateur et jugement IA contre-vérifié. Il ne déclare jamais conforme ce qu'il n'a pas vérifié. Socle WCAG 2.2 AA.",
|
|
5
5
|
"homepage": "https://socialgouv.github.io/ultra11y/",
|
|
6
6
|
"type": "module",
|
package/scripts/ultra11y.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { join as join57, relative as relative8, resolve as resolve20, sep as sep
|
|
|
6
6
|
import { fileURLToPath as fileURLToPath6, pathToFileURL as pathToFileURL3 } from "url";
|
|
7
7
|
|
|
8
8
|
// src/types.ts
|
|
9
|
-
var VERSION = "5.58.
|
|
9
|
+
var VERSION = "5.58.1";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
function isAdjudicated(by) {
|
|
12
12
|
return by === "agent" || by === "human";
|
|
@@ -70902,6 +70902,22 @@ function validateSample(raw) {
|
|
|
70902
70902
|
});
|
|
70903
70903
|
}
|
|
70904
70904
|
}
|
|
70905
|
+
if (s.exempt !== void 0) {
|
|
70906
|
+
if (!Array.isArray(s.exempt)) {
|
|
70907
|
+
err2("sample.exempt", "exempt must be an array of { path, reason }");
|
|
70908
|
+
} else {
|
|
70909
|
+
s.exempt.forEach((e, i2) => {
|
|
70910
|
+
const x = e;
|
|
70911
|
+
if (typeof x !== "object" || x === null || Array.isArray(x)) {
|
|
70912
|
+
err2(`sample.exempt[${i2}]`, "each exemption must be an object { path, reason }");
|
|
70913
|
+
return;
|
|
70914
|
+
}
|
|
70915
|
+
if (typeof x.path !== "string" || x.path.trim() === "") err2(`sample.exempt[${i2}].path`, "path must be a non-empty glob");
|
|
70916
|
+
if (typeof x.reason !== "string" || x.reason.trim() === "")
|
|
70917
|
+
err2(`sample.exempt[${i2}].reason`, "reason is required \u2014 say why this route is left out of the sample");
|
|
70918
|
+
});
|
|
70919
|
+
}
|
|
70920
|
+
}
|
|
70905
70921
|
const ok = issues.length === 0;
|
|
70906
70922
|
return { ok, issues, warnings, sample: ok ? normalizeSample(s) : void 0 };
|
|
70907
70923
|
}
|
|
@@ -70917,7 +70933,8 @@ function normalizeSample(s) {
|
|
|
70917
70933
|
}));
|
|
70918
70934
|
const transverse = Array.isArray(s.transverse) ? s.transverse.map(String) : void 0;
|
|
70919
70935
|
const global = Array.isArray(s.global) ? s.global.map(String) : void 0;
|
|
70920
|
-
|
|
70936
|
+
const exempt = Array.isArray(s.exempt) ? s.exempt.map((e) => ({ path: String(e.path), reason: String(e.reason) })) : void 0;
|
|
70937
|
+
return { pages, ...transverse?.length ? { transverse } : {}, ...global?.length ? { global } : {}, ...exempt?.length ? { exempt } : {} };
|
|
70921
70938
|
}
|
|
70922
70939
|
function sampleScope(sample) {
|
|
70923
70940
|
return {
|
|
@@ -70981,7 +70998,8 @@ function mergeSample(existing, proposed) {
|
|
|
70981
70998
|
sample: {
|
|
70982
70999
|
pages,
|
|
70983
71000
|
...existing?.transverse?.length ? { transverse: existing.transverse } : {},
|
|
70984
|
-
...existing?.global?.length ? { global: existing.global } : {}
|
|
71001
|
+
...existing?.global?.length ? { global: existing.global } : {},
|
|
71002
|
+
...existing?.exempt?.length ? { exempt: existing.exempt } : {}
|
|
70985
71003
|
},
|
|
70986
71004
|
added,
|
|
70987
71005
|
kept: pages.length - added.length
|
|
@@ -71006,7 +71024,8 @@ function unionSample(declared, snapshotted) {
|
|
|
71006
71024
|
sample: {
|
|
71007
71025
|
pages: [...pages, ...undeclared],
|
|
71008
71026
|
...declared?.transverse?.length ? { transverse: declared.transverse } : {},
|
|
71009
|
-
...declared?.global?.length ? { global: declared.global } : {}
|
|
71027
|
+
...declared?.global?.length ? { global: declared.global } : {},
|
|
71028
|
+
...declared?.exempt?.length ? { exempt: declared.exempt } : {}
|
|
71010
71029
|
},
|
|
71011
71030
|
undeclared,
|
|
71012
71031
|
uncaptured
|
|
@@ -72953,14 +72972,24 @@ function countByKey(findings) {
|
|
|
72953
72972
|
}
|
|
72954
72973
|
return out2;
|
|
72955
72974
|
}
|
|
72956
|
-
function buildRenderBaseline(findings, pages, standard, date = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)) {
|
|
72975
|
+
function buildRenderBaseline(findings, pages, standard, date = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), skipped = []) {
|
|
72957
72976
|
const out2 = {};
|
|
72958
72977
|
for (const id of [...pages].sort()) out2[id] = {};
|
|
72959
72978
|
for (const [key2, list] of [...countByKey(gatedFindings(findings))].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)) {
|
|
72960
72979
|
const page = key2.slice(0, key2.indexOf("|"));
|
|
72961
72980
|
(out2[page] ??= {})[key2] = list.length;
|
|
72962
72981
|
}
|
|
72963
|
-
|
|
72982
|
+
const missed = [...new Set(skipped)].filter((id) => !(id in out2)).sort();
|
|
72983
|
+
return {
|
|
72984
|
+
tool: "ultra11y",
|
|
72985
|
+
kind: RENDER_BASELINE_KIND,
|
|
72986
|
+
schemaVersion: 1,
|
|
72987
|
+
version: VERSION,
|
|
72988
|
+
date,
|
|
72989
|
+
standard,
|
|
72990
|
+
pages: out2,
|
|
72991
|
+
...missed.length ? { skipped: missed } : {}
|
|
72992
|
+
};
|
|
72964
72993
|
}
|
|
72965
72994
|
function parseRenderBaseline(raw, standard = "wcag") {
|
|
72966
72995
|
if (typeof raw !== "object" || raw === null) return null;
|
|
@@ -72980,7 +73009,8 @@ function parseRenderBaseline(raw, standard = "wcag") {
|
|
|
72980
73009
|
version: typeof r.version === "string" ? r.version : "unknown",
|
|
72981
73010
|
date: typeof r.date === "string" ? r.date : "",
|
|
72982
73011
|
standard: typeof r.standard === "string" ? r.standard : standard,
|
|
72983
|
-
pages
|
|
73012
|
+
pages,
|
|
73013
|
+
...Array.isArray(r.skipped) ? { skipped: r.skipped.filter((x) => typeof x === "string") } : {}
|
|
72984
73014
|
};
|
|
72985
73015
|
}
|
|
72986
73016
|
const doc = unwrapAudit(raw);
|
|
@@ -72994,20 +73024,27 @@ function parseRenderBaseline(raw, standard = "wcag") {
|
|
|
72994
73024
|
}
|
|
72995
73025
|
return null;
|
|
72996
73026
|
}
|
|
72997
|
-
function diffRenderBaseline(findings, pages, baseline, failOn = "bloquant", version = VERSION) {
|
|
73027
|
+
function diffRenderBaseline(findings, pages, baseline, failOn = "bloquant", version = VERSION, opts = {}) {
|
|
72998
73028
|
const current = countByKey(gatedFindings(findings));
|
|
72999
73029
|
const newFindings = [];
|
|
73000
73030
|
const unbaselined = [];
|
|
73001
73031
|
const without = /* @__PURE__ */ new Set();
|
|
73032
|
+
const fresh = /* @__PURE__ */ new Set();
|
|
73002
73033
|
let fixed = 0;
|
|
73003
73034
|
const audited = new Set(pages);
|
|
73004
|
-
|
|
73035
|
+
const versionMismatch = baseline && baseline.version !== version ? { baseline: baseline.version, current: version } : void 0;
|
|
73036
|
+
const reference = baseline !== null && !versionMismatch && !opts.approximate && Object.keys(baseline.pages).length > 0;
|
|
73037
|
+
const skipped = new Set(baseline?.skipped ?? []);
|
|
73038
|
+
const isNew = (page) => reference && !skipped.has(page);
|
|
73039
|
+
const absent = (page) => void (isNew(page) ? fresh : without).add(page);
|
|
73040
|
+
for (const id of pages) if (!baseline?.pages[id]) absent(id);
|
|
73005
73041
|
for (const [key2, list] of current) {
|
|
73006
73042
|
const page = key2.slice(0, key2.indexOf("|"));
|
|
73007
73043
|
const base = baseline?.pages[page];
|
|
73008
73044
|
if (!base) {
|
|
73009
|
-
|
|
73010
|
-
|
|
73045
|
+
absent(page);
|
|
73046
|
+
if (isNew(page)) newFindings.push(...list);
|
|
73047
|
+
else unbaselined.push(...list);
|
|
73011
73048
|
continue;
|
|
73012
73049
|
}
|
|
73013
73050
|
const had = base[key2] ?? 0;
|
|
@@ -73019,15 +73056,16 @@ function diffRenderBaseline(findings, pages, baseline, failOn = "bloquant", vers
|
|
|
73019
73056
|
for (const [key2, had] of Object.entries(base)) fixed += Math.max(0, had - (current.get(key2)?.length ?? 0));
|
|
73020
73057
|
}
|
|
73021
73058
|
const blocking = newFindings.filter((f) => RANK2[f.severity] <= RANK2[failOn]);
|
|
73022
|
-
const versionMismatch = baseline && baseline.version !== version ? { baseline: baseline.version, current: version } : void 0;
|
|
73023
73059
|
return {
|
|
73024
73060
|
pages: [...pages].sort(),
|
|
73025
73061
|
failOn,
|
|
73026
73062
|
newFindings,
|
|
73027
73063
|
blocking,
|
|
73028
73064
|
fixed,
|
|
73065
|
+
newPages: [...fresh].sort(),
|
|
73029
73066
|
pagesWithoutBaseline: [...without].sort(),
|
|
73030
73067
|
unbaselined,
|
|
73068
|
+
approximate: opts.approximate === true,
|
|
73031
73069
|
...versionMismatch ? { versionMismatch } : {},
|
|
73032
73070
|
noBaseline: baseline === null,
|
|
73033
73071
|
ok: blocking.length === 0 || versionMismatch !== void 0
|
|
@@ -73042,7 +73080,7 @@ function renderDiffWarnings(diff, lang = "en") {
|
|
|
73042
73080
|
);
|
|
73043
73081
|
else if (diff.pagesWithoutBaseline.length)
|
|
73044
73082
|
out2.push(
|
|
73045
|
-
fr ? `page(s) absente(s) de la baseline, ses constats ne bloquent pas : ${diff.pagesWithoutBaseline.join(", ")}.` : `page(s) the baseline never measured, their findings do not gate: ${diff.pagesWithoutBaseline.join(", ")}.`
|
|
73083
|
+
diff.approximate ? fr ? `baseline approch\xE9e (pas celle du merge-base) : les pages qu'elle ne conna\xEEt pas sont signal\xE9es sans bloquer : ${diff.pagesWithoutBaseline.join(", ")}.` : `approximate baseline (not the merge-base's own): pages it does not know are reported without gating: ${diff.pagesWithoutBaseline.join(", ")}.` : fr ? `page(s) absente(s) de la baseline, ses constats ne bloquent pas : ${diff.pagesWithoutBaseline.join(", ")}.` : `page(s) the baseline never measured, their findings do not gate: ${diff.pagesWithoutBaseline.join(", ")}.`
|
|
73046
73084
|
);
|
|
73047
73085
|
if (diff.versionMismatch)
|
|
73048
73086
|
out2.push(
|
|
@@ -73068,6 +73106,11 @@ function renderDiffMarkdown(diff, lang = "en", max = 50) {
|
|
|
73068
73106
|
""
|
|
73069
73107
|
);
|
|
73070
73108
|
for (const w of renderDiffWarnings(diff, lang)) out2.push(`> \u26A0\uFE0F ${w}`, "");
|
|
73109
|
+
if (diff.newPages.length)
|
|
73110
|
+
out2.push(
|
|
73111
|
+
fr ? `\u{1F195} Nouvelle(s) page(s), absente(s) de la baseline : jug\xE9e(s) sans r\xE9f\xE9rence, chacun de ses constats \u2265 ${sev} bloque \u2014 ${diff.newPages.join(", ")}.` : `\u{1F195} New page(s), absent from the baseline: judged with no reference, every finding \u2265 ${sev} on it gates \u2014 ${diff.newPages.join(", ")}.`,
|
|
73112
|
+
""
|
|
73113
|
+
);
|
|
73071
73114
|
if (diff.newFindings.length) {
|
|
73072
73115
|
out2.push(fr ? "| Page | Crit\xE8re | R\xE8gle | S\xE9v\xE9rit\xE9 | \xC9l\xE9ment |" : "| Page | Criterion | Rule | Severity | Element |", "|---|---|---|---|---|");
|
|
73073
73116
|
for (const f of diff.newFindings.slice(0, max))
|
|
@@ -73113,6 +73156,19 @@ var extOf = (f) => {
|
|
|
73113
73156
|
return i2 <= 0 ? "" : b.slice(i2).toLowerCase();
|
|
73114
73157
|
};
|
|
73115
73158
|
var norm5 = (p) => posix3.normalize(toPosix(p)).replace(/^\.\//, "");
|
|
73159
|
+
var ROUTE_FILES = [
|
|
73160
|
+
// Next.js App Router: app/**/page.* — at any depth, so a config at a workspace root still sees
|
|
73161
|
+
// `apps/web/src/app/**`. A `page.*` file under an `app/` directory is a route almost everywhere;
|
|
73162
|
+
// where it is not, `sample.exempt` says so.
|
|
73163
|
+
/(?:^|\/)app\/(?:.+\/)?page\.(?:tsx|jsx|ts|js|mdx)$/,
|
|
73164
|
+
// Next.js Pages Router, Nuxt, Astro: pages/** (minus `_app`/`_document`/… and API routes)
|
|
73165
|
+
/^(?:src\/)?pages\/(?!(?:.+\/)?_)(?!api\/)(?:.+\/)?[^/]+\.(?:tsx|jsx|ts|js|mdx|md|vue|astro|svelte)$/,
|
|
73166
|
+
// SvelteKit: routes/**/+page.svelte — unambiguous, so at any depth too
|
|
73167
|
+
/(?:^|\/)routes\/(?:.+\/)?\+page\.svelte$/
|
|
73168
|
+
];
|
|
73169
|
+
function isRouteFile(rel2) {
|
|
73170
|
+
return !isTestArtifact(rel2) && ROUTE_FILES.some((re) => re.test(rel2));
|
|
73171
|
+
}
|
|
73116
73172
|
var BLOCK_COMMENT = /\/\*[\s\S]*?\*\//g;
|
|
73117
73173
|
var LINE_COMMENT = /^\s*\/\/.*$/gm;
|
|
73118
73174
|
var IMPORT_RE = /\bimport\s+(type\s+)?([^;'"`]*?)\s*\bfrom\s*(["'])([^"'\n]+)\3/g;
|
|
@@ -73330,9 +73386,22 @@ function nextWrappers(page, known) {
|
|
|
73330
73386
|
}
|
|
73331
73387
|
function selectAffected(input, graph = buildAffectedGraph(input.root)) {
|
|
73332
73388
|
const changed = [...new Set(input.changed.map(norm5))].sort();
|
|
73333
|
-
const empty = {
|
|
73389
|
+
const empty = {
|
|
73390
|
+
pages: [],
|
|
73391
|
+
all: false,
|
|
73392
|
+
none: true,
|
|
73393
|
+
unmapped: [],
|
|
73394
|
+
global: [],
|
|
73395
|
+
reasons: {},
|
|
73396
|
+
unsourced: [],
|
|
73397
|
+
unsampled: [],
|
|
73398
|
+
changed: changed.length
|
|
73399
|
+
};
|
|
73334
73400
|
const unsourced = input.pages.filter((p) => !p.sources?.length).map((p) => p.id);
|
|
73335
73401
|
if (!changed.length) return { ...empty, unsourced };
|
|
73402
|
+
const declared = new Set(input.pages.flatMap((p) => (p.sources ?? []).map(norm5)));
|
|
73403
|
+
const isExempt = input.exempt?.length ? compileGlobs(input.exempt.map(norm5)) ?? (() => false) : () => false;
|
|
73404
|
+
const unsampled = changed.filter((f) => isRouteFile(f) && !declared.has(f) && !isExempt(f) && existsSync34(join43(input.root, f)));
|
|
73336
73405
|
const isGlobal = compileGlobs([...IMPLICIT_GLOBAL, ...(input.global ?? []).map(norm5)]) ?? (() => false);
|
|
73337
73406
|
const globalHits = changed.filter((f) => isGlobal(f));
|
|
73338
73407
|
if (globalHits.length)
|
|
@@ -73342,7 +73411,8 @@ function selectAffected(input, graph = buildAffectedGraph(input.root)) {
|
|
|
73342
73411
|
all: true,
|
|
73343
73412
|
none: false,
|
|
73344
73413
|
global: globalHits,
|
|
73345
|
-
unsourced
|
|
73414
|
+
unsourced,
|
|
73415
|
+
unsampled
|
|
73346
73416
|
};
|
|
73347
73417
|
const changedSet = new Set(changed);
|
|
73348
73418
|
const reached = /* @__PURE__ */ new Set();
|
|
@@ -73363,7 +73433,7 @@ function selectAffected(input, graph = buildAffectedGraph(input.root)) {
|
|
|
73363
73433
|
const unmapped = changed.filter(
|
|
73364
73434
|
(f) => !reached.has(f) && !f.startsWith("../") && MARKUP_EXT.has(extOf(f)) && !isTestArtifact(f) && existsSync34(join43(input.root, f))
|
|
73365
73435
|
);
|
|
73366
|
-
return { pages, all: false, none: pages.length === 0, unmapped, global: [], reasons, unsourced, changed: changed.length };
|
|
73436
|
+
return { pages, all: false, none: pages.length === 0, unmapped, global: [], reasons, unsourced, unsampled, changed: changed.length };
|
|
73367
73437
|
}
|
|
73368
73438
|
function git3(cwd, args2) {
|
|
73369
73439
|
return execFileSync7("git", args2, { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], maxBuffer: 64 * 1024 * 1024 });
|
|
@@ -80039,8 +80109,8 @@ Usage:
|
|
|
80039
80109
|
ultra11y audit [--captures <dir>] [--no-captures] [--require-captures] (rendered-DOM captures + .ultra11y/pages snapshots: audit real HTML)
|
|
80040
80110
|
ultra11y audit [--format sarif|github] (CI: SARIF for code scanning, or inline annotations + job summary)
|
|
80041
80111
|
ultra11y audit --in <audit.json> [--fail-on blocking|major|minor] [--format sarif|github] (re-gate an audit already computed \u2014 e.g. one carrying adjudicated verdicts \u2014 without a second detection pass)
|
|
80042
|
-
ultra11y audit --lite [--pages <ids>] [--root <dir>] [--baseline <file>] [--write-baseline <file>] [--fail-on blocking|major|minor] [--format sarif|github] [--out <dir>] [--json] (rendered regression gate: the page snapshots alone, engine only, fails on NEW findings only)
|
|
80043
|
-
ultra11y affected --since <ref> | --all [--root <dir>] [--json] (the sample pages a diff can change: sources + their imports, sample.global, the merge-base)
|
|
80112
|
+
ultra11y audit --lite [--pages <ids>] [--root <dir>] [--baseline <file> [--baseline-approximate]] [--write-baseline <file>] [--fail-on blocking|major|minor] [--format sarif|github] [--out <dir>] [--json] (rendered regression gate: the page snapshots alone, engine only, fails on NEW findings only)
|
|
80113
|
+
ultra11y affected --since <ref> | --all [--root <dir>] [--require-sampled] [--json] (the sample pages a diff can change: sources + their imports, sample.global, the merge-base)
|
|
80044
80114
|
ultra11y report --in <audit.json> [--out <dir>] [--standard <pack>] [--format sarif|github] [--lang auto|en|fr]
|
|
80045
80115
|
ultra11y report --in <audit.json> [--evidence [--evidence-max <n>]] [--out <dir>] (the Markdown report, illustrated with annotated crops)
|
|
80046
80116
|
ultra11y report --in <audit.json> --html [--evidence] [--inline-budget <bytes>] [--out <dir>] (index.html + a printable single file)
|
|
@@ -80339,7 +80409,14 @@ Options:
|
|
|
80339
80409
|
report. With --baseline it fails only on NEW findings at --fail-on; a
|
|
80340
80410
|
page the baseline never measured, or a baseline from another ultra11y
|
|
80341
80411
|
version, warns instead of failing
|
|
80342
|
-
--pages <ids> audit --lite: comma-separated page ids to audit (default: every snapshot)
|
|
80412
|
+
--pages <ids> audit --lite: comma-separated page ids to audit (default: every snapshot).
|
|
80413
|
+
A page absent from a same-version baseline is NEW: every finding on it
|
|
80414
|
+
counts as new and gates
|
|
80415
|
+
--baseline-approximate audit --lite: the baseline is not the merge-base's own, so a page it
|
|
80416
|
+
lacks only warns
|
|
80417
|
+
--require-sampled affected: fail when the diff adds or changes a route file (App Router
|
|
80418
|
+
page.*, pages/\u2026, +page.svelte) no sample page declares in its sources and
|
|
80419
|
+
sample.exempt does not exempt
|
|
80343
80420
|
--write-baseline <file> audit --lite: write the render baseline of this run
|
|
80344
80421
|
--fail-on <sev> audit/init: gate severity \u2014 blocking|major|minor (fr aliases accepted) (default: blocking)
|
|
80345
80422
|
--hook init: write a git pre-commit accessibility gate (staged snapshot + auto-fix by default)
|
|
@@ -80641,6 +80718,11 @@ function valueFlagsFor(command) {
|
|
|
80641
80718
|
var BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
|
|
80642
80719
|
// `audit --lite`: the rendered regression gate (src/lite.ts).
|
|
80643
80720
|
"lite",
|
|
80721
|
+
// `audit --lite --baseline-approximate`: the baseline is not the merge-base's own (a closest
|
|
80722
|
+
// cache entry), so a page it lacks may not be this change's — warn instead of gating it.
|
|
80723
|
+
"baseline-approximate",
|
|
80724
|
+
// `affected --require-sampled`: fail on a changed route no sample page declares.
|
|
80725
|
+
"require-sampled",
|
|
80644
80726
|
// `verify --apply … --prune`: apply what the refutation trial decided to the audit, instead
|
|
80645
80727
|
// of only reporting it (src/refute.ts).
|
|
80646
80728
|
"prune",
|
|
@@ -81125,7 +81207,17 @@ async function cmdAuditLite(p) {
|
|
|
81125
81207
|
const findings = findingsForStandard(result, standard);
|
|
81126
81208
|
const writeTo = typeof p.flags["write-baseline"] === "string" && p.flags["write-baseline"] ? p.flags["write-baseline"] : void 0;
|
|
81127
81209
|
if (writeTo) {
|
|
81128
|
-
|
|
81210
|
+
let declared = [];
|
|
81211
|
+
try {
|
|
81212
|
+
declared = (loadConfig(root)?.sample?.pages ?? []).map((pg) => pg.id).filter((id) => typeof id === "string");
|
|
81213
|
+
} catch {
|
|
81214
|
+
}
|
|
81215
|
+
const asked = typeof p.flags.pages === "string" ? p.flags.pages.split(/[\s,]+/).filter(Boolean) : [];
|
|
81216
|
+
const baseline2 = buildRenderBaseline(findings, selected, standard, void 0, [...asked, ...declared]);
|
|
81217
|
+
if (baseline2.skipped?.length)
|
|
81218
|
+
warnings.push(
|
|
81219
|
+
lang === "fr" ? `baseline \xE9crite sans ${baseline2.skipped.length} page(s) d\xE9clar\xE9e(s) faute d'instantan\xE9 (${baseline2.skipped.join(", ")}) : elles ne seront pas jug\xE9es nouvelles.` : `baseline written without ${baseline2.skipped.length} declared page(s) that left no snapshot (${baseline2.skipped.join(", ")}): they will not be judged new.`
|
|
81220
|
+
);
|
|
81129
81221
|
mkdirSync20(dirname22(writeTo), { recursive: true });
|
|
81130
81222
|
writeFileSync23(writeTo, `${JSON.stringify(baseline2, null, 2)}
|
|
81131
81223
|
`);
|
|
@@ -81144,7 +81236,7 @@ async function cmdAuditLite(p) {
|
|
|
81144
81236
|
}
|
|
81145
81237
|
}
|
|
81146
81238
|
const gating = baselineFlag !== void 0;
|
|
81147
|
-
const diff = diffRenderBaseline(findings, selected, baseline, failOn);
|
|
81239
|
+
const diff = diffRenderBaseline(findings, selected, baseline, failOn, void 0, { approximate: p.flags["baseline-approximate"] === true });
|
|
81148
81240
|
warnings.push(...gating ? renderDiffWarnings(diff, lang) : []);
|
|
81149
81241
|
if (!selected.length) warnings.push(lang === "fr" ? `aucun instantan\xE9 de page \xE0 auditer sous ${pagesDir}.` : `no page snapshot to audit under ${pagesDir}.`);
|
|
81150
81242
|
const reported = gating ? diff.newFindings : gatedFindings(findings);
|
|
@@ -81217,7 +81309,7 @@ function cmdAffected(p) {
|
|
|
81217
81309
|
}
|
|
81218
81310
|
if (every) {
|
|
81219
81311
|
const pages = v.sample.pages.map((pg) => pg.id);
|
|
81220
|
-
const r2 = { pages, all: true, none: pages.length === 0, unmapped: [], global: [], reasons: {}, unsourced: [], changed: 0 };
|
|
81312
|
+
const r2 = { pages, all: true, none: pages.length === 0, unmapped: [], global: [], reasons: {}, unsourced: [], unsampled: [], changed: 0 };
|
|
81221
81313
|
if (p.flags.json) console.log(JSON.stringify(r2, null, 2));
|
|
81222
81314
|
else console.log(lang === "fr" ? `Toutes les pages (${pages.length}).` : `Every page (${pages.length}).`);
|
|
81223
81315
|
return 0;
|
|
@@ -81229,12 +81321,19 @@ function cmdAffected(p) {
|
|
|
81229
81321
|
console.error(`ultra11y affected: ${e instanceof Error ? e.message : String(e)}`);
|
|
81230
81322
|
return 2;
|
|
81231
81323
|
}
|
|
81232
|
-
const r = selectAffected({ root, pages: v.sample.pages, global: v.sample.global, changed: changed.files });
|
|
81324
|
+
const r = selectAffected({ root, pages: v.sample.pages, global: v.sample.global, exempt: v.sample.exempt?.map((e) => e.path), changed: changed.files });
|
|
81325
|
+
const fr = lang === "fr";
|
|
81326
|
+
const requireSampled = p.flags["require-sampled"] === true;
|
|
81327
|
+
const unsampledMessage = r.unsampled.length ? fr ? `route(s) ajout\xE9e(s) ou modifi\xE9e(s) qu'aucune page de l'\xE9chantillon ne d\xE9clare : ${r.unsampled.join(", ")} \u2014 d\xE9clarez la page dans \`sample.pages\` (avec ses \`sources\`), ou exemptez-la dans \`sample.exempt\` avec sa raison.` : `route(s) added or changed that no sample page declares: ${r.unsampled.join(", ")} \u2014 declare the page in \`sample.pages\` (with its \`sources\`), or exempt it in \`sample.exempt\` with a reason.` : "";
|
|
81328
|
+
const sampledVerdict = () => {
|
|
81329
|
+
if (!unsampledMessage) return 0;
|
|
81330
|
+
console.error(`${requireSampled ? "\u2717" : "\u26A0"} ${unsampledMessage}`);
|
|
81331
|
+
return requireSampled ? 1 : 0;
|
|
81332
|
+
};
|
|
81233
81333
|
if (p.flags.json) {
|
|
81234
81334
|
console.log(JSON.stringify({ since, mergeBase: changed.mergeBase, ...r }, null, 2));
|
|
81235
|
-
return
|
|
81335
|
+
return sampledVerdict();
|
|
81236
81336
|
}
|
|
81237
|
-
const fr = lang === "fr";
|
|
81238
81337
|
if (r.all)
|
|
81239
81338
|
console.log(
|
|
81240
81339
|
fr ? `Toutes les pages (${r.pages.length}) : fichier(s) global(aux) touch\xE9(s) \u2014 ${r.global.join(", ")}.` : `Every page (${r.pages.length}): global file(s) touched \u2014 ${r.global.join(", ")}.`
|
|
@@ -81252,7 +81351,7 @@ function cmdAffected(p) {
|
|
|
81252
81351
|
console.error(
|
|
81253
81352
|
fr ? `\u26A0 page(s) sans \`sources\`, s\xE9lectionn\xE9e(s) seulement par un fichier global : ${r.unsourced.join(", ")}` : `\u26A0 page(s) declaring no \`sources\`, selected only by a global file: ${r.unsourced.join(", ")}`
|
|
81254
81353
|
);
|
|
81255
|
-
return
|
|
81354
|
+
return sampledVerdict();
|
|
81256
81355
|
}
|
|
81257
81356
|
async function cmdDev(p) {
|
|
81258
81357
|
const root = typeof p.flags.root === "string" && p.flags.root ? p.flags.root : ".";
|
|
@@ -3,7 +3,7 @@ name: review-a11y
|
|
|
3
3
|
description: "Use to REVIEW changed frontend code for accessibility: staged files, a working diff, branch, or PR; prompts such as 'review a11y', 'is this accessible?', or 'anything to fix before merge?'; and hook or CI findings on a change. Run the bundled install-free engine with cross-file JSX/TSX analysis, then adjudicate candidates and return a severity-ranked WCAG 2.2 AA review with file:line fixes, residual rendering risks, and a verdict. Use `ultra11y` instead for whole-repo audits, dated conformance reports, country standards, PRD backlogs, or authoring accessible markup."
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: 5.58.
|
|
6
|
+
version: 5.58.1
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# review-a11y — accessibility review of changed code
|