@holmdigital/engine 2.5.6 → 2.6.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/index.js CHANGED
@@ -77,6 +77,27 @@ var init_en = __esm({
77
77
  prescriptive_fix: "\u{1F4A1} Prescriptive Fix",
78
78
  use: "Use",
79
79
  footer: "Generated by @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
80
+ },
81
+ plain: {
82
+ what_happens: "What happens:",
83
+ who_is_affected: "Who is affected:",
84
+ business_impact: "What it costs you:",
85
+ how_to_fix: "How to fix it:",
86
+ badge_stoppar_kop: "Blocks purchases",
87
+ badge_hindrar: "Excludes customers",
88
+ badge_forsamrar: "Degrades experience",
89
+ badge_putsning: "Worth polishing",
90
+ intro_framing: "It does not mean you did anything wrong. Most people who build a website never find out that accessibility is even a thing. Now you know. Here is what is worth starting with, sorted by what costs you the most customers.",
91
+ sorted_by: "Sorted by business impact",
92
+ intro_found: "Found {count} {unit}",
93
+ intro_unit_singular: "issue",
94
+ intro_unit_plural: "issues",
95
+ closing: "Start at the top. The items highest up cost you the most customers.",
96
+ empty_state: "No barriers found this time.",
97
+ report_title: "Accessibility report for {url}",
98
+ report_tagline: "Accessibility report",
99
+ attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
100
+ fallback_framing: "Technical finding. Ask your developer to review this:"
80
101
  }
81
102
  };
82
103
  }
@@ -122,6 +143,27 @@ var init_sv = __esm({
122
143
  prescriptive_fix: "\u{1F4A1} Preskriptiv L\xF6sning",
123
144
  use: "Anv\xE4nd",
124
145
  footer: "Genererad av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, DOS-lagen"
146
+ },
147
+ plain: {
148
+ what_happens: "Vad som h\xE4nder:",
149
+ who_is_affected: "Vem det drabbar:",
150
+ business_impact: "Vad det kostar:",
151
+ how_to_fix: "S\xE5 fixar du:",
152
+ badge_stoppar_kop: "Stoppar k\xF6p",
153
+ badge_hindrar: "Hindrar kunder",
154
+ badge_forsamrar: "F\xF6rs\xE4mrar upplevelsen",
155
+ badge_putsning: "V\xE4rt att putsa",
156
+ intro_framing: "Det betyder inte att du gjort n\xE5got fel. De flesta som bygger en webbplats f\xE5r aldrig veta att tillg\xE4nglighet ens \xE4r en sak. Nu vet du. H\xE4r \xE4r vad som \xE4r v\xE4rt att b\xF6rja med, sorterat efter vad som kostar dig mest kunder.",
157
+ sorted_by: "Sorterat efter aff\xE4rsp\xE5verkan",
158
+ intro_found: "Hittade {count} {unit}",
159
+ intro_unit_singular: "hinder",
160
+ intro_unit_plural: "hinder",
161
+ closing: "B\xF6rja uppifr\xE5n. Punkterna h\xF6gst upp kostar dig mest kunder.",
162
+ empty_state: "Vi hittade inga hinder den h\xE4r g\xE5ngen.",
163
+ report_title: "Tillg\xE4nglighetsrapport f\xF6r {url}",
164
+ report_tagline: "Tillg\xE4nglighetsrapport",
165
+ attribution: "Rapporten genererades av HolmDigital Engine, en del av HolmDigitals ekosystem f\xF6r tillg\xE4nglighet.",
166
+ fallback_framing: "Tekniskt fynd. Be er utvecklare titta p\xE5 detta:"
125
167
  }
126
168
  };
127
169
  }
