@holmdigital/engine 2.1.4 → 2.1.6
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 +4 -2
- package/dist/{chunk-NTZZJO75.mjs → chunk-BR2T76XC.mjs} +10 -17
- package/dist/{chunk-32WU5BD6.mjs → chunk-PIGYYEJV.mjs} +9 -9
- package/dist/cli/index.js +21 -28
- package/dist/cli/index.mjs +4 -4
- package/dist/{i18n-JLPALD7H.mjs → i18n-WJXLKRLV.mjs} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +19 -26
- package/dist/index.mjs +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Most accessibility tools give you technical errors (e.g., "Color contrast must b
|
|
|
14
14
|
It handles the heavy lifting of:
|
|
15
15
|
1. **Mapping** technical failures to specific legal clauses.
|
|
16
16
|
2. **Validating** HTML structure to ensure test accuracy.
|
|
17
|
-
3. **Reporting** in multiple languages (EN, SV, NL, DE, FR, ES) for non-technical stakeholders.
|
|
17
|
+
3. **Reporting** in multiple languages (EN, SV, NO, FI, DA, NL, DE, FR, ES) for non-technical stakeholders.
|
|
18
18
|
4. **CI/CD Pipeline Integration** with automatic enforcement.
|
|
19
19
|
|
|
20
20
|
For a comprehensive guide on CLI flags, CI/CD integration, and configuration files, see the **[Engine Library Catalog](../../docs/reference/engine.md)**.
|
|
@@ -30,6 +30,8 @@ For a comprehensive guide on CLI flags, CI/CD integration, and configuration fil
|
|
|
30
30
|
- **Configurable Severity Threshold**: Fail CI only on critical/high issues (configurable).
|
|
31
31
|
- **Pseudo-Automation**: Automatically generates Playwright/Puppeteer test scripts for manual verification steps.
|
|
32
32
|
- **PDF Reporting**: Generates beautiful, compliant PDF reports with severity-sorted violations, HTML error counts, and `@HolmDigital/engine` branding.
|
|
33
|
+
- **Type-Safe Results**: Scan results return fully typed `EnrichedReport[]` with `failingNodes` and `legalContext` — zero `as any` casts in the pipeline.
|
|
34
|
+
- **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.
|
|
33
35
|
- **TypeScript**: Written in TypeScript with full type definitions included.
|
|
34
36
|
|
|
35
37
|
## Installation
|
|
@@ -89,7 +91,7 @@ npx hd-a11y-scan https://example.com --json
|
|
|
89
91
|
"url": "https://example.com",
|
|
90
92
|
"timestamp": "2026-01-13T17:05:11.749Z",
|
|
91
93
|
"metadata": {
|
|
92
|
-
"engineVersion": "2.1.
|
|
94
|
+
"engineVersion": "2.1.5",
|
|
93
95
|
"axeCoreVersion": "4.11.1",
|
|
94
96
|
"standardsVersion": "1.2.3",
|
|
95
97
|
"scanDuration": 2891,
|
|
@@ -136,17 +136,8 @@ var HtmlValidator = class {
|
|
|
136
136
|
|
|
137
137
|
// src/core/regulatory-scanner.ts
|
|
138
138
|
import { readFileSync } from "fs";
|
|
139
|
-
import { resolve, dirname } from "path";
|
|
140
|
-
import { fileURLToPath } from "url";
|
|
141
139
|
function getEngineVersion() {
|
|
142
|
-
|
|
143
|
-
const dir = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
|
|
144
|
-
const pkgPath = resolve(dir, "..", "package.json");
|
|
145
|
-
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
146
|
-
return pkg.version;
|
|
147
|
-
} catch {
|
|
148
|
-
return "2.1.1";
|
|
149
|
-
}
|
|
140
|
+
return "2.1.6";
|
|
150
141
|
}
|
|
151
142
|
function getStandardsVersion() {
|
|
152
143
|
try {
|
|
@@ -204,7 +195,7 @@ var RegulatoryScanner = class {
|
|
|
204
195
|
retries--;
|
|
205
196
|
if (retries === 0) throw e;
|
|
206
197
|
this.log(`Navigation failed, retrying... (${retries} attempts left)`);
|
|
207
|
-
await new Promise((
|
|
198
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
208
199
|
}
|
|
209
200
|
}
|
|
210
201
|
try {
|
|
@@ -279,7 +270,7 @@ var RegulatoryScanner = class {
|
|
|
279
270
|
async enrichResults(axeResults) {
|
|
280
271
|
const reports = [];
|
|
281
272
|
const { searchRulesByTags, generateRegulatoryReport, getConvergenceRule } = await import("@holmdigital/standards");
|
|
282
|
-
const { getCurrentLang } = await import("./i18n-
|
|
273
|
+
const { getCurrentLang } = await import("./i18n-WJXLKRLV.mjs");
|
|
283
274
|
const lang = getCurrentLang();
|
|
284
275
|
for (const violation of axeResults.violations) {
|
|
285
276
|
let report = generateRegulatoryReport(violation.id, lang);
|
|
@@ -503,11 +494,13 @@ import { AccessibilityStatement } from "@holmdigital/components";
|
|
|
503
494
|
import { ENFORCEMENT_BODIES } from "@holmdigital/standards";
|
|
504
495
|
import fs from "fs/promises";
|
|
505
496
|
import path from "path";
|
|
497
|
+
import { fileURLToPath } from "url";
|
|
498
|
+
var __dirname_esm = typeof __dirname === "undefined" ? path.dirname(fileURLToPath(import.meta.url)) : __dirname;
|
|
506
499
|
async function generateStatementContent(result, lang = "en", format = "html", metadata) {
|
|
507
500
|
let template;
|
|
508
501
|
const possibleTemplatePaths = [
|
|
509
|
-
path.join(
|
|
510
|
-
path.join(
|
|
502
|
+
path.join(__dirname_esm, "templates", `${lang}.json`),
|
|
503
|
+
path.join(__dirname_esm, "../src/reporting/templates", `${lang}.json`),
|
|
511
504
|
path.join(process.cwd(), "packages/engine/src/reporting/templates", `${lang}.json`)
|
|
512
505
|
];
|
|
513
506
|
let loaded = false;
|
|
@@ -523,8 +516,8 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
523
516
|
}
|
|
524
517
|
if (!loaded) {
|
|
525
518
|
const fallbackPaths = [
|
|
526
|
-
path.join(
|
|
527
|
-
path.join(
|
|
519
|
+
path.join(__dirname_esm, "templates", "en.json"),
|
|
520
|
+
path.join(__dirname_esm, "../src/reporting/templates", "en.json"),
|
|
528
521
|
path.join(process.cwd(), "packages/engine/src/reporting/templates", "en.json")
|
|
529
522
|
];
|
|
530
523
|
for (const p of fallbackPaths) {
|
|
@@ -538,7 +531,7 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
538
531
|
}
|
|
539
532
|
}
|
|
540
533
|
}
|
|
541
|
-
if (!loaded) {
|
|
534
|
+
if (!loaded || !template) {
|
|
542
535
|
throw new Error(`Accessibility statement templates missing. Looked in: ${possibleTemplatePaths.join(", ")}`);
|
|
543
536
|
}
|
|
544
537
|
let complianceLevel = "full";
|
|
@@ -34,7 +34,7 @@ var en_default = {
|
|
|
34
34
|
detailed_violations: "Detailed Violations",
|
|
35
35
|
prescriptive_fix: "\u{1F4A1} Prescriptive Fix",
|
|
36
36
|
use: "Use",
|
|
37
|
-
footer: "Generated by @holmdigital/engine
|
|
37
|
+
footer: "Generated by @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -74,7 +74,7 @@ var sv_default = {
|
|
|
74
74
|
detailed_violations: "Detaljerade brister",
|
|
75
75
|
prescriptive_fix: "\u{1F4A1} Preskriptiv L\xF6sning",
|
|
76
76
|
use: "Anv\xE4nd",
|
|
77
|
-
footer: "Genererad av @holmdigital/engine
|
|
77
|
+
footer: "Genererad av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, DOS-lagen"
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
|
|
@@ -114,7 +114,7 @@ var de_default = {
|
|
|
114
114
|
detailed_violations: "Detaillierte Verst\xF6\xDFe",
|
|
115
115
|
prescriptive_fix: "\u{1F4A1} Vorschriftsm\xE4\xDFige L\xF6sung",
|
|
116
116
|
use: "Verwenden",
|
|
117
|
-
footer: "Generiert von @holmdigital/engine
|
|
117
|
+
footer: "Generiert von @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, BITV 2.0"
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
|
|
@@ -154,7 +154,7 @@ var fr_default = {
|
|
|
154
154
|
detailed_violations: "Violations D\xE9taill\xE9es",
|
|
155
155
|
prescriptive_fix: "\u{1F4A1} Solution Prescriptive",
|
|
156
156
|
use: "Utiliser",
|
|
157
|
-
footer: "G\xE9n\xE9r\xE9 par @holmdigital/engine
|
|
157
|
+
footer: "G\xE9n\xE9r\xE9 par @holmdigital/engine v{version} \u2022 Standards : WCAG 2.1 AA, EN 301 549, RGAA"
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
|
|
@@ -194,7 +194,7 @@ var es_default = {
|
|
|
194
194
|
detailed_violations: "Violaciones Detalladas",
|
|
195
195
|
prescriptive_fix: "\u{1F4A1} Soluci\xF3n Prescriptiva",
|
|
196
196
|
use: "Usar",
|
|
197
|
-
footer: "Generado por @holmdigital/engine
|
|
197
|
+
footer: "Generado por @holmdigital/engine v{version} \u2022 Est\xE1ndares: WCAG 2.1 AA, EN 301 549, UNE 139803"
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
200
|
|
|
@@ -234,7 +234,7 @@ var fi_default = {
|
|
|
234
234
|
detailed_violations: "Yksityiskohtaiset rikkomukset",
|
|
235
235
|
prescriptive_fix: "\u{1F4A1} Ehdotettu korjaus",
|
|
236
236
|
use: "K\xE4yt\xE4",
|
|
237
|
-
footer: "Luonut @holmdigital/engine
|
|
237
|
+
footer: "Luonut @holmdigital/engine v{version} \u2022 Standardit: WCAG 2.1 AA, EN 301 549, Digipalvelulaki"
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
240
|
|
|
@@ -274,7 +274,7 @@ var dk_default = {
|
|
|
274
274
|
detailed_violations: "Detaljerede Overtr\xE6delser",
|
|
275
275
|
prescriptive_fix: "\u{1F4A1} Foresl\xE5et L\xF8sning",
|
|
276
276
|
use: "Brug",
|
|
277
|
-
footer: "Genereret af @holmdigital/engine
|
|
277
|
+
footer: "Genereret af @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Lov om tilg\xE6ngelighed"
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
280
|
|
|
@@ -314,7 +314,7 @@ var no_default = {
|
|
|
314
314
|
detailed_violations: "Detaljerte Brudd",
|
|
315
315
|
prescriptive_fix: "\u{1F4A1} Foresl\xE5tt L\xF8sning",
|
|
316
316
|
use: "Bruk",
|
|
317
|
-
footer: "Generert av @holmdigital/engine
|
|
317
|
+
footer: "Generert av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Uu-tilsynet"
|
|
318
318
|
}
|
|
319
319
|
};
|
|
320
320
|
|
|
@@ -354,7 +354,7 @@ var nl_default = {
|
|
|
354
354
|
detailed_violations: "Gedetailleerde overtredingen",
|
|
355
355
|
prescriptive_fix: "\u{1F4A1} Voorgeschreven oplossing",
|
|
356
356
|
use: "Gebruik",
|
|
357
|
-
footer: "Gegenereerd door @holmdigital/engine
|
|
357
|
+
footer: "Gegenereerd door @holmdigital/engine v{version} \u2022 Standaarden: WCAG 2.1 AA, EN 301 549, Besluit digitale toegankelijkheid overheid"
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
360
|
|
package/dist/cli/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var init_en = __esm({
|
|
|
69
69
|
detailed_violations: "Detailed Violations",
|
|
70
70
|
prescriptive_fix: "\u{1F4A1} Prescriptive Fix",
|
|
71
71
|
use: "Use",
|
|
72
|
-
footer: "Generated by @holmdigital/engine
|
|
72
|
+
footer: "Generated by @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
}
|
|
@@ -114,7 +114,7 @@ var init_sv = __esm({
|
|
|
114
114
|
detailed_violations: "Detaljerade brister",
|
|
115
115
|
prescriptive_fix: "\u{1F4A1} Preskriptiv L\xF6sning",
|
|
116
116
|
use: "Anv\xE4nd",
|
|
117
|
-
footer: "Genererad av @holmdigital/engine
|
|
117
|
+
footer: "Genererad av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, DOS-lagen"
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
}
|
|
@@ -159,7 +159,7 @@ var init_de = __esm({
|
|
|
159
159
|
detailed_violations: "Detaillierte Verst\xF6\xDFe",
|
|
160
160
|
prescriptive_fix: "\u{1F4A1} Vorschriftsm\xE4\xDFige L\xF6sung",
|
|
161
161
|
use: "Verwenden",
|
|
162
|
-
footer: "Generiert von @holmdigital/engine
|
|
162
|
+
footer: "Generiert von @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, BITV 2.0"
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
165
|
}
|
|
@@ -204,7 +204,7 @@ var init_fr = __esm({
|
|
|
204
204
|
detailed_violations: "Violations D\xE9taill\xE9es",
|
|
205
205
|
prescriptive_fix: "\u{1F4A1} Solution Prescriptive",
|
|
206
206
|
use: "Utiliser",
|
|
207
|
-
footer: "G\xE9n\xE9r\xE9 par @holmdigital/engine
|
|
207
|
+
footer: "G\xE9n\xE9r\xE9 par @holmdigital/engine v{version} \u2022 Standards : WCAG 2.1 AA, EN 301 549, RGAA"
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
}
|
|
@@ -249,7 +249,7 @@ var init_es = __esm({
|
|
|
249
249
|
detailed_violations: "Violaciones Detalladas",
|
|
250
250
|
prescriptive_fix: "\u{1F4A1} Soluci\xF3n Prescriptiva",
|
|
251
251
|
use: "Usar",
|
|
252
|
-
footer: "Generado por @holmdigital/engine
|
|
252
|
+
footer: "Generado por @holmdigital/engine v{version} \u2022 Est\xE1ndares: WCAG 2.1 AA, EN 301 549, UNE 139803"
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
255
|
}
|
|
@@ -294,7 +294,7 @@ var init_fi = __esm({
|
|
|
294
294
|
detailed_violations: "Yksityiskohtaiset rikkomukset",
|
|
295
295
|
prescriptive_fix: "\u{1F4A1} Ehdotettu korjaus",
|
|
296
296
|
use: "K\xE4yt\xE4",
|
|
297
|
-
footer: "Luonut @holmdigital/engine
|
|
297
|
+
footer: "Luonut @holmdigital/engine v{version} \u2022 Standardit: WCAG 2.1 AA, EN 301 549, Digipalvelulaki"
|
|
298
298
|
}
|
|
299
299
|
};
|
|
300
300
|
}
|
|
@@ -339,7 +339,7 @@ var init_dk = __esm({
|
|
|
339
339
|
detailed_violations: "Detaljerede Overtr\xE6delser",
|
|
340
340
|
prescriptive_fix: "\u{1F4A1} Foresl\xE5et L\xF8sning",
|
|
341
341
|
use: "Brug",
|
|
342
|
-
footer: "Genereret af @holmdigital/engine
|
|
342
|
+
footer: "Genereret af @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Lov om tilg\xE6ngelighed"
|
|
343
343
|
}
|
|
344
344
|
};
|
|
345
345
|
}
|
|
@@ -384,7 +384,7 @@ var init_no = __esm({
|
|
|
384
384
|
detailed_violations: "Detaljerte Brudd",
|
|
385
385
|
prescriptive_fix: "\u{1F4A1} Foresl\xE5tt L\xF8sning",
|
|
386
386
|
use: "Bruk",
|
|
387
|
-
footer: "Generert av @holmdigital/engine
|
|
387
|
+
footer: "Generert av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Uu-tilsynet"
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
390
|
}
|
|
@@ -429,7 +429,7 @@ var init_nl = __esm({
|
|
|
429
429
|
detailed_violations: "Gedetailleerde overtredingen",
|
|
430
430
|
prescriptive_fix: "\u{1F4A1} Voorgeschreven oplossing",
|
|
431
431
|
use: "Gebruik",
|
|
432
|
-
footer: "Gegenereerd door @holmdigital/engine
|
|
432
|
+
footer: "Gegenereerd door @holmdigital/engine v{version} \u2022 Standaarden: WCAG 2.1 AA, EN 301 549, Besluit digitale toegankelijkheid overheid"
|
|
433
433
|
}
|
|
434
434
|
};
|
|
435
435
|
}
|
|
@@ -767,18 +767,8 @@ var HtmlValidator = class {
|
|
|
767
767
|
|
|
768
768
|
// src/core/regulatory-scanner.ts
|
|
769
769
|
var import_node_fs = require("fs");
|
|
770
|
-
var import_node_path = require("path");
|
|
771
|
-
var import_node_url = require("url");
|
|
772
|
-
var import_meta = {};
|
|
773
770
|
function getEngineVersion() {
|
|
774
|
-
|
|
775
|
-
const dir = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
776
|
-
const pkgPath = (0, import_node_path.resolve)(dir, "..", "package.json");
|
|
777
|
-
const pkg = JSON.parse((0, import_node_fs.readFileSync)(pkgPath, "utf-8"));
|
|
778
|
-
return pkg.version;
|
|
779
|
-
} catch {
|
|
780
|
-
return "2.1.1";
|
|
781
|
-
}
|
|
771
|
+
return "2.1.6";
|
|
782
772
|
}
|
|
783
773
|
function getStandardsVersion() {
|
|
784
774
|
try {
|
|
@@ -836,7 +826,7 @@ var RegulatoryScanner = class {
|
|
|
836
826
|
retries--;
|
|
837
827
|
if (retries === 0) throw e;
|
|
838
828
|
this.log(`Navigation failed, retrying... (${retries} attempts left)`);
|
|
839
|
-
await new Promise((
|
|
829
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
840
830
|
}
|
|
841
831
|
}
|
|
842
832
|
try {
|
|
@@ -1408,7 +1398,7 @@ function generateReportHTML(result) {
|
|
|
1408
1398
|
}).join("")}
|
|
1409
1399
|
|
|
1410
1400
|
<footer>
|
|
1411
|
-
${t("report.footer")}
|
|
1401
|
+
${t("report.footer", { version: getEngineVersion() })}
|
|
1412
1402
|
</footer>
|
|
1413
1403
|
</body>
|
|
1414
1404
|
</html>
|
|
@@ -1451,11 +1441,14 @@ var import_components = require("@holmdigital/components");
|
|
|
1451
1441
|
var import_standards = require("@holmdigital/standards");
|
|
1452
1442
|
var import_promises = __toESM(require("fs/promises"));
|
|
1453
1443
|
var import_path = __toESM(require("path"));
|
|
1444
|
+
var import_node_url = require("url");
|
|
1445
|
+
var import_meta = {};
|
|
1446
|
+
var __dirname_esm = typeof __dirname === "undefined" ? import_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url)) : __dirname;
|
|
1454
1447
|
async function generateStatementContent(result, lang = "en", format = "html", metadata) {
|
|
1455
1448
|
let template;
|
|
1456
1449
|
const possibleTemplatePaths = [
|
|
1457
|
-
import_path.default.join(
|
|
1458
|
-
import_path.default.join(
|
|
1450
|
+
import_path.default.join(__dirname_esm, "templates", `${lang}.json`),
|
|
1451
|
+
import_path.default.join(__dirname_esm, "../src/reporting/templates", `${lang}.json`),
|
|
1459
1452
|
import_path.default.join(process.cwd(), "packages/engine/src/reporting/templates", `${lang}.json`)
|
|
1460
1453
|
];
|
|
1461
1454
|
let loaded = false;
|
|
@@ -1471,8 +1464,8 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
1471
1464
|
}
|
|
1472
1465
|
if (!loaded) {
|
|
1473
1466
|
const fallbackPaths = [
|
|
1474
|
-
import_path.default.join(
|
|
1475
|
-
import_path.default.join(
|
|
1467
|
+
import_path.default.join(__dirname_esm, "templates", "en.json"),
|
|
1468
|
+
import_path.default.join(__dirname_esm, "../src/reporting/templates", "en.json"),
|
|
1476
1469
|
import_path.default.join(process.cwd(), "packages/engine/src/reporting/templates", "en.json")
|
|
1477
1470
|
];
|
|
1478
1471
|
for (const p of fallbackPaths) {
|
|
@@ -1486,7 +1479,7 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
1486
1479
|
}
|
|
1487
1480
|
}
|
|
1488
1481
|
}
|
|
1489
|
-
if (!loaded) {
|
|
1482
|
+
if (!loaded || !template) {
|
|
1490
1483
|
throw new Error(`Accessibility statement templates missing. Looked in: ${possibleTemplatePaths.join(", ")}`);
|
|
1491
1484
|
}
|
|
1492
1485
|
let complianceLevel = "full";
|
|
@@ -1704,7 +1697,7 @@ function transformToCloudPayload(result) {
|
|
|
1704
1697
|
rule_id: report.ruleId,
|
|
1705
1698
|
impact: report.holmdigitalInsight?.diggRisk || "medium",
|
|
1706
1699
|
wcag_criteria: report.wcagCriteria ? [report.wcagCriteria] : [],
|
|
1707
|
-
element_selector: firstNode?.target || "",
|
|
1700
|
+
element_selector: Array.isArray(firstNode?.target) ? firstNode.target.join(" ") : firstNode?.target || "",
|
|
1708
1701
|
element_html: firstNode?.html || "",
|
|
1709
1702
|
failure_summary: report.holmdigitalInsight?.reasoning || report.remediation?.description || "",
|
|
1710
1703
|
fix_suggestion: report.remediation?.description || ""
|
package/dist/cli/index.mjs
CHANGED
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
generateStatement,
|
|
8
8
|
generateStatementContent,
|
|
9
9
|
getEngineVersion
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-BR2T76XC.mjs";
|
|
11
11
|
import {
|
|
12
12
|
getCurrentLang,
|
|
13
13
|
setLanguage,
|
|
14
14
|
t
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-PIGYYEJV.mjs";
|
|
16
16
|
import "../chunk-Y6FXYEAI.mjs";
|
|
17
17
|
|
|
18
18
|
// src/cli/index.ts
|
|
@@ -299,7 +299,7 @@ function generateReportHTML(result) {
|
|
|
299
299
|
}).join("")}
|
|
300
300
|
|
|
301
301
|
<footer>
|
|
302
|
-
${t("report.footer")}
|
|
302
|
+
${t("report.footer", { version: getEngineVersion() })}
|
|
303
303
|
</footer>
|
|
304
304
|
</body>
|
|
305
305
|
</html>
|
|
@@ -343,7 +343,7 @@ function transformToCloudPayload(result) {
|
|
|
343
343
|
rule_id: report.ruleId,
|
|
344
344
|
impact: report.holmdigitalInsight?.diggRisk || "medium",
|
|
345
345
|
wcag_criteria: report.wcagCriteria ? [report.wcagCriteria] : [],
|
|
346
|
-
element_selector: firstNode?.target || "",
|
|
346
|
+
element_selector: Array.isArray(firstNode?.target) ? firstNode.target.join(" ") : firstNode?.target || "",
|
|
347
347
|
element_html: firstNode?.html || "",
|
|
348
348
|
failure_summary: report.holmdigitalInsight?.reasoning || report.remediation?.description || "",
|
|
349
349
|
fix_suggestion: report.remediation?.description || ""
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RegulatoryReport } from '@holmdigital/standards';
|
|
1
|
+
import { EnrichedReport, RegulatoryReport } from '@holmdigital/standards';
|
|
2
2
|
import { Page } from 'puppeteer';
|
|
3
3
|
|
|
4
4
|
interface ValidationResult {
|
|
@@ -38,7 +38,7 @@ interface ScanResult {
|
|
|
38
38
|
url: string;
|
|
39
39
|
timestamp: string;
|
|
40
40
|
metadata: ScanMetadata;
|
|
41
|
-
reports:
|
|
41
|
+
reports: EnrichedReport[];
|
|
42
42
|
stats: {
|
|
43
43
|
passed: number;
|
|
44
44
|
critical: number;
|
|
@@ -137,7 +137,7 @@ var report = {
|
|
|
137
137
|
detailed_violations: "Detailed Violations",
|
|
138
138
|
prescriptive_fix: "💡 Prescriptive Fix",
|
|
139
139
|
use: "Use",
|
|
140
|
-
footer: "Generated by @holmdigital/engine
|
|
140
|
+
footer: "Generated by @holmdigital/engine v{version} • Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
|
|
141
141
|
};
|
|
142
142
|
var en = {
|
|
143
143
|
cli: cli,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RegulatoryReport } from '@holmdigital/standards';
|
|
1
|
+
import { EnrichedReport, RegulatoryReport } from '@holmdigital/standards';
|
|
2
2
|
import { Page } from 'puppeteer';
|
|
3
3
|
|
|
4
4
|
interface ValidationResult {
|
|
@@ -38,7 +38,7 @@ interface ScanResult {
|
|
|
38
38
|
url: string;
|
|
39
39
|
timestamp: string;
|
|
40
40
|
metadata: ScanMetadata;
|
|
41
|
-
reports:
|
|
41
|
+
reports: EnrichedReport[];
|
|
42
42
|
stats: {
|
|
43
43
|
passed: number;
|
|
44
44
|
critical: number;
|
|
@@ -137,7 +137,7 @@ var report = {
|
|
|
137
137
|
detailed_violations: "Detailed Violations",
|
|
138
138
|
prescriptive_fix: "💡 Prescriptive Fix",
|
|
139
139
|
use: "Use",
|
|
140
|
-
footer: "Generated by @holmdigital/engine
|
|
140
|
+
footer: "Generated by @holmdigital/engine v{version} • Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
|
|
141
141
|
};
|
|
142
142
|
var en = {
|
|
143
143
|
cli: cli,
|
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var init_en = __esm({
|
|
|
69
69
|
detailed_violations: "Detailed Violations",
|
|
70
70
|
prescriptive_fix: "\u{1F4A1} Prescriptive Fix",
|
|
71
71
|
use: "Use",
|
|
72
|
-
footer: "Generated by @holmdigital/engine
|
|
72
|
+
footer: "Generated by @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
}
|
|
@@ -114,7 +114,7 @@ var init_sv = __esm({
|
|
|
114
114
|
detailed_violations: "Detaljerade brister",
|
|
115
115
|
prescriptive_fix: "\u{1F4A1} Preskriptiv L\xF6sning",
|
|
116
116
|
use: "Anv\xE4nd",
|
|
117
|
-
footer: "Genererad av @holmdigital/engine
|
|
117
|
+
footer: "Genererad av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, DOS-lagen"
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
}
|
|
@@ -159,7 +159,7 @@ var init_de = __esm({
|
|
|
159
159
|
detailed_violations: "Detaillierte Verst\xF6\xDFe",
|
|
160
160
|
prescriptive_fix: "\u{1F4A1} Vorschriftsm\xE4\xDFige L\xF6sung",
|
|
161
161
|
use: "Verwenden",
|
|
162
|
-
footer: "Generiert von @holmdigital/engine
|
|
162
|
+
footer: "Generiert von @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, BITV 2.0"
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
165
|
}
|
|
@@ -204,7 +204,7 @@ var init_fr = __esm({
|
|
|
204
204
|
detailed_violations: "Violations D\xE9taill\xE9es",
|
|
205
205
|
prescriptive_fix: "\u{1F4A1} Solution Prescriptive",
|
|
206
206
|
use: "Utiliser",
|
|
207
|
-
footer: "G\xE9n\xE9r\xE9 par @holmdigital/engine
|
|
207
|
+
footer: "G\xE9n\xE9r\xE9 par @holmdigital/engine v{version} \u2022 Standards : WCAG 2.1 AA, EN 301 549, RGAA"
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
}
|
|
@@ -249,7 +249,7 @@ var init_es = __esm({
|
|
|
249
249
|
detailed_violations: "Violaciones Detalladas",
|
|
250
250
|
prescriptive_fix: "\u{1F4A1} Soluci\xF3n Prescriptiva",
|
|
251
251
|
use: "Usar",
|
|
252
|
-
footer: "Generado por @holmdigital/engine
|
|
252
|
+
footer: "Generado por @holmdigital/engine v{version} \u2022 Est\xE1ndares: WCAG 2.1 AA, EN 301 549, UNE 139803"
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
255
|
}
|
|
@@ -294,7 +294,7 @@ var init_fi = __esm({
|
|
|
294
294
|
detailed_violations: "Yksityiskohtaiset rikkomukset",
|
|
295
295
|
prescriptive_fix: "\u{1F4A1} Ehdotettu korjaus",
|
|
296
296
|
use: "K\xE4yt\xE4",
|
|
297
|
-
footer: "Luonut @holmdigital/engine
|
|
297
|
+
footer: "Luonut @holmdigital/engine v{version} \u2022 Standardit: WCAG 2.1 AA, EN 301 549, Digipalvelulaki"
|
|
298
298
|
}
|
|
299
299
|
};
|
|
300
300
|
}
|
|
@@ -339,7 +339,7 @@ var init_dk = __esm({
|
|
|
339
339
|
detailed_violations: "Detaljerede Overtr\xE6delser",
|
|
340
340
|
prescriptive_fix: "\u{1F4A1} Foresl\xE5et L\xF8sning",
|
|
341
341
|
use: "Brug",
|
|
342
|
-
footer: "Genereret af @holmdigital/engine
|
|
342
|
+
footer: "Genereret af @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Lov om tilg\xE6ngelighed"
|
|
343
343
|
}
|
|
344
344
|
};
|
|
345
345
|
}
|
|
@@ -384,7 +384,7 @@ var init_no = __esm({
|
|
|
384
384
|
detailed_violations: "Detaljerte Brudd",
|
|
385
385
|
prescriptive_fix: "\u{1F4A1} Foresl\xE5tt L\xF8sning",
|
|
386
386
|
use: "Bruk",
|
|
387
|
-
footer: "Generert av @holmdigital/engine
|
|
387
|
+
footer: "Generert av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Uu-tilsynet"
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
390
|
}
|
|
@@ -429,7 +429,7 @@ var init_nl = __esm({
|
|
|
429
429
|
detailed_violations: "Gedetailleerde overtredingen",
|
|
430
430
|
prescriptive_fix: "\u{1F4A1} Voorgeschreven oplossing",
|
|
431
431
|
use: "Gebruik",
|
|
432
|
-
footer: "Gegenereerd door @holmdigital/engine
|
|
432
|
+
footer: "Gegenereerd door @holmdigital/engine v{version} \u2022 Standaarden: WCAG 2.1 AA, EN 301 549, Besluit digitale toegankelijkheid overheid"
|
|
433
433
|
}
|
|
434
434
|
};
|
|
435
435
|
}
|
|
@@ -663,18 +663,8 @@ var HtmlValidator = class {
|
|
|
663
663
|
|
|
664
664
|
// src/core/regulatory-scanner.ts
|
|
665
665
|
var import_node_fs = require("fs");
|
|
666
|
-
var import_node_path = require("path");
|
|
667
|
-
var import_node_url = require("url");
|
|
668
|
-
var import_meta = {};
|
|
669
666
|
function getEngineVersion() {
|
|
670
|
-
|
|
671
|
-
const dir = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
672
|
-
const pkgPath = (0, import_node_path.resolve)(dir, "..", "package.json");
|
|
673
|
-
const pkg = JSON.parse((0, import_node_fs.readFileSync)(pkgPath, "utf-8"));
|
|
674
|
-
return pkg.version;
|
|
675
|
-
} catch {
|
|
676
|
-
return "2.1.1";
|
|
677
|
-
}
|
|
667
|
+
return "2.1.6";
|
|
678
668
|
}
|
|
679
669
|
function getStandardsVersion() {
|
|
680
670
|
try {
|
|
@@ -732,7 +722,7 @@ var RegulatoryScanner = class {
|
|
|
732
722
|
retries--;
|
|
733
723
|
if (retries === 0) throw e;
|
|
734
724
|
this.log(`Navigation failed, retrying... (${retries} attempts left)`);
|
|
735
|
-
await new Promise((
|
|
725
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
736
726
|
}
|
|
737
727
|
}
|
|
738
728
|
try {
|
|
@@ -1017,6 +1007,7 @@ var import_components = require("@holmdigital/components");
|
|
|
1017
1007
|
var import_standards = require("@holmdigital/standards");
|
|
1018
1008
|
var import_promises = __toESM(require("fs/promises"));
|
|
1019
1009
|
var import_path = __toESM(require("path"));
|
|
1010
|
+
var import_node_url = require("url");
|
|
1020
1011
|
|
|
1021
1012
|
// src/reporting/badge-generator.ts
|
|
1022
1013
|
var BADGE_COLOR = "00703C";
|
|
@@ -1029,11 +1020,13 @@ function generateBadgeUrl(score) {
|
|
|
1029
1020
|
}
|
|
1030
1021
|
|
|
1031
1022
|
// src/reporting/statement-generator.ts
|
|
1023
|
+
var import_meta = {};
|
|
1024
|
+
var __dirname_esm = typeof __dirname === "undefined" ? import_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url)) : __dirname;
|
|
1032
1025
|
async function generateStatementContent(result, lang = "en", format = "html", metadata) {
|
|
1033
1026
|
let template;
|
|
1034
1027
|
const possibleTemplatePaths = [
|
|
1035
|
-
import_path.default.join(
|
|
1036
|
-
import_path.default.join(
|
|
1028
|
+
import_path.default.join(__dirname_esm, "templates", `${lang}.json`),
|
|
1029
|
+
import_path.default.join(__dirname_esm, "../src/reporting/templates", `${lang}.json`),
|
|
1037
1030
|
import_path.default.join(process.cwd(), "packages/engine/src/reporting/templates", `${lang}.json`)
|
|
1038
1031
|
];
|
|
1039
1032
|
let loaded = false;
|
|
@@ -1049,8 +1042,8 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
1049
1042
|
}
|
|
1050
1043
|
if (!loaded) {
|
|
1051
1044
|
const fallbackPaths = [
|
|
1052
|
-
import_path.default.join(
|
|
1053
|
-
import_path.default.join(
|
|
1045
|
+
import_path.default.join(__dirname_esm, "templates", "en.json"),
|
|
1046
|
+
import_path.default.join(__dirname_esm, "../src/reporting/templates", "en.json"),
|
|
1054
1047
|
import_path.default.join(process.cwd(), "packages/engine/src/reporting/templates", "en.json")
|
|
1055
1048
|
];
|
|
1056
1049
|
for (const p of fallbackPaths) {
|
|
@@ -1064,7 +1057,7 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
1064
1057
|
}
|
|
1065
1058
|
}
|
|
1066
1059
|
}
|
|
1067
|
-
if (!loaded) {
|
|
1060
|
+
if (!loaded || !template) {
|
|
1068
1061
|
throw new Error(`Accessibility statement templates missing. Looked in: ${possibleTemplatePaths.join(", ")}`);
|
|
1069
1062
|
}
|
|
1070
1063
|
let complianceLevel = "full";
|
package/dist/index.mjs
CHANGED
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
generateStatement,
|
|
6
6
|
generateStatementContent,
|
|
7
7
|
getEngineVersion
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BR2T76XC.mjs";
|
|
9
9
|
import {
|
|
10
10
|
getCurrentLang,
|
|
11
11
|
setLanguage,
|
|
12
12
|
t
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-PIGYYEJV.mjs";
|
|
14
14
|
import "./chunk-Y6FXYEAI.mjs";
|
|
15
15
|
export {
|
|
16
16
|
PseudoAutomationEngine,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holmdigital/engine",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"README.md"
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
|
-
"build": "tsup
|
|
34
|
-
"dev": "tsup
|
|
33
|
+
"build": "tsup && node scripts/copy-assets.mjs",
|
|
34
|
+
"dev": "tsup --watch",
|
|
35
35
|
"test": "vitest",
|
|
36
36
|
"test:ci": "vitest run",
|
|
37
37
|
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"author": "Holm Digital AB",
|
|
61
61
|
"license": "MIT",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@holmdigital/components": "^2.1.
|
|
63
|
+
"@holmdigital/components": "^2.1.3",
|
|
64
64
|
"@holmdigital/standards": "*",
|
|
65
65
|
"axe-core": "^4.11.1",
|
|
66
66
|
"chalk": "^5.3.0",
|