@holmdigital/engine 2.6.0 → 2.7.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.
@@ -55,7 +55,8 @@ var en_default = {
55
55
  report_title: "Accessibility report for {url}",
56
56
  report_tagline: "Accessibility report",
57
57
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
58
- fallback_framing: "Technical finding. Ask your developer to review this:"
58
+ fallback_framing: "Technical finding. Ask your developer to review this:",
59
+ occurrences: "{count} occurrences"
59
60
  }
60
61
  };
61
62
 
@@ -116,7 +117,8 @@ var sv_default = {
116
117
  report_title: "Tillg\xE4nglighetsrapport f\xF6r {url}",
117
118
  report_tagline: "Tillg\xE4nglighetsrapport",
118
119
  attribution: "Rapporten genererades av HolmDigital Engine, en del av HolmDigitals ekosystem f\xF6r tillg\xE4nglighet.",
119
- fallback_framing: "Tekniskt fynd. Be er utvecklare titta p\xE5 detta:"
120
+ fallback_framing: "Tekniskt fynd som din utvecklare beh\xF6ver titta p\xE5.",
121
+ occurrences: "{count} f\xF6rekomster"
120
122
  }
121
123
  };
122
124
 
@@ -177,7 +179,8 @@ var de_default = {
177
179
  report_title: "Accessibility report for {url}",
178
180
  report_tagline: "Accessibility report",
179
181
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
180
- fallback_framing: "Technical finding. Ask your developer to review this:"
182
+ fallback_framing: "Technical finding. Ask your developer to review this:",
183
+ occurrences: "{count} occurrences"
181
184
  }
182
185
  };
183
186
 
@@ -238,7 +241,8 @@ var fr_default = {
238
241
  report_title: "Accessibility report for {url}",
239
242
  report_tagline: "Accessibility report",
240
243
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
241
- fallback_framing: "Technical finding. Ask your developer to review this:"
244
+ fallback_framing: "Technical finding. Ask your developer to review this:",
245
+ occurrences: "{count} occurrences"
242
246
  }
243
247
  };
244
248
 
@@ -299,7 +303,8 @@ var es_default = {
299
303
  report_title: "Accessibility report for {url}",
300
304
  report_tagline: "Accessibility report",
301
305
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
302
- fallback_framing: "Technical finding. Ask your developer to review this:"
306
+ fallback_framing: "Technical finding. Ask your developer to review this:",
307
+ occurrences: "{count} occurrences"
303
308
  }
304
309
  };
305
310
 
@@ -360,7 +365,8 @@ var fi_default = {
360
365
  report_title: "Accessibility report for {url}",
361
366
  report_tagline: "Accessibility report",
362
367
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
363
- fallback_framing: "Technical finding. Ask your developer to review this:"
368
+ fallback_framing: "Technical finding. Ask your developer to review this:",
369
+ occurrences: "{count} occurrences"
364
370
  }
365
371
  };
366
372
 
@@ -421,7 +427,8 @@ var dk_default = {
421
427
  report_title: "Accessibility report for {url}",
422
428
  report_tagline: "Accessibility report",
423
429
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
424
- fallback_framing: "Technical finding. Ask your developer to review this:"
430
+ fallback_framing: "Technical finding. Ask your developer to review this:",
431
+ occurrences: "{count} occurrences"
425
432
  }
426
433
  };
427
434
 
@@ -482,7 +489,8 @@ var no_default = {
482
489
  report_title: "Accessibility report for {url}",
483
490
  report_tagline: "Accessibility report",
484
491
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
485
- fallback_framing: "Technical finding. Ask your developer to review this:"
492
+ fallback_framing: "Technical finding. Ask your developer to review this:",
493
+ occurrences: "{count} occurrences"
486
494
  }
487
495
  };
488
496
 
@@ -543,7 +551,8 @@ var nl_default = {
543
551
  report_title: "Accessibility report for {url}",
544
552
  report_tagline: "Accessibility report",
545
553
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
546
- fallback_framing: "Technical finding. Ask your developer to review this:"
554
+ fallback_framing: "Technical finding. Ask your developer to review this:",
555
+ occurrences: "{count} occurrences"
547
556
  }
548
557
  };
549
558
 
