@holmdigital/engine 3.0.1 → 3.1.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/dist/{chunk-AWUGOYYR.mjs → chunk-5GP6KD7Q.mjs} +98 -11
- package/dist/chunk-QEHLOWUK.mjs +9 -0
- package/dist/{chunk-AQFORQWK.mjs → chunk-RNCZ2GNY.mjs} +37 -1
- package/dist/cli/index.js +301 -55
- package/dist/cli/index.mjs +118 -32
- package/dist/{github-actions-5AFDFD4T.mjs → github-actions-PIV5JU2C.mjs} +12 -6
- package/dist/{i18n-TCH23V3M.mjs → i18n-7RPBNX7F.mjs} +1 -1
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +135 -10
- package/dist/index.mjs +3 -2
- package/dist/{junit-generator-MNO6GP5J.mjs → junit-generator-5DTJ7YEU.mjs} +16 -3
- package/dist/{plain-report-OF2MNEE4.mjs → plain-report-XZZM5ZHK.mjs} +28 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -90,6 +90,8 @@ var init_en = __esm({
|
|
|
90
90
|
total_issues: "Total Issues",
|
|
91
91
|
html_errors: "HTML Errors",
|
|
92
92
|
detailed_violations: "Detailed Violations",
|
|
93
|
+
needs_review_title: "Needs review ({count})",
|
|
94
|
+
needs_review_note: "axe-core could not determine these automatically \u2014 verify them manually. They are not counted in the totals above.",
|
|
93
95
|
prescriptive_fix: "\u{1F4A1} Prescriptive Fix",
|
|
94
96
|
use: "Use",
|
|
95
97
|
footer: "Generated by @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
|
|
@@ -115,6 +117,8 @@ var init_en = __esm({
|
|
|
115
117
|
attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
|
|
116
118
|
fallback_framing: "Technical finding. Ask your developer to review this:",
|
|
117
119
|
occurrences: "{count} occurrences",
|
|
120
|
+
needs_review_heading: "Needs a human check ({count})",
|
|
121
|
+
needs_review_intro: "Automated tools couldn't decide these \u2014 a person should confirm them. They're not counted as barriers above.",
|
|
118
122
|
gate_blocked: "Plain-language (klarspr\xE5k) output is not yet available in '{lang}'.",
|
|
119
123
|
gate_supported: "Languages with klarspr\xE5k: {langs}.",
|
|
120
124
|
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv).",
|
|
@@ -172,6 +176,8 @@ var init_sv = __esm({
|
|
|
172
176
|
total_issues: "Antal brister",
|
|
173
177
|
html_errors: "HTML-fel",
|
|
174
178
|
detailed_violations: "Detaljerade brister",
|
|
179
|
+
needs_review_title: "Beh\xF6ver granskas ({count})",
|
|
180
|
+
needs_review_note: "axe-core kunde inte avg\xF6ra dessa automatiskt \u2014 kontrollera dem manuellt. De r\xE4knas inte in i summorna ovan.",
|
|
175
181
|
prescriptive_fix: "\u{1F4A1} Preskriptiv L\xF6sning",
|
|
176
182
|
use: "Anv\xE4nd",
|
|
177
183
|
footer: "Genererad av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, DOS-lagen"
|
|
@@ -197,6 +203,8 @@ var init_sv = __esm({
|
|
|
197
203
|
attribution: "Rapporten genererades av HolmDigital Engine, en del av HolmDigitals ekosystem f\xF6r tillg\xE4nglighet.",
|
|
198
204
|
fallback_framing: "Tekniskt fynd som din utvecklare beh\xF6ver titta p\xE5.",
|
|
199
205
|
occurrences: "{count} f\xF6rekomster",
|
|
206
|
+
needs_review_heading: "Beh\xF6ver en m\xE4nsklig kontroll ({count})",
|
|
207
|
+
needs_review_intro: "Automatiken kunde inte avg\xF6ra dessa \u2014 en m\xE4nniska b\xF6r bekr\xE4fta dem. De r\xE4knas inte som hinder ovan.",
|
|
200
208
|
gate_blocked: "Klarspr\xE5k st\xF6ds \xE4nnu inte p\xE5 '{lang}'.",
|
|
201
209
|
gate_supported: "Spr\xE5k med klarspr\xE5k: {langs}.",
|
|
202
210
|
gate_howto: "K\xF6r utan --plain f\xF6r utvecklarrapporten, eller v\xE4lj ett spr\xE5k som st\xF6ds (t.ex. --lang sv).",
|
|
@@ -254,6 +262,8 @@ var init_de = __esm({
|
|
|
254
262
|
total_issues: "Gesamtprobleme",
|
|
255
263
|
html_errors: "HTML-Fehler",
|
|
256
264
|
detailed_violations: "Detaillierte Verst\xF6\xDFe",
|
|
265
|
+
needs_review_title: "Muss gepr\xFCft werden ({count})",
|
|
266
|
+
needs_review_note: "axe-core konnte diese nicht automatisch bestimmen \u2014 bitte manuell pr\xFCfen. Sie werden oben nicht mitgez\xE4hlt.",
|
|
257
267
|
prescriptive_fix: "\u{1F4A1} Vorschriftsm\xE4\xDFige L\xF6sung",
|
|
258
268
|
use: "Verwenden",
|
|
259
269
|
footer: "Generiert von @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, BITV 2.0"
|
|
@@ -279,6 +289,8 @@ var init_de = __esm({
|
|
|
279
289
|
attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
|
|
280
290
|
fallback_framing: "Technical finding. Ask your developer to review this:",
|
|
281
291
|
occurrences: "{count} occurrences",
|
|
292
|
+
needs_review_heading: "Braucht eine menschliche Pr\xFCfung ({count})",
|
|
293
|
+
needs_review_intro: "Automatische Werkzeuge konnten dies nicht entscheiden \u2014 eine Person sollte es best\xE4tigen. Sie z\xE4hlen oben nicht als Barrieren.",
|
|
282
294
|
gate_blocked: "Verst\xE4ndliche Sprache (Klarspr\xE5k) ist f\xFCr '{lang}' noch nicht verf\xFCgbar.",
|
|
283
295
|
gate_supported: "Sprachen mit verst\xE4ndlicher Sprache: {langs}.",
|
|
284
296
|
gate_howto: "Ohne --plain ausf\xFChren f\xFCr den Entwicklerbericht, oder eine unterst\xFCtzte Sprache verwenden (z. B. --lang sv).",
|
|
@@ -336,6 +348,8 @@ var init_fr = __esm({
|
|
|
336
348
|
total_issues: "Total des Probl\xE8mes",
|
|
337
349
|
html_errors: "Erreurs HTML",
|
|
338
350
|
detailed_violations: "Violations D\xE9taill\xE9es",
|
|
351
|
+
needs_review_title: "\xC0 v\xE9rifier ({count})",
|
|
352
|
+
needs_review_note: "axe-core n'a pas pu les d\xE9terminer automatiquement \u2014 v\xE9rifiez-les manuellement. Ils ne sont pas compt\xE9s dans les totaux ci-dessus.",
|
|
339
353
|
prescriptive_fix: "\u{1F4A1} Solution Prescriptive",
|
|
340
354
|
use: "Utiliser",
|
|
341
355
|
footer: "G\xE9n\xE9r\xE9 par @holmdigital/engine v{version} \u2022 Standards : WCAG 2.1 AA, EN 301 549, RGAA"
|
|
@@ -361,6 +375,8 @@ var init_fr = __esm({
|
|
|
361
375
|
attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
|
|
362
376
|
fallback_framing: "Technical finding. Ask your developer to review this:",
|
|
363
377
|
occurrences: "{count} occurrences",
|
|
378
|
+
needs_review_heading: "N\xE9cessite une v\xE9rification humaine ({count})",
|
|
379
|
+
needs_review_intro: "Les outils automatiques n'ont pas pu trancher \u2014 une personne devrait le confirmer. Ils ne sont pas compt\xE9s comme des obstacles ci-dessus.",
|
|
364
380
|
gate_blocked: "Le langage clair (klarspr\xE5k) n'est pas encore disponible en \xAB {lang} \xBB.",
|
|
365
381
|
gate_supported: "Langues avec langage clair : {langs}.",
|
|
366
382
|
gate_howto: "Lancez sans --plain pour le rapport d\xE9veloppeur, ou utilisez une langue prise en charge (par ex. --lang sv).",
|
|
@@ -418,6 +434,8 @@ var init_es = __esm({
|
|
|
418
434
|
total_issues: "Problemas Totales",
|
|
419
435
|
html_errors: "Errores HTML",
|
|
420
436
|
detailed_violations: "Violaciones Detalladas",
|
|
437
|
+
needs_review_title: "Requiere revisi\xF3n ({count})",
|
|
438
|
+
needs_review_note: "axe-core no pudo determinarlos autom\xE1ticamente \u2014 verif\xEDcalos manualmente. No se cuentan en los totales anteriores.",
|
|
421
439
|
prescriptive_fix: "\u{1F4A1} Soluci\xF3n Prescriptiva",
|
|
422
440
|
use: "Usar",
|
|
423
441
|
footer: "Generado por @holmdigital/engine v{version} \u2022 Est\xE1ndares: WCAG 2.1 AA, EN 301 549, UNE 139803"
|
|
@@ -443,6 +461,8 @@ var init_es = __esm({
|
|
|
443
461
|
attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
|
|
444
462
|
fallback_framing: "Technical finding. Ask your developer to review this:",
|
|
445
463
|
occurrences: "{count} occurrences",
|
|
464
|
+
needs_review_heading: "Necesita una revisi\xF3n humana ({count})",
|
|
465
|
+
needs_review_intro: "Las herramientas autom\xE1ticas no pudieron decidirlo \u2014 una persona deber\xEDa confirmarlo. No se cuentan como barreras arriba.",
|
|
446
466
|
gate_blocked: "El lenguaje claro (klarspr\xE5k) a\xFAn no est\xE1 disponible en '{lang}'.",
|
|
447
467
|
gate_supported: "Idiomas con lenguaje claro: {langs}.",
|
|
448
468
|
gate_howto: "Ejecuta sin --plain para el informe para desarrolladores, o usa un idioma compatible (p. ej. --lang sv).",
|
|
@@ -500,6 +520,8 @@ var init_fi = __esm({
|
|
|
500
520
|
total_issues: "Ongelmat yhteens\xE4",
|
|
501
521
|
html_errors: "HTML-virheet",
|
|
502
522
|
detailed_violations: "Yksityiskohtaiset rikkomukset",
|
|
523
|
+
needs_review_title: "Vaatii tarkistuksen ({count})",
|
|
524
|
+
needs_review_note: "axe-core ei voinut m\xE4\xE4ritt\xE4\xE4 n\xE4it\xE4 automaattisesti \u2014 tarkista ne manuaalisesti. Niit\xE4 ei lasketa yll\xE4 oleviin summiin.",
|
|
503
525
|
prescriptive_fix: "\u{1F4A1} Ehdotettu korjaus",
|
|
504
526
|
use: "K\xE4yt\xE4",
|
|
505
527
|
footer: "Luonut @holmdigital/engine v{version} \u2022 Standardit: WCAG 2.1 AA, EN 301 549, Digipalvelulaki"
|
|
@@ -525,6 +547,8 @@ var init_fi = __esm({
|
|
|
525
547
|
attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
|
|
526
548
|
fallback_framing: "Technical finding. Ask your developer to review this:",
|
|
527
549
|
occurrences: "{count} occurrences",
|
|
550
|
+
needs_review_heading: "Vaatii ihmisen tarkistuksen ({count})",
|
|
551
|
+
needs_review_intro: "Automaattiset ty\xF6kalut eiv\xE4t voineet p\xE4\xE4tt\xE4\xE4 n\xE4it\xE4 \u2014 ihmisen tulisi vahvistaa ne. Niit\xE4 ei lasketa esteiksi yll\xE4.",
|
|
528
552
|
gate_blocked: "Selkokielinen (klarspr\xE5k) raportti ei ole viel\xE4 saatavilla kielell\xE4 '{lang}'.",
|
|
529
553
|
gate_supported: "Kielet, joilla selkokielinen raportti on saatavilla: {langs}.",
|
|
530
554
|
gate_howto: "Aja ilman --plain-valitsinta kehitt\xE4j\xE4raporttia varten tai k\xE4yt\xE4 tuettua kielt\xE4 (esim. --lang sv).",
|
|
@@ -582,6 +606,8 @@ var init_dk = __esm({
|
|
|
582
606
|
total_issues: "Totale Fejl",
|
|
583
607
|
html_errors: "HTML Fejl",
|
|
584
608
|
detailed_violations: "Detaljerede Overtr\xE6delser",
|
|
609
|
+
needs_review_title: "Skal gennemg\xE5s ({count})",
|
|
610
|
+
needs_review_note: "axe-core kunne ikke afg\xF8re disse automatisk \u2014 kontroll\xE9r dem manuelt. De t\xE6lles ikke med i totalerne ovenfor.",
|
|
585
611
|
prescriptive_fix: "\u{1F4A1} Foresl\xE5et L\xF8sning",
|
|
586
612
|
use: "Brug",
|
|
587
613
|
footer: "Genereret af @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Lov om tilg\xE6ngelighed"
|
|
@@ -607,6 +633,8 @@ var init_dk = __esm({
|
|
|
607
633
|
attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
|
|
608
634
|
fallback_framing: "Technical finding. Ask your developer to review this:",
|
|
609
635
|
occurrences: "{count} occurrences",
|
|
636
|
+
needs_review_heading: "Kr\xE6ver et menneskeligt tjek ({count})",
|
|
637
|
+
needs_review_intro: "Automatiske v\xE6rkt\xF8jer kunne ikke afg\xF8re disse \u2014 en person b\xF8r bekr\xE6fte dem. De t\xE6lles ikke som barrierer ovenfor.",
|
|
610
638
|
gate_blocked: "Klarsprog (klarspr\xE5k) er endnu ikke tilg\xE6ngeligt p\xE5 '{lang}'.",
|
|
611
639
|
gate_supported: "Sprog med klarsprog: {langs}.",
|
|
612
640
|
gate_howto: "K\xF8r uden --plain for udviklerrapporten, eller brug et underst\xF8ttet sprog (f.eks. --lang sv).",
|
|
@@ -635,7 +663,7 @@ var init_no = __esm({
|
|
|
635
663
|
statement_saved: "Tilgjengelighetserkl\xE6ring lagret i {path}",
|
|
636
664
|
score: "\nEtterlevelsespoeng: {score}/100",
|
|
637
665
|
status: "Etterlevelsesstatus: {status}",
|
|
638
|
-
not_compliant: " (Oppfyller ikke lovkrav -
|
|
666
|
+
not_compliant: " (Oppfyller ikke lovkrav - forskrift om universell utforming av IKT-l\xF8sninger)",
|
|
639
667
|
viewport: "Visningsomr\xE5de: {width}x{height}",
|
|
640
668
|
prescriptive_fix: "\n\u{1F4A1} Foresl\xE5tt l\xF8sning:",
|
|
641
669
|
use_component: "Bruk komponent: {component}",
|
|
@@ -664,6 +692,8 @@ var init_no = __esm({
|
|
|
664
692
|
total_issues: "Totale Feil",
|
|
665
693
|
html_errors: "HTML Feil",
|
|
666
694
|
detailed_violations: "Detaljerte Brudd",
|
|
695
|
+
needs_review_title: "M\xE5 gjennomg\xE5s ({count})",
|
|
696
|
+
needs_review_note: "axe-core kunne ikke avgj\xF8re disse automatisk \u2014 kontroller dem manuelt. De telles ikke med i totalene ovenfor.",
|
|
667
697
|
prescriptive_fix: "\u{1F4A1} Foresl\xE5tt L\xF8sning",
|
|
668
698
|
use: "Bruk",
|
|
669
699
|
footer: "Generert av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Uu-tilsynet"
|
|
@@ -689,6 +719,8 @@ var init_no = __esm({
|
|
|
689
719
|
attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
|
|
690
720
|
fallback_framing: "Technical finding. Ask your developer to review this:",
|
|
691
721
|
occurrences: "{count} occurrences",
|
|
722
|
+
needs_review_heading: "Trenger en menneskelig sjekk ({count})",
|
|
723
|
+
needs_review_intro: "Automatiske verkt\xF8y kunne ikke avgj\xF8re disse \u2014 en person b\xF8r bekrefte dem. De telles ikke som barrierer ovenfor.",
|
|
692
724
|
gate_blocked: "Klarspr\xE5k er enn\xE5 ikke tilgjengelig p\xE5 '{lang}'.",
|
|
693
725
|
gate_supported: "Spr\xE5k med klarspr\xE5k: {langs}.",
|
|
694
726
|
gate_howto: "Kj\xF8r uten --plain for utviklerrapporten, eller bruk et st\xF8ttet spr\xE5k (f.eks. --lang sv).",
|
|
@@ -746,6 +778,8 @@ var init_nl = __esm({
|
|
|
746
778
|
total_issues: "Totaal aantal problemen",
|
|
747
779
|
html_errors: "HTML-fouten",
|
|
748
780
|
detailed_violations: "Gedetailleerde overtredingen",
|
|
781
|
+
needs_review_title: "Moet worden gecontroleerd ({count})",
|
|
782
|
+
needs_review_note: "axe-core kon deze niet automatisch bepalen \u2014 controleer ze handmatig. Ze worden hierboven niet meegeteld.",
|
|
749
783
|
prescriptive_fix: "\u{1F4A1} Voorgeschreven oplossing",
|
|
750
784
|
use: "Gebruik",
|
|
751
785
|
footer: "Gegenereerd door @holmdigital/engine v{version} \u2022 Standaarden: WCAG 2.1 AA, EN 301 549, Besluit digitale toegankelijkheid overheid"
|
|
@@ -771,6 +805,8 @@ var init_nl = __esm({
|
|
|
771
805
|
attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
|
|
772
806
|
fallback_framing: "Technical finding. Ask your developer to review this:",
|
|
773
807
|
occurrences: "{count} occurrences",
|
|
808
|
+
needs_review_heading: "Heeft een menselijke controle nodig ({count})",
|
|
809
|
+
needs_review_intro: "Automatische tools konden dit niet bepalen \u2014 een persoon moet het bevestigen. Ze tellen hierboven niet als drempels.",
|
|
774
810
|
gate_blocked: "Begrijpelijke taal (klarspr\xE5k) is nog niet beschikbaar in '{lang}'.",
|
|
775
811
|
gate_supported: "Talen met begrijpelijke taal: {langs}.",
|
|
776
812
|
gate_howto: "Voer uit zonder --plain voor het ontwikkelaarsrapport, of gebruik een ondersteunde taal (bijv. --lang sv).",
|
|
@@ -1083,7 +1119,7 @@ async function probeWithoutJavaScript(browser, options) {
|
|
|
1083
1119
|
// src/core/regulatory-scanner.ts
|
|
1084
1120
|
var import_node_fs = require("fs");
|
|
1085
1121
|
function getEngineVersion() {
|
|
1086
|
-
return "3.0
|
|
1122
|
+
return "3.1.0";
|
|
1087
1123
|
}
|
|
1088
1124
|
function getStandardsVersion() {
|
|
1089
1125
|
try {
|
|
@@ -1205,12 +1241,14 @@ var RegulatoryScanner = class {
|
|
|
1205
1241
|
this.log(`Raw Axe Violations: ${axeResults.violations?.length || 0}`);
|
|
1206
1242
|
passedCount = axeResults.passes?.length || 0;
|
|
1207
1243
|
const regulatoryReports = this.options.light ? await this.enrichResultsLight(axeResults) : await this.enrichResults(axeResults);
|
|
1244
|
+
const incompleteReports = await this.enrichIncomplete(axeResults);
|
|
1245
|
+
const allReports = [...regulatoryReports, ...incompleteReports];
|
|
1208
1246
|
let noScript;
|
|
1209
1247
|
if (this.options.noScriptCheck) {
|
|
1210
1248
|
noScript = await this.runNoScriptCheck(textLengthWithJs ?? 0);
|
|
1211
1249
|
}
|
|
1212
1250
|
const scanDuration = Date.now() - startTime;
|
|
1213
|
-
const result = this.generateResultPackage(
|
|
1251
|
+
const result = this.generateResultPackage(allReports, passedCount, scanDuration, pageTitle, pageLanguage);
|
|
1214
1252
|
if (htmlValidation) {
|
|
1215
1253
|
result.htmlValidation = htmlValidation;
|
|
1216
1254
|
}
|
|
@@ -1420,14 +1458,96 @@ var RegulatoryScanner = class {
|
|
|
1420
1458
|
}
|
|
1421
1459
|
return reports;
|
|
1422
1460
|
}
|
|
1461
|
+
/**
|
|
1462
|
+
* KRAV-3 (Intern #12): bär axes `incomplete` vidare som "needs review"-poster
|
|
1463
|
+
* (internt `cantTell`). axe kunde inte avgöra pass/fail, så en människa måste
|
|
1464
|
+
* kontrollera. Poster märks `cantTell` och exkluderas ur stats/score/
|
|
1465
|
+
* complianceStatus i generateResultPackage — men tappas aldrig tyst.
|
|
1466
|
+
*
|
|
1467
|
+
* Skälet läses ur nodens check-data (`message` + `messageKey`), t.ex.
|
|
1468
|
+
* `bgOverlap` = bakgrunden kunde inte bestämmas. Ett `contrastRatio: 0` som
|
|
1469
|
+
* följer med i det fallet är INTE en uppmätt nollkontrast, så vi bär
|
|
1470
|
+
* skäl-texten, aldrig ett hopfabricerat mätvärde (Intern #20).
|
|
1471
|
+
*/
|
|
1472
|
+
async enrichIncomplete(axeResults) {
|
|
1473
|
+
const incomplete = axeResults.incomplete;
|
|
1474
|
+
if (!incomplete || incomplete.length === 0) return [];
|
|
1475
|
+
const reports = [];
|
|
1476
|
+
const { generateRegulatoryReport, getConvergenceRule } = await import("@holmdigital/standards");
|
|
1477
|
+
const { getCurrentLang: getCurrentLang2 } = await Promise.resolve().then(() => (init_i18n(), i18n_exports));
|
|
1478
|
+
const lang = getCurrentLang2();
|
|
1479
|
+
const readMessageKey = (checks) => checks?.find((c) => c.data && typeof c.data === "object" && "messageKey" in c.data) ?? checks?.[0];
|
|
1480
|
+
for (const item of incomplete) {
|
|
1481
|
+
const nodeInfos = item.nodes.map((node) => {
|
|
1482
|
+
const c = readMessageKey(node.any);
|
|
1483
|
+
const data = c?.data && typeof c.data === "object" ? c.data : void 0;
|
|
1484
|
+
const messageKey = data && typeof data.messageKey === "string" ? data.messageKey : void 0;
|
|
1485
|
+
const concerning = !!data && ("expectedContrastRatio" in data || "contrastRatio" in data);
|
|
1486
|
+
return {
|
|
1487
|
+
html: node.html,
|
|
1488
|
+
target: node.target.join(" "),
|
|
1489
|
+
// axes egen check-message (VARFÖR den inte kunde avgöras).
|
|
1490
|
+
// Aldrig ett kontrastvärde — i bgOverlap-fallet finns inget uppmätt.
|
|
1491
|
+
failureSummary: c?.message ?? node.failureSummary ?? item.help,
|
|
1492
|
+
messageKey,
|
|
1493
|
+
concerning
|
|
1494
|
+
};
|
|
1495
|
+
});
|
|
1496
|
+
const ordered = nodeInfos.map((n, i) => ({ n, i })).sort((a, b) => Number(b.n.concerning) - Number(a.n.concerning) || a.i - b.i).map((x) => x.n);
|
|
1497
|
+
const reviewReason = (ordered.find((n) => n.concerning) ?? ordered[0])?.messageKey;
|
|
1498
|
+
const failingNodes = ordered.slice(0, 3).map((n) => ({
|
|
1499
|
+
html: n.html,
|
|
1500
|
+
target: n.target,
|
|
1501
|
+
failureSummary: n.failureSummary
|
|
1502
|
+
}));
|
|
1503
|
+
const reasoning = failingNodes[0]?.failureSummary ?? item.help;
|
|
1504
|
+
const base = generateRegulatoryReport(item.id, lang);
|
|
1505
|
+
if (base) {
|
|
1506
|
+
const fullRule = getConvergenceRule(base.ruleId, lang);
|
|
1507
|
+
reports.push({
|
|
1508
|
+
...base,
|
|
1509
|
+
cantTell: true,
|
|
1510
|
+
reviewReason,
|
|
1511
|
+
holmdigitalInsight: { ...base.holmdigitalInsight, reasoning },
|
|
1512
|
+
legalContext: fullRule?.legalContext,
|
|
1513
|
+
failingNodes
|
|
1514
|
+
});
|
|
1515
|
+
} else {
|
|
1516
|
+
reports.push({
|
|
1517
|
+
ruleId: item.id,
|
|
1518
|
+
wcagCriteria: item.tags.find((t2) => t2.startsWith("wcag")) || "Unknown",
|
|
1519
|
+
en301549Criteria: "",
|
|
1520
|
+
dosLagenReference: "",
|
|
1521
|
+
diggRisk: "medium",
|
|
1522
|
+
eaaImpact: "medium",
|
|
1523
|
+
remediation: { description: item.help, technicalGuidance: item.description, component: void 0 },
|
|
1524
|
+
holmdigitalInsight: {
|
|
1525
|
+
diggRisk: "medium",
|
|
1526
|
+
eaaImpact: "medium",
|
|
1527
|
+
reasoning,
|
|
1528
|
+
swedishInterpretation: "",
|
|
1529
|
+
priorityRationale: ""
|
|
1530
|
+
},
|
|
1531
|
+
testability: { automated: false, requiresManualCheck: true, pseudoAutomation: false, complexity: "moderate" },
|
|
1532
|
+
cantTell: true,
|
|
1533
|
+
reviewReason,
|
|
1534
|
+
failingNodes
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
return reports;
|
|
1539
|
+
}
|
|
1423
1540
|
generateResultPackage(reports, passedCount, scanDuration, pageTitle, pageLanguage) {
|
|
1541
|
+
const scored = reports.filter((r) => !r.cantTell);
|
|
1542
|
+
const needsReview = reports.length - scored.length;
|
|
1424
1543
|
const stats = {
|
|
1425
1544
|
passed: passedCount,
|
|
1426
|
-
critical:
|
|
1427
|
-
high:
|
|
1428
|
-
medium:
|
|
1429
|
-
low:
|
|
1430
|
-
total:
|
|
1545
|
+
critical: scored.filter((r) => r.holmdigitalInsight.diggRisk === "critical").length,
|
|
1546
|
+
high: scored.filter((r) => r.holmdigitalInsight.diggRisk === "high").length,
|
|
1547
|
+
medium: scored.filter((r) => r.holmdigitalInsight.diggRisk === "medium").length,
|
|
1548
|
+
low: scored.filter((r) => r.holmdigitalInsight.diggRisk === "low").length,
|
|
1549
|
+
total: scored.length,
|
|
1550
|
+
needsReview
|
|
1431
1551
|
};
|
|
1432
1552
|
const weightedScore = stats.critical * 25 + // Critical violations are severe
|
|
1433
1553
|
stats.high * 15 + // High risk affects usability significantly
|
|
@@ -1458,7 +1578,7 @@ var RegulatoryScanner = class {
|
|
|
1458
1578
|
pageTitle,
|
|
1459
1579
|
pageLanguage
|
|
1460
1580
|
};
|
|
1461
|
-
const reportsWithContext =
|
|
1581
|
+
const reportsWithContext = scored.filter((r) => r.legalContext);
|
|
1462
1582
|
const legalSummary = {
|
|
1463
1583
|
wadApplicable: reportsWithContext.filter(
|
|
1464
1584
|
(r) => r.legalContext?.appliesTo?.includes("WAD")
|
|
@@ -1584,6 +1704,11 @@ function generateBadgeUrl(score) {
|
|
|
1584
1704
|
return `${BADGE_BASE_URL}-100%25-${BADGE_COLOR}?style=flat-square`;
|
|
1585
1705
|
}
|
|
1586
1706
|
|
|
1707
|
+
// src/reporting/needs-review.ts
|
|
1708
|
+
init_cjs_shims();
|
|
1709
|
+
var isNeedsReview = (report) => report.cantTell === true;
|
|
1710
|
+
var violationsOf = (reports) => reports.filter((r) => !isNeedsReview(r));
|
|
1711
|
+
|
|
1587
1712
|
// src/reporting/statement-generator.ts
|
|
1588
1713
|
var EVALUATION_METHOD = {
|
|
1589
1714
|
sv: "Automatiserad granskning via @holmdigital/engine",
|
|
@@ -1660,7 +1785,7 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
1660
1785
|
complianceLevel = "partial";
|
|
1661
1786
|
}
|
|
1662
1787
|
const issuesMap = /* @__PURE__ */ new Map();
|
|
1663
|
-
result.reports.forEach((report) => {
|
|
1788
|
+
violationsOf(result.reports).forEach((report) => {
|
|
1664
1789
|
if (!issuesMap.has(report.ruleId)) {
|
|
1665
1790
|
const issueText = `${report.ruleId} (${report.wcagCriteria})`;
|
|
1666
1791
|
issuesMap.set(report.ruleId, issueText);
|
package/dist/index.mjs
CHANGED
|
@@ -9,12 +9,13 @@ import {
|
|
|
9
9
|
generateStatementContent,
|
|
10
10
|
getEngineVersion,
|
|
11
11
|
probeWithoutJavaScript
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5GP6KD7Q.mjs";
|
|
13
13
|
import {
|
|
14
14
|
getCurrentLang,
|
|
15
15
|
setLanguage,
|
|
16
16
|
t
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RNCZ2GNY.mjs";
|
|
18
|
+
import "./chunk-QEHLOWUK.mjs";
|
|
18
19
|
import "./chunk-DIBTSSLZ.mjs";
|
|
19
20
|
export {
|
|
20
21
|
NOSCRIPT_EMPTY_THRESHOLD,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
needsReviewOf,
|
|
3
|
+
violationsOf
|
|
4
|
+
} from "./chunk-QEHLOWUK.mjs";
|
|
1
5
|
import "./chunk-DIBTSSLZ.mjs";
|
|
2
6
|
|
|
3
7
|
// src/reporting/junit-generator.ts
|
|
@@ -5,12 +9,15 @@ function generateJUnitXML(result) {
|
|
|
5
9
|
const { url, reports, stats, metadata } = result;
|
|
6
10
|
const duration = metadata.scanDuration;
|
|
7
11
|
const timestamp = result.timestamp;
|
|
8
|
-
const
|
|
12
|
+
const violations = violationsOf(reports);
|
|
13
|
+
const needsReview = needsReviewOf(reports);
|
|
14
|
+
const totalTests = stats.passed + stats.total + stats.needsReview;
|
|
9
15
|
const failures = stats.total;
|
|
16
|
+
const skipped = stats.needsReview;
|
|
10
17
|
const xmlLines = [
|
|
11
18
|
`<?xml version="1.0" encoding="UTF-8"?>`,
|
|
12
19
|
`<testsuites name="HolmDigital Accessibility Scan" time="${duration / 1e3}" tests="${totalTests}" failures="${failures}">`,
|
|
13
|
-
` <testsuite name="${url}" tests="${totalTests}" failures="${failures}" errors="0" time="${duration / 1e3}" timestamp="${timestamp}">`,
|
|
20
|
+
` <testsuite name="${url}" tests="${totalTests}" failures="${failures}" skipped="${skipped}" errors="0" time="${duration / 1e3}" timestamp="${timestamp}">`,
|
|
14
21
|
` <properties>`,
|
|
15
22
|
` <property name="engineVersion" value="${metadata.engineVersion}"/>`,
|
|
16
23
|
` <property name="axeCoreVersion" value="${metadata.axeCoreVersion}"/>`,
|
|
@@ -24,7 +31,7 @@ function generateJUnitXML(result) {
|
|
|
24
31
|
for (let i = 0; i < stats.passed; i++) {
|
|
25
32
|
xmlLines.push(` <testcase name="Passed Accessibility Rule ${i + 1}" classname="Accessibility.Success" time="0" />`);
|
|
26
33
|
}
|
|
27
|
-
|
|
34
|
+
violations.forEach((report) => {
|
|
28
35
|
const severity = report.holmdigitalInsight.diggRisk;
|
|
29
36
|
const message = escapeXML(report.holmdigitalInsight.reasoning);
|
|
30
37
|
const criteria = `WCAG ${report.wcagCriteria} | EN 301 549 ${report.en301549Criteria}`;
|
|
@@ -49,6 +56,12 @@ ${escapeXML(help)}</failure>`);
|
|
|
49
56
|
}
|
|
50
57
|
xmlLines.push(` </testcase>`);
|
|
51
58
|
});
|
|
59
|
+
needsReview.forEach((report) => {
|
|
60
|
+
const message = escapeXML(report.holmdigitalInsight.reasoning);
|
|
61
|
+
xmlLines.push(` <testcase name="[NEEDS REVIEW] ${report.ruleId}" classname="${report.wcagCriteria}" time="0">`);
|
|
62
|
+
xmlLines.push(` <skipped message="${message}"/>`);
|
|
63
|
+
xmlLines.push(` </testcase>`);
|
|
64
|
+
});
|
|
52
65
|
xmlLines.push(` </testsuite>`);
|
|
53
66
|
xmlLines.push(`</testsuites>`);
|
|
54
67
|
return xmlLines.join("\n");
|
|
@@ -7,7 +7,11 @@ import {
|
|
|
7
7
|
getCurrentLang,
|
|
8
8
|
setLanguage,
|
|
9
9
|
t
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RNCZ2GNY.mjs";
|
|
11
|
+
import {
|
|
12
|
+
needsReviewOf,
|
|
13
|
+
violationsOf
|
|
14
|
+
} from "./chunk-QEHLOWUK.mjs";
|
|
11
15
|
import "./chunk-DIBTSSLZ.mjs";
|
|
12
16
|
|
|
13
17
|
// src/reporting/plain-report.ts
|
|
@@ -45,26 +49,30 @@ function renderPlainReport(result, lang = "en", plainFallbackFrom) {
|
|
|
45
49
|
console.log(chalk.yellow(t("plain.gate_fallback", { lang: languageDisplayName(plainFallbackFrom) })));
|
|
46
50
|
console.log("");
|
|
47
51
|
}
|
|
48
|
-
|
|
52
|
+
const violations = violationsOf(result.reports);
|
|
53
|
+
const needsReview = needsReviewOf(result.reports);
|
|
54
|
+
if (violations.length === 0 && needsReview.length === 0) {
|
|
49
55
|
console.log(t("plain.empty_state"));
|
|
50
56
|
console.log("");
|
|
51
57
|
console.log(t("plain.attribution"));
|
|
52
58
|
return;
|
|
53
59
|
}
|
|
54
|
-
const sortedGroups = groupReportsByRule(
|
|
60
|
+
const sortedGroups = groupReportsByRule(violations).sort((a, b) => {
|
|
55
61
|
const aLevel = IMPACT_ORDER[levelOf(a.report)] ?? 4;
|
|
56
62
|
const bLevel = IMPACT_ORDER[levelOf(b.report)] ?? 4;
|
|
57
63
|
return aLevel - bLevel;
|
|
58
64
|
});
|
|
59
|
-
const count =
|
|
65
|
+
const count = violations.length;
|
|
60
66
|
const unit = count === 1 ? t("plain.intro_unit_singular") : t("plain.intro_unit_plural");
|
|
61
|
-
const breakdown = impactBreakdown(
|
|
67
|
+
const breakdown = impactBreakdown(violations, levelOf, IMPACT_ORDER);
|
|
62
68
|
const breakdownText = breakdown.map((b) => `${b.count} ${t(BADGE_KEY[b.level])}`).join(", ");
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
if (violations.length > 0) {
|
|
70
|
+
console.log(t("plain.intro_framing"));
|
|
71
|
+
console.log(t("plain.intro_found", { count, unit }));
|
|
72
|
+
console.log(`${count} ${unit}: ${breakdownText}`);
|
|
73
|
+
console.log(t("plain.sorted_by"));
|
|
74
|
+
console.log("");
|
|
75
|
+
}
|
|
68
76
|
const isSwedish = getCurrentLang() === "sv";
|
|
69
77
|
sortedGroups.forEach((group, index) => {
|
|
70
78
|
const report = group.report;
|
|
@@ -86,6 +94,16 @@ function renderPlainReport(result, lang = "en", plainFallbackFrom) {
|
|
|
86
94
|
}
|
|
87
95
|
console.log("");
|
|
88
96
|
});
|
|
97
|
+
if (needsReview.length > 0) {
|
|
98
|
+
console.log(t("plain.needs_review_heading", { count: needsReview.length }));
|
|
99
|
+
console.log(t("plain.needs_review_intro"));
|
|
100
|
+
needsReview.forEach((report) => {
|
|
101
|
+
const pl = report.plainLanguage;
|
|
102
|
+
const heading = pl?.headline ? `${pl.headline} (${report.ruleId})` : report.ruleId;
|
|
103
|
+
console.log(`- ${heading}`);
|
|
104
|
+
});
|
|
105
|
+
console.log("");
|
|
106
|
+
}
|
|
89
107
|
console.log(t("plain.closing"));
|
|
90
108
|
console.log("");
|
|
91
109
|
console.log(t("plain.attribution"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holmdigital/engine",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@holmdigital/components": "^4.0.0",
|
|
89
|
-
"@holmdigital/standards": "^3.0.
|
|
89
|
+
"@holmdigital/standards": "^3.0.2",
|
|
90
90
|
"axe-core": "^4.13.0",
|
|
91
91
|
"chalk": "^6.0.0",
|
|
92
92
|
"commander": "^15.0.0",
|