@@ -167,6 +209,27 @@ var init_de = __esm({
167
209
  prescriptive_fix: "\u{1F4A1} Vorschriftsm\xE4\xDFige L\xF6sung",
168
210
  use: "Verwenden",
169
211
  footer: "Generiert von @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, BITV 2.0"
212
+ },
213
+ plain: {
214
+ what_happens: "What happens:",
215
+ who_is_affected: "Who is affected:",
216
+ business_impact: "What it costs you:",
217
+ how_to_fix: "How to fix it:",
218
+ badge_stoppar_kop: "Blocks purchases",
219
+ badge_hindrar: "Excludes customers",
220
+ badge_forsamrar: "Degrades experience",
221
+ badge_putsning: "Worth polishing",
222
+ intro_framing: "It does not mean you did anything wrong. Most people who build a website never find out that accessibility is even a thing. Now you know. Here is what is worth starting with, sorted by what costs you the most customers.",
223
+ sorted_by: "Sorted by business impact",
224
+ intro_found: "Found {count} {unit}",
225
+ intro_unit_singular: "issue",
226
+ intro_unit_plural: "issues",
227
+ closing: "Start at the top. The items highest up cost you the most customers.",
228
+ empty_state: "No barriers found this time.",
229
+ report_title: "Accessibility report for {url}",
230
+ report_tagline: "Accessibility report",
231
+ attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
232
+ fallback_framing: "Technical finding. Ask your developer to review this:"
170
233
  }
171
234
  };
172
235
  }
@@ -212,6 +275,27 @@ var init_fr = __esm({
212
275
  prescriptive_fix: "\u{1F4A1} Solution Prescriptive",
213
276
  use: "Utiliser",
214
277
  footer: "G\xE9n\xE9r\xE9 par @holmdigital/engine v{version} \u2022 Standards : WCAG 2.1 AA, EN 301 549, RGAA"
278
+ },
279
+ plain: {
280
+ what_happens: "What happens:",
281
+ who_is_affected: "Who is affected:",
282
+ business_impact: "What it costs you:",
283
+ how_to_fix: "How to fix it:",
284
+ badge_stoppar_kop: "Blocks purchases",
285
+ badge_hindrar: "Excludes customers",
286
+ badge_forsamrar: "Degrades experience",
287
+ badge_putsning: "Worth polishing",
288
+ intro_framing: "It does not mean you did anything wrong. Most people who build a website never find out that accessibility is even a thing. Now you know. Here is what is worth starting with, sorted by what costs you the most customers.",
289
+ sorted_by: "Sorted by business impact",
290
+ intro_found: "Found {count} {unit}",
291
+ intro_unit_singular: "issue",
292
+ intro_unit_plural: "issues",
293
+ closing: "Start at the top. The items highest up cost you the most customers.",
294
+ empty_state: "No barriers found this time.",
295
+ report_title: "Accessibility report for {url}",
296
+ report_tagline: "Accessibility report",
297
+ attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
298
+ fallback_framing: "Technical finding. Ask your developer to review this:"
215
299
  }
216
300
  };
217
301
  }
@@ -257,6 +341,27 @@ var init_es = __esm({
257
341
  prescriptive_fix: "\u{1F4A1} Soluci\xF3n Prescriptiva",
258
342
  use: "Usar",
259
343
  footer: "Generado por @holmdigital/engine v{version} \u2022 Est\xE1ndares: WCAG 2.1 AA, EN 301 549, UNE 139803"
344
+ },
345
+ plain: {
346
+ what_happens: "What happens:",
347
+ who_is_affected: "Who is affected:",
348
+ business_impact: "What it costs you:",
349
+ how_to_fix: "How to fix it:",
350
+ badge_stoppar_kop: "Blocks purchases",
351
+ badge_hindrar: "Excludes customers",
352
+ badge_forsamrar: "Degrades experience",
353
+ badge_putsning: "Worth polishing",
354
+ intro_framing: "It does not mean you did anything wrong. Most people who build a website never find out that accessibility is even a thing. Now you know. Here is what is worth starting with, sorted by what costs you the most customers.",
355
+ sorted_by: "Sorted by business impact",
356
+ intro_found: "Found {count} {unit}",
357
+ intro_unit_singular: "issue",
358
+ intro_unit_plural: "issues",
359
+ closing: "Start at the top. The items highest up cost you the most customers.",
360
+ empty_state: "No barriers found this time.",
361
+ report_title: "Accessibility report for {url}",
362
+ report_tagline: "Accessibility report",
363
+ attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
364
+ fallback_framing: "Technical finding. Ask your developer to review this:"
260
365
  }
261
366
  };
