eaa-kit 0.7.0 → 0.11.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 +182 -135
- package/dist/astro/index.d.ts +1 -3
- package/dist/astro/index.js +2 -3
- package/dist/audit/runners/worker.js +2 -3
- package/dist/{audit-DRjAY2iY.js → audit-DbqNIrt6.js} +85 -219
- package/dist/audit-rUhqnm3o.js +1 -0
- package/dist/{baseline-BpE7DbDq.js → baseline-CKElWbx4.js} +18 -8
- package/dist/baseline-DU0EPiTq.js +1 -0
- package/dist/baseline-DYOejLFO.js +1 -0
- package/dist/baseline-DvdsFTQy.js +126 -0
- package/dist/{cache-D4dOIuOi.js → cache-DIV4G0TI.js} +24 -5
- package/dist/{checklist-DDd9jewi.js → checklist-CA0Ri71Z.js} +8 -9
- package/dist/cli/index.js +115 -158
- package/dist/{collect-Cu1q9NTB.js → collect-CjucwTEF.js} +16 -8
- package/dist/{command-3r4fht5f.js → command-C8ZFvcc1.js} +33 -10
- package/dist/completeness-Cg-XIKWN.js +1 -0
- package/dist/completeness-Dzyvgr4Z.js +72 -0
- package/dist/component-CgbeRgJa.js +1 -0
- package/dist/{component-ChisoFyY.js → component-ZLd8DA_a.js} +3 -4
- package/dist/countries-B_PE6r5R.js +180 -0
- package/dist/countries-CCqog6dy.js +28 -0
- package/dist/coverage-B9_6yv_8.js +2 -0
- package/dist/{coverage-cb5kPp48.js → coverage-C1Z6t9Ct.js} +5 -7
- package/dist/{crawl-BHkJmUkA.js → crawl-CkHJJV4w.js} +135 -25
- package/dist/{criteria-CnPJKGeb.js → criteria-CacF0HP1.js} +1 -2
- package/dist/{load-BaWMa-G_.js → define-BdTPIfqE.js} +46 -99
- package/dist/detect-DnFHXpWh.js +49 -0
- package/dist/detect-oLDadgee.js +160 -0
- package/dist/doctor-q8IebwAb.js +248 -0
- package/dist/eleventy/index.d.ts +1 -3
- package/dist/eleventy/index.js +2 -3
- package/dist/entry-kf94P140.js +173 -0
- package/dist/{fingerprint-BjYV_0F7.js → fingerprint-CcoQ1WxQ.js} +1 -2
- package/dist/{frameworks-B4ClIJgE.js → frameworks-BboC8eNk.js} +234 -28
- package/dist/frameworks-Y-n3NUuG.js +1 -0
- package/dist/{fs-BmPtmFke.js → fs-tPD5r0wY.js} +1 -2
- package/dist/hosts-B48qR6Vt.js +19 -0
- package/dist/{html-BIxxF3FC.js → html-Bjq3Iw3g.js} +56 -14
- package/dist/{impact-luGCnN8F.js → impact-BGlJ6j0Y.js} +1 -2
- package/dist/{impact-EEB9ZXmC.d.ts → impact-CZjUloYC.d.ts} +0 -2
- package/dist/index.d.ts +50 -26
- package/dist/index.js +3 -2
- package/dist/init-3Ti3ao5Z.js +232 -0
- package/dist/issues-WLlepU95.js +120 -0
- package/dist/{jsdom-CsW_xVcA.js → jsdom-C4pLIMyP.js} +2 -3
- package/dist/jsdom-Zle--VQ1.js +2 -0
- package/dist/{json-Bus6YhxB.js → json-B_k4CDmR.js} +5 -6
- package/dist/json-IL1JxlTL.js +1 -0
- package/dist/load-C3eFEdoH.js +98 -0
- package/dist/load-oQQJPNlV.js +1 -0
- package/dist/markdown-D-QpPYsz.js +138 -0
- package/dist/next-8zDgH0nP.js +119 -0
- package/dist/nuxt/index.d.ts +1 -3
- package/dist/nuxt/index.js +2 -3
- package/dist/pages-CCP1WfYe.js +363 -0
- package/dist/{playwright-ukCr_5o3.js → playwright-ky4b_HME.js} +98 -16
- package/dist/{pool-B4tEUa2S.js → pool-B3XKdk57.js} +4 -5
- package/dist/project-B21NT_aX.js +502 -0
- package/dist/project-Dht13sb1.js +1 -0
- package/dist/{remediation-C0klJblu.js → remediation-BkE7q7dT.js} +2 -176
- package/dist/{render-C1sUZZI_.js → render-ky8cm4QF.js} +50 -24
- package/dist/result-DhoT4g0P.js +1 -0
- package/dist/{result-B7_zVxAX.js → result-g8dGsrcv.js} +1 -2
- package/dist/{review-CdMK2GpQ.js → review-BGjTBFvd.js} +11 -4
- package/dist/review-iheEjp7_.js +1 -0
- package/dist/{routes-CmdRUuOs.js → routes-BpQeBDmM.js} +4 -5
- package/dist/{run-DrS0Komf.js → run-D7tc7IU2.js} +2 -3
- package/dist/{run-BK2blxMI.d.ts → run-VXnP4uLp.d.ts} +2 -6
- package/dist/{sarif-BNCE0PNT.js → sarif-v66-PjdE.js} +9 -9
- package/dist/{schema-DJSF4K05.js → schema-DfC-Ww1w.js} +1 -2
- package/dist/setup-BYlqHlo0.js +2 -0
- package/dist/setup-Cf82ONw0.js +353 -0
- package/dist/shell-BdQYTaBQ.js +89 -0
- package/dist/site-CxVyh8IO.js +71 -0
- package/dist/start-bdanSxZr.js +100 -0
- package/dist/statement/templates/be.de.md +148 -0
- package/dist/statement/templates/be.en.md +142 -0
- package/dist/statement/templates/be.fr.md +146 -0
- package/dist/statement/templates/be.nl.md +147 -0
- package/dist/statement/templates/cz.cs.md +138 -0
- package/dist/statement/templates/cz.en.md +140 -0
- package/dist/statement/templates/dk.da.md +142 -0
- package/dist/statement/templates/dk.en.md +142 -0
- package/dist/statement/templates/fi.en.md +139 -0
- package/dist/statement/templates/fi.fi.md +141 -0
- package/dist/statement/templates/ie.en.md +144 -0
- package/dist/statement/templates/pl.en.md +143 -0
- package/dist/statement/templates/pl.pl.md +144 -0
- package/dist/statement/templates/pt.en.md +143 -0
- package/dist/statement/templates/pt.pt.md +145 -0
- package/dist/statement/templates/se.en.md +148 -0
- package/dist/statement/templates/se.sv.md +150 -0
- package/dist/{text-BF1LHMiV.js → text-CISDPU49.js} +11 -3
- package/dist/{version-B3v4rNoG.js → version-C8aJm8YJ.js} +1 -2
- package/dist/vite/index.d.ts +1 -3
- package/dist/vite/index.js +2 -3
- package/dist/watch-CefxwMsZ.js +121 -0
- package/dist/webpack/index.d.ts +1 -3
- package/dist/webpack/index.js +2 -3
- package/dist/{worksheet-BIxMtbUd.js → worksheet-CcBo9G7s.js} +4 -5
- package/dist/workspaces-BBFXOyeV.js +85 -0
- package/package.json +16 -14
- package/dist/audit-Bwm1xBdJ.js +0 -2
- package/dist/baseline-rtnj3RHB.js +0 -2
- package/dist/component-DcCn3BJS.js +0 -2
- package/dist/coverage-n1X9CkiG.js +0 -3
- package/dist/frameworks-etFg_O8K.js +0 -2
- package/dist/init-DrFfzjvm.js +0 -119
- package/dist/jsdom-BUYuVJJm.js +0 -3
- package/dist/json-CrQmoTj6.js +0 -2
- package/dist/load-n62iXDq_.js +0 -2
- package/dist/project-CzOnkLH6.js +0 -274
- package/dist/project-MFrXcw1M.js +0 -2
- package/dist/result-CRmjjoAA.js +0 -2
- package/dist/review-DIbOTmOM.js +0 -2
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { n as isDirectory } from "./fs-tPD5r0wY.js";
|
|
2
|
+
import { d as warn, l as note } from "./command-C8ZFvcc1.js";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import pc from "picocolors";
|
|
5
|
+
import { watch } from "node:fs";
|
|
6
|
+
// src/cli/watch.ts
|
|
7
|
+
const DEFAULT_DEBOUNCE_MS = 150;
|
|
8
|
+
const DEFAULT_POLL_MS = 1e3;
|
|
9
|
+
/**
|
|
10
|
+
* Run, then run again on every change, until the signal fires.
|
|
11
|
+
*
|
|
12
|
+
* Resolves with 0 once the watch is ended, or with 2 when there is nothing it
|
|
13
|
+
* could watch: a run that found its pages over HTTP, or found none at all with
|
|
14
|
+
* no directory named to wait for.
|
|
15
|
+
*/
|
|
16
|
+
async function watchAudit(options) {
|
|
17
|
+
const debounceMs = options.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
18
|
+
const pollMs = options.pollMs ?? DEFAULT_POLL_MS;
|
|
19
|
+
const watch = options.watch ?? nodeWatch;
|
|
20
|
+
const { signal, dispose } = stopSignal(options.signal);
|
|
21
|
+
const found = (await options.run(options.directory)).directory ?? options.directory;
|
|
22
|
+
if (found === void 0) {
|
|
23
|
+
dispose();
|
|
24
|
+
warn("--watch needs a build directory to watch, and this run did not read one. Name the directory, e.g. eaa-kit audit ./dist --watch.");
|
|
25
|
+
return 2;
|
|
26
|
+
}
|
|
27
|
+
const target = path.resolve(options.cwd, found);
|
|
28
|
+
const ignored = (options.ignore ?? []).map((entry) => path.resolve(options.cwd, entry));
|
|
29
|
+
let running;
|
|
30
|
+
let pending = false;
|
|
31
|
+
let timer;
|
|
32
|
+
let watcher;
|
|
33
|
+
let poller;
|
|
34
|
+
const runAgain = async () => {
|
|
35
|
+
do {
|
|
36
|
+
pending = false;
|
|
37
|
+
process.stderr.write(`\n${pc.dim(`─── ${(/* @__PURE__ */ new Date()).toLocaleTimeString()} ───`)}\n`);
|
|
38
|
+
await options.run(found);
|
|
39
|
+
} while (pending && !signal.aborted);
|
|
40
|
+
running = void 0;
|
|
41
|
+
if (!signal.aborted) waiting();
|
|
42
|
+
};
|
|
43
|
+
const schedule = () => {
|
|
44
|
+
if (signal.aborted) return;
|
|
45
|
+
if (running !== void 0) {
|
|
46
|
+
pending = true;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
clearTimeout(timer);
|
|
50
|
+
timer = setTimeout(() => {
|
|
51
|
+
running = runAgain();
|
|
52
|
+
}, debounceMs);
|
|
53
|
+
};
|
|
54
|
+
const isIgnored = (file) => {
|
|
55
|
+
if (file === null) return false;
|
|
56
|
+
const absolute = path.resolve(target, file);
|
|
57
|
+
return ignored.some((entry) => absolute === entry || absolute.startsWith(`${entry}${path.sep}`));
|
|
58
|
+
};
|
|
59
|
+
const arm = async () => {
|
|
60
|
+
if (signal.aborted) return;
|
|
61
|
+
if (!await isDirectory(target)) {
|
|
62
|
+
poller ??= setInterval(() => {
|
|
63
|
+
isDirectory(target).then((present) => {
|
|
64
|
+
if (!present || signal.aborted) return;
|
|
65
|
+
clearInterval(poller);
|
|
66
|
+
poller = void 0;
|
|
67
|
+
arm();
|
|
68
|
+
schedule();
|
|
69
|
+
});
|
|
70
|
+
}, pollMs);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
watcher = watch(target, (file) => {
|
|
74
|
+
if (!isIgnored(file)) schedule();
|
|
75
|
+
}, () => {
|
|
76
|
+
watcher?.close();
|
|
77
|
+
watcher = void 0;
|
|
78
|
+
arm();
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const waiting = () => {
|
|
82
|
+
note(`Watching ${path.relative(options.cwd, target) || "."} for changes. Ctrl-C to stop.`);
|
|
83
|
+
};
|
|
84
|
+
await arm();
|
|
85
|
+
waiting();
|
|
86
|
+
await new Promise((resolve) => {
|
|
87
|
+
if (signal.aborted) resolve();
|
|
88
|
+
else signal.addEventListener("abort", () => resolve(), { once: true });
|
|
89
|
+
});
|
|
90
|
+
clearTimeout(timer);
|
|
91
|
+
clearInterval(poller);
|
|
92
|
+
watcher?.close();
|
|
93
|
+
dispose();
|
|
94
|
+
await running;
|
|
95
|
+
return 0;
|
|
96
|
+
}
|
|
97
|
+
/** Recursive `fs.watch`, which Node supports on every platform this tool does. */
|
|
98
|
+
function nodeWatch(directory, onChange, onError) {
|
|
99
|
+
const watcher = watch(directory, { recursive: true }, (_event, file) => onChange(file === null ? null : String(file)));
|
|
100
|
+
watcher.on("error", onError);
|
|
101
|
+
return watcher;
|
|
102
|
+
}
|
|
103
|
+
/** The caller's signal, or one that Ctrl-C and SIGTERM fire. */
|
|
104
|
+
function stopSignal(given) {
|
|
105
|
+
if (given !== void 0) return {
|
|
106
|
+
signal: given,
|
|
107
|
+
dispose: () => {}
|
|
108
|
+
};
|
|
109
|
+
const controller = new AbortController();
|
|
110
|
+
const stop = () => controller.abort();
|
|
111
|
+
process.once("SIGINT", stop);
|
|
112
|
+
process.once("SIGTERM", stop);
|
|
113
|
+
return {
|
|
114
|
+
signal: controller.signal,
|
|
115
|
+
dispose: () => {
|
|
116
|
+
process.off("SIGINT", stop);
|
|
117
|
+
process.off("SIGTERM", stop);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export { watchAudit };
|
package/dist/webpack/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { n as IntegrationOptions, t as BuildAuditError } from "../run-
|
|
2
|
-
//#region src/webpack/index.d.ts
|
|
1
|
+
import { n as IntegrationOptions, t as BuildAuditError } from "../run-VXnP4uLp.js";
|
|
3
2
|
/** The part of a webpack compilation this reads. */
|
|
4
3
|
interface CompilationLike {
|
|
5
4
|
/** Non-empty when the build itself failed; there is nothing to audit then. */
|
|
@@ -29,5 +28,4 @@ declare class EaaKitWebpackPlugin {
|
|
|
29
28
|
constructor(options?: EaaKitWebpackOptions);
|
|
30
29
|
apply(compiler: CompilerLike): void;
|
|
31
30
|
}
|
|
32
|
-
//#endregion
|
|
33
31
|
export { BuildAuditError, CompilationLike, CompilerLike, EaaKitWebpackOptions, EaaKitWebpackPlugin as default };
|
package/dist/webpack/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as auditBuild, r as stderrLogger, t as BuildAuditError } from "../run-
|
|
1
|
+
import { n as auditBuild, r as stderrLogger, t as BuildAuditError } from "../run-D7tc7IU2.js";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
|
|
3
|
+
// src/webpack/index.ts
|
|
4
4
|
var EaaKitWebpackPlugin = class {
|
|
5
5
|
options;
|
|
6
6
|
constructor(options = {}) {
|
|
@@ -16,5 +16,4 @@ var EaaKitWebpackPlugin = class {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { BuildAuditError, EaaKitWebpackPlugin as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as WCAG22_AA_CRITERIA } from "./criteria-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { t as WCAG22_AA_CRITERIA } from "./criteria-CacF0HP1.js";
|
|
2
|
+
import { a as manualCheckFor, i as rulesByCriterion, o as understandingUrl } from "./coverage-C1Z6t9Ct.js";
|
|
3
|
+
import { n as DEFAULT_TAGS } from "./result-g8dGsrcv.js";
|
|
4
|
+
// src/audit/worksheet.ts
|
|
5
5
|
function buildWorksheet(options) {
|
|
6
6
|
const rules = rulesByCriterion(options.tags ?? DEFAULT_TAGS);
|
|
7
7
|
const unautomatable = WCAG22_AA_CRITERIA.filter((criterion) => (rules.get(criterion.number) ?? []).length === 0);
|
|
@@ -60,5 +60,4 @@ function criterionEntry(criterion, rules, review) {
|
|
|
60
60
|
lines.push("");
|
|
61
61
|
return lines;
|
|
62
62
|
}
|
|
63
|
-
//#endregion
|
|
64
63
|
export { buildWorksheet };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { i as toPosix, t as exists } from "./fs-tPD5r0wY.js";
|
|
2
|
+
import { i as detectFramework } from "./frameworks-BboC8eNk.js";
|
|
3
|
+
import { o as readPackageJson } from "./project-B21NT_aX.js";
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { glob } from "tinyglobby";
|
|
7
|
+
// src/audit/workspaces.ts
|
|
8
|
+
/** Where Turborepo and Nx put things by convention, when nothing else says. */
|
|
9
|
+
const CONVENTIONAL = ["apps/*", "packages/*"];
|
|
10
|
+
/** Undefined when `root` is not the root of a workspace. */
|
|
11
|
+
async function findWorkspaceSites(root) {
|
|
12
|
+
const listed = await workspaceGlobs(root);
|
|
13
|
+
if (listed === void 0) return void 0;
|
|
14
|
+
const trim = (pattern) => pattern.replace(/^!/, "").replace(/\/$/, "");
|
|
15
|
+
const included = listed.globs.filter((pattern) => !pattern.startsWith("!"));
|
|
16
|
+
const excluded = listed.globs.filter((pattern) => pattern.startsWith("!"));
|
|
17
|
+
const manifests = await glob(included.map((pattern) => `${trim(pattern)}/package.json`), {
|
|
18
|
+
cwd: root,
|
|
19
|
+
ignore: ["**/node_modules/**", ...excluded.flatMap((pattern) => [`${trim(pattern)}/package.json`, `${trim(pattern)}/**`])],
|
|
20
|
+
onlyFiles: true,
|
|
21
|
+
dot: false
|
|
22
|
+
});
|
|
23
|
+
const sites = [];
|
|
24
|
+
for (const manifest of manifests.sort()) {
|
|
25
|
+
const dir = path.dirname(manifest);
|
|
26
|
+
if (dir === ".") continue;
|
|
27
|
+
const absolute = path.join(root, dir);
|
|
28
|
+
const framework = await detectFramework(absolute, await readPackageJson(absolute));
|
|
29
|
+
if (framework === void 0) continue;
|
|
30
|
+
if (framework.framework.id === "vite" && !await exists(path.join(absolute, "index.html"))) continue;
|
|
31
|
+
sites.push({
|
|
32
|
+
dir: toPosix(dir),
|
|
33
|
+
framework
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
evidence: listed.evidence,
|
|
38
|
+
sites
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async function workspaceGlobs(root) {
|
|
42
|
+
const pnpm = await readText(path.join(root, "pnpm-workspace.yaml"));
|
|
43
|
+
if (pnpm !== void 0) return {
|
|
44
|
+
evidence: "pnpm-workspace.yaml",
|
|
45
|
+
globs: yamlPackages(pnpm)
|
|
46
|
+
};
|
|
47
|
+
const pkg = await readPackageJson(root);
|
|
48
|
+
const workspaces = Array.isArray(pkg?.workspaces) ? pkg.workspaces : pkg?.workspaces?.packages;
|
|
49
|
+
if (workspaces !== void 0 && workspaces.length > 0) return {
|
|
50
|
+
evidence: "package.json workspaces",
|
|
51
|
+
globs: workspaces
|
|
52
|
+
};
|
|
53
|
+
const lerna = await readText(path.join(root, "lerna.json"));
|
|
54
|
+
if (lerna !== void 0) try {
|
|
55
|
+
return {
|
|
56
|
+
evidence: "lerna.json",
|
|
57
|
+
globs: JSON.parse(lerna).packages ?? CONVENTIONAL
|
|
58
|
+
};
|
|
59
|
+
} catch {
|
|
60
|
+
return {
|
|
61
|
+
evidence: "lerna.json",
|
|
62
|
+
globs: CONVENTIONAL
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
for (const marker of ["turbo.json", "nx.json"]) if (await exists(path.join(root, marker))) return {
|
|
66
|
+
evidence: marker,
|
|
67
|
+
globs: CONVENTIONAL
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The `packages:` list out of pnpm-workspace.yaml, read with a pattern. It is a
|
|
72
|
+
* list of strings, and a YAML parser would be a dependency for one list.
|
|
73
|
+
* Negated entries are kept: they are exclusions, applied when scanning.
|
|
74
|
+
*/
|
|
75
|
+
function yamlPackages(source) {
|
|
76
|
+
return [...(/^packages:\s*\n((?:[ \t]*(?:-.*|#.*)?\n?)*)/m.exec(source)?.[1] ?? "").matchAll(/^[ \t]*-[ \t]*['"]?([^'"\n#]+?)['"]?[ \t]*(?:#.*)?$/gm)].map((match) => match[1] ?? "").filter((entry) => entry !== "");
|
|
77
|
+
}
|
|
78
|
+
async function readText(file) {
|
|
79
|
+
try {
|
|
80
|
+
return await readFile(file, "utf8");
|
|
81
|
+
} catch {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export { findWorkspaceSites };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eaa-kit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "WCAG 2.2 AA auditor and EU accessibility statement generator for
|
|
3
|
+
"version": "0.11.0",
|
|
4
|
+
"description": "WCAG 2.2 AA auditor and EU accessibility statement generator for fifteen countries (AT, BE, CH, CZ, DE, DK, ES, FI, FR, IE, IT, NL, PL, PT, SE). Audits a static build or a running site from the command line.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -82,7 +82,8 @@
|
|
|
82
82
|
"smoke": "pnpm build && node dist/cli/index.js audit tests/fixtures/site --include about/** --format json && node dist/cli/index.js audit tests/fixtures/site --include \"about/**\" \"blog/**\" \"drafts/**\" \"legacy.htm\" --concurrency 2 && node dist/cli/index.js audit tests/fixtures/site --include about/** --format html && node dist/cli/index.js audit tests/fixtures/site --baseline examples/baseline.json && node -e \"import('./dist/astro/index.js').then(m => { const i = m.default(); if (i.name !== 'eaa-kit' || typeof i.hooks['astro:build:done'] !== 'function') { throw new Error('astro entry point is not an integration') } console.log('astro entry ok') })\" && node dist/cli/index.js baseline tests/fixtures/site --output .eaa-kit/smoke-baseline.json && node dist/cli/index.js baseline tests/fixtures/site --output .eaa-kit/smoke-baseline.json --prune && node dist/cli/index.js checklist --record .eaa-kit/smoke-review.json --output .eaa-kit/smoke-review.md && node dist/cli/index.js audit tests/fixtures/site --include about/** --review .eaa-kit/smoke-review.json --coverage && node dist/cli/index.js statement --config examples/eaa.config.json && node dist/cli/index.js statement --config examples/eaa.config.json --audit examples/report.json --format html && node dist/cli/index.js audit tests/fixtures/site --include about/** --format json --no-cache --output .eaa-kit/smoke-base.json && node dist/cli/index.js audit tests/fixtures/site --include about/** --format json --no-cache --output .eaa-kit/smoke-head.json && node dist/cli/index.js diff .eaa-kit/smoke-base.json .eaa-kit/smoke-head.json --format json",
|
|
83
83
|
"bench": "pnpm build && node scripts/bench.mjs",
|
|
84
84
|
"examples": "pnpm build && node scripts/generate-examples.mjs",
|
|
85
|
-
"test:packaged": "pnpm build && node scripts/test-packaged.mjs"
|
|
85
|
+
"test:packaged": "pnpm build && node scripts/test-packaged.mjs",
|
|
86
|
+
"release:check": "node scripts/release-check.ts"
|
|
86
87
|
},
|
|
87
88
|
"peerDependencies": {
|
|
88
89
|
"astro": ">=4.0.0",
|
|
@@ -97,27 +98,28 @@
|
|
|
97
98
|
}
|
|
98
99
|
},
|
|
99
100
|
"dependencies": {
|
|
100
|
-
"axe-core": "
|
|
101
|
-
"commander": "^15.
|
|
102
|
-
"jsdom": "^30.
|
|
101
|
+
"axe-core": "~4.13.0",
|
|
102
|
+
"commander": "^15.1.0",
|
|
103
|
+
"jsdom": "^30.1.3",
|
|
103
104
|
"picocolors": "^1.1.1",
|
|
104
105
|
"tinyglobby": "^0.2.17"
|
|
105
106
|
},
|
|
106
107
|
"devDependencies": {
|
|
107
|
-
"@11ty/eleventy": "^3.1.
|
|
108
|
+
"@11ty/eleventy": "^3.1.8",
|
|
108
109
|
"@biomejs/biome": "^2.5.9",
|
|
109
110
|
"@types/jsdom": "^30.0.0",
|
|
110
|
-
"@types/node": "^26.
|
|
111
|
+
"@types/node": "^26.6.6",
|
|
111
112
|
"ajv": "^8.20.0",
|
|
112
113
|
"ajv-formats": "^3.0.1",
|
|
113
|
-
"astro": "^7.
|
|
114
|
-
"nuxt": "^4.
|
|
115
|
-
"playwright": "^1.
|
|
114
|
+
"astro": "^7.4.13",
|
|
115
|
+
"nuxt": "^4.6.4",
|
|
116
|
+
"playwright": "^1.65.1",
|
|
116
117
|
"tsdown": "^0.22.14",
|
|
117
118
|
"typescript": "^7.0.2",
|
|
118
|
-
"vite": "^8.
|
|
119
|
-
"vitest": "^4.1.
|
|
120
|
-
"webpack": "^5.
|
|
119
|
+
"vite": "^8.3.8",
|
|
120
|
+
"vitest": "^4.1.12",
|
|
121
|
+
"webpack": "^5.113.0",
|
|
122
|
+
"yaml": "^2.9.1"
|
|
121
123
|
},
|
|
122
124
|
"publishConfig": {
|
|
123
125
|
"access": "public",
|
package/dist/audit-Bwm1xBdJ.js
DELETED
package/dist/init-DrFfzjvm.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { t as DEFAULT_FAIL_ON } from "./impact-luGCnN8F.js";
|
|
2
|
-
import { s as COUNTRIES, t as CONFIG_FILENAMES } from "./load-BaWMa-G_.js";
|
|
3
|
-
import { t as exists } from "./fs-BmPtmFke.js";
|
|
4
|
-
import { l as warn, o as fail, s as note } from "./command-3r4fht5f.js";
|
|
5
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
import pc from "picocolors";
|
|
8
|
-
import { createInterface } from "node:readline/promises";
|
|
9
|
-
//#region src/cli/init.ts
|
|
10
|
-
const COUNTRY_LOCALES = {
|
|
11
|
-
AT: "de-AT",
|
|
12
|
-
DE: "de-DE",
|
|
13
|
-
CH: "de-CH",
|
|
14
|
-
ES: "es-ES",
|
|
15
|
-
FR: "fr-FR",
|
|
16
|
-
IT: "it-IT",
|
|
17
|
-
NL: "nl-NL"
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Everything the project already says about itself.
|
|
21
|
-
*
|
|
22
|
-
* A guess that is wrong is worse than an empty field somebody has to fill, so
|
|
23
|
-
* this only reads what a project states outright.
|
|
24
|
-
*/
|
|
25
|
-
async function detectDefaults(cwd) {
|
|
26
|
-
const detected = {};
|
|
27
|
-
try {
|
|
28
|
-
const pkg = JSON.parse(await readFile(path.join(cwd, "package.json"), "utf8"));
|
|
29
|
-
if (typeof pkg.name === "string" && pkg.name !== "") detected.name = pkg.name.replace(/^@[^/]+\//, "");
|
|
30
|
-
if (typeof pkg.homepage === "string" && /^https?:\/\//.test(pkg.homepage)) detected.url = pkg.homepage;
|
|
31
|
-
} catch {}
|
|
32
|
-
return detected;
|
|
33
|
-
}
|
|
34
|
-
/** Whether a config is already there, so init never overwrites one silently. */
|
|
35
|
-
async function existingConfig(cwd) {
|
|
36
|
-
for (const name of CONFIG_FILENAMES) if (await exists(path.join(cwd, name))) return name;
|
|
37
|
-
}
|
|
38
|
-
/** Reads answers, showing what each will be if the reader just hits enter. */
|
|
39
|
-
function terminalPrompt() {
|
|
40
|
-
const rl = createInterface({
|
|
41
|
-
input: process.stdin,
|
|
42
|
-
output: process.stderr
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
ask: async (question, fallback) => {
|
|
46
|
-
const shown = fallback === "" ? "" : pc.dim(` (${fallback})`);
|
|
47
|
-
const answer = (await rl.question(`${question}${shown}: `)).trim();
|
|
48
|
-
return answer === "" ? fallback : answer;
|
|
49
|
-
},
|
|
50
|
-
close: () => rl.close()
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
async function runInitCommand(options = {}) {
|
|
54
|
-
const cwd = options.cwd ?? process.cwd();
|
|
55
|
-
const target = path.resolve(cwd, options.output ?? "eaa.config.json");
|
|
56
|
-
const already = await existingConfig(cwd);
|
|
57
|
-
if (already !== void 0 && !options.force) {
|
|
58
|
-
warn(`${already} already exists. Pass --force to overwrite it.`);
|
|
59
|
-
return { exitCode: 1 };
|
|
60
|
-
}
|
|
61
|
-
const detected = await detectDefaults(cwd);
|
|
62
|
-
const terminal = options.ask === void 0 && !options.yes && process.stdin.isTTY === true ? terminalPrompt() : void 0;
|
|
63
|
-
const rl = options.ask ?? terminal?.ask;
|
|
64
|
-
const ask = async (question, fallback) => rl === void 0 ? fallback : rl(question, fallback);
|
|
65
|
-
if (rl !== void 0) process.stderr.write(`${pc.bold("eaa-kit init")}\n${pc.dim("Everything here is a claim you are making. Press enter to take a default.\n\n")}`);
|
|
66
|
-
const name = await ask("Site name", detected.name ?? "");
|
|
67
|
-
const url = await ask("Site URL", detected.url ?? "https://example.com");
|
|
68
|
-
const country = normaliseCountry(await ask(`Country whose law applies (${COUNTRIES.join("/")})`, "AT"));
|
|
69
|
-
const locale = await ask("Language of the site", COUNTRY_LOCALES[country]);
|
|
70
|
-
const legalName = await ask("Legal entity answerable for the site", name);
|
|
71
|
-
const email = await ask("Feedback email", "");
|
|
72
|
-
const feedbackUrl = await ask("Feedback or contact form URL (optional)", "");
|
|
73
|
-
terminal?.close();
|
|
74
|
-
const config = {
|
|
75
|
-
site: {
|
|
76
|
-
name,
|
|
77
|
-
url,
|
|
78
|
-
locale
|
|
79
|
-
},
|
|
80
|
-
provider: {
|
|
81
|
-
legalName,
|
|
82
|
-
email,
|
|
83
|
-
...feedbackUrl === "" ? {} : { feedbackUrl }
|
|
84
|
-
},
|
|
85
|
-
compliance: {
|
|
86
|
-
status: "partially-compliant",
|
|
87
|
-
assessedOn: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
|
|
88
|
-
assessmentMethod: "self-assessment",
|
|
89
|
-
knownIssues: []
|
|
90
|
-
},
|
|
91
|
-
enforcement: { country },
|
|
92
|
-
audit: { failOn: DEFAULT_FAIL_ON }
|
|
93
|
-
};
|
|
94
|
-
try {
|
|
95
|
-
await writeFile(target, `${JSON.stringify(config, null, 2)}\n`, "utf8");
|
|
96
|
-
} catch (cause) {
|
|
97
|
-
const reason = cause instanceof Error ? cause.message : String(cause);
|
|
98
|
-
fail(`Could not write ${path.basename(target)}: ${reason}`);
|
|
99
|
-
return { exitCode: 2 };
|
|
100
|
-
}
|
|
101
|
-
process.stderr.write(`Wrote ${path.relative(cwd, target) || path.basename(target)}\n`);
|
|
102
|
-
const missing = [name === "" ? "site.name" : void 0, email === "" ? "provider.email" : void 0].filter((field) => field !== void 0);
|
|
103
|
-
if (missing.length > 0) {
|
|
104
|
-
const [verb, pronoun] = missing.length === 1 ? ["is", "it"] : ["are", "them"];
|
|
105
|
-
warn(`${missing.join(" and ")} ${verb} empty and required. Fill ${pronoun} in before generating a statement.`);
|
|
106
|
-
}
|
|
107
|
-
note("Read it before publishing anything from it: status is partially-compliant,\nwhich is the honest default before an audit has run.\n\nNext: eaa-kit audit · eaa-kit statement");
|
|
108
|
-
return {
|
|
109
|
-
file: target,
|
|
110
|
-
exitCode: 0
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
/** Falls back rather than failing: a typo should not throw away the answers. */
|
|
114
|
-
function normaliseCountry(value) {
|
|
115
|
-
const upper = value.trim().toUpperCase();
|
|
116
|
-
return COUNTRIES.includes(upper) ? upper : "AT";
|
|
117
|
-
}
|
|
118
|
-
//#endregion
|
|
119
|
-
export { runInitCommand };
|
package/dist/jsdom-BUYuVJJm.js
DELETED
package/dist/json-CrQmoTj6.js
DELETED
package/dist/load-n62iXDq_.js
DELETED