ultra11y 5.48.0 → 5.49.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 +1 -1
- package/package.json +1 -1
- package/scripts/build-guidance-wcag.mjs +2 -1
- package/scripts/build-standards.mjs +5 -3
- package/scripts/ultra11y.mjs +77 -22
- package/scripts/vendor-stamp.d.mts +6 -0
- package/scripts/vendor-stamp.mjs +36 -0
- package/skills/review-a11y/SKILL.md +1 -1
- package/skills/review-a11y/scripts/ultra11y.mjs +77 -22
- package/skills/ultra11y/SKILL.md +1 -1
- package/skills/ultra11y/references/dynamic.md +10 -0
- package/skills/ultra11y/scripts/ultra11y.mjs +77 -22
- package/skills/ultra11y/templates/gitlab-ci.yml +1 -1
- package/src/cli.ts +27 -7
- package/src/ledger.ts +26 -3
- package/src/mcp/handlers.ts +11 -4
- package/src/mcp/tools.ts +8 -1
- package/src/scan-local.ts +66 -8
- package/src/types.ts +1 -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.
|
|
13
|
+
"version": "5.49.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.
|
|
4
|
+
"version": "5.49.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.
|
|
4
|
+
"version": "5.49.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",
|
|
@@ -27,7 +27,7 @@ import { fileURLToPath } from "node:url";
|
|
|
27
27
|
// Ownership marker: `ultra11y install --opencode` refuses to overwrite a plugin file that
|
|
28
28
|
// does not carry it, so a user's own ultra11y.js is never clobbered.
|
|
29
29
|
const ULTRA11Y_OPENCODE_PLUGIN = "ULTRA11Y_OPENCODE_PLUGIN";
|
|
30
|
-
const ULTRA11Y_PLUGIN_VERSION = "5.
|
|
30
|
+
const ULTRA11Y_PLUGIN_VERSION = "5.49.1";
|
|
31
31
|
|
|
32
32
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
33
33
|
|
package/README.md
CHANGED
|
@@ -517,7 +517,7 @@ node scripts/ultra11y.mjs scan http://localhost:3000 --runtime local --cwd . --m
|
|
|
517
517
|
node scripts/ultra11y.mjs report --in audits/audit-latest.json --out audits
|
|
518
518
|
```
|
|
519
519
|
|
|
520
|
-
Only the Docker runtime needs Docker. `--runtime local` needs a Chromium binary (`npx playwright install chromium`) plus `@playwright/test` and `@axe-core/playwright` — which **come with the npm package**, since they are its own dependencies; the audited project's own copies take precedence when it has them. Running the engine as a **standalone skill bundle** is the exception: an installed skill has no `node_modules` beside it, so there the two packages must be in the audited project, reachable from `--cwd`. The engine bundle itself stays dependency-free either way. The Docker runner + Dockerfile are embedded in the engine and mirrored under `docker/` (with a `docker-compose.yml`). See `skills/ultra11y/references/dynamic.md`.
|
|
520
|
+
Only the Docker runtime needs Docker. `--runtime local` needs a Chromium binary (`npx playwright install chromium`, or one already on the machine named with `--browser-path /usr/bin/chromium` / `ULTRA11Y_BROWSER_PATH` — launched as given, never replaced by a fallback) plus `@playwright/test` and `@axe-core/playwright` — which **come with the npm package**, since they are its own dependencies; the audited project's own copies take precedence when it has them. Running the engine as a **standalone skill bundle** is the exception: an installed skill has no `node_modules` beside it, so there the two packages must be in the audited project, reachable from `--cwd`. The engine bundle itself stays dependency-free either way. The Docker runner + Dockerfile are embedded in the engine and mirrored under `docker/` (with a `docker-compose.yml`). See `skills/ultra11y/references/dynamic.md`.
|
|
521
521
|
|
|
522
522
|
Typical audit flow:
|
|
523
523
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultra11y",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.49.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",
|
|
@@ -31,6 +31,7 @@ import { execFileSync } from "node:child_process";
|
|
|
31
31
|
import { dirname, join } from "node:path";
|
|
32
32
|
import { fileURLToPath } from "node:url";
|
|
33
33
|
import { tmpdir } from "node:os";
|
|
34
|
+
import { withPreviousStamp } from "./vendor-stamp.mjs";
|
|
34
35
|
|
|
35
36
|
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
36
37
|
const VENDOR = join(root, "scripts", "vendor", "wcag-2.2-techniques.json");
|
|
@@ -246,7 +247,7 @@ async function refresh() {
|
|
|
246
247
|
criteria,
|
|
247
248
|
};
|
|
248
249
|
mkdirSync(dirname(VENDOR), { recursive: true });
|
|
249
|
-
writeFileSync(VENDOR, JSON.stringify(out, null, 2) + "\n");
|
|
250
|
+
writeFileSync(VENDOR, JSON.stringify(withPreviousStamp(VENDOR, out), null, 2) + "\n");
|
|
250
251
|
const withGood = Object.values(criteria).filter((x) => x.good).length;
|
|
251
252
|
const withBad = Object.values(criteria).filter((x) => x.bad).length;
|
|
252
253
|
const withBrief = Object.values(criteria).filter((x) => x.brief).length;
|
|
@@ -20,6 +20,7 @@ import { writeFileSync, readFileSync, readdirSync, existsSync, mkdirSync } from
|
|
|
20
20
|
import { execFileSync } from "node:child_process";
|
|
21
21
|
import { dirname, join } from "node:path";
|
|
22
22
|
import { fileURLToPath } from "node:url";
|
|
23
|
+
import { sameButForTheDate, withPreviousStamp } from "./vendor-stamp.mjs";
|
|
23
24
|
|
|
24
25
|
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
25
26
|
const DATA = join(root, "src", "data");
|
|
@@ -228,7 +229,8 @@ async function deriveUniverse() {
|
|
|
228
229
|
criteria,
|
|
229
230
|
};
|
|
230
231
|
mkdirSync(dirname(VENDOR_UNIVERSE), { recursive: true });
|
|
231
|
-
|
|
232
|
+
// The dated provenance sentence is the stamp here: kept as committed when the universe is unchanged.
|
|
233
|
+
writeFileSync(VENDOR_UNIVERSE, JSON.stringify(withPreviousStamp(VENDOR_UNIVERSE, universe, { stamp: "provenance", sameStamp: sameButForTheDate }), null, 2) + "\n");
|
|
232
234
|
console.log(`build-standards --refresh-universe: ${criteria.length} SCs (all levels) derived → ${VENDOR_UNIVERSE}`);
|
|
233
235
|
return universe;
|
|
234
236
|
}
|
|
@@ -414,7 +416,7 @@ async function deriveFr() {
|
|
|
414
416
|
glossary,
|
|
415
417
|
};
|
|
416
418
|
mkdirSync(dirname(VENDOR_FR), { recursive: true });
|
|
417
|
-
writeFileSync(VENDOR_FR, JSON.stringify(out, null, 2) + "\n");
|
|
419
|
+
writeFileSync(VENDOR_FR, JSON.stringify(withPreviousStamp(VENDOR_FR, out), null, 2) + "\n");
|
|
418
420
|
console.log(
|
|
419
421
|
`build-standards --refresh-fr: ${Object.keys(criteria).length} SC + ${Object.keys(guidelines).length} guideline + ${Object.keys(principles).length} principle French titles, ` +
|
|
420
422
|
`${Object.keys(criteriaText).length} SC bodies, ${Object.keys(glossary).length} glossary terms → ${VENDOR_FR}`,
|
|
@@ -608,7 +610,7 @@ async function deriveText() {
|
|
|
608
610
|
glossary,
|
|
609
611
|
};
|
|
610
612
|
mkdirSync(dirname(VENDOR_TEXT), { recursive: true });
|
|
611
|
-
writeFileSync(VENDOR_TEXT, JSON.stringify(out, null, 2) + "\n");
|
|
613
|
+
writeFileSync(VENDOR_TEXT, JSON.stringify(withPreviousStamp(VENDOR_TEXT, out), null, 2) + "\n");
|
|
612
614
|
console.log(`build-standards --refresh-text: ${Object.keys(criteria).length} SC texts + ${Object.keys(glossary).length} glossary terms → ${VENDOR_TEXT}`);
|
|
613
615
|
return out;
|
|
614
616
|
}
|
package/scripts/ultra11y.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { join as join53, relative as relative6, resolve as resolve17, sep as sep
|
|
|
6
6
|
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL3 } from "url";
|
|
7
7
|
|
|
8
8
|
// src/types.ts
|
|
9
|
-
var VERSION = "5.
|
|
9
|
+
var VERSION = "5.49.1";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
var INAPPLICABLE_STATUS = "C";
|
|
12
12
|
|
|
@@ -66581,6 +66581,9 @@ var canonicalFile2 = (file) => {
|
|
|
66581
66581
|
const at = posix3.lastIndexOf(marker);
|
|
66582
66582
|
return at >= 0 ? posix3.slice(at) : posix3;
|
|
66583
66583
|
};
|
|
66584
|
+
function portableFile(file) {
|
|
66585
|
+
return canonicalFile2(file.replace(/\\/g, "/"));
|
|
66586
|
+
}
|
|
66584
66587
|
var anchorKey2 = (e) => {
|
|
66585
66588
|
const file = canonicalFile2(e.file);
|
|
66586
66589
|
let snippet2 = norm3(e.snippet ?? "");
|
|
@@ -66685,8 +66688,10 @@ function writeLedger(path, ledger) {
|
|
|
66685
66688
|
}
|
|
66686
66689
|
function entriesFrom(adj, accepted, date) {
|
|
66687
66690
|
const out2 = [];
|
|
66691
|
+
const portable = (xs) => xs.map((x) => typeof x.file === "string" ? { ...x, file: portableFile(x.file) } : x);
|
|
66688
66692
|
for (const it of adj.items) {
|
|
66689
66693
|
if (!accepted.has(it.criteriaId) || it.verdict === null) continue;
|
|
66694
|
+
const citations = (it.citations ?? []).map(readCitation).filter((c2) => c2 !== null);
|
|
66690
66695
|
out2.push({
|
|
66691
66696
|
criteriaId: it.criteriaId,
|
|
66692
66697
|
verdict: it.verdict,
|
|
@@ -66694,9 +66699,9 @@ function entriesFrom(adj, accepted, date) {
|
|
|
66694
66699
|
...it.reason ? { reason: it.reason } : {},
|
|
66695
66700
|
// Normalised here too: a citation may have arrived as a bare "file:line" string, and a
|
|
66696
66701
|
// ledger entry has to hold the object form so a replay can re-anchor and re-ground it.
|
|
66697
|
-
...
|
|
66698
|
-
...it.findings?.length ? { findings: it.findings } : {},
|
|
66699
|
-
...it.recommendations?.length ? { recommendations: it.recommendations } : {},
|
|
66702
|
+
...citations.length ? { citations: portable(citations) } : {},
|
|
66703
|
+
...it.findings?.length ? { findings: portable(it.findings) } : {},
|
|
66704
|
+
...it.recommendations?.length ? { recommendations: portable(it.recommendations) } : {},
|
|
66700
66705
|
evidenceFingerprint: evidenceFingerprint(it.evidence),
|
|
66701
66706
|
evidenceAnchors: evidenceAnchorsOf(it.evidence),
|
|
66702
66707
|
evidenceFiles: evidenceFilesOf(it.evidence),
|
|
@@ -68412,12 +68417,30 @@ function resolvesRuntime(cwd, spec) {
|
|
|
68412
68417
|
}
|
|
68413
68418
|
});
|
|
68414
68419
|
}
|
|
68415
|
-
|
|
68420
|
+
var BROWSER_PATH_SOURCES = "--browser-path / ULTRA11Y_BROWSER_PATH";
|
|
68421
|
+
function localTierStatus(cwd, choice = {}) {
|
|
68416
68422
|
for (const spec of [PW_SPEC, AXE_SPEC]) {
|
|
68417
68423
|
if (!resolvesRuntime(cwd, spec)) {
|
|
68418
68424
|
return { ok: false, reason: `${spec} resolves neither from ${cwd} nor from ultra11y itself` };
|
|
68419
68425
|
}
|
|
68420
68426
|
}
|
|
68427
|
+
if (choice.browserPath) {
|
|
68428
|
+
const executable = choice.browserPath;
|
|
68429
|
+
let isFile = false;
|
|
68430
|
+
try {
|
|
68431
|
+
isFile = statSync15(executable).isFile();
|
|
68432
|
+
} catch {
|
|
68433
|
+
isFile = false;
|
|
68434
|
+
}
|
|
68435
|
+
if (!isFile) {
|
|
68436
|
+
return {
|
|
68437
|
+
ok: false,
|
|
68438
|
+
executable,
|
|
68439
|
+
reason: `no browser binary at ${executable} (${BROWSER_PATH_SOURCES}) \u2014 install a browser there, or drop the path to let Playwright resolve its own`
|
|
68440
|
+
};
|
|
68441
|
+
}
|
|
68442
|
+
return { ok: true, executable };
|
|
68443
|
+
}
|
|
68421
68444
|
try {
|
|
68422
68445
|
const pw = requireRuntime(cwd, PW_SPEC);
|
|
68423
68446
|
const bin = pw.chromium?.executablePath?.();
|
|
@@ -68434,8 +68457,8 @@ function localTierStatus(cwd) {
|
|
|
68434
68457
|
return { ok: false, reason: `${PW_SPEC} failed to load: ${e.message.split("\n")[0]}` };
|
|
68435
68458
|
}
|
|
68436
68459
|
}
|
|
68437
|
-
function localAvailable(cwd) {
|
|
68438
|
-
return localTierStatus(cwd).ok;
|
|
68460
|
+
function localAvailable(cwd, choice = {}) {
|
|
68461
|
+
return localTierStatus(cwd, choice).ok;
|
|
68439
68462
|
}
|
|
68440
68463
|
function resolveLocalDeps(cwd) {
|
|
68441
68464
|
let chromium;
|
|
@@ -68482,8 +68505,18 @@ var realDir = (dir) => {
|
|
|
68482
68505
|
}
|
|
68483
68506
|
};
|
|
68484
68507
|
var MISSING_BROWSER = /Executable doesn'?t exist|playwright install|browserType\.launch/i;
|
|
68485
|
-
async function launchChromium(chromium, cwd = ".", warn = (m) => console.error(m)) {
|
|
68508
|
+
async function launchChromium(chromium, cwd = ".", warn = (m) => console.error(m), choice = {}) {
|
|
68486
68509
|
const args2 = ["--no-sandbox", "--disable-dev-shm-usage"];
|
|
68510
|
+
if (choice.browserPath) {
|
|
68511
|
+
try {
|
|
68512
|
+
return await chromium.launch({ args: args2, executablePath: choice.browserPath });
|
|
68513
|
+
} catch (e) {
|
|
68514
|
+
const msg2 = e instanceof Error ? e.message : String(e);
|
|
68515
|
+
throw new Error(
|
|
68516
|
+
`Could not launch the browser at ${choice.browserPath} (${BROWSER_PATH_SOURCES}): ${msg2.split("\n")[0]}. An explicit browser is never replaced by another \u2014 fix the path, or drop it to let Playwright resolve its own.`
|
|
68517
|
+
);
|
|
68518
|
+
}
|
|
68519
|
+
}
|
|
68487
68520
|
let first;
|
|
68488
68521
|
try {
|
|
68489
68522
|
return await chromium.launch({ args: args2 });
|
|
@@ -68849,7 +68882,7 @@ async function runScanLocal(opts) {
|
|
|
68849
68882
|
const lang = opts.lang ?? "en";
|
|
68850
68883
|
const interact = opts.interact !== false;
|
|
68851
68884
|
const { chromium, AxeBuilder } = resolveLocalDeps(opts.cwd);
|
|
68852
|
-
const browser = await launchChromium(chromium, opts.cwd);
|
|
68885
|
+
const browser = await launchChromium(chromium, opts.cwd, void 0, { browserPath: opts.browserPath });
|
|
68853
68886
|
try {
|
|
68854
68887
|
const out2 = await runOnPage(browser, AxeBuilder, opts.target, isFile, {
|
|
68855
68888
|
storageState: opts.storageState,
|
|
@@ -68868,7 +68901,7 @@ async function runScanManyLocal(urls, opts) {
|
|
|
68868
68901
|
const lang = opts.lang ?? "en";
|
|
68869
68902
|
const interact = opts.interact !== false;
|
|
68870
68903
|
const { chromium, AxeBuilder } = resolveLocalDeps(opts.cwd);
|
|
68871
|
-
const browser = await launchChromium(chromium, opts.cwd);
|
|
68904
|
+
const browser = await launchChromium(chromium, opts.cwd, void 0, { browserPath: opts.browserPath });
|
|
68872
68905
|
const findings = [];
|
|
68873
68906
|
const snapshots = [];
|
|
68874
68907
|
const outs = [];
|
|
@@ -68929,7 +68962,7 @@ async function runSampleScanLocal(pages, opts) {
|
|
|
68929
68962
|
const lang = opts.lang ?? "en";
|
|
68930
68963
|
const interact = opts.interact !== false;
|
|
68931
68964
|
const { chromium, AxeBuilder } = resolveLocalDeps(opts.cwd);
|
|
68932
|
-
const browser = await launchChromium(chromium, opts.cwd);
|
|
68965
|
+
const browser = await launchChromium(chromium, opts.cwd, void 0, { browserPath: opts.browserPath });
|
|
68933
68966
|
const findings = [];
|
|
68934
68967
|
const snapshots = [];
|
|
68935
68968
|
const outs = [];
|
|
@@ -74159,12 +74192,14 @@ function handleFix(args2, cwd) {
|
|
|
74159
74192
|
process.chdir(prev);
|
|
74160
74193
|
}
|
|
74161
74194
|
}
|
|
74195
|
+
var FAIL_ON_ALIASES = { error: "blocking", warning: "major", notice: "minor" };
|
|
74196
|
+
var FAIL_ON_TOKENS = "blocking, major, minor (or bloquant, majeur, mineur; error/warning/notice as aliases)";
|
|
74162
74197
|
function handleInit(args2, cwd) {
|
|
74163
|
-
const failOnRaw = str2(args2.fail_on) ?? "
|
|
74164
|
-
|
|
74165
|
-
|
|
74198
|
+
const failOnRaw = str2(args2.fail_on) ?? "blocking";
|
|
74199
|
+
const failOn = parseFailOn(FAIL_ON_ALIASES[failOnRaw] ?? failOnRaw);
|
|
74200
|
+
if (failOn === null) {
|
|
74201
|
+
throw new ToolError(`\`fail_on\` must be one of: ${FAIL_ON_TOKENS} (got "${failOnRaw}")`);
|
|
74166
74202
|
}
|
|
74167
|
-
const failOn = failOnRaw;
|
|
74168
74203
|
const enginePath = resolve15("scripts/ultra11y.mjs");
|
|
74169
74204
|
const written = [];
|
|
74170
74205
|
if (bool(args2.hook)) written.push(writeHook(cwd, enginePath, failOn));
|
|
@@ -74651,7 +74686,14 @@ var WRITE_TOOLS = [
|
|
|
74651
74686
|
hook: { type: "boolean", description: "Install the git pre-commit hook." },
|
|
74652
74687
|
ci: { type: "boolean", description: "Install the CI workflow." },
|
|
74653
74688
|
baseline: { type: "boolean", description: "Record the current findings as the accepted baseline." },
|
|
74654
|
-
fail_on: {
|
|
74689
|
+
fail_on: {
|
|
74690
|
+
type: "string",
|
|
74691
|
+
// The CLI's own `--fail-on` vocabulary (English or French), which is what the
|
|
74692
|
+
// generated hook and workflow carry. The axe-style trio is kept as aliases:
|
|
74693
|
+
// error ⇒ blocking, warning ⇒ major, notice ⇒ minor.
|
|
74694
|
+
enum: ["blocking", "major", "minor", "bloquant", "majeur", "mineur", "error", "warning", "notice"],
|
|
74695
|
+
description: "Severity that fails the gate: blocking | major | minor (default blocking). error/warning/notice are accepted as aliases of the three."
|
|
74696
|
+
}
|
|
74655
74697
|
},
|
|
74656
74698
|
required: ["cwd"]
|
|
74657
74699
|
}
|
|
@@ -75904,6 +75946,9 @@ Options:
|
|
|
75904
75946
|
--docker scan: alias of --runtime docker (built on first use)
|
|
75905
75947
|
--cwd <dir> scan: --runtime local resolves @playwright/test + @axe-core/playwright
|
|
75906
75948
|
(and the browser) from here (e.g. --cwd packages/app)
|
|
75949
|
+
--browser-path <file> scan / status --browser: launch THIS browser executable (e.g. a
|
|
75950
|
+
distribution's /usr/bin/chromium) instead of the one Playwright resolves.
|
|
75951
|
+
Explicit: never replaced by a fallback. Env: ULTRA11Y_BROWSER_PATH
|
|
75907
75952
|
--storage-state <file> scan: --runtime local \u2014 Playwright storageState JSON for
|
|
75908
75953
|
authenticated pages (e.g. test-results/.auth/user.json)
|
|
75909
75954
|
--no-interact scan: --runtime local \u2014 disable the STATEFUL probes (fill inputs,
|
|
@@ -76063,6 +76108,9 @@ var VALUE_FLAGS2 = /* @__PURE__ */ new Set([
|
|
|
76063
76108
|
"guidance",
|
|
76064
76109
|
"runtime",
|
|
76065
76110
|
"cwd",
|
|
76111
|
+
// `scan` / `status --browser`: an explicit browser executable (a distribution's Chromium),
|
|
76112
|
+
// launched as given and never replaced by Playwright's fallbacks. Env: ULTRA11Y_BROWSER_PATH.
|
|
76113
|
+
"browser-path",
|
|
76066
76114
|
"storage-state",
|
|
76067
76115
|
"captures",
|
|
76068
76116
|
"run",
|
|
@@ -77008,9 +77056,14 @@ function reportInstall(results, verb) {
|
|
|
77008
77056
|
}
|
|
77009
77057
|
return failed2 ? 1 : 0;
|
|
77010
77058
|
}
|
|
77059
|
+
function browserPathOf(flags2, env = process.env) {
|
|
77060
|
+
if (typeof flags2["browser-path"] === "string" && flags2["browser-path"]) return flags2["browser-path"];
|
|
77061
|
+
const fromEnv = env.ULTRA11Y_BROWSER_PATH;
|
|
77062
|
+
return typeof fromEnv === "string" && fromEnv.trim() ? fromEnv.trim() : void 0;
|
|
77063
|
+
}
|
|
77011
77064
|
function cmdStatus(p) {
|
|
77012
77065
|
const rows = statusReport({ project: p.flags.project === true });
|
|
77013
|
-
const browser = p.flags.browser === true ? localTierStatus(typeof p.flags.cwd === "string" && p.flags.cwd ? p.flags.cwd : ".") : void 0;
|
|
77066
|
+
const browser = p.flags.browser === true ? localTierStatus(typeof p.flags.cwd === "string" && p.flags.cwd ? p.flags.cwd : ".", { browserPath: browserPathOf(p.flags) }) : void 0;
|
|
77014
77067
|
if (p.flags.json === true) {
|
|
77015
77068
|
console.log(JSON.stringify({ version: VERSION, targets: rows, ...browser ? { browser } : {} }, null, 2));
|
|
77016
77069
|
return 0;
|
|
@@ -78481,6 +78534,7 @@ async function cmdScan(p) {
|
|
|
78481
78534
|
}
|
|
78482
78535
|
const cwd = typeof p.flags.cwd === "string" && p.flags.cwd ? p.flags.cwd : process.cwd();
|
|
78483
78536
|
const storageState = typeof p.flags["storage-state"] === "string" && p.flags["storage-state"] ? p.flags["storage-state"] : void 0;
|
|
78537
|
+
const browserPath = browserPathOf(p.flags);
|
|
78484
78538
|
const runtimeFlag = typeof p.flags.runtime === "string" && p.flags.runtime ? p.flags.runtime : p.flags.local === true ? "local" : p.flags.docker === true ? "docker" : "auto";
|
|
78485
78539
|
if (!["auto", "local", "docker"].includes(runtimeFlag)) {
|
|
78486
78540
|
console.error(`ultra11y scan: --runtime must be local, docker, or auto (got "${runtimeFlag}").`);
|
|
@@ -78489,10 +78543,10 @@ async function cmdScan(p) {
|
|
|
78489
78543
|
let useLocal;
|
|
78490
78544
|
if (runtimeFlag === "local") useLocal = true;
|
|
78491
78545
|
else if (runtimeFlag === "docker") useLocal = false;
|
|
78492
|
-
else if (localAvailable(cwd)) useLocal = true;
|
|
78546
|
+
else if (localAvailable(cwd, { browserPath })) useLocal = true;
|
|
78493
78547
|
else if (dockerAvailable()) {
|
|
78494
78548
|
useLocal = false;
|
|
78495
|
-
const s = localTierStatus(cwd);
|
|
78549
|
+
const s = localTierStatus(cwd, { browserPath });
|
|
78496
78550
|
console.error(
|
|
78497
78551
|
lang === "fr" ? `ultra11y scan : tier local indisponible${s.ok ? "" : ` (${s.reason})`} \u2014 bascule sur Docker. Passez --runtime local pour en faire une erreur.` : `ultra11y scan: local tier unavailable${s.ok ? "" : ` (${s.reason})`} \u2014 falling back to Docker. Pass --runtime local to make this an error instead.`
|
|
78498
78552
|
);
|
|
@@ -78548,12 +78602,12 @@ async function cmdScan(p) {
|
|
|
78548
78602
|
let dynamic;
|
|
78549
78603
|
try {
|
|
78550
78604
|
if (useSample && sampleConfig) {
|
|
78551
|
-
dynamic = useLocal ? await runSampleScanLocal(sampleConfig.pages, { cwd, storageState, lang, interact, interactClicks, snapshotRoot }) : runSampleScan(sampleConfig.pages, void 0, snapshotRoot);
|
|
78605
|
+
dynamic = useLocal ? await runSampleScanLocal(sampleConfig.pages, { cwd, storageState, lang, interact, interactClicks, snapshotRoot, browserPath }) : runSampleScan(sampleConfig.pages, void 0, snapshotRoot);
|
|
78552
78606
|
} else if (sitemap || crawl) {
|
|
78553
78607
|
const depth = typeof p.flags.depth === "string" ? Number(p.flags.depth) : void 0;
|
|
78554
78608
|
const max = typeof p.flags.max === "string" ? Number(p.flags.max) : void 0;
|
|
78555
78609
|
const onPage = (url, n) => console.error(`ultra11y scan: page ${n} \u2014 ${url}`);
|
|
78556
|
-
dynamic = useLocal ? await runCrawlScanLocal({ sitemap, crawl, depth, max, onPage, cwd, storageState, lang, interact, interactClicks, snapshotRoot }) : await runCrawlScan({ sitemap, crawl, depth, max, onPage, snapshotRoot });
|
|
78610
|
+
dynamic = useLocal ? await runCrawlScanLocal({ sitemap, crawl, depth, max, onPage, cwd, storageState, lang, interact, interactClicks, snapshotRoot, browserPath }) : await runCrawlScan({ sitemap, crawl, depth, max, onPage, snapshotRoot });
|
|
78557
78611
|
} else {
|
|
78558
78612
|
const targets = p.positionals.filter((a) => a !== "-");
|
|
78559
78613
|
if (targets.length === 0) {
|
|
@@ -78561,7 +78615,7 @@ async function cmdScan(p) {
|
|
|
78561
78615
|
return 2;
|
|
78562
78616
|
}
|
|
78563
78617
|
if (useLocal) {
|
|
78564
|
-
dynamic = targets.length === 1 ? await runScanLocal({ target: targets[0], cwd, storageState, lang, interact, interactClicks, snapshotRoot }) : await runScanManyLocal(targets, { cwd, storageState, lang, interact, interactClicks, snapshotRoot });
|
|
78618
|
+
dynamic = targets.length === 1 ? await runScanLocal({ target: targets[0], cwd, storageState, lang, interact, interactClicks, snapshotRoot, browserPath }) : await runScanManyLocal(targets, { cwd, storageState, lang, interact, interactClicks, snapshotRoot, browserPath });
|
|
78565
78619
|
} else {
|
|
78566
78620
|
dynamic = targets.length === 1 ? runScan({ target: targets[0], snapshotRoot }) : runScanMany(targets, void 0, snapshotRoot);
|
|
78567
78621
|
}
|
|
@@ -79208,6 +79262,7 @@ if (isInvokedDirectly()) {
|
|
|
79208
79262
|
export {
|
|
79209
79263
|
COMMANDS,
|
|
79210
79264
|
REMOVED_FLAGS,
|
|
79265
|
+
browserPathOf,
|
|
79211
79266
|
main,
|
|
79212
79267
|
parseArgs,
|
|
79213
79268
|
scanSnapshotRoot
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const sameButForTheDate: (a: unknown, b: unknown) => boolean;
|
|
2
|
+
export declare function withPreviousStamp<T extends Record<string, unknown>>(
|
|
3
|
+
path: string,
|
|
4
|
+
next: T,
|
|
5
|
+
opts?: { stamp?: string; sameStamp?: (prev: unknown, next: unknown) => boolean },
|
|
6
|
+
): T;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// A vendored dataset carries the day it was fetched (`fetchedAt`, or a dated `provenance`
|
|
2
|
+
// sentence). Stamping it with TODAY on every refresh made the daily cron commit eight files a
|
|
3
|
+
// day — the four vendored sources and the engine bundles that embed them, three of 3.7 MB —
|
|
4
|
+
// for a one-line diff that said nothing had changed. A stamp is a fact about the DATA: it
|
|
5
|
+
// moves when the data moves, and stays put when a refresh fetched the same bytes again.
|
|
6
|
+
import { readFileSync } from "node:fs";
|
|
7
|
+
|
|
8
|
+
/** The stamp field, by default `fetchedAt` — a bare date. */
|
|
9
|
+
const DEFAULT_STAMP = "fetchedAt";
|
|
10
|
+
|
|
11
|
+
/** A dated sentence (the universe's `provenance`) is the same stamp when only its date differs. */
|
|
12
|
+
const DATE_RE = /\d{4}-\d{2}-\d{2}/g;
|
|
13
|
+
export const sameButForTheDate = (a, b) => typeof a === "string" && typeof b === "string" && a.replace(DATE_RE, "<date>") === b.replace(DATE_RE, "<date>");
|
|
14
|
+
|
|
15
|
+
/** Return `next` carrying the stamp the committed file at `path` already has, when everything
|
|
16
|
+
* BUT the stamp is identical to that file — so a refresh that fetched the same source again
|
|
17
|
+
* writes the same bytes again. Any difference in the data, a missing or unreadable file, or
|
|
18
|
+
* a stamp that is not merely re-dated (`sameStamp`), hands back `next` untouched.
|
|
19
|
+
*
|
|
20
|
+
* Identity is the serialised object minus the stamp, in the writer's own key order: the
|
|
21
|
+
* committed file was produced by the same writer, so a byte-level comparison is exact and
|
|
22
|
+
* needs no deep-equality rules of its own. */
|
|
23
|
+
export function withPreviousStamp(path, next, { stamp = DEFAULT_STAMP, sameStamp = () => true } = {}) {
|
|
24
|
+
if (!(stamp in next)) return next;
|
|
25
|
+
let prev;
|
|
26
|
+
try {
|
|
27
|
+
prev = JSON.parse(readFileSync(path, "utf8"));
|
|
28
|
+
} catch {
|
|
29
|
+
return next;
|
|
30
|
+
}
|
|
31
|
+
if (!prev || typeof prev !== "object" || !(stamp in prev)) return next;
|
|
32
|
+
if (!sameStamp(prev[stamp], next[stamp])) return next;
|
|
33
|
+
const strip = (o) => JSON.stringify(Object.fromEntries(Object.entries(o).filter(([k]) => k !== stamp)));
|
|
34
|
+
if (strip(prev) !== strip(next)) return next;
|
|
35
|
+
return { ...next, [stamp]: prev[stamp] };
|
|
36
|
+
}
|
|
@@ -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.
|
|
6
|
+
version: 5.49.1
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# review-a11y — accessibility review of changed code
|