@diegovelasquezweb/a11y-engine 0.4.0 → 0.4.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diegovelasquezweb/a11y-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "WCAG 2.2 AA accessibility audit engine — scanner, analyzer, and report builders",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,15 +29,14 @@
|
|
|
29
29
|
"assets/source/**",
|
|
30
30
|
"assets/generated/**",
|
|
31
31
|
"docs/**",
|
|
32
|
-
"scripts/sync-assets.mjs",
|
|
33
32
|
"README.md",
|
|
34
33
|
"CHANGELOG.md",
|
|
35
34
|
"LICENSE"
|
|
36
35
|
],
|
|
37
36
|
"scripts": {
|
|
38
|
-
"sync-assets": "node
|
|
37
|
+
"sync-assets": "node src/sync-assets.mjs",
|
|
39
38
|
"test": "vitest run",
|
|
40
|
-
"prepublishOnly": "node
|
|
39
|
+
"prepublishOnly": "node src/sync-assets.mjs"
|
|
41
40
|
},
|
|
42
41
|
"dependencies": {
|
|
43
42
|
"@axe-core/playwright": "^4.11.1",
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
import { log, getInternalPath } from "
|
|
10
|
-
import { ASSET_PATHS, loadAssetJson } from "
|
|
11
|
-
import { buildManualCheckCard } from "
|
|
12
|
-
import { escapeHtml } from "
|
|
9
|
+
import { log, getInternalPath } from "../core/utils.mjs";
|
|
10
|
+
import { ASSET_PATHS, loadAssetJson } from "../core/asset-loader.mjs";
|
|
11
|
+
import { buildManualCheckCard } from "./renderers/html.mjs";
|
|
12
|
+
import { escapeHtml } from "./renderers/utils.mjs";
|
|
13
13
|
|
|
14
14
|
const MANUAL_CHECKS = loadAssetJson(
|
|
15
15
|
ASSET_PATHS.reporting.manualChecks,
|
package/src/reports/html.mjs
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* a premium design system with persona-based impact analysis.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { log, readJson, getInternalPath, DEFAULTS } from "
|
|
9
|
-
import { ASSET_PATHS, loadAssetJson } from "
|
|
8
|
+
import { log, readJson, getInternalPath, DEFAULTS } from "../core/utils.mjs";
|
|
9
|
+
import { ASSET_PATHS, loadAssetJson } from "../core/asset-loader.mjs";
|
|
10
10
|
import fs from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import {
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
scoreLabel,
|
|
17
17
|
buildPersonaSummary,
|
|
18
18
|
wcagOverallStatus,
|
|
19
|
-
} from "
|
|
20
|
-
import { escapeHtml } from "
|
|
19
|
+
} from "./renderers/findings.mjs";
|
|
20
|
+
import { escapeHtml } from "./renderers/utils.mjs";
|
|
21
21
|
|
|
22
22
|
const RULE_METADATA = loadAssetJson(
|
|
23
23
|
ASSET_PATHS.reporting.wcagReference,
|
|
@@ -27,7 +27,7 @@ const RULE_METADATA = loadAssetJson(
|
|
|
27
27
|
import {
|
|
28
28
|
buildIssueCard,
|
|
29
29
|
buildPageGroupedSection,
|
|
30
|
-
} from "
|
|
30
|
+
} from "./renderers/html.mjs";
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Prints the CLI usage instructions and available options for the HTML report builder.
|
package/src/reports/md.mjs
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* backlog or README-style remediation roadmap.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { readJson, log, getInternalPath, DEFAULTS } from "
|
|
8
|
+
import { readJson, log, getInternalPath, DEFAULTS } from "../core/utils.mjs";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import path from "node:path";
|
|
11
|
-
import { normalizeFindings } from "
|
|
12
|
-
import { buildMarkdownSummary } from "
|
|
11
|
+
import { normalizeFindings } from "./renderers/findings.mjs";
|
|
12
|
+
import { buildMarkdownSummary } from "./renderers/md.mjs";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Prints the CLI usage instructions and available options for the Markdown report builder.
|
package/src/reports/pdf.mjs
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
import { chromium } from "playwright";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import path from "node:path";
|
|
11
|
-
import { readJson, log, getInternalPath, DEFAULTS } from "
|
|
11
|
+
import { readJson, log, getInternalPath, DEFAULTS } from "../core/utils.mjs";
|
|
12
12
|
import {
|
|
13
13
|
normalizeFindings,
|
|
14
14
|
buildSummary,
|
|
15
15
|
computeComplianceScore,
|
|
16
16
|
wcagOverallStatus,
|
|
17
|
-
} from "
|
|
17
|
+
} from "./renderers/findings.mjs";
|
|
18
18
|
import {
|
|
19
19
|
scoreMetrics,
|
|
20
20
|
buildPdfTableOfContents,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
buildPdfNextSteps,
|
|
27
27
|
buildPdfAuditLimitations,
|
|
28
28
|
buildPdfCoverPage,
|
|
29
|
-
} from "
|
|
29
|
+
} from "./renderers/pdf.mjs";
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Prints the CLI usage instructions and available options for the PDF report builder.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* sync-assets.mjs
|
|
4
4
|
* Generates assets/generated/**\/*.mjs from assets/source/**\/*.json.
|
|
5
|
-
* Run: node
|
|
5
|
+
* Run: node src/sync-assets.mjs
|
|
6
6
|
* Hooked automatically in prepublishOnly.
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -48,7 +48,6 @@ function syncDir(sourceDir, generatedDir) {
|
|
|
48
48
|
|
|
49
49
|
const content = `export default ${JSON.stringify(data)};\n`;
|
|
50
50
|
|
|
51
|
-
// Only write if content changed (avoid unnecessary fs writes)
|
|
52
51
|
let existing = null;
|
|
53
52
|
try { existing = fs.readFileSync(mjsPath, "utf-8"); } catch { /* new file */ }
|
|
54
53
|
|