@@ -138,7 +138,7 @@ var HtmlValidator = class {
138
138
  // src/core/regulatory-scanner.ts
139
139
  import { readFileSync } from "fs";
140
140
  function getEngineVersion() {
141
- return "2.6.0";
141
+ return "2.7.0";
142
142
  }
143
143
  function getStandardsVersion() {
144
144
  try {
@@ -323,7 +323,7 @@ var RegulatoryScanner = class {
323
323
  async enrichResults(axeResults) {
324
324
  const reports = [];
325
325
  const { searchRulesByTags, generateRegulatoryReport, getConvergenceRule } = await import("@holmdigital/standards");
326
- const { getCurrentLang } = await import("./i18n-SE7FLXIF.mjs");
326
+ const { getCurrentLang } = await import("./i18n-VUB5WFVC.mjs");
327
327
  const lang = getCurrentLang();
328
328
  for (const violation of axeResults.violations) {
329
329
  let report = generateRegulatoryReport(violation.id, lang);
@@ -0,0 +1,26 @@
1
+ // src/reporting/plain-group.ts
2
+ function groupReportsByRule(reports) {
3
+ const groups = /* @__PURE__ */ new Map();
4
+ for (const report of reports) {
5
+ const existing = groups.get(report.ruleId);
6
+ if (existing) {
7
+ existing.count += 1;
8
+ } else {
9
+ groups.set(report.ruleId, { report, count: 1 });
10
+ }
11
+ }
12
+ return [...groups.values()];
13
+ }
14
+ function impactBreakdown(reports, levelOf, order) {
15
+ const counts = /* @__PURE__ */ new Map();
16
+ for (const report of reports) {
17
+ const level = levelOf(report);
18
+ counts.set(level, (counts.get(level) ?? 0) + 1);
19
+ }
20
+ return [...counts.entries()].map(([level, count]) => ({ level, count })).sort((a, b) => (order[a.level] ?? 4) - (order[b.level] ?? 4));
21
+ }
22
+
23
+ export {
24
+ groupReportsByRule,
25
+ impactBreakdown
26
+ };
package/dist/cli/index.js CHANGED
@@ -97,7 +97,8 @@ var init_en = __esm({
97
97
  report_title: "Accessibility report for {url}",
98
98
  report_tagline: "Accessibility report",
99
99
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
100
- fallback_framing: "Technical finding. Ask your developer to review this:"
100
+ fallback_framing: "Technical finding. Ask your developer to review this:",
101
+ occurrences: "{count} occurrences"
101
102
  }
102
103
  };
103
104
  }
@@ -163,7 +164,8 @@ var init_sv = __esm({
163
164
  report_title: "Tillg\xE4nglighetsrapport f\xF6r {url}",
164
165
  report_tagline: "Tillg\xE4nglighetsrapport",
165
166
  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:"
167
+ fallback_framing: "Tekniskt fynd som din utvecklare beh\xF6ver titta p\xE5.",
168
+ occurrences: "{count} f\xF6rekomster"
167
169
  }
168
170
  };
169
171
  }
@@ -229,7 +231,8 @@ var init_de = __esm({
229
231
  report_title: "Accessibility report for {url}",
230
232
  report_tagline: "Accessibility report",
231
233
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
232
- fallback_framing: "Technical finding. Ask your developer to review this:"
234
+ fallback_framing: "Technical finding. Ask your developer to review this:",
235
+ occurrences: "{count} occurrences"
233
236
  }
234
237
  };
235
238
  }
@@ -295,7 +298,8 @@ var init_fr = __esm({
295
298
  report_title: "Accessibility report for {url}",
296
299
  report_tagline: "Accessibility report",
297
300
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
298
- fallback_framing: "Technical finding. Ask your developer to review this:"
301
+ fallback_framing: "Technical finding. Ask your developer to review this:",
302
+ occurrences: "{count} occurrences"
299
303
  }
300
304
  };
301
305
  }
@@ -361,7 +365,8 @@ var init_es = __esm({
361
365
  report_title: "Accessibility report for {url}",
362
366
  report_tagline: "Accessibility report",
363
367
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
364
- fallback_framing: "Technical finding. Ask your developer to review this:"
368
+ fallback_framing: "Technical finding. Ask your developer to review this:",
369
+ occurrences: "{count} occurrences"
365
370
  }
366
371
  };
367
372
  }
@@ -427,7 +432,8 @@ var init_fi = __esm({
427
432
  report_title: "Accessibility report for {url}",
428
433
  report_tagline: "Accessibility report",
429
434
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
430
- fallback_framing: "Technical finding. Ask your developer to review this:"
435
+ fallback_framing: "Technical finding. Ask your developer to review this:",
436
+ occurrences: "{count} occurrences"
431
437
  }
432
438
  };
433
439
  }
