@holmdigital/engine 2.8.0 → 2.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.
- package/README.md +5 -2
- package/dist/{chunk-AICMJ3YF.mjs → chunk-4HV55NRY.mjs} +1 -1
- package/dist/cli/index.js +17 -7
- package/dist/cli/index.mjs +16 -7
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{plain-report-R2TZYGLD.mjs → plain-report-JQAGRPKC.mjs} +2 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -35,6 +35,7 @@ For a comprehensive guide on CLI flags, CI/CD integration, and configuration fil
|
|
|
35
35
|
- **Configurable Severity Threshold**: Fail CI only on critical/high issues (configurable).
|
|
36
36
|
- **Pseudo-Automation**: Automatically generates Playwright/Puppeteer test scripts for manual verification steps.
|
|
37
37
|
- **PDF Reporting**: Generates beautiful, compliant PDF reports with severity-sorted violations, HTML error counts, and `@HolmDigital/engine` branding.
|
|
38
|
+
- **Plain-Language Reports**: `--plain` (or `--audience plain`) renders the report and PDF in plain language for managers, lawyers, and buyers without a technical background. Findings of the same rule are grouped into one card with an occurrence count, with a business-impact breakdown and Swedish-language fallback.
|
|
38
39
|
- **Type-Safe Results**: Scan results return fully typed `EnrichedReport[]` with `failingNodes` and `legalContext` — zero `as any` casts in the pipeline.
|
|
39
40
|
- **Build-Time Version Injection**: Engine version derived from `package.json` at build time via tsup `define` — CLI, cloud client, and reports always report the correct version.
|
|
40
41
|
- **TypeScript**: Written in TypeScript with full type definitions included.
|
|
@@ -73,6 +74,8 @@ npx hd-a11y-scan <url> [options]
|
|
|
73
74
|
| `--api-key <key>` | API Key for HolmDigital Cloud |
|
|
74
75
|
| `--cloud-url <url>` | Custom Cloud API Endpoint (default: cloud.holmdigital.se) |
|
|
75
76
|
| `--light` | Fast score-only mode — skips HTML validation and detailed legal mapping |
|
|
77
|
+
| `--plain` | Plain-language mode (klarspråksläge): report and PDF in non-technical language for recipients without a technical background. Alias for `--audience plain`. |
|
|
78
|
+
| `--audience <mode>` | Report audience: `developer` (default) or `plain`. |
|
|
76
79
|
|
|
77
80
|
### 🏆 Accessibility Badge
|
|
78
81
|
If your site achieves a **100% score**, the CLI will generate a [Shields.io](https://shields.io/) badge that you can add to your project's README:
|
|
@@ -113,9 +116,9 @@ npx hd-a11y-scan https://hospital.example.com --country US --sector private --st
|
|
|
113
116
|
"url": "https://example.com",
|
|
114
117
|
"timestamp": "2026-01-13T17:05:11.749Z",
|
|
115
118
|
"metadata": {
|
|
116
|
-
"engineVersion": "2.
|
|
119
|
+
"engineVersion": "2.8.0",
|
|
117
120
|
"axeCoreVersion": "4.11.1",
|
|
118
|
-
"standardsVersion": "2.
|
|
121
|
+
"standardsVersion": "2.8.0",
|
|
119
122
|
"scanDuration": 2891,
|
|
120
123
|
"pageTitle": "Example Domain",
|
|
121
124
|
"pageLanguage": "en"
|
package/dist/cli/index.js
CHANGED
|
@@ -786,7 +786,8 @@ function renderPlainReport(result, lang = "en") {
|
|
|
786
786
|
const badgeText = BADGE_CHALK[level](t(BADGE_KEY[level]));
|
|
787
787
|
const pl = report.plainLanguage;
|
|
788
788
|
const occurrences = group.count > 1 ? `, ${t("plain.occurrences", { count: group.count })}` : "";
|
|
789
|
-
|
|
789
|
+
const heading = pl?.headline ? `${pl.headline} (${report.ruleId})` : report.ruleId;
|
|
790
|
+
console.log(`${index + 1}. ${badgeText}: ${heading}${occurrences}`);
|
|
790
791
|
if (pl) {
|
|
791
792
|
console.log(` ${t("plain.what_happens")} ${pl.whatHappens}`);
|
|
792
793
|
console.log(` ${t("plain.who_is_affected")} ${pl.whoIsAffected}`);
|
|
@@ -1098,7 +1099,7 @@ var HtmlValidator = class {
|
|
|
1098
1099
|
// src/core/regulatory-scanner.ts
|
|
1099
1100
|
var import_node_fs = require("fs");
|
|
1100
1101
|
function getEngineVersion() {
|
|
1101
|
-
return "2.
|
|
1102
|
+
return "2.9.0";
|
|
1102
1103
|
}
|
|
1103
1104
|
function getStandardsVersion() {
|
|
1104
1105
|
try {
|
|
@@ -1912,10 +1913,11 @@ ${sortedGroups.map((group) => {
|
|
|
1912
1913
|
const badgeText = escapeHtml(t(PLAIN_BADGE_KEY[level]));
|
|
1913
1914
|
const pl = report.plainLanguage;
|
|
1914
1915
|
const occurrences = group.count > 1 ? `, ${escapeHtml(t("plain.occurrences", { count: group.count }))}` : "";
|
|
1916
|
+
const headingHtml = pl?.headline ? `${escapeHtml(pl.headline)} <span class="issue-rule-ref">(${escapeHtml(report.ruleId)})</span>` : escapeHtml(report.ruleId);
|
|
1915
1917
|
if (pl) {
|
|
1916
1918
|
return ` <li class="issue-item ${cardClass}">
|
|
1917
1919
|
<span class="badge ${badgeClass}">${badgeText}</span>
|
|
1918
|
-
<strong class="issue-id">${
|
|
1920
|
+
<strong class="issue-id">${headingHtml}${occurrences}</strong>
|
|
1919
1921
|
<dl class="issue-fields">
|
|
1920
1922
|
<dt>${t("plain.what_happens")}</dt><dd>${escapeHtml(pl.whatHappens)}</dd>
|
|
1921
1923
|
<dt>${t("plain.who_is_affected")}</dt><dd>${escapeHtml(pl.whoIsAffected)}</dd>
|
|
@@ -1927,7 +1929,7 @@ ${sortedGroups.map((group) => {
|
|
|
1927
1929
|
const rawDetail = isSwedish ? "" : ` ${escapeHtml(report.remediation.description)}`;
|
|
1928
1930
|
return ` <li class="issue-item ${cardClass}">
|
|
1929
1931
|
<span class="badge ${badgeClass}">${badgeText}</span>
|
|
1930
|
-
<strong class="issue-id">${
|
|
1932
|
+
<strong class="issue-id">${headingHtml}${occurrences}</strong>
|
|
1931
1933
|
<p class="issue-fallback"><span class="fallback-framing">${escapeHtml(t("plain.fallback_framing"))}</span>${rawDetail}</p>
|
|
1932
1934
|
</li>`;
|
|
1933
1935
|
}
|
|
@@ -2077,13 +2079,21 @@ ${sortedGroups.map((group) => {
|
|
|
2077
2079
|
/* ---- Rule ID ---- */
|
|
2078
2080
|
.issue-id {
|
|
2079
2081
|
display: block;
|
|
2082
|
+
font-size: 1.05rem;
|
|
2083
|
+
font-weight: 700;
|
|
2084
|
+
color: #1e293b;
|
|
2085
|
+
margin-bottom: 0.75rem;
|
|
2086
|
+
break-after: avoid;
|
|
2087
|
+
page-break-after: avoid;
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
/* Raw axe rule id as a small, subordinate technical reference next to the
|
|
2091
|
+
Swedish plain-language heading. */
|
|
2092
|
+
.issue-rule-ref {
|
|
2080
2093
|
font-size: 0.78rem;
|
|
2081
2094
|
font-weight: 600;
|
|
2082
2095
|
color: #64748b;
|
|
2083
2096
|
font-family: ui-monospace, 'Cascadia Code', 'Courier New', monospace;
|
|
2084
|
-
margin-bottom: 0.75rem;
|
|
2085
|
-
break-after: avoid;
|
|
2086
|
-
page-break-after: avoid;
|
|
2087
2097
|
}
|
|
2088
2098
|
|
|
2089
2099
|
/* ---- Field label/value pairs ---- */
|
package/dist/cli/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
generateStatement,
|
|
8
8
|
generateStatementContent,
|
|
9
9
|
getEngineVersion
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-4HV55NRY.mjs";
|
|
11
11
|
import {
|
|
12
12
|
groupReportsByRule,
|
|
13
13
|
impactBreakdown
|
|
@@ -411,10 +411,11 @@ ${sortedGroups.map((group) => {
|
|
|
411
411
|
const badgeText = escapeHtml(t(PLAIN_BADGE_KEY[level]));
|
|
412
412
|
const pl = report.plainLanguage;
|
|
413
413
|
const occurrences = group.count > 1 ? `, ${escapeHtml(t("plain.occurrences", { count: group.count }))}` : "";
|
|
414
|
+
const headingHtml = pl?.headline ? `${escapeHtml(pl.headline)} <span class="issue-rule-ref">(${escapeHtml(report.ruleId)})</span>` : escapeHtml(report.ruleId);
|
|
414
415
|
if (pl) {
|
|
415
416
|
return ` <li class="issue-item ${cardClass}">
|
|
416
417
|
<span class="badge ${badgeClass}">${badgeText}</span>
|
|
417
|
-
<strong class="issue-id">${
|
|
418
|
+
<strong class="issue-id">${headingHtml}${occurrences}</strong>
|
|
418
419
|
<dl class="issue-fields">
|
|
419
420
|
<dt>${t("plain.what_happens")}</dt><dd>${escapeHtml(pl.whatHappens)}</dd>
|
|
420
421
|
<dt>${t("plain.who_is_affected")}</dt><dd>${escapeHtml(pl.whoIsAffected)}</dd>
|
|
@@ -426,7 +427,7 @@ ${sortedGroups.map((group) => {
|
|
|
426
427
|
const rawDetail = isSwedish ? "" : ` ${escapeHtml(report.remediation.description)}`;
|
|
427
428
|
return ` <li class="issue-item ${cardClass}">
|
|
428
429
|
<span class="badge ${badgeClass}">${badgeText}</span>
|
|
429
|
-
<strong class="issue-id">${
|
|
430
|
+
<strong class="issue-id">${headingHtml}${occurrences}</strong>
|
|
430
431
|
<p class="issue-fallback"><span class="fallback-framing">${escapeHtml(t("plain.fallback_framing"))}</span>${rawDetail}</p>
|
|
431
432
|
</li>`;
|
|
432
433
|
}
|
|
@@ -576,13 +577,21 @@ ${sortedGroups.map((group) => {
|
|
|
576
577
|
/* ---- Rule ID ---- */
|
|
577
578
|
.issue-id {
|
|
578
579
|
display: block;
|
|
580
|
+
font-size: 1.05rem;
|
|
581
|
+
font-weight: 700;
|
|
582
|
+
color: #1e293b;
|
|
583
|
+
margin-bottom: 0.75rem;
|
|
584
|
+
break-after: avoid;
|
|
585
|
+
page-break-after: avoid;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/* Raw axe rule id as a small, subordinate technical reference next to the
|
|
589
|
+
Swedish plain-language heading. */
|
|
590
|
+
.issue-rule-ref {
|
|
579
591
|
font-size: 0.78rem;
|
|
580
592
|
font-weight: 600;
|
|
581
593
|
color: #64748b;
|
|
582
594
|
font-family: ui-monospace, 'Cascadia Code', 'Courier New', monospace;
|
|
583
|
-
margin-bottom: 0.75rem;
|
|
584
|
-
break-after: avoid;
|
|
585
|
-
page-break-after: avoid;
|
|
586
595
|
}
|
|
587
596
|
|
|
588
597
|
/* ---- Field label/value pairs ---- */
|
|
@@ -919,7 +928,7 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
919
928
|
console.log(chalk.gray(`
|
|
920
929
|
Scan: ${result.metadata.scanDuration}ms | ${result.metadata.engineVersion}`));
|
|
921
930
|
} else if (options.audience === "plain") {
|
|
922
|
-
const { renderPlainReport } = await import("../plain-report-
|
|
931
|
+
const { renderPlainReport } = await import("../plain-report-JQAGRPKC.mjs");
|
|
923
932
|
renderPlainReport(result, options.lang);
|
|
924
933
|
} else {
|
|
925
934
|
console.log("\n");
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -67,7 +67,8 @@ function renderPlainReport(result, lang = "en") {
|
|
|
67
67
|
const badgeText = BADGE_CHALK[level](t(BADGE_KEY[level]));
|
|
68
68
|
const pl = report.plainLanguage;
|
|
69
69
|
const occurrences = group.count > 1 ? `, ${t("plain.occurrences", { count: group.count })}` : "";
|
|
70
|
-
|
|
70
|
+
const heading = pl?.headline ? `${pl.headline} (${report.ruleId})` : report.ruleId;
|
|
71
|
+
console.log(`${index + 1}. ${badgeText}: ${heading}${occurrences}`);
|
|
71
72
|
if (pl) {
|
|
72
73
|
console.log(` ${t("plain.what_happens")} ${pl.whatHappens}`);
|
|
73
74
|
console.log(` ${t("plain.who_is_affected")} ${pl.whoIsAffected}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holmdigital/engine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -84,25 +84,25 @@
|
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@holmdigital/components": "^3.0.0",
|
|
86
86
|
"@holmdigital/standards": "^2.8.0",
|
|
87
|
-
"axe-core": "^4.
|
|
87
|
+
"axe-core": "^4.12.1",
|
|
88
88
|
"chalk": "^5.3.0",
|
|
89
89
|
"commander": "^12.1.0",
|
|
90
|
-
"cosmiconfig": "^9.0.
|
|
91
|
-
"html-validate": "
|
|
90
|
+
"cosmiconfig": "^9.0.2",
|
|
91
|
+
"html-validate": "11.5.3",
|
|
92
92
|
"ora": "^8.1.1",
|
|
93
|
-
"puppeteer": "
|
|
93
|
+
"puppeteer": "25.2.0",
|
|
94
94
|
"react": "^18.3.1 || ^19.0.0",
|
|
95
95
|
"react-dom": "^18.3.1 || ^19.0.0",
|
|
96
96
|
"ws": "^8.18.0"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@types/cosmiconfig": "^5.0.3",
|
|
100
|
-
"@types/node": "^
|
|
100
|
+
"@types/node": "^26.0.0",
|
|
101
101
|
"@types/react": "^18.3.1 || ^19.0.0",
|
|
102
102
|
"@types/react-dom": "^18.3.1 || ^19.0.0",
|
|
103
103
|
"@types/ws": "^8.5.13",
|
|
104
104
|
"tsup": "^8.3.5",
|
|
105
105
|
"typescript": "^5.7.2",
|
|
106
|
-
"vitest": "^4.
|
|
106
|
+
"vitest": "^4.1.9"
|
|
107
107
|
}
|
|
108
108
|
}
|