262
367
  }
@@ -302,6 +407,27 @@ var init_fi = __esm({
302
407
  prescriptive_fix: "\u{1F4A1} Ehdotettu korjaus",
303
408
  use: "K\xE4yt\xE4",
304
409
  footer: "Luonut @holmdigital/engine v{version} \u2022 Standardit: WCAG 2.1 AA, EN 301 549, Digipalvelulaki"
410
+ },
411
+ plain: {
412
+ what_happens: "What happens:",
413
+ who_is_affected: "Who is affected:",
414
+ business_impact: "What it costs you:",
415
+ how_to_fix: "How to fix it:",
416
+ badge_stoppar_kop: "Blocks purchases",
417
+ badge_hindrar: "Excludes customers",
418
+ badge_forsamrar: "Degrades experience",
419
+ badge_putsning: "Worth polishing",
420
+ intro_framing: "It does not mean you did anything wrong. Most people who build a website never find out that accessibility is even a thing. Now you know. Here is what is worth starting with, sorted by what costs you the most customers.",
421
+ sorted_by: "Sorted by business impact",
422
+ intro_found: "Found {count} {unit}",
423
+ intro_unit_singular: "issue",
424
+ intro_unit_plural: "issues",
425
+ closing: "Start at the top. The items highest up cost you the most customers.",
426
+ empty_state: "No barriers found this time.",
427
+ report_title: "Accessibility report for {url}",
428
+ report_tagline: "Accessibility report",
429
+ attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
430
+ fallback_framing: "Technical finding. Ask your developer to review this:"
305
431
  }
306
432
  };
307
433
  }
@@ -347,6 +473,27 @@ var init_dk = __esm({
347
473
  prescriptive_fix: "\u{1F4A1} Foresl\xE5et L\xF8sning",
348
474
  use: "Brug",
349
475
  footer: "Genereret af @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Lov om tilg\xE6ngelighed"
476
+ },
477
+ plain: {
478
+ what_happens: "What happens:",
479
+ who_is_affected: "Who is affected:",
480
+ business_impact: "What it costs you:",
481
+ how_to_fix: "How to fix it:",
482
+ badge_stoppar_kop: "Blocks purchases",
483
+ badge_hindrar: "Excludes customers",
484
+ badge_forsamrar: "Degrades experience",
485
+ badge_putsning: "Worth polishing",
486
+ intro_framing: "It does not mean you did anything wrong. Most people who build a website never find out that accessibility is even a thing. Now you know. Here is what is worth starting with, sorted by what costs you the most customers.",
487
+ sorted_by: "Sorted by business impact",
488
+ intro_found: "Found {count} {unit}",
489
+ intro_unit_singular: "issue",
490
+ intro_unit_plural: "issues",
491
+ closing: "Start at the top. The items highest up cost you the most customers.",
492
+ empty_state: "No barriers found this time.",
493
+ report_title: "Accessibility report for {url}",
494
+ report_tagline: "Accessibility report",
495
+ attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
496
+ fallback_framing: "Technical finding. Ask your developer to review this:"
350
497
  }
351
498
  };
352
499
  }
