@holmdigital/engine 3.0.2 → 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-VF73LLSO.mjs → chunk-5GP6KD7Q.mjs} +98 -11
- package/dist/chunk-QEHLOWUK.mjs +9 -0
- package/dist/{chunk-QUCGL754.mjs → chunk-RNCZ2GNY.mjs} +36 -0
- package/dist/cli/index.js +300 -54
- package/dist/cli/index.mjs +118 -32
- package/dist/{github-actions-5AFDFD4T.mjs → github-actions-PIV5JU2C.mjs} +12 -6
- package/dist/{i18n-JGWNYSZO.mjs → i18n-7RPBNX7F.mjs} +1 -1
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +134 -9
- package/dist/index.mjs +3 -2
- package/dist/{junit-generator-MNO6GP5J.mjs → junit-generator-5DTJ7YEU.mjs} +16 -3
- package/dist/{plain-report-BRVL3OVD.mjs → plain-report-XZZM5ZHK.mjs} +28 -10
- package/package.json +2 -2
package/dist/cli/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).",
|
|
@@ -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).",
|
|
@@ -889,6 +925,18 @@ var init_plain_group = __esm({
|
|
|
889
925
|
}
|
|
890
926
|
});
|
|
891
927
|
|
|
928
|
+
// src/reporting/needs-review.ts
|
|
929
|
+
var isNeedsReview, violationsOf, needsReviewOf;
|
|
930
|
+
var init_needs_review = __esm({
|
|
931
|
+
"src/reporting/needs-review.ts"() {
|
|
932
|
+
"use strict";
|
|
933
|
+
init_cjs_shims();
|
|
934
|
+
isNeedsReview = (report) => report.cantTell === true;
|
|
935
|
+
violationsOf = (reports) => reports.filter((r) => !isNeedsReview(r));
|
|
936
|
+
needsReviewOf = (reports) => reports.filter(isNeedsReview);
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
|
|
892
940
|
// src/reporting/plain-language-support.ts
|
|
893
941
|
function isEnglish(lang) {
|
|
894
942
|
return /^en(-|$)/i.test(lang.trim());
|
|
@@ -948,26 +996,30 @@ function renderPlainReport(result, lang = "en", plainFallbackFrom) {
|
|
|
948
996
|
console.log(import_chalk.default.yellow(t("plain.gate_fallback", { lang: languageDisplayName(plainFallbackFrom) })));
|
|
949
997
|
console.log("");
|
|
950
998
|
}
|
|
951
|
-
|
|
999
|
+
const violations = violationsOf(result.reports);
|
|
1000
|
+
const needsReview = needsReviewOf(result.reports);
|
|
1001
|
+
if (violations.length === 0 && needsReview.length === 0) {
|
|
952
1002
|
console.log(t("plain.empty_state"));
|
|
953
1003
|
console.log("");
|
|
954
1004
|
console.log(t("plain.attribution"));
|
|
955
1005
|
return;
|
|
956
1006
|
}
|
|
957
|
-
const sortedGroups = groupReportsByRule(
|
|
1007
|
+
const sortedGroups = groupReportsByRule(violations).sort((a, b) => {
|
|
958
1008
|
const aLevel = IMPACT_ORDER[levelOf(a.report)] ?? 4;
|
|
959
1009
|
const bLevel = IMPACT_ORDER[levelOf(b.report)] ?? 4;
|
|
960
1010
|
return aLevel - bLevel;
|
|
961
1011
|
});
|
|
962
|
-
const count =
|
|
1012
|
+
const count = violations.length;
|
|
963
1013
|
const unit = count === 1 ? t("plain.intro_unit_singular") : t("plain.intro_unit_plural");
|
|
964
|
-
const breakdown = impactBreakdown(
|
|
1014
|
+
const breakdown = impactBreakdown(violations, levelOf, IMPACT_ORDER);
|
|
965
1015
|
const breakdownText = breakdown.map((b) => `${b.count} ${t(BADGE_KEY[b.level])}`).join(", ");
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
1016
|
+
if (violations.length > 0) {
|
|
1017
|
+
console.log(t("plain.intro_framing"));
|
|
1018
|
+
console.log(t("plain.intro_found", { count, unit }));
|
|
1019
|
+
console.log(`${count} ${unit}: ${breakdownText}`);
|
|
1020
|
+
console.log(t("plain.sorted_by"));
|
|
1021
|
+
console.log("");
|
|
1022
|
+
}
|
|
971
1023
|
const isSwedish = getCurrentLang() === "sv";
|
|
972
1024
|
sortedGroups.forEach((group, index) => {
|
|
973
1025
|
const report = group.report;
|
|
@@ -989,6 +1041,16 @@ function renderPlainReport(result, lang = "en", plainFallbackFrom) {
|
|
|
989
1041
|
}
|
|
990
1042
|
console.log("");
|
|
991
1043
|
});
|
|
1044
|
+
if (needsReview.length > 0) {
|
|
1045
|
+
console.log(t("plain.needs_review_heading", { count: needsReview.length }));
|
|
1046
|
+
console.log(t("plain.needs_review_intro"));
|
|
1047
|
+
needsReview.forEach((report) => {
|
|
1048
|
+
const pl = report.plainLanguage;
|
|
1049
|
+
const heading = pl?.headline ? `${pl.headline} (${report.ruleId})` : report.ruleId;
|
|
1050
|
+
console.log(`- ${heading}`);
|
|
1051
|
+
});
|
|
1052
|
+
console.log("");
|
|
1053
|
+
}
|
|
992
1054
|
console.log(t("plain.closing"));
|
|
993
1055
|
console.log("");
|
|
994
1056
|
console.log(t("plain.attribution"));
|
|
@@ -1001,6 +1063,7 @@ var init_plain_report = __esm({
|
|
|
1001
1063
|
import_chalk = __toESM(require("chalk"));
|
|
1002
1064
|
init_i18n();
|
|
1003
1065
|
init_plain_group();
|
|
1066
|
+
init_needs_review();
|
|
1004
1067
|
init_plain_language_support();
|
|
1005
1068
|
IMPACT_ORDER = {
|
|
1006
1069
|
"stoppar-kop": 0,
|
|
@@ -1035,12 +1098,8 @@ __export(github_actions_exports, {
|
|
|
1035
1098
|
generateGitHubActionsAnnotations: () => generateGitHubActionsAnnotations
|
|
1036
1099
|
});
|
|
1037
1100
|
function generateGitHubActionsAnnotations(reports) {
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
if (report.holmdigitalInsight.diggRisk === "critical") {
|
|
1041
|
-
level = "error";
|
|
1042
|
-
}
|
|
1043
|
-
const title = `[${report.ruleId}] ${report.wcagCriteria}`;
|
|
1101
|
+
const emit = (report, level, titlePrefix = "") => {
|
|
1102
|
+
const title = `${titlePrefix}[${report.ruleId}] ${report.wcagCriteria}`;
|
|
1044
1103
|
const message = `${report.holmdigitalInsight.reasoning}
|
|
1045
1104
|
|
|
1046
1105
|
Legitimacy: ${report.dosLagenReference}
|
|
@@ -1052,12 +1111,19 @@ Fix: ${report.remediation.component ? `Use <${report.remediation.component} />`
|
|
|
1052
1111
|
} else {
|
|
1053
1112
|
console.log(`::${level} title=${title}::${message}`);
|
|
1054
1113
|
}
|
|
1114
|
+
};
|
|
1115
|
+
violationsOf(reports).forEach((report) => {
|
|
1116
|
+
emit(report, report.holmdigitalInsight.diggRisk === "critical" ? "error" : "warning");
|
|
1117
|
+
});
|
|
1118
|
+
needsReviewOf(reports).forEach((report) => {
|
|
1119
|
+
emit(report, "notice", "[needs review] ");
|
|
1055
1120
|
});
|
|
1056
1121
|
}
|
|
1057
1122
|
var init_github_actions = __esm({
|
|
1058
1123
|
"src/reporting/github-actions.ts"() {
|
|
1059
1124
|
"use strict";
|
|
1060
1125
|
init_cjs_shims();
|
|
1126
|
+
init_needs_review();
|
|
1061
1127
|
}
|
|
1062
1128
|
});
|
|
1063
1129
|
|
|
@@ -1070,12 +1136,15 @@ function generateJUnitXML(result) {
|
|
|
1070
1136
|
const { url, reports, stats, metadata } = result;
|
|
1071
1137
|
const duration = metadata.scanDuration;
|
|
1072
1138
|
const timestamp = result.timestamp;
|
|
1073
|
-
const
|
|
1139
|
+
const violations = violationsOf(reports);
|
|
1140
|
+
const needsReview = needsReviewOf(reports);
|
|
1141
|
+
const totalTests = stats.passed + stats.total + stats.needsReview;
|
|
1074
1142
|
const failures = stats.total;
|
|
1143
|
+
const skipped = stats.needsReview;
|
|
1075
1144
|
const xmlLines = [
|
|
1076
1145
|
`<?xml version="1.0" encoding="UTF-8"?>`,
|
|
1077
1146
|
`<testsuites name="HolmDigital Accessibility Scan" time="${duration / 1e3}" tests="${totalTests}" failures="${failures}">`,
|
|
1078
|
-
` <testsuite name="${url}" tests="${totalTests}" failures="${failures}" errors="0" time="${duration / 1e3}" timestamp="${timestamp}">`,
|
|
1147
|
+
` <testsuite name="${url}" tests="${totalTests}" failures="${failures}" skipped="${skipped}" errors="0" time="${duration / 1e3}" timestamp="${timestamp}">`,
|
|
1079
1148
|
` <properties>`,
|
|
1080
1149
|
` <property name="engineVersion" value="${metadata.engineVersion}"/>`,
|
|
1081
1150
|
` <property name="axeCoreVersion" value="${metadata.axeCoreVersion}"/>`,
|
|
@@ -1089,7 +1158,7 @@ function generateJUnitXML(result) {
|
|
|
1089
1158
|
for (let i = 0; i < stats.passed; i++) {
|
|
1090
1159
|
xmlLines.push(` <testcase name="Passed Accessibility Rule ${i + 1}" classname="Accessibility.Success" time="0" />`);
|
|
1091
1160
|
}
|
|
1092
|
-
|
|
1161
|
+
violations.forEach((report) => {
|
|
1093
1162
|
const severity = report.holmdigitalInsight.diggRisk;
|
|
1094
1163
|
const message = escapeXML(report.holmdigitalInsight.reasoning);
|
|
1095
1164
|
const criteria = `WCAG ${report.wcagCriteria} | EN 301 549 ${report.en301549Criteria}`;
|
|
@@ -1114,6 +1183,12 @@ ${escapeXML(help)}</failure>`);
|
|
|
1114
1183
|
}
|
|
1115
1184
|
xmlLines.push(` </testcase>`);
|
|
1116
1185
|
});
|
|
1186
|
+
needsReview.forEach((report) => {
|
|
1187
|
+
const message = escapeXML(report.holmdigitalInsight.reasoning);
|
|
1188
|
+
xmlLines.push(` <testcase name="[NEEDS REVIEW] ${report.ruleId}" classname="${report.wcagCriteria}" time="0">`);
|
|
1189
|
+
xmlLines.push(` <skipped message="${message}"/>`);
|
|
1190
|
+
xmlLines.push(` </testcase>`);
|
|
1191
|
+
});
|
|
1117
1192
|
xmlLines.push(` </testsuite>`);
|
|
1118
1193
|
xmlLines.push(`</testsuites>`);
|
|
1119
1194
|
return xmlLines.join("\n");
|
|
@@ -1142,6 +1217,7 @@ var init_junit_generator = __esm({
|
|
|
1142
1217
|
"src/reporting/junit-generator.ts"() {
|
|
1143
1218
|
"use strict";
|
|
1144
1219
|
init_cjs_shims();
|
|
1220
|
+
init_needs_review();
|
|
1145
1221
|
}
|
|
1146
1222
|
});
|
|
1147
1223
|
|
|
@@ -1353,7 +1429,7 @@ async function probeWithoutJavaScript(browser, options) {
|
|
|
1353
1429
|
// src/core/regulatory-scanner.ts
|
|
1354
1430
|
var import_node_fs = require("fs");
|
|
1355
1431
|
function getEngineVersion() {
|
|
1356
|
-
return "3.0
|
|
1432
|
+
return "3.1.0";
|
|
1357
1433
|
}
|
|
1358
1434
|
function getStandardsVersion() {
|
|
1359
1435
|
try {
|
|
@@ -1475,12 +1551,14 @@ var RegulatoryScanner = class {
|
|
|
1475
1551
|
this.log(`Raw Axe Violations: ${axeResults.violations?.length || 0}`);
|
|
1476
1552
|
passedCount = axeResults.passes?.length || 0;
|
|
1477
1553
|
const regulatoryReports = this.options.light ? await this.enrichResultsLight(axeResults) : await this.enrichResults(axeResults);
|
|
1554
|
+
const incompleteReports = await this.enrichIncomplete(axeResults);
|
|
1555
|
+
const allReports = [...regulatoryReports, ...incompleteReports];
|
|
1478
1556
|
let noScript;
|
|
1479
1557
|
if (this.options.noScriptCheck) {
|
|
1480
1558
|
noScript = await this.runNoScriptCheck(textLengthWithJs ?? 0);
|
|
1481
1559
|
}
|
|
1482
1560
|
const scanDuration = Date.now() - startTime;
|
|
1483
|
-
const result = this.generateResultPackage(
|
|
1561
|
+
const result = this.generateResultPackage(allReports, passedCount, scanDuration, pageTitle, pageLanguage);
|
|
1484
1562
|
if (htmlValidation) {
|
|
1485
1563
|
result.htmlValidation = htmlValidation;
|
|
1486
1564
|
}
|
|
@@ -1690,14 +1768,96 @@ var RegulatoryScanner = class {
|
|
|
1690
1768
|
}
|
|
1691
1769
|
return reports;
|
|
1692
1770
|
}
|
|
1771
|
+
/**
|
|
1772
|
+
* KRAV-3 (Intern #12): bär axes `incomplete` vidare som "needs review"-poster
|
|
1773
|
+
* (internt `cantTell`). axe kunde inte avgöra pass/fail, så en människa måste
|
|
1774
|
+
* kontrollera. Poster märks `cantTell` och exkluderas ur stats/score/
|
|
1775
|
+
* complianceStatus i generateResultPackage — men tappas aldrig tyst.
|
|
1776
|
+
*
|
|
1777
|
+
* Skälet läses ur nodens check-data (`message` + `messageKey`), t.ex.
|
|
1778
|
+
* `bgOverlap` = bakgrunden kunde inte bestämmas. Ett `contrastRatio: 0` som
|
|
1779
|
+
* följer med i det fallet är INTE en uppmätt nollkontrast, så vi bär
|
|
1780
|
+
* skäl-texten, aldrig ett hopfabricerat mätvärde (Intern #20).
|
|
1781
|
+
*/
|
|
1782
|
+
async enrichIncomplete(axeResults) {
|
|
1783
|
+
const incomplete = axeResults.incomplete;
|
|
1784
|
+
if (!incomplete || incomplete.length === 0) return [];
|
|
1785
|
+
const reports = [];
|
|
1786
|
+
const { generateRegulatoryReport, getConvergenceRule } = await import("@holmdigital/standards");
|
|
1787
|
+
const { getCurrentLang: getCurrentLang2 } = await Promise.resolve().then(() => (init_i18n(), i18n_exports));
|
|
1788
|
+
const lang = getCurrentLang2();
|
|
1789
|
+
const readMessageKey = (checks) => checks?.find((c) => c.data && typeof c.data === "object" && "messageKey" in c.data) ?? checks?.[0];
|
|
1790
|
+
for (const item of incomplete) {
|
|
1791
|
+
const nodeInfos = item.nodes.map((node) => {
|
|
1792
|
+
const c = readMessageKey(node.any);
|
|
1793
|
+
const data = c?.data && typeof c.data === "object" ? c.data : void 0;
|
|
1794
|
+
const messageKey = data && typeof data.messageKey === "string" ? data.messageKey : void 0;
|
|
1795
|
+
const concerning = !!data && ("expectedContrastRatio" in data || "contrastRatio" in data);
|
|
1796
|
+
return {
|
|
1797
|
+
html: node.html,
|
|
1798
|
+
target: node.target.join(" "),
|
|
1799
|
+
// axes egen check-message (VARFÖR den inte kunde avgöras).
|
|
1800
|
+
// Aldrig ett kontrastvärde — i bgOverlap-fallet finns inget uppmätt.
|
|
1801
|
+
failureSummary: c?.message ?? node.failureSummary ?? item.help,
|
|
1802
|
+
messageKey,
|
|
1803
|
+
concerning
|
|
1804
|
+
};
|
|
1805
|
+
});
|
|
1806
|
+
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);
|
|
1807
|
+
const reviewReason = (ordered.find((n) => n.concerning) ?? ordered[0])?.messageKey;
|
|
1808
|
+
const failingNodes = ordered.slice(0, 3).map((n) => ({
|
|
1809
|
+
html: n.html,
|
|
1810
|
+
target: n.target,
|
|
1811
|
+
failureSummary: n.failureSummary
|
|
1812
|
+
}));
|
|
1813
|
+
const reasoning = failingNodes[0]?.failureSummary ?? item.help;
|
|
1814
|
+
const base = generateRegulatoryReport(item.id, lang);
|
|
1815
|
+
if (base) {
|
|
1816
|
+
const fullRule = getConvergenceRule(base.ruleId, lang);
|
|
1817
|
+
reports.push({
|
|
1818
|
+
...base,
|
|
1819
|
+
cantTell: true,
|
|
1820
|
+
reviewReason,
|
|
1821
|
+
holmdigitalInsight: { ...base.holmdigitalInsight, reasoning },
|
|
1822
|
+
legalContext: fullRule?.legalContext,
|
|
1823
|
+
failingNodes
|
|
1824
|
+
});
|
|
1825
|
+
} else {
|
|
1826
|
+
reports.push({
|
|
1827
|
+
ruleId: item.id,
|
|
1828
|
+
wcagCriteria: item.tags.find((t2) => t2.startsWith("wcag")) || "Unknown",
|
|
1829
|
+
en301549Criteria: "",
|
|
1830
|
+
dosLagenReference: "",
|
|
1831
|
+
diggRisk: "medium",
|
|
1832
|
+
eaaImpact: "medium",
|
|
1833
|
+
remediation: { description: item.help, technicalGuidance: item.description, component: void 0 },
|
|
1834
|
+
holmdigitalInsight: {
|
|
1835
|
+
diggRisk: "medium",
|
|
1836
|
+
eaaImpact: "medium",
|
|
1837
|
+
reasoning,
|
|
1838
|
+
swedishInterpretation: "",
|
|
1839
|
+
priorityRationale: ""
|
|
1840
|
+
},
|
|
1841
|
+
testability: { automated: false, requiresManualCheck: true, pseudoAutomation: false, complexity: "moderate" },
|
|
1842
|
+
cantTell: true,
|
|
1843
|
+
reviewReason,
|
|
1844
|
+
failingNodes
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
return reports;
|
|
1849
|
+
}
|
|
1693
1850
|
generateResultPackage(reports, passedCount, scanDuration, pageTitle, pageLanguage) {
|
|
1851
|
+
const scored = reports.filter((r) => !r.cantTell);
|
|
1852
|
+
const needsReview = reports.length - scored.length;
|
|
1694
1853
|
const stats = {
|
|
1695
1854
|
passed: passedCount,
|
|
1696
|
-
critical:
|
|
1697
|
-
high:
|
|
1698
|
-
medium:
|
|
1699
|
-
low:
|
|
1700
|
-
total:
|
|
1855
|
+
critical: scored.filter((r) => r.holmdigitalInsight.diggRisk === "critical").length,
|
|
1856
|
+
high: scored.filter((r) => r.holmdigitalInsight.diggRisk === "high").length,
|
|
1857
|
+
medium: scored.filter((r) => r.holmdigitalInsight.diggRisk === "medium").length,
|
|
1858
|
+
low: scored.filter((r) => r.holmdigitalInsight.diggRisk === "low").length,
|
|
1859
|
+
total: scored.length,
|
|
1860
|
+
needsReview
|
|
1701
1861
|
};
|
|
1702
1862
|
const weightedScore = stats.critical * 25 + // Critical violations are severe
|
|
1703
1863
|
stats.high * 15 + // High risk affects usability significantly
|
|
@@ -1728,7 +1888,7 @@ var RegulatoryScanner = class {
|
|
|
1728
1888
|
pageTitle,
|
|
1729
1889
|
pageLanguage
|
|
1730
1890
|
};
|
|
1731
|
-
const reportsWithContext =
|
|
1891
|
+
const reportsWithContext = scored.filter((r) => r.legalContext);
|
|
1732
1892
|
const legalSummary = {
|
|
1733
1893
|
wadApplicable: reportsWithContext.filter(
|
|
1734
1894
|
(r) => r.legalContext?.appliesTo?.includes("WAD")
|
|
@@ -1860,6 +2020,7 @@ function isBadgeWithheldByRobustness(noScript) {
|
|
|
1860
2020
|
// src/reporting/html-template.ts
|
|
1861
2021
|
init_i18n();
|
|
1862
2022
|
init_plain_group();
|
|
2023
|
+
init_needs_review();
|
|
1863
2024
|
init_plain_language_support();
|
|
1864
2025
|
var LOCALE_TO_INTL = {
|
|
1865
2026
|
sv: "sv-SE",
|
|
@@ -1937,6 +2098,24 @@ function generateReportHTML(result, sector = "public", audience = "developer", p
|
|
|
1937
2098
|
const highCount = result.stats.high;
|
|
1938
2099
|
const htmlErrorsCount = result.htmlValidation?.errors?.length ?? 0;
|
|
1939
2100
|
const scoreColor = result.score > 90 ? "#16a34a" : result.score > 70 ? "#eab308" : "#dc2626";
|
|
2101
|
+
const needsReviewReports = needsReviewOf(result.reports);
|
|
2102
|
+
const needsReviewSection = needsReviewReports.length === 0 ? "" : `
|
|
2103
|
+
<div class="section-title">${t("report.needs_review_title", { count: needsReviewReports.length })}</div>
|
|
2104
|
+
<p style="font-size: 0.9rem; color: #64748b; margin-bottom: 0.75rem;">${t("report.needs_review_note")}</p>
|
|
2105
|
+
${needsReviewReports.map((report) => `
|
|
2106
|
+
<div class="violation-card">
|
|
2107
|
+
<div class="violation-header">
|
|
2108
|
+
<div class="violation-title">${report.ruleId}</div>
|
|
2109
|
+
<div><span class="badge">needs review</span></div>
|
|
2110
|
+
</div>
|
|
2111
|
+
<div class="violation-meta">
|
|
2112
|
+
WCAG ${report.wcagCriteria} \u2022 EN 301 549 ${report.en301549Criteria}
|
|
2113
|
+
</div>
|
|
2114
|
+
<div style="font-size: 0.95rem; color: #334155; line-height: 1.5;">
|
|
2115
|
+
${report.holmdigitalInsight.reasoning}
|
|
2116
|
+
</div>
|
|
2117
|
+
</div>
|
|
2118
|
+
`).join("")}`;
|
|
1940
2119
|
return `
|
|
1941
2120
|
<!DOCTYPE html>
|
|
1942
2121
|
<html lang="${getCurrentLang()}">
|
|
@@ -2168,7 +2347,7 @@ function generateReportHTML(result, sector = "public", audience = "developer", p
|
|
|
2168
2347
|
|
|
2169
2348
|
<div class="section-title">${t("report.detailed_violations")}</div>
|
|
2170
2349
|
|
|
2171
|
-
${
|
|
2350
|
+
${violationsOf(result.reports).sort((a, b) => {
|
|
2172
2351
|
const severityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
2173
2352
|
const aRisk = a.holmdigitalInsight.diggRisk.toLowerCase();
|
|
2174
2353
|
const bRisk = b.holmdigitalInsight.diggRisk.toLowerCase();
|
|
@@ -2202,7 +2381,7 @@ function generateReportHTML(result, sector = "public", audience = "developer", p
|
|
|
2202
2381
|
` : ""}
|
|
2203
2382
|
</div>
|
|
2204
2383
|
`;
|
|
2205
|
-
}).join("")}
|
|
2384
|
+
}).join("")}${needsReviewSection}
|
|
2206
2385
|
${renderNoScriptSection(result)}
|
|
2207
2386
|
<footer>
|
|
2208
2387
|
${t("report.footer", { version: getEngineVersion() })}
|
|
@@ -2266,14 +2445,16 @@ function generatePlainReportHTML(result, plainFallbackFrom) {
|
|
|
2266
2445
|
const logoDataUri = getLogoDataUri();
|
|
2267
2446
|
const fallbackName = plainFallbackFrom ? languageDisplayName(plainFallbackFrom) : "";
|
|
2268
2447
|
const noticeHtml = fallbackName ? `<p class="plain-fallback-notice">${escapeHtml(t("plain.gate_fallback", { lang: fallbackName }))}</p>` : "";
|
|
2269
|
-
const
|
|
2448
|
+
const violations = violationsOf(result.reports);
|
|
2449
|
+
const needsReview = needsReviewOf(result.reports);
|
|
2450
|
+
const sortedGroups = groupReportsByRule(violations).sort((a, b) => {
|
|
2270
2451
|
const aLevel = PLAIN_IMPACT_ORDER[plainLevelOf(a.report)] ?? 4;
|
|
2271
2452
|
const bLevel = PLAIN_IMPACT_ORDER[plainLevelOf(b.report)] ?? 4;
|
|
2272
2453
|
return aLevel - bLevel;
|
|
2273
2454
|
});
|
|
2274
|
-
const count =
|
|
2455
|
+
const count = violations.length;
|
|
2275
2456
|
const unit = count === 1 ? t("plain.intro_unit_singular") : t("plain.intro_unit_plural");
|
|
2276
|
-
const breakdownText = impactBreakdown(
|
|
2457
|
+
const breakdownText = impactBreakdown(violations, plainLevelOf, PLAIN_IMPACT_ORDER).map((b) => `${b.count} ${escapeHtml(t(PLAIN_BADGE_KEY[b.level]))}`).join(", ");
|
|
2277
2458
|
const isSwedish = lang === "sv";
|
|
2278
2459
|
const itemsHtml = sortedGroups.length === 0 ? `<p>${t("plain.empty_state")}</p>` : `<ul class="issue-list">
|
|
2279
2460
|
${sortedGroups.map((group) => {
|
|
@@ -2306,6 +2487,22 @@ ${sortedGroups.map((group) => {
|
|
|
2306
2487
|
}
|
|
2307
2488
|
}).join("\n")}
|
|
2308
2489
|
</ul>`;
|
|
2490
|
+
const needsReviewHtml = needsReview.length === 0 ? "" : `<section class="needs-review">
|
|
2491
|
+
<h2 class="needs-review-heading">${escapeHtml(t("plain.needs_review_heading", { count: needsReview.length }))}</h2>
|
|
2492
|
+
<p class="needs-review-intro">${escapeHtml(t("plain.needs_review_intro"))}</p>
|
|
2493
|
+
<ul class="needs-review-list">
|
|
2494
|
+
${needsReview.map((report) => {
|
|
2495
|
+
const pl = report.plainLanguage;
|
|
2496
|
+
const heading = pl?.headline ? `${escapeHtml(pl.headline)} <span class="issue-rule-ref">(${escapeHtml(report.ruleId)})</span>` : escapeHtml(report.ruleId);
|
|
2497
|
+
return ` <li>${heading}</li>`;
|
|
2498
|
+
}).join("\n")}
|
|
2499
|
+
</ul>
|
|
2500
|
+
</section>`;
|
|
2501
|
+
const introHtml = violations.length === 0 ? "" : `<div class="intro">
|
|
2502
|
+
<p>${t("plain.intro_framing")}</p>
|
|
2503
|
+
<p>${t("plain.intro_found", { count, unit })}</p>
|
|
2504
|
+
<p class="intro-breakdown">${count} ${escapeHtml(unit)}: ${breakdownText}</p>
|
|
2505
|
+
</div>`;
|
|
2309
2506
|
return `<!DOCTYPE html>
|
|
2310
2507
|
<html lang="${lang}">
|
|
2311
2508
|
<head>
|
|
@@ -2521,6 +2718,34 @@ ${sortedGroups.map((group) => {
|
|
|
2521
2718
|
page-break-before: avoid;
|
|
2522
2719
|
}
|
|
2523
2720
|
|
|
2721
|
+
/* ---- Needs review (cantTell): kept visually distinct from the barrier
|
|
2722
|
+
list \u2014 a neutral, low-alarm block for items a human must confirm. ---- */
|
|
2723
|
+
.needs-review {
|
|
2724
|
+
margin-top: 2rem;
|
|
2725
|
+
padding: 1rem 1.25rem;
|
|
2726
|
+
background: #f8fafc;
|
|
2727
|
+
border: 1px solid #e2e8f0;
|
|
2728
|
+
border-left: 4px solid #64748b;
|
|
2729
|
+
border-radius: 6px;
|
|
2730
|
+
}
|
|
2731
|
+
.needs-review-heading {
|
|
2732
|
+
font-size: 1rem;
|
|
2733
|
+
font-weight: 700;
|
|
2734
|
+
color: #334155;
|
|
2735
|
+
margin-bottom: 0.35rem;
|
|
2736
|
+
}
|
|
2737
|
+
.needs-review-intro {
|
|
2738
|
+
font-size: 0.9rem;
|
|
2739
|
+
color: #64748b;
|
|
2740
|
+
margin-bottom: 0.6rem;
|
|
2741
|
+
}
|
|
2742
|
+
.needs-review-list {
|
|
2743
|
+
margin: 0;
|
|
2744
|
+
padding-left: 1.25rem;
|
|
2745
|
+
font-size: 0.95rem;
|
|
2746
|
+
color: #334155;
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2524
2749
|
/* ---- Fixed per-page footer (Task H2): position:fixed elements are
|
|
2525
2750
|
repeated on every printed page in Chromium print-to-PDF. White
|
|
2526
2751
|
background + top border so cards never show through; the @page
|
|
@@ -2557,13 +2782,9 @@ ${sortedGroups.map((group) => {
|
|
|
2557
2782
|
|
|
2558
2783
|
<div class="report-body">
|
|
2559
2784
|
${noticeHtml}
|
|
2560
|
-
|
|
2561
|
-
<p>${t("plain.intro_framing")}</p>
|
|
2562
|
-
<p>${t("plain.intro_found", { count, unit })}</p>
|
|
2563
|
-
<p class="intro-breakdown">${count} ${escapeHtml(unit)}: ${breakdownText}</p>
|
|
2564
|
-
</div>
|
|
2785
|
+
${introHtml}
|
|
2565
2786
|
|
|
2566
|
-
${itemsHtml}
|
|
2787
|
+
${itemsHtml}${needsReviewHtml}
|
|
2567
2788
|
${renderNoScriptSection(result)}
|
|
2568
2789
|
<p class="closing">${t("plain.closing")}</p>
|
|
2569
2790
|
</div>
|
|
@@ -2614,6 +2835,7 @@ var import_components = require("@holmdigital/components");
|
|
|
2614
2835
|
var import_standards2 = require("@holmdigital/standards");
|
|
2615
2836
|
var import_promises = __toESM(require("fs/promises"));
|
|
2616
2837
|
var import_path = __toESM(require("path"));
|
|
2838
|
+
init_needs_review();
|
|
2617
2839
|
var EVALUATION_METHOD = {
|
|
2618
2840
|
sv: "Automatiserad granskning via @holmdigital/engine",
|
|
2619
2841
|
en: "Automated scan via @holmdigital/engine",
|
|
@@ -2689,7 +2911,7 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
2689
2911
|
complianceLevel = "partial";
|
|
2690
2912
|
}
|
|
2691
2913
|
const issuesMap = /* @__PURE__ */ new Map();
|
|
2692
|
-
result.reports.forEach((report) => {
|
|
2914
|
+
violationsOf(result.reports).forEach((report) => {
|
|
2693
2915
|
if (!issuesMap.has(report.ruleId)) {
|
|
2694
2916
|
const issueText = `${report.ruleId} (${report.wcagCriteria})`;
|
|
2695
2917
|
issuesMap.set(report.ruleId, issueText);
|
|
@@ -2975,11 +3197,13 @@ function parseHydrationWait(raw) {
|
|
|
2975
3197
|
// src/cli/index.ts
|
|
2976
3198
|
init_i18n();
|
|
2977
3199
|
init_plain_language_support();
|
|
3200
|
+
init_needs_review();
|
|
2978
3201
|
|
|
2979
3202
|
// src/cli/cloud-client.ts
|
|
2980
3203
|
init_cjs_shims();
|
|
3204
|
+
init_needs_review();
|
|
2981
3205
|
function transformToCloudPayload(result) {
|
|
2982
|
-
const
|
|
3206
|
+
const toCloudViolation = (report) => {
|
|
2983
3207
|
const firstNode = report.failingNodes?.[0];
|
|
2984
3208
|
return {
|
|
2985
3209
|
rule_id: report.ruleId,
|
|
@@ -2990,7 +3214,9 @@ function transformToCloudPayload(result) {
|
|
|
2990
3214
|
failure_summary: report.holmdigitalInsight?.reasoning || report.remediation?.description || "",
|
|
2991
3215
|
fix_suggestion: report.remediation?.description || ""
|
|
2992
3216
|
};
|
|
2993
|
-
}
|
|
3217
|
+
};
|
|
3218
|
+
const violations = violationsOf(result.reports).map(toCloudViolation);
|
|
3219
|
+
const needs_review = needsReviewOf(result.reports).map(toCloudViolation);
|
|
2994
3220
|
return {
|
|
2995
3221
|
url: result.url,
|
|
2996
3222
|
compliance_score: result.score,
|
|
@@ -3001,7 +3227,9 @@ function transformToCloudPayload(result) {
|
|
|
3001
3227
|
moderate_count: result.stats.medium,
|
|
3002
3228
|
minor_count: result.stats.low,
|
|
3003
3229
|
engine_version: getEngineVersion(),
|
|
3004
|
-
violations
|
|
3230
|
+
violations,
|
|
3231
|
+
needs_review_count: result.stats.needsReview,
|
|
3232
|
+
needs_review
|
|
3005
3233
|
};
|
|
3006
3234
|
}
|
|
3007
3235
|
async function sendToCloud(config, result) {
|
|
@@ -3213,7 +3441,9 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
3213
3441
|
// Rådgivande robusthetsindikator. Undefined när --noscript-check
|
|
3214
3442
|
// inte används och faller då ur JSON:en av sig själv.
|
|
3215
3443
|
noScript: result.noScript,
|
|
3216
|
-
|
|
3444
|
+
// Needs review (cantTell) hör inte hemma bland topIssues — de är
|
|
3445
|
+
// inte fel. Antalet bärs av result.stats.needsReview (Intern #12).
|
|
3446
|
+
topIssues: violationsOf(result.reports).slice(0, 5).map((r) => ({
|
|
3217
3447
|
id: r.ruleId,
|
|
3218
3448
|
impact: r.holmdigitalInsight.diggRisk,
|
|
3219
3449
|
description: r.remediation.description,
|
|
@@ -3233,10 +3463,14 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
3233
3463
|
console.log("");
|
|
3234
3464
|
console.log(import_chalk2.default.bold(`Score: ${scoreColor(`${result.score}/100`)} Status: ${statusColor(result.complianceStatus)}`));
|
|
3235
3465
|
console.log(import_chalk2.default.gray(`Critical: ${result.stats.critical} | High: ${result.stats.high} | Medium: ${result.stats.medium} | Low: ${result.stats.low}`));
|
|
3236
|
-
if (result.
|
|
3466
|
+
if (result.stats.needsReview > 0) {
|
|
3467
|
+
console.log(import_chalk2.default.gray(`Needs review: ${result.stats.needsReview}`));
|
|
3468
|
+
}
|
|
3469
|
+
const lightViolations = violationsOf(result.reports);
|
|
3470
|
+
if (lightViolations.length > 0) {
|
|
3237
3471
|
console.log("");
|
|
3238
3472
|
console.log(import_chalk2.default.bold("Top Issues:"));
|
|
3239
|
-
|
|
3473
|
+
lightViolations.slice(0, 5).forEach((r) => {
|
|
3240
3474
|
const color = r.holmdigitalInsight.diggRisk === "critical" ? import_chalk2.default.red : r.holmdigitalInsight.diggRisk === "high" ? import_chalk2.default.yellow : import_chalk2.default.gray;
|
|
3241
3475
|
console.log(color(` [${r.holmdigitalInsight.diggRisk.toUpperCase()}] ${r.ruleId} \u2014 ${r.remediation.description}`));
|
|
3242
3476
|
});
|
|
@@ -3247,6 +3481,8 @@ Scan: ${result.metadata.scanDuration}ms | ${result.metadata.engineVersion}`));
|
|
|
3247
3481
|
const { renderPlainReport: renderPlainReport2 } = await Promise.resolve().then(() => (init_plain_report(), plain_report_exports));
|
|
3248
3482
|
renderPlainReport2(result, plainFallbackFrom ? "en" : options.lang, plainFallbackFrom);
|
|
3249
3483
|
} else {
|
|
3484
|
+
const violations = violationsOf(result.reports);
|
|
3485
|
+
const needsReview = needsReviewOf(result.reports);
|
|
3250
3486
|
console.log("\n");
|
|
3251
3487
|
const scoreColor = result.score >= 90 ? import_chalk2.default.green : result.score >= 70 ? import_chalk2.default.yellow : import_chalk2.default.red;
|
|
3252
3488
|
console.log(import_chalk2.default.bold(`[ Compliance Score: ${scoreColor(result.score + "/100")} ] ${result.score >= 90 ? "\u{1F7E2}" : result.score >= 70 ? "\u{1F7E1}" : "\u{1F534}"}`));
|
|
@@ -3264,7 +3500,7 @@ ${t("cli.badge_withheld")}`));
|
|
|
3264
3500
|
}
|
|
3265
3501
|
console.log(import_chalk2.default.gray("----------------------------------------"));
|
|
3266
3502
|
const calculateCategoryScore = (filterFn) => {
|
|
3267
|
-
const failures =
|
|
3503
|
+
const failures = violations.filter(filterFn).length;
|
|
3268
3504
|
return Math.max(10, 100 - failures * 20);
|
|
3269
3505
|
};
|
|
3270
3506
|
const cats = [
|
|
@@ -3276,7 +3512,7 @@ ${t("cli.badge_withheld")}`));
|
|
|
3276
3512
|
{
|
|
3277
3513
|
name: "Keyboard Nav ",
|
|
3278
3514
|
score: calculateCategoryScore((r) => ["2.1.1", "2.1.2", "2.4.3", "2.4.7"].some((c) => r.wcagCriteria.includes(c))),
|
|
3279
|
-
critical:
|
|
3515
|
+
critical: violations.some((r) => ["2.1.1", "2.1.2"].some((c) => r.wcagCriteria.includes(c)) && r.holmdigitalInsight.diggRisk === "critical")
|
|
3280
3516
|
},
|
|
3281
3517
|
{
|
|
3282
3518
|
name: "Contrast ",
|
|
@@ -3300,9 +3536,9 @@ ${t("cli.badge_withheld")}`));
|
|
|
3300
3536
|
let riskIcon = "\u2705";
|
|
3301
3537
|
if (result.legalSummary && result.legalSummary.eaaDeadlineViolations > 0) {
|
|
3302
3538
|
legalRisk = "HIGH";
|
|
3303
|
-
const hasKeyboardIssues =
|
|
3304
|
-
const hasContrastIssues =
|
|
3305
|
-
const hasStructureIssues =
|
|
3539
|
+
const hasKeyboardIssues = violations.some((r) => ["2.1.1", "2.1.2"].some((c) => r.wcagCriteria.includes(c)));
|
|
3540
|
+
const hasContrastIssues = violations.some((r) => r.wcagCriteria.includes("1.4.3") || r.ruleId === "color-contrast");
|
|
3541
|
+
const hasStructureIssues = violations.some((r) => r.wcagCriteria.includes("1.3.1"));
|
|
3306
3542
|
if (hasKeyboardIssues) riskReason = "Keyboard accessibility blocks EAA compliance";
|
|
3307
3543
|
else if (hasContrastIssues) riskReason = "Contrast issues block EAA compliance";
|
|
3308
3544
|
else if (hasStructureIssues) riskReason = "HTML structure issues block EAA compliance";
|
|
@@ -3324,10 +3560,10 @@ ${t("cli.badge_withheld")}`));
|
|
|
3324
3560
|
console.log(import_chalk2.default.gray(" ... and more (run with --json for full details)"));
|
|
3325
3561
|
console.log(import_chalk2.default.gray("----------------------------------------"));
|
|
3326
3562
|
}
|
|
3327
|
-
if (
|
|
3563
|
+
if (violations.length > 0) {
|
|
3328
3564
|
console.log(import_chalk2.default.bold("Top Violations:"));
|
|
3329
3565
|
}
|
|
3330
|
-
|
|
3566
|
+
violations.forEach((report, i) => {
|
|
3331
3567
|
if (i > 5) return;
|
|
3332
3568
|
const color = report.holmdigitalInsight.diggRisk === "critical" ? import_chalk2.default.red : import_chalk2.default.yellow;
|
|
3333
3569
|
console.log(color.bold(`
|
|
@@ -3337,9 +3573,19 @@ ${t("cli.badge_withheld")}`));
|
|
|
3337
3573
|
console.log(import_chalk2.default.green(`Fix: Use component <${report.remediation.component} />`));
|
|
3338
3574
|
}
|
|
3339
3575
|
});
|
|
3340
|
-
if (
|
|
3576
|
+
if (violations.length > 5) {
|
|
3341
3577
|
console.log(import_chalk2.default.gray(`
|
|
3342
|
-
... and ${
|
|
3578
|
+
... and ${violations.length - 5} more issues.`));
|
|
3579
|
+
}
|
|
3580
|
+
if (needsReview.length > 0) {
|
|
3581
|
+
console.log(import_chalk2.default.cyan.bold(`
|
|
3582
|
+
\u2139\uFE0F Needs review (${needsReview.length}): axe could not determine these automatically`));
|
|
3583
|
+
needsReview.slice(0, 5).forEach((report) => {
|
|
3584
|
+
console.log(import_chalk2.default.cyan(` [NEEDS REVIEW] ${report.ruleId} \u2014 WCAG ${report.wcagCriteria}`));
|
|
3585
|
+
});
|
|
3586
|
+
if (needsReview.length > 5) {
|
|
3587
|
+
console.log(import_chalk2.default.gray(` ... and ${needsReview.length - 5} more to review.`));
|
|
3588
|
+
}
|
|
3343
3589
|
}
|
|
3344
3590
|
console.log(import_chalk2.default.gray("\n----------------------------------------"));
|
|
3345
3591
|
console.log(`Scan Date: ${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}`);
|
|
@@ -3347,7 +3593,7 @@ ${t("cli.badge_withheld")}`));
|
|
|
3347
3593
|
if (options.generateTests) {
|
|
3348
3594
|
console.log(import_chalk2.default.magenta.bold(t("cli.pseudo_tests")));
|
|
3349
3595
|
const automation = new PseudoAutomationEngine();
|
|
3350
|
-
|
|
3596
|
+
violations.forEach((report) => {
|
|
3351
3597
|
if (report.testability.pseudoAutomation) {
|
|
3352
3598
|
console.log(import_chalk2.default.cyan(t("cli.test_for", { ruleId: report.ruleId })));
|
|
3353
3599
|
console.log(import_chalk2.default.gray(automation.generateTestScript(report, url)));
|