@@ -493,7 +499,8 @@ var init_dk = __esm({
493
499
  report_title: "Accessibility report for {url}",
494
500
  report_tagline: "Accessibility report",
495
501
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
496
- fallback_framing: "Technical finding. Ask your developer to review this:"
502
+ fallback_framing: "Technical finding. Ask your developer to review this:",
503
+ occurrences: "{count} occurrences"
497
504
  }
498
505
  };
499
506
  }
@@ -559,7 +566,8 @@ var init_no = __esm({
559
566
  report_title: "Accessibility report for {url}",
560
567
  report_tagline: "Accessibility report",
561
568
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
562
- fallback_framing: "Technical finding. Ask your developer to review this:"
569
+ fallback_framing: "Technical finding. Ask your developer to review this:",
570
+ occurrences: "{count} occurrences"
563
571
  }
564
572
  };
565
573
  }
@@ -625,7 +633,8 @@ var init_nl = __esm({
625
633
  report_title: "Accessibility report for {url}",
626
634
  report_tagline: "Accessibility report",
627
635
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
628
- fallback_framing: "Technical finding. Ask your developer to review this:"
636
+ fallback_framing: "Technical finding. Ask your developer to review this:",
637
+ occurrences: "{count} occurrences"
629
638
  }
630
639
  };
631
640
  }
@@ -712,6 +721,34 @@ var init_i18n = __esm({
712
721
  }
713
722
  });
714
723
 
724
+ // src/reporting/plain-group.ts
725
+ function groupReportsByRule(reports) {
726
+ const groups = /* @__PURE__ */ new Map();
727
+ for (const report of reports) {
728
+ const existing = groups.get(report.ruleId);
729
+ if (existing) {
730
+ existing.count += 1;
731
+ } else {
732
+ groups.set(report.ruleId, { report, count: 1 });
733
+ }
734
+ }
735
+ return [...groups.values()];
736
+ }
737
+ function impactBreakdown(reports, levelOf2, order) {
738
+ const counts = /* @__PURE__ */ new Map();
739
+ for (const report of reports) {
740
+ const level = levelOf2(report);
741
+ counts.set(level, (counts.get(level) ?? 0) + 1);
742
+ }
743
+ return [...counts.entries()].map(([level, count]) => ({ level, count })).sort((a, b) => (order[a.level] ?? 4) - (order[b.level] ?? 4));
744
+ }
745
+ var init_plain_group = __esm({
746
+ "src/reporting/plain-group.ts"() {
747
+ "use strict";
748
+ init_cjs_shims();
749
+ }
750
+ });
751
+
715
752
  // src/reporting/plain-report.ts
716
753
  var plain_report_exports = {};