@@ -392,6 +539,27 @@ var init_no = __esm({
392
539
  prescriptive_fix: "\u{1F4A1} Foresl\xE5tt L\xF8sning",
393
540
  use: "Bruk",
394
541
  footer: "Generert av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Uu-tilsynet"
542
+ },
543
+ plain: {
544
+ what_happens: "What happens:",
545
+ who_is_affected: "Who is affected:",
546
+ business_impact: "What it costs you:",
547
+ how_to_fix: "How to fix it:",
548
+ badge_stoppar_kop: "Blocks purchases",
549
+ badge_hindrar: "Excludes customers",
550
+ badge_forsamrar: "Degrades experience",
551
+ badge_putsning: "Worth polishing",
552
+ intro_framing: "It does not mean you did anything wrong. Most people who build a website never find out that accessibility is even a thing. Now you know. Here is what is worth starting with, sorted by what costs you the most customers.",
553
+ sorted_by: "Sorted by business impact",
554
+ intro_found: "Found {count} {unit}",
555
+ intro_unit_singular: "issue",
556
+ intro_unit_plural: "issues",
557
+ closing: "Start at the top. The items highest up cost you the most customers.",
558
+ empty_state: "No barriers found this time.",
559
+ report_title: "Accessibility report for {url}",
560
+ report_tagline: "Accessibility report",
561
+ attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
562
+ fallback_framing: "Technical finding. Ask your developer to review this:"
395
563
  }
396
564
  };
397
565
  }
@@ -437,6 +605,27 @@ var init_nl = __esm({
437
605
  prescriptive_fix: "\u{1F4A1} Voorgeschreven oplossing",
438
606
  use: "Gebruik",
439
607
  footer: "Gegenereerd door @holmdigital/engine v{version} \u2022 Standaarden: WCAG 2.1 AA, EN 301 549, Besluit digitale toegankelijkheid overheid"
608
+ },
609
+ plain: {
610
+ what_happens: "What happens:",
611
+ who_is_affected: "Who is affected:",
612
+ business_impact: "What it costs you:",
613
+ how_to_fix: "How to fix it:",
614
+ badge_stoppar_kop: "Blocks purchases",
615
+ badge_hindrar: "Excludes customers",
616
+ badge_forsamrar: "Degrades experience",
617
+ badge_putsning: "Worth polishing",
618
+ intro_framing: "It does not mean you did anything wrong. Most people who build a website never find out that accessibility is even a thing. Now you know. Here is what is worth starting with, sorted by what costs you the most customers.",
619
+ sorted_by: "Sorted by business impact",
620
+ intro_found: "Found {count} {unit}",
621
+ intro_unit_singular: "issue",
622
+ intro_unit_plural: "issues",
623
+ closing: "Start at the top. The items highest up cost you the most customers.",
624
+ empty_state: "No barriers found this time.",
625
+ report_title: "Accessibility report for {url}",
626
+ report_tagline: "Accessibility report",
627
+ attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
628
+ fallback_framing: "Technical finding. Ask your developer to review this:"
440
629
  }
441
630
  };
442
631
  }
