@holmdigital/engine 4.0.1 → 4.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.
@@ -0,0 +1,10 @@
1
+ // ../../node_modules/tsup/assets/esm_shims.js
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ var getFilename = () => fileURLToPath(import.meta.url);
5
+ var getDirname = () => path.dirname(getFilename());
6
+ var __dirname = /* @__PURE__ */ getDirname();
7
+
8
+ export {
9
+ __dirname
10
+ };
@@ -2,9 +2,8 @@ import {
2
2
  violationsOf
3
3
  } from "./chunk-QEHLOWUK.mjs";
4
4
  import {
5
- __dirname,
6
- __require
7
- } from "./chunk-DIBTSSLZ.mjs";
5
+ __dirname
6
+ } from "./chunk-DYBFXNEE.mjs";
8
7
 
9
8
  // src/core/virtual-dom.ts
10
9
  var VirtualDOMBuilder = class {
@@ -342,6 +341,7 @@ Chrome said: ${chromeSaid}`
342
341
 
343
342
  // src/core/regulatory-scanner.ts
344
343
  import { readFileSync } from "fs";
344
+ import { createRequire } from "module";
345
345
  function wcagTagToCriterion(tag) {
346
346
  const m = /^wcag(\d+)$/.exec(tag);
347
347
  if (!m) return null;
@@ -399,11 +399,11 @@ function isInterstitialPage(pageTitle, hasMetaRefresh, bodyTextLength) {
399
399
  return false;
400
400
  }
401
401
  function getEngineVersion() {
402
- return "4.0.1";
402
+ return "4.1.0";
403
403
  }
404
404
  function getStandardsVersion() {
405
405
  try {
406
- const stdPath = __require.resolve("@holmdigital/standards/package.json");
406
+ const stdPath = createRequire(import.meta.url).resolve("@holmdigital/standards/package.json");
407
407
  const pkg = JSON.parse(readFileSync(stdPath, "utf-8"));
408
408
  return pkg.version;
409
409
  } catch {
@@ -661,7 +661,7 @@ var RegulatoryScanner = class {
661
661
  };
662
662
  const KLARSPRAK_TOP_N = 8;
663
663
  const { generateRegulatoryReport, getAllConvergenceRules } = await import("@holmdigital/standards");
664
- const { getCurrentLang } = await import("./i18n-CQ2US2HR.mjs");
664
+ const { getCurrentLang } = await import("./i18n-LDYZ4L3B.mjs");
665
665
  const lang = getCurrentLang();
666
666
  const allRules = getAllConvergenceRules(lang);
667
667
  const selfMatchingIds = getSelfMatchingRuleIds(allRules);
@@ -717,7 +717,7 @@ var RegulatoryScanner = class {
717
717
  async enrichResults(axeResults) {
718
718
  const reports = [];
719
719
  const { generateRegulatoryReport, getConvergenceRule, getAllConvergenceRules } = await import("@holmdigital/standards");
720
- const { getCurrentLang } = await import("./i18n-CQ2US2HR.mjs");
720
+ const { getCurrentLang } = await import("./i18n-LDYZ4L3B.mjs");
721
721
  const lang = getCurrentLang();
722
722
  const allRules = getAllConvergenceRules(lang);
723
723
  const selfMatchingIds = getSelfMatchingRuleIds(allRules);
@@ -764,7 +764,9 @@ var RegulatoryScanner = class {
764
764
  const fallback = FALLBACK_STRINGS[lang] || FALLBACK_STRINGS["en"];
765
765
  reports.push({
766
766
  ruleId: violation.id,
767
- wcagCriteria: isBestPractice ? "Best Practice" : "Unknown",
767
+ // Kriteriet ur axes egna wcagNNN-taggar, som i light-läget (Intern #30),
768
+ // innan 'Unknown'. Lägsta kriteriet vinner, som i selectMappedRuleId.
769
+ wcagCriteria: isBestPractice ? "Best Practice" : criteriaFromTags(violation.tags).sort(compareCriteria)[0] || "Unknown",
768
770
  // Intern #39: omappat fynd → EN-9.x ur axes egen tagg som fallback
769
771
  // före 'Unknown'. Best practice behåller 'N/A'. Rör aldrig matchade.
770
772
  en301549Criteria: isBestPractice ? "N/A" : en301549FromTags(violation.tags) || "Unknown",
@@ -788,7 +790,15 @@ var RegulatoryScanner = class {
788
790
  requiresManualCheck: false,
789
791
  pseudoAutomation: false,
790
792
  complexity: "moderate"
791
- }
793
+ },
794
+ // Felnoderna följer med även när regeln saknar mappning. Fyndet räknas
795
+ // in i score, och utan noderna ser kunden avdraget men inte var felet
796
+ // sitter (label-content-name-mismatch i axe-core 4.14, 2026-11-10).
797
+ failingNodes: violation.nodes.map((node) => ({
798
+ html: node.html,
799
+ target: node.target.join(" "),
800
+ failureSummary: node.failureSummary
801
+ }))
792
802
  });
793
803
  }
794
804
  }
@@ -810,7 +820,7 @@ var RegulatoryScanner = class {
810
820
  if (!incomplete || incomplete.length === 0) return [];
811
821
  const reports = [];
812
822
  const { generateRegulatoryReport, getConvergenceRule } = await import("@holmdigital/standards");
813
- const { getCurrentLang } = await import("./i18n-CQ2US2HR.mjs");
823
+ const { getCurrentLang } = await import("./i18n-LDYZ4L3B.mjs");
814
824
  const lang = getCurrentLang();
815
825
  const readMessageKey = (checks) => checks?.find((c) => c.data && typeof c.data === "object" && "messageKey" in c.data) ?? checks?.[0];
816
826
  for (const item of incomplete) {
package/dist/cli/index.js CHANGED
@@ -36,9 +36,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  ));
37
37
 
38
38
  // ../../node_modules/tsup/assets/cjs_shims.js
39
+ var getImportMetaUrl, importMetaUrl;
39
40
  var init_cjs_shims = __esm({
40
41
  "../../node_modules/tsup/assets/cjs_shims.js"() {
41
42
  "use strict";
43
+ getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
44
+ importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
42
45
  }
43
46
  });
44
47
 
@@ -1707,6 +1710,7 @@ Chrome said: ${chromeSaid}`
1707
1710
 
1708
1711
  // src/core/regulatory-scanner.ts
1709
1712
  var import_node_fs = require("fs");
1713
+ var import_node_module = require("module");
1710
1714
  function wcagTagToCriterion(tag) {
1711
1715
  const m = /^wcag(\d+)$/.exec(tag);
1712
1716
  if (!m) return null;
@@ -1764,11 +1768,11 @@ function isInterstitialPage(pageTitle, hasMetaRefresh, bodyTextLength) {
1764
1768
  return false;
1765
1769
  }
1766
1770
  function getEngineVersion() {
1767
- return "4.0.1";
1771
+ return "4.1.0";
1768
1772
  }
1769
1773
  function getStandardsVersion() {
1770
1774
  try {
1771
- const stdPath = require.resolve("@holmdigital/standards/package.json");
1775
+ const stdPath = (0, import_node_module.createRequire)(importMetaUrl).resolve("@holmdigital/standards/package.json");
1772
1776
  const pkg = JSON.parse((0, import_node_fs.readFileSync)(stdPath, "utf-8"));
1773
1777
  return pkg.version;
1774
1778
  } catch {
@@ -2129,7 +2133,9 @@ var RegulatoryScanner = class {
2129
2133
  const fallback = FALLBACK_STRINGS[lang] || FALLBACK_STRINGS["en"];
2130
2134
  reports.push({
2131
2135
  ruleId: violation.id,
2132
- wcagCriteria: isBestPractice ? "Best Practice" : "Unknown",
2136
+ // Kriteriet ur axes egna wcagNNN-taggar, som i light-läget (Intern #30),
2137
+ // innan 'Unknown'. Lägsta kriteriet vinner, som i selectMappedRuleId.
2138
+ wcagCriteria: isBestPractice ? "Best Practice" : criteriaFromTags(violation.tags).sort(compareCriteria)[0] || "Unknown",
2133
2139
  // Intern #39: omappat fynd → EN-9.x ur axes egen tagg som fallback
2134
2140
  // före 'Unknown'. Best practice behåller 'N/A'. Rör aldrig matchade.
2135
2141
  en301549Criteria: isBestPractice ? "N/A" : en301549FromTags(violation.tags) || "Unknown",
@@ -2153,7 +2159,15 @@ var RegulatoryScanner = class {
2153
2159
  requiresManualCheck: false,
2154
2160
  pseudoAutomation: false,
2155
2161
  complexity: "moderate"
2156
- }
2162
+ },
2163
+ // Felnoderna följer med även när regeln saknar mappning. Fyndet räknas
2164
+ // in i score, och utan noderna ser kunden avdraget men inte var felet
2165
+ // sitter (label-content-name-mismatch i axe-core 4.14, 2026-11-10).
2166
+ failingNodes: violation.nodes.map((node) => ({
2167
+ html: node.html,
2168
+ target: node.target.join(" "),
2169
+ failureSummary: node.failureSummary
2170
+ }))
2157
2171
  });
2158
2172
  }
2159
2173
  }
@@ -10,7 +10,7 @@ import {
10
10
  generateStatementContent,
11
11
  getEngineVersion,
12
12
  isBadgeWithheldByRobustness
13
- } from "../chunk-Y4NNYB3U.mjs";
13
+ } from "../chunk-R3Q4WIF6.mjs";
14
14
  import {
15
15
  groupReportsByRule,
16
16
  impactBreakdown,
@@ -29,7 +29,7 @@ import {
29
29
  } from "../chunk-QEHLOWUK.mjs";
30
30
  import {
31
31
  __dirname
32
- } from "../chunk-DIBTSSLZ.mjs";
32
+ } from "../chunk-DYBFXNEE.mjs";
33
33
 
34
34
  // src/cli/index.ts
35
35
  import { Command } from "commander";
@@ -1253,7 +1253,7 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
1253
1253
  console.log(JSON.stringify(result, null, 2));
1254
1254
  } else if (result.complianceStatus === "INCONCLUSIVE") {
1255
1255
  if (options.audience === "plain") {
1256
- const { renderPlainReport } = await import("../plain-report-4MJZKEGX.mjs");
1256
+ const { renderPlainReport } = await import("../plain-report-332RPOHK.mjs");
1257
1257
  renderPlainReport(result, plainFallbackFrom ? "en" : options.lang, plainFallbackFrom, options.sector);
1258
1258
  } else {
1259
1259
  console.log("");
@@ -1285,7 +1285,7 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
1285
1285
  console.log(chalk.gray(`
1286
1286
  Scan: ${result.metadata.scanDuration}ms | ${result.metadata.engineVersion}`));
1287
1287
  } else if (options.audience === "plain") {
1288
- const { renderPlainReport } = await import("../plain-report-4MJZKEGX.mjs");
1288
+ const { renderPlainReport } = await import("../plain-report-332RPOHK.mjs");
1289
1289
  renderPlainReport(result, plainFallbackFrom ? "en" : options.lang, plainFallbackFrom, options.sector);
1290
1290
  } else {
1291
1291
  const violations = violationsOf(result.reports);
@@ -1412,14 +1412,14 @@ ${t("cli.badge_withheld")}`));
1412
1412
  renderNoScriptAdvisory(result.noScript);
1413
1413
  }
1414
1414
  if (options.ci && result.reports.length > 0) {
1415
- const { generateGitHubActionsAnnotations } = await import("../github-actions-PIV5JU2C.mjs");
1415
+ const { generateGitHubActionsAnnotations } = await import("../github-actions-NC3KGO4P.mjs");
1416
1416
  generateGitHubActionsAnnotations(result.reports);
1417
1417
  }
1418
1418
  if (options.ci && result.complianceStatus === "INCONCLUSIVE") {
1419
1419
  console.log("::warning::Accessibility scan inconclusive \u2014 the page looked like an interstitial/wait/bot-challenge page, so the real content was not assessed. Try a higher --wait-for-hydration.");
1420
1420
  }
1421
1421
  if (options.junit) {
1422
- const { generateJUnitXML } = await import("../junit-generator-B6HW7DCD.mjs");
1422
+ const { generateJUnitXML } = await import("../junit-generator-4LHP7SGE.mjs");
1423
1423
  const fs = await import("fs/promises");
1424
1424
  const xml = generateJUnitXML(result);
1425
1425
  await fs.writeFile(options.junit, xml);
@@ -2,7 +2,7 @@ import {
2
2
  needsReviewOf,
3
3
  violationsOf
4
4
  } from "./chunk-QEHLOWUK.mjs";
5
- import "./chunk-DIBTSSLZ.mjs";
5
+ import "./chunk-DYBFXNEE.mjs";
6
6
 
7
7
  // src/reporting/github-actions.ts
8
8
  function generateGitHubActionsAnnotations(reports) {
@@ -3,7 +3,7 @@ import {
3
3
  setLanguage,
4
4
  t
5
5
  } from "./chunk-BDL6KFVJ.mjs";
6
- import "./chunk-DIBTSSLZ.mjs";
6
+ import "./chunk-DYBFXNEE.mjs";
7
7
  export {
8
8
  getCurrentLang,
9
9
  setLanguage,
package/dist/index.d.mts CHANGED
@@ -155,95 +155,100 @@ declare class PseudoAutomationEngine {
155
155
  generateManualChecklist(report: RegulatoryReport): string;
156
156
  }
157
157
 
158
- var cli = {
159
- title: "\n🌐 HolmDigital Regulatory Scanner\n",
160
- scanning: "Scanning {url}...\n",
161
- initializing: "Initializing scanner...",
162
- analyzing: "Analyzing DOM & Shadow DOM...",
163
- complete: "Scan complete!",
164
- generating_pdf: "Generating PDF Report...",
165
- pdf_saved: "PDF Report saved to {path}",
166
- scan_failed: "Scan failed",
167
- critical_failure: "\nCI/CD Failure: Critical regulatory violations found.",
168
- generating_statement: "Generating Accessibility Statement...",
169
- statement_saved: "Accessibility Statement saved to {path}",
170
- score: "\nCompliance Score: {score}/100",
171
- status: "Compliance Status: {status}",
172
- not_compliant: " (Not compliant with legal requirements)",
173
- viewport: "Viewport: {width}x{height}",
174
- prescriptive_fix: "\n💡 Prescriptive Fix:",
175
- use_component: "Use component: {component}",
176
- pseudo_tests: "\n🧬 Generating Pseudo-Automation Tests...\n",
177
- test_for: "Test for {ruleId}:",
178
- junit_saved: "JUnit XML report saved to {path}",
179
- noscript_heading: "\n🧪 Robustness without JavaScript (advisory)",
180
- noscript_coverage: "Content available without JavaScript: {percent}% ({without} of {with} characters)",
181
- noscript_empty: "The page is effectively empty without JavaScript.",
182
- noscript_partial: "A substantial part of the content is missing without JavaScript.",
183
- noscript_ok: "Core content is available without JavaScript.",
184
- noscript_unknown: "Could not be measured.",
185
- noscript_fallback: "A <noscript> fallback is present.",
186
- noscript_no_fallback: "No <noscript> fallback was found.",
187
- noscript_impact: "This rarely affects the people who turned JavaScript off, but the people whose scripts never arrived: a weak mobile network, a corporate proxy, a browser extension that misbehaves, a timeout. They get an empty page instead of a slow one.",
188
- noscript_advisory: "Recommendation, not a legal requirement. No WCAG success criterion requires a page to work without JavaScript, so this does not affect the compliance score.",
189
- badge_withheld: "100/100 with no findings. The robustness check is not clean, so we do not generate a shareable badge.",
190
- inconclusive_headline: "⚠️ Could not scan the real content",
191
- inconclusive_detail: "The page looked like a wait / redirect / bot-challenge page (interstitial), so this result does not reflect the real site. An honest \"could not measure\" is safer than a misleading score. Try a higher --wait-for-hydration <ms>, or open the URL in a browser to check."
192
- };
193
- var report = {
194
- title: "Accessibility Report - {url}",
195
- generated: "Generated: {date}",
196
- scan_target: "Scan Target: {url}",
197
- overall_score: "Overall Score",
198
- critical_issues: "Critical Issues",
199
- high_issues: "High Issues",
200
- total_issues: "Total Issues",
201
- html_errors: "HTML Errors",
202
- detailed_violations: "Detailed Violations",
203
- needs_review_title: "Needs review ({count})",
204
- needs_review_note: "axe-core could not determine these automatically. They are neither passed nor failed, so check them manually. They are not counted in the totals above.",
205
- prescriptive_fix: "💡 Prescriptive Fix",
206
- use: "Use",
207
- footer: "Generated by @holmdigital/engine v{version} • Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen",
208
- inconclusive_title: "We could not scan the real page",
209
- inconclusive_detail: "The page looked like a wait, redirect, or verification screen (for example a bot check or an interstitial), so the engine measured that screen instead of your site. Nothing here reflects your real content. Try again with a higher --wait-for-hydration value, and if it persists, open the address in a browser to confirm the site loads."
210
- };
211
- var plain = {
212
- what_happens: "What happens:",
213
- who_is_affected: "Who is affected:",
214
- business_impact: "What it costs you:",
215
- how_to_fix: "How to fix it:",
216
- badge_stoppar_kop: "Blocks purchases",
217
- badge_hindrar: "Excludes customers",
218
- badge_forsamrar: "Degrades experience",
219
- badge_putsning: "Worth polishing",
220
- 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.",
221
- sorted_by: "Sorted by business impact",
222
- intro_found: "Found {count} {unit}",
223
- intro_unit_singular: "issue",
224
- intro_unit_plural: "issues",
225
- closing: "Start at the top. The items highest up cost you the most customers.",
226
- empty_state: "No barriers found this time.",
227
- inconclusive: "We could not read your real page this time. It looked like a waiting or verification screen (for example a \"please wait\" message or a bot check), so there is nothing reliable to report yet. Please try again — and if it keeps happening, open your website in a normal browser to make sure it loads.",
228
- report_title: "Accessibility report for {url}",
229
- report_tagline: "Accessibility report",
230
- attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
231
- fallback_framing: "Technical finding. Ask your developer to review this:",
232
- occurrences: "{count} occurrences",
233
- needs_review_heading: "Needs a human check ({count})",
234
- needs_review_intro: "The automated checks could not determine these on their own. They are neither passed nor failed. A person needs to look at them and decide whether they are barriers. That is why they are not counted in the number of confirmed barriers above.",
235
- gate_blocked: "Plain-language (klarspråk) output is not yet available in '{lang}'.",
236
- gate_supported: "Languages with klarspråk: {langs}.",
237
- gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv).",
238
- gate_fallback: "Plain language is not yet available in {lang}, so this report is shown in English. We add languages one country at a time."
239
- };
240
- var en = {
241
- cli: cli,
242
- report: report,
243
- plain: plain
158
+ declare namespace cli {
159
+ let title: string;
160
+ let scanning: string;
161
+ let initializing: string;
162
+ let analyzing: string;
163
+ let complete: string;
164
+ let generating_pdf: string;
165
+ let pdf_saved: string;
166
+ let scan_failed: string;
167
+ let critical_failure: string;
168
+ let generating_statement: string;
169
+ let statement_saved: string;
170
+ let score: string;
171
+ let status: string;
172
+ let not_compliant: string;
173
+ let viewport: string;
174
+ let prescriptive_fix: string;
175
+ let use_component: string;
176
+ let pseudo_tests: string;
177
+ let test_for: string;
178
+ let junit_saved: string;
179
+ let noscript_heading: string;
180
+ let noscript_coverage: string;
181
+ let noscript_empty: string;
182
+ let noscript_partial: string;
183
+ let noscript_ok: string;
184
+ let noscript_unknown: string;
185
+ let noscript_fallback: string;
186
+ let noscript_no_fallback: string;
187
+ let noscript_impact: string;
188
+ let noscript_advisory: string;
189
+ let badge_withheld: string;
190
+ let inconclusive_headline: string;
191
+ let inconclusive_detail: string;
192
+ }
193
+ declare namespace report {
194
+ let title_1: string;
195
+ export { title_1 as title };
196
+ export let generated: string;
197
+ export let scan_target: string;
198
+ export let overall_score: string;
199
+ export let critical_issues: string;
200
+ export let high_issues: string;
201
+ export let total_issues: string;
202
+ export let html_errors: string;
203
+ export let detailed_violations: string;
204
+ export let needs_review_title: string;
205
+ export let needs_review_note: string;
206
+ let prescriptive_fix_1: string;
207
+ export { prescriptive_fix_1 as prescriptive_fix };
208
+ export let use: string;
209
+ export let footer: string;
210
+ export let inconclusive_title: string;
211
+ let inconclusive_detail_1: string;
212
+ export { inconclusive_detail_1 as inconclusive_detail };
213
+ }
214
+ declare namespace plain {
215
+ let what_happens: string;
216
+ let who_is_affected: string;
217
+ let business_impact: string;
218
+ let how_to_fix: string;
219
+ let badge_stoppar_kop: string;
220
+ let badge_hindrar: string;
221
+ let badge_forsamrar: string;
222
+ let badge_putsning: string;
223
+ let intro_framing: string;
224
+ let sorted_by: string;
225
+ let intro_found: string;
226
+ let intro_unit_singular: string;
227
+ let intro_unit_plural: string;
228
+ let closing: string;
229
+ let empty_state: string;
230
+ let inconclusive: string;
231
+ let report_title: string;
232
+ let report_tagline: string;
233
+ let attribution: string;
234
+ let fallback_framing: string;
235
+ let occurrences: string;
236
+ let needs_review_heading: string;
237
+ let needs_review_intro: string;
238
+ let gate_blocked: string;
239
+ let gate_supported: string;
240
+ let gate_howto: string;
241
+ let gate_fallback: string;
242
+ }
243
+
244
+
245
+ declare const export_default: {
246
+ cli: typeof cli;
247
+ report: typeof report;
248
+ plain: typeof plain;
244
249
  };
245
250
 
246
- type LocaleData = typeof en;
251
+ type LocaleData = typeof export_default;
247
252
  type Paths<T> = T extends object ? {
248
253
  [K in keyof T]: `${Exclude<K, symbol>}${"" | `.${Paths<T[K]>}`}`;
249
254
  }[keyof T] : never;
@@ -270,4 +275,5 @@ interface StatementMetadata {
270
275
  declare function generateStatementContent(result: ScanResult, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<string>;
271
276
  declare function generateStatement(result: ScanResult, outputPath: string, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<void>;
272
277
 
273
- export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, type NoScriptProbeMeasurement, type NoScriptProbeOptions, type NoScriptResult, type NoScriptVerdict, PseudoAutomationEngine, RegulatoryScanner, type ScanMetadata, type ScanResult, type ScannerOptions, type StatementMetadata, VirtualDOMBuilder, type VirtualDOMConfig, type VirtualNode, criteriaFromTags, en301549FromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript, selectMappedRuleId, setLanguage, t, wcagTagToCriterion };
278
+ export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, PseudoAutomationEngine, RegulatoryScanner, VirtualDOMBuilder, criteriaFromTags, en301549FromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript, selectMappedRuleId, setLanguage, t, wcagTagToCriterion };
279
+ export type { NoScriptProbeMeasurement, NoScriptProbeOptions, NoScriptResult, NoScriptVerdict, ScanMetadata, ScanResult, ScannerOptions, StatementMetadata, VirtualDOMConfig, VirtualNode };
package/dist/index.d.ts CHANGED
@@ -155,95 +155,100 @@ declare class PseudoAutomationEngine {
155
155
  generateManualChecklist(report: RegulatoryReport): string;
156
156
  }
157
157
 
158
- var cli = {
159
- title: "\n🌐 HolmDigital Regulatory Scanner\n",
160
- scanning: "Scanning {url}...\n",
161
- initializing: "Initializing scanner...",
162
- analyzing: "Analyzing DOM & Shadow DOM...",
163
- complete: "Scan complete!",
164
- generating_pdf: "Generating PDF Report...",
165
- pdf_saved: "PDF Report saved to {path}",
166
- scan_failed: "Scan failed",
167
- critical_failure: "\nCI/CD Failure: Critical regulatory violations found.",
168
- generating_statement: "Generating Accessibility Statement...",
169
- statement_saved: "Accessibility Statement saved to {path}",
170
- score: "\nCompliance Score: {score}/100",
171
- status: "Compliance Status: {status}",
172
- not_compliant: " (Not compliant with legal requirements)",
173
- viewport: "Viewport: {width}x{height}",
174
- prescriptive_fix: "\n💡 Prescriptive Fix:",
175
- use_component: "Use component: {component}",
176
- pseudo_tests: "\n🧬 Generating Pseudo-Automation Tests...\n",
177
- test_for: "Test for {ruleId}:",
178
- junit_saved: "JUnit XML report saved to {path}",
179
- noscript_heading: "\n🧪 Robustness without JavaScript (advisory)",
180
- noscript_coverage: "Content available without JavaScript: {percent}% ({without} of {with} characters)",
181
- noscript_empty: "The page is effectively empty without JavaScript.",
182
- noscript_partial: "A substantial part of the content is missing without JavaScript.",
183
- noscript_ok: "Core content is available without JavaScript.",
184
- noscript_unknown: "Could not be measured.",
185
- noscript_fallback: "A <noscript> fallback is present.",
186
- noscript_no_fallback: "No <noscript> fallback was found.",
187
- noscript_impact: "This rarely affects the people who turned JavaScript off, but the people whose scripts never arrived: a weak mobile network, a corporate proxy, a browser extension that misbehaves, a timeout. They get an empty page instead of a slow one.",
188
- noscript_advisory: "Recommendation, not a legal requirement. No WCAG success criterion requires a page to work without JavaScript, so this does not affect the compliance score.",
189
- badge_withheld: "100/100 with no findings. The robustness check is not clean, so we do not generate a shareable badge.",
190
- inconclusive_headline: "⚠️ Could not scan the real content",
191
- inconclusive_detail: "The page looked like a wait / redirect / bot-challenge page (interstitial), so this result does not reflect the real site. An honest \"could not measure\" is safer than a misleading score. Try a higher --wait-for-hydration <ms>, or open the URL in a browser to check."
192
- };
193
- var report = {
194
- title: "Accessibility Report - {url}",
195
- generated: "Generated: {date}",
196
- scan_target: "Scan Target: {url}",
197
- overall_score: "Overall Score",
198
- critical_issues: "Critical Issues",
199
- high_issues: "High Issues",
200
- total_issues: "Total Issues",
201
- html_errors: "HTML Errors",
202
- detailed_violations: "Detailed Violations",
203
- needs_review_title: "Needs review ({count})",
204
- needs_review_note: "axe-core could not determine these automatically. They are neither passed nor failed, so check them manually. They are not counted in the totals above.",
205
- prescriptive_fix: "💡 Prescriptive Fix",
206
- use: "Use",
207
- footer: "Generated by @holmdigital/engine v{version} • Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen",
208
- inconclusive_title: "We could not scan the real page",
209
- inconclusive_detail: "The page looked like a wait, redirect, or verification screen (for example a bot check or an interstitial), so the engine measured that screen instead of your site. Nothing here reflects your real content. Try again with a higher --wait-for-hydration value, and if it persists, open the address in a browser to confirm the site loads."
210
- };
211
- var plain = {
212
- what_happens: "What happens:",
213
- who_is_affected: "Who is affected:",
214
- business_impact: "What it costs you:",
215
- how_to_fix: "How to fix it:",
216
- badge_stoppar_kop: "Blocks purchases",
217
- badge_hindrar: "Excludes customers",
218
- badge_forsamrar: "Degrades experience",
219
- badge_putsning: "Worth polishing",
220
- 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.",
221
- sorted_by: "Sorted by business impact",
222
- intro_found: "Found {count} {unit}",
223
- intro_unit_singular: "issue",
224
- intro_unit_plural: "issues",
225
- closing: "Start at the top. The items highest up cost you the most customers.",
226
- empty_state: "No barriers found this time.",
227
- inconclusive: "We could not read your real page this time. It looked like a waiting or verification screen (for example a \"please wait\" message or a bot check), so there is nothing reliable to report yet. Please try again — and if it keeps happening, open your website in a normal browser to make sure it loads.",
228
- report_title: "Accessibility report for {url}",
229
- report_tagline: "Accessibility report",
230
- attribution: "Report generated by HolmDigital Engine, part of the HolmDigital accessibility ecosystem.",
231
- fallback_framing: "Technical finding. Ask your developer to review this:",
232
- occurrences: "{count} occurrences",
233
- needs_review_heading: "Needs a human check ({count})",
234
- needs_review_intro: "The automated checks could not determine these on their own. They are neither passed nor failed. A person needs to look at them and decide whether they are barriers. That is why they are not counted in the number of confirmed barriers above.",
235
- gate_blocked: "Plain-language (klarspråk) output is not yet available in '{lang}'.",
236
- gate_supported: "Languages with klarspråk: {langs}.",
237
- gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv).",
238
- gate_fallback: "Plain language is not yet available in {lang}, so this report is shown in English. We add languages one country at a time."
239
- };
240
- var en = {
241
- cli: cli,
242
- report: report,
243
- plain: plain
158
+ declare namespace cli {
159
+ let title: string;
160
+ let scanning: string;
161
+ let initializing: string;
162
+ let analyzing: string;
163
+ let complete: string;
164
+ let generating_pdf: string;
165
+ let pdf_saved: string;
166
+ let scan_failed: string;
167
+ let critical_failure: string;
168
+ let generating_statement: string;
169
+ let statement_saved: string;
170
+ let score: string;
171
+ let status: string;
172
+ let not_compliant: string;
173
+ let viewport: string;
174
+ let prescriptive_fix: string;
175
+ let use_component: string;
176
+ let pseudo_tests: string;
177
+ let test_for: string;
178
+ let junit_saved: string;
179
+ let noscript_heading: string;
180
+ let noscript_coverage: string;
181
+ let noscript_empty: string;
182
+ let noscript_partial: string;
183
+ let noscript_ok: string;
184
+ let noscript_unknown: string;
185
+ let noscript_fallback: string;
186
+ let noscript_no_fallback: string;
187
+ let noscript_impact: string;
188
+ let noscript_advisory: string;
189
+ let badge_withheld: string;
190
+ let inconclusive_headline: string;
191
+ let inconclusive_detail: string;
192
+ }
193
+ declare namespace report {
194
+ let title_1: string;
195
+ export { title_1 as title };
196
+ export let generated: string;
197
+ export let scan_target: string;
198
+ export let overall_score: string;
199
+ export let critical_issues: string;
200
+ export let high_issues: string;
201
+ export let total_issues: string;
202
+ export let html_errors: string;
203
+ export let detailed_violations: string;
204
+ export let needs_review_title: string;
205
+ export let needs_review_note: string;
206
+ let prescriptive_fix_1: string;
207
+ export { prescriptive_fix_1 as prescriptive_fix };
208
+ export let use: string;
209
+ export let footer: string;
210
+ export let inconclusive_title: string;
211
+ let inconclusive_detail_1: string;
212
+ export { inconclusive_detail_1 as inconclusive_detail };
213
+ }
214
+ declare namespace plain {
215
+ let what_happens: string;
216
+ let who_is_affected: string;
217
+ let business_impact: string;
218
+ let how_to_fix: string;
219
+ let badge_stoppar_kop: string;
220
+ let badge_hindrar: string;
221
+ let badge_forsamrar: string;
222
+ let badge_putsning: string;
223
+ let intro_framing: string;
224
+ let sorted_by: string;
225
+ let intro_found: string;
226
+ let intro_unit_singular: string;
227
+ let intro_unit_plural: string;
228
+ let closing: string;
229
+ let empty_state: string;
230
+ let inconclusive: string;
231
+ let report_title: string;
232
+ let report_tagline: string;
233
+ let attribution: string;
234
+ let fallback_framing: string;
235
+ let occurrences: string;
236
+ let needs_review_heading: string;
237
+ let needs_review_intro: string;
238
+ let gate_blocked: string;
239
+ let gate_supported: string;
240
+ let gate_howto: string;
241
+ let gate_fallback: string;
242
+ }
243
+
244
+
245
+ declare const export_default: {
246
+ cli: typeof cli;
247
+ report: typeof report;
248
+ plain: typeof plain;
244
249
  };
245
250
 
246
- type LocaleData = typeof en;
251
+ type LocaleData = typeof export_default;
247
252
  type Paths<T> = T extends object ? {
248
253
  [K in keyof T]: `${Exclude<K, symbol>}${"" | `.${Paths<T[K]>}`}`;
249
254
  }[keyof T] : never;
@@ -270,4 +275,5 @@ interface StatementMetadata {
270
275
  declare function generateStatementContent(result: ScanResult, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<string>;
271
276
  declare function generateStatement(result: ScanResult, outputPath: string, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<void>;
272
277
 
273
- export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, type NoScriptProbeMeasurement, type NoScriptProbeOptions, type NoScriptResult, type NoScriptVerdict, PseudoAutomationEngine, RegulatoryScanner, type ScanMetadata, type ScanResult, type ScannerOptions, type StatementMetadata, VirtualDOMBuilder, type VirtualDOMConfig, type VirtualNode, criteriaFromTags, en301549FromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript, selectMappedRuleId, setLanguage, t, wcagTagToCriterion };
278
+ export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, PseudoAutomationEngine, RegulatoryScanner, VirtualDOMBuilder, criteriaFromTags, en301549FromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript, selectMappedRuleId, setLanguage, t, wcagTagToCriterion };
279
+ export type { NoScriptProbeMeasurement, NoScriptProbeOptions, NoScriptResult, NoScriptVerdict, ScanMetadata, ScanResult, ScannerOptions, StatementMetadata, VirtualDOMConfig, VirtualNode };
package/dist/index.js CHANGED
@@ -36,9 +36,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
37
 
38
38
  // ../../node_modules/tsup/assets/cjs_shims.js
39
+ var getImportMetaUrl, importMetaUrl;
39
40
  var init_cjs_shims = __esm({
40
41
  "../../node_modules/tsup/assets/cjs_shims.js"() {
41
42
  "use strict";
43
+ getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
44
+ importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
42
45
  }
43
46
  });
44
47
 
@@ -1312,6 +1315,7 @@ Chrome said: ${chromeSaid}`
1312
1315
 
1313
1316
  // src/core/regulatory-scanner.ts
1314
1317
  var import_node_fs = require("fs");
1318
+ var import_node_module = require("module");
1315
1319
  function wcagTagToCriterion(tag) {
1316
1320
  const m = /^wcag(\d+)$/.exec(tag);
1317
1321
  if (!m) return null;
@@ -1369,11 +1373,11 @@ function isInterstitialPage(pageTitle, hasMetaRefresh, bodyTextLength) {
1369
1373
  return false;
1370
1374
  }
1371
1375
  function getEngineVersion() {
1372
- return "4.0.1";
1376
+ return "4.1.0";
1373
1377
  }
1374
1378
  function getStandardsVersion() {
1375
1379
  try {
1376
- const stdPath = require.resolve("@holmdigital/standards/package.json");
1380
+ const stdPath = (0, import_node_module.createRequire)(importMetaUrl).resolve("@holmdigital/standards/package.json");
1377
1381
  const pkg = JSON.parse((0, import_node_fs.readFileSync)(stdPath, "utf-8"));
1378
1382
  return pkg.version;
1379
1383
  } catch {
@@ -1734,7 +1738,9 @@ var RegulatoryScanner = class {
1734
1738
  const fallback = FALLBACK_STRINGS[lang] || FALLBACK_STRINGS["en"];
1735
1739
  reports.push({
1736
1740
  ruleId: violation.id,
1737
- wcagCriteria: isBestPractice ? "Best Practice" : "Unknown",
1741
+ // Kriteriet ur axes egna wcagNNN-taggar, som i light-läget (Intern #30),
1742
+ // innan 'Unknown'. Lägsta kriteriet vinner, som i selectMappedRuleId.
1743
+ wcagCriteria: isBestPractice ? "Best Practice" : criteriaFromTags(violation.tags).sort(compareCriteria)[0] || "Unknown",
1738
1744
  // Intern #39: omappat fynd → EN-9.x ur axes egen tagg som fallback
1739
1745
  // före 'Unknown'. Best practice behåller 'N/A'. Rör aldrig matchade.
1740
1746
  en301549Criteria: isBestPractice ? "N/A" : en301549FromTags(violation.tags) || "Unknown",
@@ -1758,7 +1764,15 @@ var RegulatoryScanner = class {
1758
1764
  requiresManualCheck: false,
1759
1765
  pseudoAutomation: false,
1760
1766
  complexity: "moderate"
1761
- }
1767
+ },
1768
+ // Felnoderna följer med även när regeln saknar mappning. Fyndet räknas
1769
+ // in i score, och utan noderna ser kunden avdraget men inte var felet
1770
+ // sitter (label-content-name-mismatch i axe-core 4.14, 2026-11-10).
1771
+ failingNodes: violation.nodes.map((node) => ({
1772
+ html: node.html,
1773
+ target: node.target.join(" "),
1774
+ failureSummary: node.failureSummary
1775
+ }))
1762
1776
  });
1763
1777
  }
1764
1778
  }
package/dist/index.mjs CHANGED
@@ -17,14 +17,14 @@ import {
17
17
  resolveNationalLawReference,
18
18
  selectMappedRuleId,
19
19
  wcagTagToCriterion
20
- } from "./chunk-Y4NNYB3U.mjs";
20
+ } from "./chunk-R3Q4WIF6.mjs";
21
21
  import {
22
22
  getCurrentLang,
23
23
  setLanguage,
24
24
  t
25
25
  } from "./chunk-BDL6KFVJ.mjs";
26
26
  import "./chunk-QEHLOWUK.mjs";
27
- import "./chunk-DIBTSSLZ.mjs";
27
+ import "./chunk-DYBFXNEE.mjs";
28
28
  export {
29
29
  NOSCRIPT_EMPTY_THRESHOLD,
30
30
  NOSCRIPT_PARTIAL_THRESHOLD,
@@ -2,7 +2,7 @@ import {
2
2
  needsReviewOf,
3
3
  violationsOf
4
4
  } from "./chunk-QEHLOWUK.mjs";
5
- import "./chunk-DIBTSSLZ.mjs";
5
+ import "./chunk-DYBFXNEE.mjs";
6
6
 
7
7
  // src/reporting/junit-generator.ts
8
8
  function generateJUnitXML(result) {
@@ -13,7 +13,7 @@ import {
13
13
  needsReviewOf,
14
14
  violationsOf
15
15
  } from "./chunk-QEHLOWUK.mjs";
16
- import "./chunk-DIBTSSLZ.mjs";
16
+ import "./chunk-DYBFXNEE.mjs";
17
17
 
18
18
  // src/reporting/plain-report.ts
19
19
  import chalk from "chalk";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holmdigital/engine",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -85,26 +85,26 @@
85
85
  },
86
86
  "dependencies": {
87
87
  "@holmdigital/components": "^4.2.0",
88
- "@holmdigital/standards": "^5.0.0",
89
- "axe-core": "^4.13.0",
90
- "chalk": "^6.0.0",
88
+ "@holmdigital/standards": "^5.2.0",
89
+ "axe-core": "^4.14.0",
90
+ "chalk": "^6.0.1",
91
91
  "commander": "^15.0.0",
92
- "cosmiconfig": "^9.0.2",
93
- "html-validate": "11.16.0",
94
- "ora": "^9.4.1",
92
+ "cosmiconfig": "^10.0.1",
93
+ "html-validate": "11.18.0",
94
+ "ora": "^10.0.0",
95
95
  "puppeteer": "25.16.0",
96
96
  "react": "^18.3.1 || ^19.0.0",
97
97
  "react-dom": "^18.3.1 || ^19.0.0",
98
- "ws": "^8.21.1"
98
+ "ws": "^8.22.1"
99
99
  },
100
100
  "devDependencies": {
101
101
  "@types/cosmiconfig": "^6.0.3",
102
102
  "@types/node": "^26.6.2",
103
103
  "@types/react": "^19.2.18",
104
104
  "@types/react-dom": "^19.2.7",
105
- "@types/ws": "^8.5.13",
106
- "tsup": "^8.3.5",
105
+ "@types/ws": "^8.18.2",
106
+ "tsup": "^9.0.0",
107
107
  "typescript": "^6.0.3",
108
- "vitest": "^4.1.10"
108
+ "vitest": "^5.1.0"
109
109
  }
110
110
  }
@@ -1,18 +0,0 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined") return require.apply(this, arguments);
5
- throw Error('Dynamic require of "' + x + '" is not supported');
6
- });
7
-
8
- // ../../node_modules/tsup/assets/esm_shims.js
9
- import path from "path";
10
- import { fileURLToPath } from "url";
11
- var getFilename = () => fileURLToPath(import.meta.url);
12
- var getDirname = () => path.dirname(getFilename());
13
- var __dirname = /* @__PURE__ */ getDirname();
14
-
15
- export {
16
- __require,
17
- __dirname
18
- };