@diegovelasquezweb/a11y-engine 0.4.1 → 0.5.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 (44) hide show
  1. package/CHANGELOG.md +80 -26
  2. package/README.md +76 -215
  3. package/docs/api-reference.md +107 -0
  4. package/docs/architecture.md +83 -209
  5. package/docs/cli-handbook.md +4 -4
  6. package/docs/engine-manifest.md +58 -0
  7. package/docs/outputs.md +9 -11
  8. package/docs/testing.md +63 -0
  9. package/package.json +3 -6
  10. package/src/core/asset-loader.mjs +22 -14
  11. package/src/index.d.mts +29 -12
  12. package/src/index.mjs +49 -52
  13. package/src/pipeline/dom-scanner.mjs +4 -4
  14. package/src/reports/checklist.mjs +4 -4
  15. package/src/reports/html.mjs +5 -5
  16. package/src/reports/md.mjs +3 -3
  17. package/src/reports/pdf.mjs +3 -3
  18. package/src/reports/renderers/findings.mjs +32 -32
  19. package/src/reports/renderers/md.mjs +6 -4
  20. package/assets/source/discovery/crawler-config.json +0 -11
  21. package/assets/source/discovery/stack-detection.json +0 -235
  22. package/assets/source/engine/cdp-checks.json +0 -30
  23. package/assets/source/engine/pa11y-config.json +0 -53
  24. package/assets/source/remediation/axe-check-maps.json +0 -31
  25. package/assets/source/remediation/code-patterns.json +0 -109
  26. package/assets/source/remediation/guardrails.json +0 -24
  27. package/assets/source/remediation/intelligence.json +0 -4166
  28. package/assets/source/remediation/source-boundaries.json +0 -46
  29. package/assets/source/reporting/compliance-config.json +0 -173
  30. package/assets/source/reporting/manual-checks.json +0 -944
  31. package/assets/source/reporting/wcag-reference.json +0 -588
  32. package/src/sync-assets.mjs +0 -66
  33. /package/assets/{generated/discovery → discovery}/crawler-config.mjs +0 -0
  34. /package/assets/{generated/discovery → discovery}/stack-detection.mjs +0 -0
  35. /package/assets/{generated/remediation → remediation}/axe-check-maps.mjs +0 -0
  36. /package/assets/{generated/remediation → remediation}/code-patterns.mjs +0 -0
  37. /package/assets/{generated/remediation → remediation}/guardrails.mjs +0 -0
  38. /package/assets/{generated/remediation → remediation}/intelligence.mjs +0 -0
  39. /package/assets/{generated/remediation → remediation}/source-boundaries.mjs +0 -0
  40. /package/assets/{generated/reporting → reporting}/compliance-config.mjs +0 -0
  41. /package/assets/{generated/reporting → reporting}/manual-checks.mjs +0 -0
  42. /package/assets/{generated/reporting → reporting}/wcag-reference.mjs +0 -0
  43. /package/assets/{generated/engine → scanning}/cdp-checks.mjs +0 -0
  44. /package/assets/{generated/engine → scanning}/pa11y-config.mjs +0 -0
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * sync-assets.mjs
4
- * Generates assets/generated/**\/*.mjs from assets/source/**\/*.json.
5
- * Run: node src/sync-assets.mjs
6
- * Hooked automatically in prepublishOnly.
7
- */
8
-
9
- import fs from "node:fs";
10
- import path from "node:path";
11
- import { fileURLToPath } from "node:url";
12
-
13
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
14
- const ROOT = path.resolve(__dirname, "..");
15
- const SOURCE_DIR = path.join(ROOT, "assets", "source");
16
- const GENERATED_DIR = path.join(ROOT, "assets", "generated");
17
-
18
- let synced = 0;
19
- let skipped = 0;
20
-
21
- function syncDir(sourceDir, generatedDir) {
22
- fs.mkdirSync(generatedDir, { recursive: true });
23
-
24
- for (const entry of fs.readdirSync(sourceDir, { withFileTypes: true })) {
25
- const sourcePath = path.join(sourceDir, entry.name);
26
- const generatedPath = path.join(generatedDir, entry.name);
27
-
28
- if (entry.isDirectory()) {
29
- syncDir(sourcePath, path.join(generatedDir, entry.name));
30
- continue;
31
- }
32
-
33
- if (!entry.name.endsWith(".json")) {
34
- skipped++;
35
- continue;
36
- }
37
-
38
- const mjsName = entry.name.replace(/\.json$/, ".mjs");
39
- const mjsPath = path.join(generatedDir, mjsName);
40
-
41
- let data;
42
- try {
43
- data = JSON.parse(fs.readFileSync(sourcePath, "utf-8"));
44
- } catch (err) {
45
- console.error(` [ERROR] Failed to parse ${sourcePath}: ${err.message}`);
46
- process.exit(1);
47
- }
48
-
49
- const content = `export default ${JSON.stringify(data)};\n`;
50
-
51
- let existing = null;
52
- try { existing = fs.readFileSync(mjsPath, "utf-8"); } catch { /* new file */ }
53
-
54
- if (existing !== content) {
55
- fs.writeFileSync(mjsPath, content, "utf-8");
56
- console.log(` synced: ${path.relative(ROOT, mjsPath)}`);
57
- synced++;
58
- } else {
59
- skipped++;
60
- }
61
- }
62
- }
63
-
64
- console.log("Syncing assets/source/*.json → assets/generated/*.mjs");
65
- syncDir(SOURCE_DIR, GENERATED_DIR);
66
- console.log(`Done. ${synced} file(s) written, ${skipped} unchanged/skipped.`);