@@ -677,7 +866,7 @@ var HtmlValidator = class {
677
866
  // src/core/regulatory-scanner.ts
678
867
  var import_node_fs = require("fs");
679
868
  function getEngineVersion() {
680
- return "2.5.6";
869
+ return "2.6.0";
681
870
  }
682
871
  function getStandardsVersion() {
683
872
  try {
package/dist/index.mjs CHANGED
@@ -5,12 +5,12 @@ import {
5
5
  generateStatement,
6
6
  generateStatementContent,
7
7
  getEngineVersion
8
- } from "./chunk-YI5WLSPC.mjs";
8
+ } from "./chunk-AE5DGJCS.mjs";
9
9
  import {
10
10
  getCurrentLang,
11
11
  setLanguage,
12
12
  t
13
- } from "./chunk-FBGKWDZT.mjs";
13
+ } from "./chunk-TT3JDVGJ.mjs";
14
14
  import "./chunk-DIBTSSLZ.mjs";
15
15
  export {
16
16
  PseudoAutomationEngine,
@@ -0,0 +1,77 @@
1
+ import {
2
+ setLanguage,
3
+ t
4
+ } from "./chunk-TT3JDVGJ.mjs";
5
+ import "./chunk-DIBTSSLZ.mjs";
6
+
7
+ // src/reporting/plain-report.ts
8
+ import chalk from "chalk";
9
+ var IMPACT_ORDER = {
10
+ "stoppar-kop": 0,
11
+ "hindrar": 1,
12
+ "forsamrar": 2,
13
+ "putsning": 3
14
+ };
15
+ var RISK_TO_IMPACT = {
16
+ critical: "stoppar-kop",
17
+ high: "hindrar",
18
+ medium: "forsamrar",
19
+ low: "putsning"
20
+ };
21
+ var BADGE_CHALK = {
22
+ "stoppar-kop": chalk.red.bold,
23
+ "hindrar": chalk.red,
24
+ "forsamrar": chalk.yellow,
25
+ "putsning": chalk.gray
26
+ };
27
+ var BADGE_KEY = {
28
+ "stoppar-kop": "plain.badge_stoppar_kop",
29
+ "hindrar": "plain.badge_hindrar",
30
+ "forsamrar": "plain.badge_forsamrar",
31
+ "putsning": "plain.badge_putsning"
32
+ };
33
+ function levelOf(report) {
34
+ return report.plainLanguage?.impactLevel ?? RISK_TO_IMPACT[report.holmdigitalInsight.diggRisk] ?? "putsning";
35
+ }
36
+ function renderPlainReport(result, lang = "en") {
37
+ setLanguage(lang);
38
+ if (result.reports.length === 0) {
39
+ console.log(t("plain.empty_state"));
40
+ console.log("");
41
+ console.log(t("plain.attribution"));
42
+ return;
43
+ }
44
+ const sortedReports = [...result.reports].sort((a, b) => {
45
+ const aLevel = IMPACT_ORDER[levelOf(a)] ?? 4;
46
+ const bLevel = IMPACT_ORDER[levelOf(b)] ?? 4;
47
+ return aLevel - bLevel;
48
+ });
49
+ const count = sortedReports.length;
50
+ const unit = count === 1 ? t("plain.intro_unit_singular") : t("plain.intro_unit_plural");
51
+ console.log(t("plain.intro_framing"));
52
+ console.log(t("plain.intro_found", { count, unit }));
53
+ console.log(t("plain.sorted_by"));
54
+ console.log("");
55
+ sortedReports.forEach((rawReport, index) => {
56
+ const report = rawReport;
57
+ const level = levelOf(report);
58
+ const badgeText = BADGE_CHALK[level](t(BADGE_KEY[level]));
59
+ const pl = report.plainLanguage;
60
+ console.log(`${index + 1}. ${badgeText} \u2014 ${report.ruleId}`);
61
+ if (pl) {
62
+ console.log(` ${t("plain.what_happens")} ${pl.whatHappens}`);
63
+ console.log(` ${t("plain.who_is_affected")} ${pl.whoIsAffected}`);
64
+ console.log(` ${t("plain.business_impact")} ${pl.businessImpact}`);
65
+ console.log(` ${t("plain.how_to_fix")} ${pl.howToFix}`);
66
+ } else {
67
+ console.log(` ${t("plain.fallback_framing")} ${report.remediation.description}`);
68
+ }
69
+ console.log("");
70
+ });
71
+ console.log(t("plain.closing"));
72
+ console.log("");
73
+ console.log(t("plain.attribution"));
74
+ }
75
+ export {
76
+ renderPlainReport
77
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holmdigital/engine",
3
- "version": "2.5.6",
3
+ "version": "2.6.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -83,7 +83,7 @@
83
83
  "license": "MIT",
84
84
  "dependencies": {
85
85
  "@holmdigital/components": "^2.7.2",
86
- "@holmdigital/standards": "^2.6.1",
86
+ "@holmdigital/standards": "^2.7.0",
87
87
  "axe-core": "^4.11.1",
88
88
  "chalk": "^5.3.0",
89
89
  "commander": "^12.1.0",