@holmdigital/engine 2.4.1 → 2.5.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/README.md CHANGED
@@ -14,16 +14,19 @@ Most accessibility tools give you technical errors (e.g., "Color contrast must b
14
14
  It handles the heavy lifting of:
15
15
  1. **Mapping** technical failures to specific legal clauses.
16
16
  2. **Validating** HTML structure to ensure test accuracy.
17
- 3. **Reporting** in multiple languages (EN, SV, NO, FI, DA, NL, DE, FR, ES, IT, PT, PL, EN-AU) for non-technical stakeholders.
17
+ 3. **Reporting** in multiple languages — 9 CLI output locales (EN, SV, NO, FI, DA, NL, DE, FR, ES) and 16 accessibility statement template locales (adds IT, PT, PL, EN-GB, EN-US, EN-CA, EN-AU) — for non-technical stakeholders.
18
18
  4. **CI/CD Pipeline Integration** with automatic enforcement.
19
19
 
20
20
  For a comprehensive guide on CLI flags, CI/CD integration, and configuration files, see the **[Engine Library Catalog](../../docs/reference/engine.md)**.
21
21
 
22
22
  ## Features
23
23
 
24
- - **Regulatory Mapping**: Maps technical failures to EU laws (EN 301 549, EAA) and international laws (Australian DDA).
24
+ - **Regulatory Mapping**: Maps technical failures to EU laws (EN 301 549, EAA), international laws (Australian DDA), and **U.S. ADA (Title II state/local, Title III private sector) + Section 508 (federal agencies)**.
25
+ - **Sector-Aware US Routing**: `--country US --sector public` references **ADA Title II + Section 508** (DOJ enforcement); `--sector private` references **ADA Title III** (DOJ enforcement).
25
26
  - **HTML Structure Validation**: Built-in `html-validate` checks to prevent false positives/negatives.
26
- - **Internationalization (i18n)**: Comprehensive support for 13 languages: English (`en`), Swedish (`sv`), Norwegian (`no`), Finnish (`fi`), Danish (`da`), German (`de`), French (`fr`), Spanish (`es`), Dutch (`nl`), Italian (`it`), Portuguese (`pt`), Polish (`pl`), and Australian English (`en-au`).
27
+ - **Internationalization (i18n)**:
28
+ - **CLI output**: 9 locale files (`en`, `sv`, `no`, `fi`, `da`, `de`, `fr`, `es`, `nl`) + 4 English aliases (`en-gb`, `en-us`, `en-ca`, `en-au`) that fall back to `en`.
29
+ - **Statement templates**: 16 locale files — adds `it`, `pt`, `pl`, and separate templates for each English variant (`en-gb`, `en-us`, `en-ca`, `en-au`).
27
30
  - **Template-Driven Accessibility Statements**: Generates modern, glassmorphism-styled statements using externalized JSON templates for each language, allowing for professional legal phrasing and deep customization.
28
31
  - **Multi-Company Metadata**: Easily customize statements via CLI flags or `.a11yrc` for scalable client generation.
29
32
  - **Enriched JUnit XML**: Professional CI/CD reports including scan duration, page title, engine metadata, and **detailed failing node** snippets (Target + HTML).
@@ -49,7 +52,7 @@ npx hd-a11y-scan <url> [options]
49
52
  **Options:**
50
53
  | Option | Description |
51
54
  |--------|-------------|
52
- | `--lang <code>` | Language code (`en`, `sv`, `no`, `fi`, `da`, `de`, `fr`, `es`, `nl`, `it`, `pt`, `pl`) |
55
+ | `--lang <code>` | Language code. CLI output: `en`, `sv`, `no`, `fi`, `da`, `de`, `fr`, `es`, `nl` (+ aliases `en-gb`, `en-us`, `en-ca`, `en-au` fall back to `en`). Statement templates also accept `it`, `pt`, `pl`. |
53
56
  | `--threshold <level>` | Severity threshold for compliance (`critical`, `high`, `medium`, `low`). Default: `high` |
54
57
  | `--ci` | Run in CI mode (exit code 1 on failure) |
55
58
  | `--json` | Output results as JSON |
@@ -91,6 +94,12 @@ npx hd-a11y-scan https://example.com --light
91
94
 
92
95
  # Light scan with JSON output (perfect for scan-server integration)
93
96
  npx hd-a11y-scan https://example.com --light --json
97
+
98
+ # U.S. state/local government statement (ADA Title II + Section 508, DOJ)
99
+ npx hd-a11y-scan https://example.gov --country US --sector public --statement statement.md --lang en-us
100
+
101
+ # U.S. private sector / public accommodation statement (ADA Title III, DOJ)
102
+ npx hd-a11y-scan https://shop.example.com --country US --sector private --statement statement.md --lang en-us
94
103
  ```
95
104
 
96
105
  ## JSON Output
@@ -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.4.1";
141
+ return "2.5.0";
142
142
  }
143
143
  function getStandardsVersion() {
144
144
  try {
@@ -557,7 +557,7 @@ function generateBadgeMarkdown(score) {
557
557
  import React from "react";
558
558
  import { renderToStaticMarkup } from "react-dom/server";
559
559
  import { AccessibilityStatement } from "@holmdigital/components";
560
- import { getEnforcementBody, getNationalLawByFramework } from "@holmdigital/standards";
560
+ import { getEnforcementBody, getNationalLawByFramework, getNationalLaws } from "@holmdigital/standards";
561
561
  import fs from "fs/promises";
562
562
  import path from "path";
563
563
  var EVALUATION_METHOD = {
@@ -803,12 +803,29 @@ async function generateStatementContent(result, lang = "en", format = "html", me
803
803
  "{<tiers externe>}": props.generatorTool?.name || "HolmDigital Engine",
804
804
  "{<tercero externo>}": props.generatorTool?.name || "HolmDigital Engine",
805
805
  "{<third party>}": props.generatorTool?.name || "HolmDigital Engine",
806
- "{<enforcement_body>}": getEnforcementBody(country, sector),
806
+ "{<enforcement_body>}": (() => {
807
+ if (country === "US") {
808
+ const adaLaw = getNationalLaws("US").find((l) => l.euFramework === "ADA" && l.scope === sector);
809
+ if (adaLaw) return adaLaw.enforcement.authorityName;
810
+ }
811
+ return getEnforcementBody(country, sector);
812
+ })(),
807
813
  "{<national_law>}": (() => {
808
814
  if (country === "AU") {
809
815
  const ddaLaw = getNationalLawByFramework("DDA", "AU");
810
816
  return ddaLaw ? `${ddaLaw.fullName}` : "Disability Discrimination Act 1992 (Cth)";
811
817
  }
818
+ if (country === "US") {
819
+ const usLaws = getNationalLaws("US");
820
+ const adaLaw = usLaws.find((l) => l.euFramework === "ADA" && l.scope === sector);
821
+ if (adaLaw) {
822
+ if (sector === "public") {
823
+ const s508 = usLaws.find((l) => l.id === "us-508");
824
+ return s508 ? `${adaLaw.fullName} (${adaLaw.law}) & ${s508.fullName} (${s508.law})` : `${adaLaw.fullName} (${adaLaw.law})`;
825
+ }
826
+ return `${adaLaw.fullName} (${adaLaw.law})`;
827
+ }
828
+ }
812
829
  const law = getNationalLawByFramework(sector === "private" ? "EAA" : "WAD", country);
813
830
  return law ? `${law.fullName} (${law.law})` : "";
814
831
  })(),
package/dist/cli/index.js CHANGED
@@ -783,7 +783,7 @@ var HtmlValidator = class {
783
783
  // src/core/regulatory-scanner.ts
784
784
  var import_node_fs = require("fs");
785
785
  function getEngineVersion() {
786
- return "2.4.1";
786
+ return "2.5.0";
787
787
  }
788
788
  function getStandardsVersion() {
789
789
  try {
@@ -1788,12 +1788,29 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1788
1788
  "{<tiers externe>}": props.generatorTool?.name || "HolmDigital Engine",
1789
1789
  "{<tercero externo>}": props.generatorTool?.name || "HolmDigital Engine",
1790
1790
  "{<third party>}": props.generatorTool?.name || "HolmDigital Engine",
1791
- "{<enforcement_body>}": (0, import_standards.getEnforcementBody)(country, sector),
1791
+ "{<enforcement_body>}": (() => {
1792
+ if (country === "US") {
1793
+ const adaLaw = (0, import_standards.getNationalLaws)("US").find((l) => l.euFramework === "ADA" && l.scope === sector);
1794
+ if (adaLaw) return adaLaw.enforcement.authorityName;
1795
+ }
1796
+ return (0, import_standards.getEnforcementBody)(country, sector);
1797
+ })(),
1792
1798
  "{<national_law>}": (() => {
1793
1799
  if (country === "AU") {
1794
1800
  const ddaLaw = (0, import_standards.getNationalLawByFramework)("DDA", "AU");
1795
1801
  return ddaLaw ? `${ddaLaw.fullName}` : "Disability Discrimination Act 1992 (Cth)";
1796
1802
  }
1803
+ if (country === "US") {
1804
+ const usLaws = (0, import_standards.getNationalLaws)("US");
1805
+ const adaLaw = usLaws.find((l) => l.euFramework === "ADA" && l.scope === sector);
1806
+ if (adaLaw) {
1807
+ if (sector === "public") {
1808
+ const s508 = usLaws.find((l) => l.id === "us-508");
1809
+ return s508 ? `${adaLaw.fullName} (${adaLaw.law}) & ${s508.fullName} (${s508.law})` : `${adaLaw.fullName} (${adaLaw.law})`;
1810
+ }
1811
+ return `${adaLaw.fullName} (${adaLaw.law})`;
1812
+ }
1813
+ }
1797
1814
  const law = (0, import_standards.getNationalLawByFramework)(sector === "private" ? "EAA" : "WAD", country);
1798
1815
  return law ? `${law.fullName} (${law.law})` : "";
1799
1816
  })(),
@@ -7,7 +7,7 @@ import {
7
7
  generateStatement,
8
8
  generateStatementContent,
9
9
  getEngineVersion
10
- } from "../chunk-FDDZKXUT.mjs";
10
+ } from "../chunk-4AM7NVKM.mjs";
11
11
  import {
12
12
  getCurrentLang,
13
13
  setLanguage,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "Accessibility of {<website>}",
3
- "intro": "This website is run by {<organisation>}. We want as many people as possible to be able to use it, and this document describes how {<website>} complies with Section 508 of the Rehabilitation Act, any known accessibility issues, and how you can report problems so that we can fix them.",
3
+ "intro": "This website is run by {<organisation>}. We want as many people as possible to be able to use it, and this document describes how {<website>} complies with {<national_law>}, any known accessibility issues, and how you can report problems so that we can fix them.",
4
4
  "sections": [
5
5
  {
6
6
  "id": "how-accessible",
@@ -20,7 +20,7 @@
20
20
  {
21
21
  "id": "enforcement",
22
22
  "title": "Enforcement procedure",
23
- "content": "The {<enforcement_body>} is responsible for enforcing Section 508 of the Rehabilitation Act and the Americans with Disabilities Act (ADA). If you experience accessibility issues on our website, you can submit a complaint to {<enforcement_body>}.\n\nYou can also file a complaint with {<enforcement_body>} if you believe our website does not comply with Section 508 or the ADA, or if your request for accessible content has not been handled appropriately."
23
+ "content": "The {<enforcement_body>} is responsible for enforcing {<national_law>}. If you experience accessibility issues on our website, you can submit a complaint to {<enforcement_body>}.\n\nYou can also file a complaint with {<enforcement_body>} if you believe our website does not comply with the applicable law, or if your request for accessible content has not been handled appropriately."
24
24
  },
25
25
  {
26
26
  "id": "technical",
package/dist/index.js CHANGED
@@ -677,7 +677,7 @@ var HtmlValidator = class {
677
677
  // src/core/regulatory-scanner.ts
678
678
  var import_node_fs = require("fs");
679
679
  function getEngineVersion() {
680
- return "2.4.1";
680
+ return "2.5.0";
681
681
  }
682
682
  function getStandardsVersion() {
683
683
  try {
@@ -1343,12 +1343,29 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1343
1343
  "{<tiers externe>}": props.generatorTool?.name || "HolmDigital Engine",
1344
1344
  "{<tercero externo>}": props.generatorTool?.name || "HolmDigital Engine",
1345
1345
  "{<third party>}": props.generatorTool?.name || "HolmDigital Engine",
1346
- "{<enforcement_body>}": (0, import_standards.getEnforcementBody)(country, sector),
1346
+ "{<enforcement_body>}": (() => {
1347
+ if (country === "US") {
1348
+ const adaLaw = (0, import_standards.getNationalLaws)("US").find((l) => l.euFramework === "ADA" && l.scope === sector);
1349
+ if (adaLaw) return adaLaw.enforcement.authorityName;
1350
+ }
1351
+ return (0, import_standards.getEnforcementBody)(country, sector);
1352
+ })(),
1347
1353
  "{<national_law>}": (() => {
1348
1354
  if (country === "AU") {
1349
1355
  const ddaLaw = (0, import_standards.getNationalLawByFramework)("DDA", "AU");
1350
1356
  return ddaLaw ? `${ddaLaw.fullName}` : "Disability Discrimination Act 1992 (Cth)";
1351
1357
  }
1358
+ if (country === "US") {
1359
+ const usLaws = (0, import_standards.getNationalLaws)("US");
1360
+ const adaLaw = usLaws.find((l) => l.euFramework === "ADA" && l.scope === sector);
1361
+ if (adaLaw) {
1362
+ if (sector === "public") {
1363
+ const s508 = usLaws.find((l) => l.id === "us-508");
1364
+ return s508 ? `${adaLaw.fullName} (${adaLaw.law}) & ${s508.fullName} (${s508.law})` : `${adaLaw.fullName} (${adaLaw.law})`;
1365
+ }
1366
+ return `${adaLaw.fullName} (${adaLaw.law})`;
1367
+ }
1368
+ }
1352
1369
  const law = (0, import_standards.getNationalLawByFramework)(sector === "private" ? "EAA" : "WAD", country);
1353
1370
  return law ? `${law.fullName} (${law.law})` : "";
1354
1371
  })(),
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  generateStatement,
6
6
  generateStatementContent,
7
7
  getEngineVersion
8
- } from "./chunk-FDDZKXUT.mjs";
8
+ } from "./chunk-4AM7NVKM.mjs";
9
9
  import {
10
10
  getCurrentLang,
11
11
  setLanguage,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "Accessibility of {<website>}",
3
- "intro": "This website is run by {<organisation>}. We want as many people as possible to be able to use it, and this document describes how {<website>} complies with Section 508 of the Rehabilitation Act, any known accessibility issues, and how you can report problems so that we can fix them.",
3
+ "intro": "This website is run by {<organisation>}. We want as many people as possible to be able to use it, and this document describes how {<website>} complies with {<national_law>}, any known accessibility issues, and how you can report problems so that we can fix them.",
4
4
  "sections": [
5
5
  {
6
6
  "id": "how-accessible",
@@ -20,7 +20,7 @@
20
20
  {
21
21
  "id": "enforcement",
22
22
  "title": "Enforcement procedure",
23
- "content": "The {<enforcement_body>} is responsible for enforcing Section 508 of the Rehabilitation Act and the Americans with Disabilities Act (ADA). If you experience accessibility issues on our website, you can submit a complaint to {<enforcement_body>}.\n\nYou can also file a complaint with {<enforcement_body>} if you believe our website does not comply with Section 508 or the ADA, or if your request for accessible content has not been handled appropriately."
23
+ "content": "The {<enforcement_body>} is responsible for enforcing {<national_law>}. If you experience accessibility issues on our website, you can submit a complaint to {<enforcement_body>}.\n\nYou can also file a complaint with {<enforcement_body>} if you believe our website does not comply with the applicable law, or if your request for accessible content has not been handled appropriately."
24
24
  },
25
25
  {
26
26
  "id": "technical",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holmdigital/engine",
3
- "version": "2.4.1",
3
+ "version": "2.5.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"