eaa-kit 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -11
- package/dist/astro/index.d.ts +1 -1
- package/dist/astro/index.js +1 -1
- package/dist/audit/runners/worker.js +5 -1
- package/dist/audit-DK2StT1_.js +2 -0
- package/dist/{audit-CPoZMXGM.js → audit-e_uixhPG.js} +123 -54
- package/dist/baseline-BscHfFSW.js +2 -0
- package/dist/{baseline-DB9CZGnV.js → baseline-D2qWmUC6.js} +40 -12
- package/dist/checklist-BtgkxMEa.js +44 -0
- package/dist/cli/index.js +153 -25
- package/dist/{collect-CFM8gEVv.js → collect-Cu1q9NTB.js} +34 -3
- package/dist/command-CZKp9Wi_.js +251 -0
- package/dist/{remediation-Dtowi2EC.js → completeness-Dwq3CPB3.js} +61 -43
- package/dist/{component-C3GL1Mnu.js → component-ChisoFyY.js} +1 -1
- package/dist/{component-DKd3EHOg.js → component-DcCn3BJS.js} +1 -1
- package/dist/coverage-7bQqWNfN.js +2 -0
- package/dist/{coverage-B4IBKMO8.js → coverage-BD2_CYns.js} +46 -8
- package/dist/{crawl-BiI1Lau_.js → crawl-BHkJmUkA.js} +119 -11
- package/dist/eleventy/index.d.ts +1 -1
- package/dist/eleventy/index.js +1 -1
- package/dist/fingerprint-BjYV_0F7.js +67 -0
- package/dist/{html-BGTO3ypW.js → html-Bmh7X_sM.js} +52 -30
- package/dist/{impact-DZt2oBCP.js → impact-luGCnN8F.js} +11 -1
- package/dist/index.d.ts +187 -5
- package/dist/index.js +3 -3
- package/dist/{init-DIWDE35F.js → init-BjKYttxc.js} +10 -4
- package/dist/{jsdom-DCpGSLfW.js → jsdom-CQar6OQS.js} +12 -4
- package/dist/jsdom-DMvU2h-f.js +3 -0
- package/dist/{json-QQuFIw1W.js → json-HJDgJp09.js} +1 -1
- package/dist/{json-DjEvy1nX.js → json-PNg6BeXp.js} +13 -18
- package/dist/load-Bc_xDGAh.js +2 -0
- package/dist/{load-5wRGLvub.js → load-vZdV_fD1.js} +137 -8
- package/dist/nuxt/index.d.ts +1 -1
- package/dist/nuxt/index.js +1 -1
- package/dist/{playwright-BWniOain.js → playwright-C-miJP2b.js} +32 -7
- package/dist/{pool-BMevaLWD.js → pool-dkexq5xo.js} +52 -2
- package/dist/{render-DrvXRCEn.js → render-CtsqR0k-.js} +150 -11
- package/dist/{result-DoamKFsp.js → result-DfUru6y_.js} +60 -3
- package/dist/review-CdMK2GpQ.js +161 -0
- package/dist/review-DIbOTmOM.js +2 -0
- package/dist/{run-DB34BSOZ.js → run-D7hdVXLA.js} +1 -1
- package/dist/{run-BMASMmwO.d.ts → run-YiqyQA2b.d.ts} +17 -0
- package/dist/{sarif-SR3_lLYd.js → sarif-BKvq_AUm.js} +25 -14
- package/dist/{schema-is6CGX2D.js → schema-DJSF4K05.js} +15 -1
- package/dist/statement/templates/es.en.md +125 -0
- package/dist/statement/templates/es.es.md +127 -0
- package/dist/statement/templates/fr.en.md +128 -0
- package/dist/statement/templates/fr.fr.md +131 -0
- package/dist/statement/templates/it.en.md +127 -0
- package/dist/statement/templates/it.it.md +130 -0
- package/dist/statement/templates/nl.en.md +125 -0
- package/dist/statement/templates/nl.nl.md +127 -0
- package/dist/{text-CKKpzkYM.js → text-BF1LHMiV.js} +22 -2
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/webpack/index.d.ts +1 -1
- package/dist/webpack/index.js +1 -1
- package/dist/worksheet-eUjwYLxC.js +63 -0
- package/package.json +7 -3
- package/dist/audit-CpXH2Mk8.js +0 -2
- package/dist/baseline-22Y1NWxM.js +0 -2
- package/dist/command-D8l_oYbV.js +0 -77
- package/dist/fingerprint-DRoneAjj.js +0 -20
- package/dist/jsdom-4IMzv0eE.js +0 -3
package/dist/command-D8l_oYbV.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import pc from "picocolors";
|
|
4
|
-
//#region src/cli/command.ts
|
|
5
|
-
/**
|
|
6
|
-
* What every command does around the audit itself: say what is happening, run
|
|
7
|
-
* the engine, and put the document somewhere.
|
|
8
|
-
*
|
|
9
|
-
* `audit` and `baseline` are siblings — one reports what a run found and the
|
|
10
|
-
* other writes it down — so they take the same flags, choose between the same
|
|
11
|
-
* two engines and fail on the same setup problems. Keeping that in one place is
|
|
12
|
-
* what stops the two commands drifting into disagreeing about what a run is.
|
|
13
|
-
*/
|
|
14
|
-
/** Progress and diagnostics go to stderr, so the report can be piped away. */
|
|
15
|
-
function note(message) {
|
|
16
|
-
process.stderr.write(pc.dim(`${message}\n`));
|
|
17
|
-
}
|
|
18
|
-
function warn(message) {
|
|
19
|
-
process.stderr.write(`${pc.yellow("warning")} ${message}\n`);
|
|
20
|
-
}
|
|
21
|
-
function fail(message) {
|
|
22
|
-
process.stderr.write(`${pc.red("error")} ${message}\n`);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Advice the reader should not miss, without the `warning` prefix: nothing has
|
|
26
|
-
* gone wrong, but what happens next is theirs to get right.
|
|
27
|
-
*/
|
|
28
|
-
function advise(message) {
|
|
29
|
-
process.stderr.write(pc.yellow(`${message}\n`));
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Audit the pages with whichever engine was asked for.
|
|
33
|
-
*
|
|
34
|
-
* Returns undefined when the browser was asked for and is not usable, having
|
|
35
|
-
* already said so: Playwright missing is a setup problem with a specific fix,
|
|
36
|
-
* not a crash, and both commands turn it into exit 2.
|
|
37
|
-
*/
|
|
38
|
-
async function runEngine(pages, options) {
|
|
39
|
-
const runnerOptions = {
|
|
40
|
-
cwd: options.cwd,
|
|
41
|
-
...options.baseUrl === void 0 ? {} : { baseUrl: options.baseUrl },
|
|
42
|
-
...options.timeoutMs === void 0 ? {} : { timeoutMs: options.timeoutMs }
|
|
43
|
-
};
|
|
44
|
-
if (!options.browser) {
|
|
45
|
-
const { runPooledAudit } = await import("./pool-BMevaLWD.js");
|
|
46
|
-
return runPooledAudit(pages, {
|
|
47
|
-
...runnerOptions,
|
|
48
|
-
...options.concurrency === void 0 ? {} : { concurrency: options.concurrency }
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
const { BrowserUnavailableError, runBrowserAudit } = await import("./playwright-BWniOain.js");
|
|
52
|
-
try {
|
|
53
|
-
return await runBrowserAudit(options.directory, pages, runnerOptions);
|
|
54
|
-
} catch (cause) {
|
|
55
|
-
if (cause instanceof BrowserUnavailableError) {
|
|
56
|
-
fail(cause.message);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
throw cause;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Write a document to `output`, or to stdout when there is none. Parent
|
|
64
|
-
* directories are created, since a report path in CI usually names one that is
|
|
65
|
-
* not there yet.
|
|
66
|
-
*/
|
|
67
|
-
async function emitDocument(body, output, cwd) {
|
|
68
|
-
if (output === void 0) {
|
|
69
|
-
process.stdout.write(body);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const target = path.resolve(cwd, output);
|
|
73
|
-
await mkdir(path.dirname(target), { recursive: true });
|
|
74
|
-
await writeFile(target, body, "utf8");
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
export { runEngine as a, note as i, emitDocument as n, warn as o, fail as r, advise as t };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
//#region src/audit/fingerprint.ts
|
|
3
|
-
/**
|
|
4
|
-
* A stable identity for one violating element.
|
|
5
|
-
*
|
|
6
|
-
* Derived from the rule, the selector and the element's own markup, and
|
|
7
|
-
* deliberately not from the file it was found in. Two consumers need this and
|
|
8
|
-
* they need it to agree: SARIF, so that moving a page does not close one code
|
|
9
|
-
* scanning alert and open an identical one, and the baseline, so that an
|
|
10
|
-
* accepted violation stays accepted when the surrounding page changes.
|
|
11
|
-
*
|
|
12
|
-
* Sixteen hex characters. This identifies a defect for humans and tooling, not
|
|
13
|
-
* a secret, and a full digest in every entry would make a baseline file for a
|
|
14
|
-
* large site unreadable.
|
|
15
|
-
*/
|
|
16
|
-
function elementFingerprint(ruleId, selector, html) {
|
|
17
|
-
return createHash("sha256").update(`${ruleId}\n${selector}\n${html}`).digest("hex").slice(0, 16);
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
export { elementFingerprint as t };
|
package/dist/jsdom-4IMzv0eE.js
DELETED