717
754
  __export(plain_report_exports, {
@@ -728,28 +765,35 @@ function renderPlainReport(result, lang = "en") {
728
765
  console.log(t("plain.attribution"));
729
766
  return;
730
767
  }
731
- const sortedReports = [...result.reports].sort((a, b) => {
732
- const aLevel = IMPACT_ORDER[levelOf(a)] ?? 4;
733
- const bLevel = IMPACT_ORDER[levelOf(b)] ?? 4;
768
+ const sortedGroups = groupReportsByRule(result.reports).sort((a, b) => {
769
+ const aLevel = IMPACT_ORDER[levelOf(a.report)] ?? 4;
770
+ const bLevel = IMPACT_ORDER[levelOf(b.report)] ?? 4;
734
771
  return aLevel - bLevel;
735
772
  });
736
- const count = sortedReports.length;
773
+ const count = result.reports.length;
737
774
  const unit = count === 1 ? t("plain.intro_unit_singular") : t("plain.intro_unit_plural");
775
+ const breakdown = impactBreakdown(result.reports, levelOf, IMPACT_ORDER);
776
+ const breakdownText = breakdown.map((b) => `${b.count} ${t(BADGE_KEY[b.level])}`).join(", ");
738
777
  console.log(t("plain.intro_framing"));
739
778
  console.log(t("plain.intro_found", { count, unit }));
779
+ console.log(`${count} ${unit}: ${breakdownText}`);
740
780
  console.log(t("plain.sorted_by"));
741
781
  console.log("");
742
- sortedReports.forEach((rawReport, index) => {
743
- const report = rawReport;
782
+ const isSwedish = getCurrentLang() === "sv";
783
+ sortedGroups.forEach((group, index) => {
784
+ const report = group.report;
744
785
  const level = levelOf(report);
745
786
  const badgeText = BADGE_CHALK[level](t(BADGE_KEY[level]));
746
787
  const pl = report.plainLanguage;
747
- console.log(`${index + 1}. ${badgeText} \u2014 ${report.ruleId}`);
788
+ const occurrences = group.count > 1 ? `, ${t("plain.occurrences", { count: group.count })}` : "";
789
+ console.log(`${index + 1}. ${badgeText} \u2014 ${report.ruleId}${occurrences}`);
748
790
  if (pl) {
749
791
  console.log(` ${t("plain.what_happens")} ${pl.whatHappens}`);
750
792
  console.log(` ${t("plain.who_is_affected")} ${pl.whoIsAffected}`);
751
793
  console.log(` ${t("plain.business_impact")} ${pl.businessImpact}`);
752
794
  console.log(` ${t("plain.how_to_fix")} ${pl.howToFix}`);
795
+ } else if (isSwedish) {
796
+ console.log(` ${t("plain.fallback_framing")}`);
753
797
  } else {
754
798
  console.log(` ${t("plain.fallback_framing")} ${report.remediation.description}`);
755
799
  }
@@ -766,6 +810,7 @@ var init_plain_report = __esm({
766
810
  init_cjs_shims();
767
811
  import_chalk = __toESM(require("chalk"));
768
812
  init_i18n();
813
+ init_plain_group();
769
814
  IMPACT_ORDER = {
770
815
  "stoppar-kop": 0,
771
816
  "hindrar": 1,
@@ -1053,7 +1098,7 @@ var HtmlValidator = class {
1053
1098
  // src/core/regulatory-scanner.ts
1054
1099
  var import_node_fs = require("fs");
1055
1100
  function getEngineVersion() {
1056
- return "2.6.0";
1101
+ return "2.7.0";
1057
1102
  }
1058
1103
  function getStandardsVersion() {
1059
1104
  try {
@@ -1477,6 +1522,7 @@ function generateBadgeMarkdown(score) {
1477
1522
 
1478
1523
  // src/reporting/html-template.ts
1479
1524
  init_i18n();
1525
+ init_plain_group();
1480
1526
  var LOCALE_TO_INTL = {
1481
1527
  sv: "sv-SE",
1482
1528
  en: "en-US",
@@ -1841,25 +1887,28 @@ function generatePlainReportHTML(result) {
1841
1887
  const lang = getCurrentLang();
1842
1888
  const safeUrl = escapeHtml(result.url);
1843
1889
  const logoDataUri = getLogoDataUri();
1844
- const sortedReports = [...result.reports].sort((a, b) => {
1845
- const aLevel = PLAIN_IMPACT_ORDER[plainLevelOf(a)] ?? 4;
1846
- const bLevel = PLAIN_IMPACT_ORDER[plainLevelOf(b)] ?? 4;
1890
+ const sortedGroups = groupReportsByRule(result.reports).sort((a, b) => {
1891
+ const aLevel = PLAIN_IMPACT_ORDER[plainLevelOf(a.report)] ?? 4;
1892
+ const bLevel = PLAIN_IMPACT_ORDER[plainLevelOf(b.report)] ?? 4;
1847
1893
  return aLevel - bLevel;
1848
1894
  });
1849
- const count = sortedReports.length;
1895
+ const count = result.reports.length;
1850
1896
  const unit = count === 1 ? t("plain.intro_unit_singular") : t("plain.intro_unit_plural");
1851
- const itemsHtml = sortedReports.length === 0 ? `<p>${t("plain.empty_state")}</p>` : `<ul class="issue-list">
1852
- ${sortedReports.map((rawReport) => {
1853
- const report = rawReport;
1897
+ const breakdownText = impactBreakdown(result.reports, plainLevelOf, PLAIN_IMPACT_ORDER).map((b) => `${b.count} ${escapeHtml(t(PLAIN_BADGE_KEY[b.level]))}`).join(", ");
1898
+ const isSwedish = lang === "sv";
1899
+ const itemsHtml = sortedGroups.length === 0 ? `<p>${t("plain.empty_state")}</p>` : `<ul class="issue-list">
1900
+ ${sortedGroups.map((group) => {
1901
+ const report = group.report;
1854
1902
  const level = plainLevelOf(report);
1855
1903
  const badgeClass = PLAIN_BADGE_CLASS[level];
1856
1904
  const cardClass = `issue-item--${level}`;
1857
1905
  const badgeText = escapeHtml(t(PLAIN_BADGE_KEY[level]));
1858
1906
  const pl = report.plainLanguage;
1907
+ const occurrences = group.count > 1 ? `, ${escapeHtml(t("plain.occurrences", { count: group.count }))}` : "";
1859
1908
  if (pl) {
1860
1909
  return ` <li class="issue-item ${cardClass}">
1861
1910
  <span class="badge ${badgeClass}">${badgeText}</span>
1862
- <strong class="issue-id">${escapeHtml(report.ruleId)}</strong>
1911
+ <strong class="issue-id">${escapeHtml(report.ruleId)}${occurrences}</strong>
1863
1912
  <dl class="issue-fields">
1864
1913
  <dt>${t("plain.what_happens")}</dt><dd>${escapeHtml(pl.whatHappens)}</dd>
1865
1914
  <dt>${t("plain.who_is_affected")}</dt><dd>${escapeHtml(pl.whoIsAffected)}</dd>
@@ -1868,10 +1917,11 @@ ${sortedReports.map((rawReport) => {
1868
1917
  </dl>
1869
1918
  </li>`;
1870
1919
  } else {
1920
+ const rawDetail = isSwedish ? "" : ` ${escapeHtml(report.remediation.description)}`;
1871
1921
  return ` <li class="issue-item ${cardClass}">
1872
1922
  <span class="badge ${badgeClass}">${badgeText}</span>
1873
- <strong class="issue-id">${escapeHtml(report.ruleId)}</strong>
1874
- <p class="issue-fallback"><span class="fallback-framing">${escapeHtml(t("plain.fallback_framing"))}</span> ${escapeHtml(report.remediation.description)}</p>
1923
+ <strong class="issue-id">${escapeHtml(report.ruleId)}${occurrences}</strong>
1924
+ <p class="issue-fallback"><span class="fallback-framing">${escapeHtml(t("plain.fallback_framing"))}</span>${rawDetail}</p>
1875
1925
  </li>`;
1876
1926
  }
1877
1927
  }).join("\n")}
@@ -2104,6 +2154,7 @@ ${sortedReports.map((rawReport) => {
2104
2154
  <div class="intro">
2105
2155
  <p>${t("plain.intro_framing")}</p>
2106
2156
  <p>${t("plain.intro_found", { count, unit })}</p>
2157
+ <p class="intro-breakdown">${count} ${escapeHtml(unit)}: ${breakdownText}</p>
2107
2158
  </div>
2108
2159
 
2109
2160
  ${itemsHtml}
@@ -7,12 +7,16 @@ import {
7
7
  generateStatement,
8
8
  generateStatementContent,
9
9
  getEngineVersion
10
- } from "../chunk-AE5DGJCS.mjs";
10
+ } from "../chunk-KXI4TVHQ.mjs";
11
+ import {
12
+ groupReportsByRule,
13
+ impactBreakdown
14
+ } from "../chunk-VNNYP4NV.mjs";
11
15
  import {
12
16
  getCurrentLang,
13
17
  setLanguage,
14
18
  t
15
- } from "../chunk-TT3JDVGJ.mjs";
19
+ } from "../chunk-6CGNOKCN.mjs";
16
20
  import {
17
21
  __dirname
18
22
  } from "../chunk-DIBTSSLZ.mjs";
@@ -389,25 +393,28 @@ function generatePlainReportHTML(result) {
389
393
  const lang = getCurrentLang();
390
394
  const safeUrl = escapeHtml(result.url);
391
395
  const logoDataUri = getLogoDataUri();
392
- const sortedReports = [...result.reports].sort((a, b) => {
393
- const aLevel = PLAIN_IMPACT_ORDER[plainLevelOf(a)] ?? 4;
394
- const bLevel = PLAIN_IMPACT_ORDER[plainLevelOf(b)] ?? 4;
396
+ const sortedGroups = groupReportsByRule(result.reports).sort((a, b) => {
397
+ const aLevel = PLAIN_IMPACT_ORDER[plainLevelOf(a.report)] ?? 4;
398
+ const bLevel = PLAIN_IMPACT_ORDER[plainLevelOf(b.report)] ?? 4;
395
399
  return aLevel - bLevel;
396
400
  });
397
- const count = sortedReports.length;
401
+ const count = result.reports.length;
398
402
  const unit = count === 1 ? t("plain.intro_unit_singular") : t("plain.intro_unit_plural");
399
- const itemsHtml = sortedReports.length === 0 ? `<p>${t("plain.empty_state")}</p>` : `<ul class="issue-list">
400
- ${sortedReports.map((rawReport) => {
401
- const report = rawReport;
403
+ const breakdownText = impactBreakdown(result.reports, plainLevelOf, PLAIN_IMPACT_ORDER).map((b) => `${b.count} ${escapeHtml(t(PLAIN_BADGE_KEY[b.level]))}`).join(", ");
404
+ const isSwedish = lang === "sv";
405
+ const itemsHtml = sortedGroups.length === 0 ? `<p>${t("plain.empty_state")}</p>` : `<ul class="issue-list">
406
+ ${sortedGroups.map((group) => {
407
+ const report = group.report;
402
408
  const level = plainLevelOf(report);
403
409
  const badgeClass = PLAIN_BADGE_CLASS[level];
404
410
  const cardClass = `issue-item--${level}`;
405
411
  const badgeText = escapeHtml(t(PLAIN_BADGE_KEY[level]));
406
412
  const pl = report.plainLanguage;
413
+ const occurrences = group.count > 1 ? `, ${escapeHtml(t("plain.occurrences", { count: group.count }))}` : "";
407
414
  if (pl) {
408
415
  return ` <li class="issue-item ${cardClass}">
409
416
  <span class="badge ${badgeClass}">${badgeText}</span>
410
- <strong class="issue-id">${escapeHtml(report.ruleId)}</strong>
417
+ <strong class="issue-id">${escapeHtml(report.ruleId)}${occurrences}</strong>
411
418
  <dl class="issue-fields">
412
419
  <dt>${t("plain.what_happens")}</dt><dd>${escapeHtml(pl.whatHappens)}</dd>
413
420
  <dt>${t("plain.who_is_affected")}</dt><dd>${escapeHtml(pl.whoIsAffected)}</dd>
@@ -416,10 +423,11 @@ ${sortedReports.map((rawReport) => {
416
423
  </dl>
417
424
  </li>`;
418
425
  } else {
426
+ const rawDetail = isSwedish ? "" : ` ${escapeHtml(report.remediation.description)}`;
419
427
  return ` <li class="issue-item ${cardClass}">
420
428
  <span class="badge ${badgeClass}">${badgeText}</span>
421
- <strong class="issue-id">${escapeHtml(report.ruleId)}</strong>
422
- <p class="issue-fallback"><span class="fallback-framing">${escapeHtml(t("plain.fallback_framing"))}</span> ${escapeHtml(report.remediation.description)}</p>
429
+ <strong class="issue-id">${escapeHtml(report.ruleId)}${occurrences}</strong>
430
+ <p class="issue-fallback"><span class="fallback-framing">${escapeHtml(t("plain.fallback_framing"))}</span>${rawDetail}</p>
423
431
  </li>`;
424
432
  }
425
433
  }).join("\n")}
@@ -652,6 +660,7 @@ ${sortedReports.map((rawReport) => {
652
660
  <div class="intro">
653
661
  <p>${t("plain.intro_framing")}</p>
654
662
  <p>${t("plain.intro_found", { count, unit })}</p>
663
+ <p class="intro-breakdown">${count} ${escapeHtml(unit)}: ${breakdownText}</p>
655
664
  </div>
656
665
 
657
666
  ${itemsHtml}
@@ -910,7 +919,7 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
910
919
  console.log(chalk.gray(`
911
920
  Scan: ${result.metadata.scanDuration}ms | ${result.metadata.engineVersion}`));
912
921
  } else if (options.audience === "plain") {
913
- const { renderPlainReport } = await import("../plain-report-AK5QAT5P.mjs");
922
+ const { renderPlainReport } = await import("../plain-report-R2TZYGLD.mjs");
914
923
  renderPlainReport(result, options.lang);
915
924
  } else {
916
925
  console.log("\n");
@@ -2,7 +2,7 @@ import {
2
2
  getCurrentLang,
3
3
  setLanguage,
4
4
  t
5
- } from "./chunk-TT3JDVGJ.mjs";
5
+ } from "./chunk-6CGNOKCN.mjs";
6
6
  import "./chunk-DIBTSSLZ.mjs";
7
7
  export {
8
8
  getCurrentLang,
package/dist/index.d.mts CHANGED
@@ -160,7 +160,8 @@ var plain = {
160
160
  report_title: "Accessibility report for {url}",
161
161
  report_tagline: "Accessibility report",
162
162
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
163
- fallback_framing: "Technical finding. Ask your developer to review this:"
163
+ fallback_framing: "Technical finding. Ask your developer to review this:",
164
+ occurrences: "{count} occurrences"
164
165
  };
165
166
  var en = {
166
167
  cli: cli,
package/dist/index.d.ts CHANGED
@@ -160,7 +160,8 @@ var plain = {
160
160
  report_title: "Accessibility report for {url}",
161
161
  report_tagline: "Accessibility report",
162
162
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
163
- fallback_framing: "Technical finding. Ask your developer to review this:"
163
+ fallback_framing: "Technical finding. Ask your developer to review this:",
164
+ occurrences: "{count} occurrences"
164
165
  };
165
166
  var en = {
166
167
  cli: cli,
package/dist/index.js CHANGED
@@ -97,7 +97,8 @@ var init_en = __esm({
97
97
  report_title: "Accessibility report for {url}",
98
98
  report_tagline: "Accessibility report",
99
99
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
100
- fallback_framing: "Technical finding. Ask your developer to review this:"
100
+ fallback_framing: "Technical finding. Ask your developer to review this:",
101
+ occurrences: "{count} occurrences"
101
102
  }
102
103
  };
103
104
  }
@@ -163,7 +164,8 @@ var init_sv = __esm({
163
164
  report_title: "Tillg\xE4nglighetsrapport f\xF6r {url}",
164
165
  report_tagline: "Tillg\xE4nglighetsrapport",
165
166
  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:"
167
+ fallback_framing: "Tekniskt fynd som din utvecklare beh\xF6ver titta p\xE5.",
168
+ occurrences: "{count} f\xF6rekomster"
167
169
  }
168
170
  };
169
171
  }
@@ -229,7 +231,8 @@ var init_de = __esm({
229
231
  report_title: "Accessibility report for {url}",
230
232
  report_tagline: "Accessibility report",
231
233
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
232
- fallback_framing: "Technical finding. Ask your developer to review this:"
234
+ fallback_framing: "Technical finding. Ask your developer to review this:",
235
+ occurrences: "{count} occurrences"
233
236
  }
234
237
  };
235
238
  }
@@ -295,7 +298,8 @@ var init_fr = __esm({
295
298
  report_title: "Accessibility report for {url}",
296
299
  report_tagline: "Accessibility report",
297
300
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
298
- fallback_framing: "Technical finding. Ask your developer to review this:"
301
+ fallback_framing: "Technical finding. Ask your developer to review this:",
302
+ occurrences: "{count} occurrences"
299
303
  }
300
304
  };
301
305
  }
@@ -361,7 +365,8 @@ var init_es = __esm({
361
365
  report_title: "Accessibility report for {url}",
362
366
  report_tagline: "Accessibility report",
363
367
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
364
- fallback_framing: "Technical finding. Ask your developer to review this:"
368
+ fallback_framing: "Technical finding. Ask your developer to review this:",
369
+ occurrences: "{count} occurrences"
365
370
  }
366
371
  };
367
372
  }
@@ -427,7 +432,8 @@ var init_fi = __esm({
427
432
  report_title: "Accessibility report for {url}",
428
433
  report_tagline: "Accessibility report",
429
434
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
430
- fallback_framing: "Technical finding. Ask your developer to review this:"
435
+ fallback_framing: "Technical finding. Ask your developer to review this:",
436
+ occurrences: "{count} occurrences"
431
437
  }
432
438
  };
433
439
  }
@@ -493,7 +499,8 @@ var init_dk = __esm({
493
499
  report_title: "Accessibility report for {url}",
494
500
  report_tagline: "Accessibility report",
495
501
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
496
- fallback_framing: "Technical finding. Ask your developer to review this:"
502
+ fallback_framing: "Technical finding. Ask your developer to review this:",
503
+ occurrences: "{count} occurrences"
497
504
  }
498
505
  };
499
506
  }
@@ -559,7 +566,8 @@ var init_no = __esm({
559
566
  report_title: "Accessibility report for {url}",
560
567
  report_tagline: "Accessibility report",
561
568
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
562
- fallback_framing: "Technical finding. Ask your developer to review this:"
569
+ fallback_framing: "Technical finding. Ask your developer to review this:",
570
+ occurrences: "{count} occurrences"
563
571
  }
564
572
  };
565
573
  }
@@ -625,7 +633,8 @@ var init_nl = __esm({
625
633
  report_title: "Accessibility report for {url}",
626
634
  report_tagline: "Accessibility report",
627
635
  attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
628
- fallback_framing: "Technical finding. Ask your developer to review this:"
636
+ fallback_framing: "Technical finding. Ask your developer to review this:",
637
+ occurrences: "{count} occurrences"
629
638
  }
630
639
  };
631
640
  }
@@ -866,7 +875,7 @@ var HtmlValidator = class {
866
875
  // src/core/regulatory-scanner.ts
867
876
  var import_node_fs = require("fs");
868
877
  function getEngineVersion() {
869
- return "2.6.0";
878
+ return "2.7.0";
870
879
  }
871
880
  function getStandardsVersion() {
872
881
  try {
package/dist/index.mjs CHANGED
@@ -5,12 +5,12 @@ import {
5
5
  generateStatement,
6
6
  generateStatementContent,
7
7
  getEngineVersion
8
- } from "./chunk-AE5DGJCS.mjs";
8
+ } from "./chunk-KXI4TVHQ.mjs";
9
9
  import {
10
10
  getCurrentLang,
11
11
  setLanguage,
12
12
  t
13
- } from "./chunk-TT3JDVGJ.mjs";
13
+ } from "./chunk-6CGNOKCN.mjs";
14
14
  import "./chunk-DIBTSSLZ.mjs";
15
15
  export {
16
16
  PseudoAutomationEngine,
@@ -1,7 +1,12 @@
1
1
  import {
2
+ groupReportsByRule,
3
+ impactBreakdown
4
+ } from "./chunk-VNNYP4NV.mjs";
5
+ import {
6
+ getCurrentLang,
2
7
  setLanguage,
3
8
  t
4
- } from "./chunk-TT3JDVGJ.mjs";
9
+ } from "./chunk-6CGNOKCN.mjs";
5
10
  import "./chunk-DIBTSSLZ.mjs";
6
11
 
7
12
  // src/reporting/plain-report.ts
@@ -41,28 +46,35 @@ function renderPlainReport(result, lang = "en") {
41
46
  console.log(t("plain.attribution"));
42
47
  return;
43
48
  }
44
- const sortedReports = [...result.reports].sort((a, b) => {
45
- const aLevel = IMPACT_ORDER[levelOf(a)] ?? 4;
46
- const bLevel = IMPACT_ORDER[levelOf(b)] ?? 4;
49
+ const sortedGroups = groupReportsByRule(result.reports).sort((a, b) => {
50
+ const aLevel = IMPACT_ORDER[levelOf(a.report)] ?? 4;
51
+ const bLevel = IMPACT_ORDER[levelOf(b.report)] ?? 4;
47
52
  return aLevel - bLevel;
48
53
  });
49
- const count = sortedReports.length;
54
+ const count = result.reports.length;
50
55
  const unit = count === 1 ? t("plain.intro_unit_singular") : t("plain.intro_unit_plural");
56
+ const breakdown = impactBreakdown(result.reports, levelOf, IMPACT_ORDER);
57
+ const breakdownText = breakdown.map((b) => `${b.count} ${t(BADGE_KEY[b.level])}`).join(", ");
51
58
  console.log(t("plain.intro_framing"));
52
59
  console.log(t("plain.intro_found", { count, unit }));
60
+ console.log(`${count} ${unit}: ${breakdownText}`);
53
61
  console.log(t("plain.sorted_by"));
54
62
  console.log("");
55
- sortedReports.forEach((rawReport, index) => {
56
- const report = rawReport;
63
+ const isSwedish = getCurrentLang() === "sv";
64
+ sortedGroups.forEach((group, index) => {
65
+ const report = group.report;
57
66
  const level = levelOf(report);
58
67
  const badgeText = BADGE_CHALK[level](t(BADGE_KEY[level]));
59
68
  const pl = report.plainLanguage;
60
- console.log(`${index + 1}. ${badgeText} \u2014 ${report.ruleId}`);
69
+ const occurrences = group.count > 1 ? `, ${t("plain.occurrences", { count: group.count })}` : "";
70
+ console.log(`${index + 1}. ${badgeText} \u2014 ${report.ruleId}${occurrences}`);
61
71
  if (pl) {
62
72
  console.log(` ${t("plain.what_happens")} ${pl.whatHappens}`);
63
73
  console.log(` ${t("plain.who_is_affected")} ${pl.whoIsAffected}`);
64
74
  console.log(` ${t("plain.business_impact")} ${pl.businessImpact}`);
65
75
  console.log(` ${t("plain.how_to_fix")} ${pl.howToFix}`);
76
+ } else if (isSwedish) {
77
+ console.log(` ${t("plain.fallback_framing")}`);
66
78
  } else {
67
79
  console.log(` ${t("plain.fallback_framing")} ${report.remediation.description}`);
68
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holmdigital/engine",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -82,8 +82,8 @@
82
82
  "author": "Holm Digital AB",
83
83
  "license": "MIT",
84
84
  "dependencies": {
85
- "@holmdigital/components": "^2.7.2",
86
- "@holmdigital/standards": "^2.7.0",
85
+ "@holmdigital/components": "^3.0.0",
86
+ "@holmdigital/standards": "^2.8.0",
87
87
  "axe-core": "^4.11.1",
88
88
  "chalk": "^5.3.0",
89
89
  "commander": "^12.1.0",