@holmdigital/engine 1.4.3 → 1.4.5
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 +20 -7
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.mjs +2 -2
- package/package.json +78 -70
package/README.md
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
# @holmdigital/engine
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@holmdigital/engine)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+

|
|
6
|
+
[](https://www.npmjs.com/package/@holmdigital/engine)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
> Regulatory accessibility test engine with Virtual DOM, Shadow DOM support, and built-in legal compliance reporting.
|
|
9
|
+
|
|
10
|
+
## Why this package?
|
|
11
|
+
|
|
12
|
+
Most accessibility tools give you technical errors (e.g., "Color contrast must be 4.5:1"). This engine bridges the gap between **technical code validation** (using `axe-core`) and **legal compliance** (EN 301 549, Section 508, DOS-lagen).
|
|
13
|
+
|
|
14
|
+
It handles the heavy lifting of:
|
|
15
|
+
1. **Mapping** technical failures to specific legal clauses.
|
|
16
|
+
2. **Validating** HTML structure to ensure test accuracy.
|
|
17
|
+
3. **Reporting** in multiple languages (EN, SV, NL, DE, FR, ES) for non-technical stakeholders.
|
|
6
18
|
|
|
7
19
|
## Features
|
|
8
20
|
|
|
9
|
-
- **Regulatory Mapping**: Maps technical failures to EU laws.
|
|
10
|
-
- **HTML Structure Validation**:
|
|
11
|
-
- **Internationalization (i18n)**: Supports English (`en`), Swedish (`sv`), German (`de`), French (`fr`), Spanish (`es`), and Dutch (`nl`).
|
|
12
|
-
- **Pseudo-Automation**:
|
|
13
|
-
- **PDF Reporting**: Generates beautiful, compliant PDF reports.
|
|
21
|
+
- **Regulatory Mapping**: Maps technical failures to EU laws (EN 301 549, EAA).
|
|
22
|
+
- **HTML Structure Validation**: Built-in `html-validate` checks to prevent false positives/negatives.
|
|
23
|
+
- **Internationalization (i18n)**: Supports English (`en`), Swedish (`sv`), German (`de`), French (`fr`), Spanish (`es`), and Dutch (`nl`).
|
|
24
|
+
- **Pseudo-Automation**: Automatically generates Playwright/Puppeteer test scripts for manual verification steps.
|
|
25
|
+
- **PDF Reporting**: Generates beautiful, compliant PDF reports out of the box.
|
|
26
|
+
- **TypeScript**: Written in TypeScript with full type definitions included.
|
|
14
27
|
|
|
15
28
|
## Installation
|
|
16
29
|
|
package/dist/cli/index.js
CHANGED
|
@@ -1005,7 +1005,7 @@ async function generatePDF(htmlContent, outputPath) {
|
|
|
1005
1005
|
init_i18n();
|
|
1006
1006
|
|
|
1007
1007
|
// src/cli/cloud-client.ts
|
|
1008
|
-
var ENGINE_VERSION = "1.
|
|
1008
|
+
var ENGINE_VERSION = "1.4.4";
|
|
1009
1009
|
function transformToCloudPayload(result) {
|
|
1010
1010
|
const violations = result.reports.map((report) => {
|
|
1011
1011
|
const firstNode = report.failingNodes?.[0];
|
|
@@ -1094,7 +1094,7 @@ function isValidUrl(urlString) {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
var program = new import_commander.Command();
|
|
1096
1096
|
program.name("hd-a11y-scan").description("HolmDigital Regulatory Scanner").version("0.1.0");
|
|
1097
|
-
program.argument("<url>", "URL to scan").option("--lang <code", "Language code (en, sv)", "en").option("--ci", "Run in CI/CD mode (exit code 1 on critical failures)").option("--generate-tests", "Generate Pseudo-Automation tests").option("--json", "Output as JSON").option("--pdf <path>", "Generate PDF report to path").option("--viewport <size>", 'Set viewport (e.g. "mobile", "desktop", "1024x768")').option("--api-key <key>", "API key for HolmDigital Cloud authentication").option("--cloud-url <url>", "Cloud API URL", "https://cloud.holmdigital.se").action(async (url, options) => {
|
|
1097
|
+
program.argument("<url>", "URL to scan").option("--lang <code>", "Language code (en, sv)", "en").option("--ci", "Run in CI/CD mode (exit code 1 on critical failures)").option("--generate-tests", "Generate Pseudo-Automation tests").option("--json", "Output as JSON").option("--pdf <path>", "Generate PDF report to path").option("--viewport <size>", 'Set viewport (e.g. "mobile", "desktop", "1024x768")').option("--api-key <key>", "API key for HolmDigital Cloud authentication").option("--cloud-url <url>", "Cloud API URL", "https://cloud.holmdigital.se").action(async (url, options) => {
|
|
1098
1098
|
setLanguage(options.lang);
|
|
1099
1099
|
if (!isValidUrl(url)) {
|
|
1100
1100
|
console.error(import_chalk.default.red(`Error: Invalid URL format '${url}'`));
|
package/dist/cli/index.mjs
CHANGED
|
@@ -262,7 +262,7 @@ async function generatePDF(htmlContent, outputPath) {
|
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
// src/cli/cloud-client.ts
|
|
265
|
-
var ENGINE_VERSION = "1.
|
|
265
|
+
var ENGINE_VERSION = "1.4.4";
|
|
266
266
|
function transformToCloudPayload(result) {
|
|
267
267
|
const violations = result.reports.map((report) => {
|
|
268
268
|
const firstNode = report.failingNodes?.[0];
|
|
@@ -351,7 +351,7 @@ function isValidUrl(urlString) {
|
|
|
351
351
|
}
|
|
352
352
|
var program = new Command();
|
|
353
353
|
program.name("hd-a11y-scan").description("HolmDigital Regulatory Scanner").version("0.1.0");
|
|
354
|
-
program.argument("<url>", "URL to scan").option("--lang <code", "Language code (en, sv)", "en").option("--ci", "Run in CI/CD mode (exit code 1 on critical failures)").option("--generate-tests", "Generate Pseudo-Automation tests").option("--json", "Output as JSON").option("--pdf <path>", "Generate PDF report to path").option("--viewport <size>", 'Set viewport (e.g. "mobile", "desktop", "1024x768")').option("--api-key <key>", "API key for HolmDigital Cloud authentication").option("--cloud-url <url>", "Cloud API URL", "https://cloud.holmdigital.se").action(async (url, options) => {
|
|
354
|
+
program.argument("<url>", "URL to scan").option("--lang <code>", "Language code (en, sv)", "en").option("--ci", "Run in CI/CD mode (exit code 1 on critical failures)").option("--generate-tests", "Generate Pseudo-Automation tests").option("--json", "Output as JSON").option("--pdf <path>", "Generate PDF report to path").option("--viewport <size>", 'Set viewport (e.g. "mobile", "desktop", "1024x768")').option("--api-key <key>", "API key for HolmDigital Cloud authentication").option("--cloud-url <url>", "Cloud API URL", "https://cloud.holmdigital.se").action(async (url, options) => {
|
|
355
355
|
setLanguage(options.lang);
|
|
356
356
|
if (!isValidUrl(url)) {
|
|
357
357
|
console.error(chalk.red(`Error: Invalid URL format '${url}'`));
|
package/package.json
CHANGED
|
@@ -1,71 +1,79 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@holmdigital/engine",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"private": false,
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public",
|
|
7
|
-
"registry": "https://registry.npmjs.org/"
|
|
8
|
-
},
|
|
9
|
-
"description": "Regulatory accessibility test engine with Virtual DOM and Shadow DOM support",
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/holmdigital/a11y-hd.git",
|
|
13
|
-
"directory": "packages/engine"
|
|
14
|
-
},
|
|
15
|
-
"main": "./dist/index.js",
|
|
16
|
-
"module": "./dist/index.mjs",
|
|
17
|
-
"types": "./dist/index.d.ts",
|
|
18
|
-
"bin": {
|
|
19
|
-
"hd-a11y-scan": "./dist/cli/index.js"
|
|
20
|
-
},
|
|
21
|
-
"exports": {
|
|
22
|
-
".": {
|
|
23
|
-
"types": "./dist/index.d.ts",
|
|
24
|
-
"import": "./dist/index.mjs",
|
|
25
|
-
"require": "./dist/index.js"
|
|
26
|
-
},
|
|
27
|
-
"./cli": "./dist/cli/index.js"
|
|
28
|
-
},
|
|
29
|
-
"files": [
|
|
30
|
-
"dist",
|
|
31
|
-
"README.md"
|
|
32
|
-
],
|
|
33
|
-
"scripts": {
|
|
34
|
-
"build": "tsup src/index.ts src/cli/index.ts --format cjs,esm --dts --clean",
|
|
35
|
-
"dev": "tsup src/index.ts src/cli/index.ts --format cjs,esm --dts --watch",
|
|
36
|
-
"test": "vitest",
|
|
37
|
-
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
38
|
-
"lint": "eslint src --ext .ts",
|
|
39
|
-
"prepublishOnly": "npm run build"
|
|
40
|
-
},
|
|
41
|
-
"keywords": [
|
|
42
|
-
"accessibility",
|
|
43
|
-
"a11y",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@holmdigital/engine",
|
|
3
|
+
"version": "1.4.5",
|
|
4
|
+
"private": false,
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public",
|
|
7
|
+
"registry": "https://registry.npmjs.org/"
|
|
8
|
+
},
|
|
9
|
+
"description": "Regulatory accessibility test engine with Virtual DOM and Shadow DOM support",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/holmdigital/a11y-hd.git",
|
|
13
|
+
"directory": "packages/engine"
|
|
14
|
+
},
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"module": "./dist/index.mjs",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"bin": {
|
|
19
|
+
"hd-a11y-scan": "./dist/cli/index.js"
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.mjs",
|
|
25
|
+
"require": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./cli": "./dist/cli/index.js"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsup src/index.ts src/cli/index.ts --format cjs,esm --dts --clean",
|
|
35
|
+
"dev": "tsup src/index.ts src/cli/index.ts --format cjs,esm --dts --watch",
|
|
36
|
+
"test": "vitest",
|
|
37
|
+
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
38
|
+
"lint": "eslint src --ext .ts",
|
|
39
|
+
"prepublishOnly": "npm run build"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"accessibility",
|
|
43
|
+
"a11y",
|
|
44
|
+
"wcag",
|
|
45
|
+
"en301549",
|
|
46
|
+
"compliance",
|
|
47
|
+
"automation",
|
|
48
|
+
"testing",
|
|
49
|
+
"regulatory",
|
|
50
|
+
"html-validate",
|
|
51
|
+
"axe-core",
|
|
52
|
+
"ead",
|
|
53
|
+
"european-accessibility-act",
|
|
54
|
+
"holmdigital",
|
|
55
|
+
"section508",
|
|
56
|
+
"ada",
|
|
57
|
+
"dos-lagen",
|
|
58
|
+
"digitale-barrierefreiheit"
|
|
59
|
+
],
|
|
60
|
+
"author": "Holm Digital AB",
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@holmdigital/standards": "*",
|
|
64
|
+
"axe-core": "^4.10.2",
|
|
65
|
+
"chalk": "^5.3.0",
|
|
66
|
+
"commander": "^12.1.0",
|
|
67
|
+
"html-validate": "^10.4.0",
|
|
68
|
+
"ora": "^8.1.1",
|
|
69
|
+
"puppeteer": "^23.10.4",
|
|
70
|
+
"ws": "^8.18.0"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@types/node": "^22.10.2",
|
|
74
|
+
"@types/ws": "^8.5.13",
|
|
75
|
+
"tsup": "^8.3.5",
|
|
76
|
+
"typescript": "^5.7.2",
|
|
77
|
+
"vitest": "^4.0.16"
|
|
78
|
+
}
|
|
71
79
|
}
|