eaa-kit 0.7.0 → 0.9.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.
Files changed (66) hide show
  1. package/README.md +30 -8
  2. package/dist/astro/index.js +1 -1
  3. package/dist/audit-CJDCQaFY.js +2 -0
  4. package/dist/{audit-DRjAY2iY.js → audit-J2jeLo-y.js} +38 -198
  5. package/dist/{baseline-rtnj3RHB.js → baseline-477B1CZ_.js} +1 -1
  6. package/dist/baseline-D9ihb-wk.js +2 -0
  7. package/dist/{baseline-BpE7DbDq.js → baseline-DrFh7joZ.js} +14 -3
  8. package/dist/baseline-wyJsSIFQ.js +127 -0
  9. package/dist/{checklist-DDd9jewi.js → checklist-Gx2g3LFC.js} +6 -6
  10. package/dist/cli/index.js +83 -143
  11. package/dist/{collect-Cu1q9NTB.js → collect-BJYk7_pJ.js} +1 -1
  12. package/dist/{command-3r4fht5f.js → command-BGGMf4vn.js} +30 -4
  13. package/dist/countries-DRTBubeE.js +25 -0
  14. package/dist/countries-Dg0BdytB.js +156 -0
  15. package/dist/{coverage-n1X9CkiG.js → coverage-GvaMpV64.js} +1 -1
  16. package/dist/{coverage-cb5kPp48.js → coverage-zdzgSKjz.js} +1 -1
  17. package/dist/{crawl-BHkJmUkA.js → crawl-DwdqiljK.js} +5 -3
  18. package/dist/{load-BaWMa-G_.js → define-Ctf2uOEh.js} +41 -94
  19. package/dist/eleventy/index.js +1 -1
  20. package/dist/entry-CjqjrUBY.js +174 -0
  21. package/dist/{html-BIxxF3FC.js → html-whingnfj.js} +6 -4
  22. package/dist/index.d.ts +42 -5
  23. package/dist/index.js +3 -2
  24. package/dist/init-CPbFVMuk.js +293 -0
  25. package/dist/{json-CrQmoTj6.js → json-CyLmvF5P.js} +1 -1
  26. package/dist/{json-Bus6YhxB.js → json-SGCgxSPT.js} +1 -1
  27. package/dist/load-CH-ltdlq.js +99 -0
  28. package/dist/load-D7lBeOsq.js +2 -0
  29. package/dist/nuxt/index.js +1 -1
  30. package/dist/pages-DxY5Z0gl.js +300 -0
  31. package/dist/{project-MFrXcw1M.js → project-BLFdCbOq.js} +1 -1
  32. package/dist/{project-CzOnkLH6.js → project-v2PoRw70.js} +18 -1
  33. package/dist/{remediation-C0klJblu.js → remediation-Bbs4KcX1.js} +18 -1
  34. package/dist/{render-C1sUZZI_.js → render-C6zYfaba.js} +29 -5
  35. package/dist/{review-CdMK2GpQ.js → review-Bz0fO9_I.js} +9 -1
  36. package/dist/{review-DIbOTmOM.js → review-a-2ghjQ5.js} +1 -1
  37. package/dist/{routes-CmdRUuOs.js → routes-CSctpS1P.js} +1 -1
  38. package/dist/{run-DrS0Komf.js → run-DzVEOkiF.js} +1 -1
  39. package/dist/{sarif-BNCE0PNT.js → sarif-9BAgNiOa.js} +3 -2
  40. package/dist/site-BHMtf3q2.js +72 -0
  41. package/dist/start-DzOM0p6I.js +101 -0
  42. package/dist/statement/templates/be.de.md +148 -0
  43. package/dist/statement/templates/be.en.md +142 -0
  44. package/dist/statement/templates/be.fr.md +146 -0
  45. package/dist/statement/templates/be.nl.md +147 -0
  46. package/dist/statement/templates/cz.cs.md +137 -0
  47. package/dist/statement/templates/cz.en.md +139 -0
  48. package/dist/statement/templates/dk.da.md +141 -0
  49. package/dist/statement/templates/dk.en.md +141 -0
  50. package/dist/statement/templates/fi.en.md +139 -0
  51. package/dist/statement/templates/fi.fi.md +141 -0
  52. package/dist/statement/templates/ie.en.md +144 -0
  53. package/dist/statement/templates/pl.en.md +143 -0
  54. package/dist/statement/templates/pl.pl.md +144 -0
  55. package/dist/statement/templates/pt.en.md +142 -0
  56. package/dist/statement/templates/pt.pt.md +145 -0
  57. package/dist/statement/templates/se.en.md +139 -0
  58. package/dist/statement/templates/se.sv.md +142 -0
  59. package/dist/vite/index.js +1 -1
  60. package/dist/watch-B2RoUbo0.js +122 -0
  61. package/dist/webpack/index.js +1 -1
  62. package/dist/{worksheet-BIxMtbUd.js → worksheet-B_kQ1pxq.js} +1 -1
  63. package/package.json +2 -2
  64. package/dist/audit-Bwm1xBdJ.js +0 -2
  65. package/dist/init-DrFfzjvm.js +0 -119
  66. package/dist/load-n62iXDq_.js +0 -2
@@ -1,6 +1,6 @@
1
1
  import { t as WCAG22_AA_CRITERIA } from "./criteria-CnPJKGeb.js";
2
2
  import { n as DEFAULT_TAGS } from "./result-B7_zVxAX.js";
3
- import { a as manualCheckFor, i as rulesByCriterion, o as understandingUrl } from "./coverage-cb5kPp48.js";
3
+ import { a as manualCheckFor, i as rulesByCriterion, o as understandingUrl } from "./coverage-zdzgSKjz.js";
4
4
  //#region src/audit/worksheet.ts
5
5
  function buildWorksheet(options) {
6
6
  const rules = rulesByCriterion(options.tags ?? DEFAULT_TAGS);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eaa-kit",
3
- "version": "0.7.0",
4
- "description": "WCAG 2.2 AA auditor and EU accessibility statement generator for seven countries (AT, DE, CH, ES, FR, IT, NL). Audits a static build or a running site from the command line.",
3
+ "version": "0.9.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": {
@@ -1,2 +0,0 @@
1
- import { n as runAuditCommand } from "./audit-DRjAY2iY.js";
2
- export { runAuditCommand };
@@ -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 };
@@ -1,2 +0,0 @@
1
- import { r as loadAuditConfig } from "./load-BaWMa-G_.js";
2
- export { loadAuditConfig };