@octaviaflow/accessibility-checker 1.0.0 → 1.1.2
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 +378 -52
- package/bin/achecker.js +9 -0
- package/cjs/checker/index.js +4 -43
- package/cjs/index.js +117 -0
- package/cjs/storage/reportWriter.js +190 -0
- package/cjs/utils/wcag-rules.js +65 -0
- package/mjs/checker/index.js +2 -9
- package/mjs/index.js +110 -0
- package/mjs/storage/reportWriter.js +186 -0
- package/mjs/utils/wcag-rules.js +61 -0
- package/package.json +35 -15
- package/types/checker/index.d.ts +11 -2
- package/types/index.d.ts +16 -0
- package/types/storage/reportWriter.d.ts +3 -0
- package/types/utils/wcag-rules.d.ts +10 -0
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octaviaflow/accessibility-checker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"description": "Accessibility checker for OctaviaFlow Design System - A custom implementation",
|
|
6
7
|
"main": "cjs/index.js",
|
|
7
8
|
"module": "mjs/index.js",
|
|
@@ -27,13 +28,20 @@
|
|
|
27
28
|
"bugs": "https://github.com/OctaviaFlow/OctaviaFlow-Design-System/issues",
|
|
28
29
|
"scripts": {
|
|
29
30
|
"clean": "rimraf cjs mjs types",
|
|
30
|
-
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
31
|
-
"build:mjs": "tsc -p tsconfig.mjs.json",
|
|
32
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
33
|
-
"build": "
|
|
34
|
-
"test": "vitest",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
31
|
+
"build:cjs": "bun x tsc -p tsconfig.cjs.json",
|
|
32
|
+
"build:mjs": "bun x tsc -p tsconfig.mjs.json",
|
|
33
|
+
"build:types": "bun x tsc -p tsconfig.types.json",
|
|
34
|
+
"build": "bun run clean && bun run build:cjs && bun run build:mjs && bun run build:types",
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"test:watch": "vitest",
|
|
37
|
+
"lint": "eslint src/**/*.ts",
|
|
38
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
39
|
+
"format": "prettier --write src/**/*.{ts,js,json}",
|
|
40
|
+
"format:check": "prettier --check src/**/*.{ts,js,json}",
|
|
41
|
+
"ci-check": "bun run build && bun run test && bun run lint && echo \"✓ Done\"",
|
|
42
|
+
"start": "node ./cjs/index.js --sample",
|
|
43
|
+
"dev": "bun run build && bun run start",
|
|
44
|
+
"prepublishOnly": "bun run build"
|
|
37
45
|
},
|
|
38
46
|
"keywords": [
|
|
39
47
|
"octaviaflow",
|
|
@@ -51,18 +59,30 @@
|
|
|
51
59
|
"exceljs": "^4.3.0",
|
|
52
60
|
"js-yaml": "^4.1.0",
|
|
53
61
|
"jsdom": "^27.1.0",
|
|
62
|
+
"minimist": "^1.2.8",
|
|
54
63
|
"puppeteer": "^24.29.1",
|
|
55
|
-
"string-hash": "^1.1.3"
|
|
64
|
+
"string-hash": "^1.1.3",
|
|
65
|
+
"chalk": "^5.3.0",
|
|
66
|
+
"ora": "^8.1.1"
|
|
56
67
|
},
|
|
57
68
|
"devDependencies": {
|
|
58
69
|
"@types/jsdom": "^27.0.0",
|
|
59
|
-
"@types/
|
|
60
|
-
"
|
|
61
|
-
"
|
|
70
|
+
"@types/minimist": "^1.2.5",
|
|
71
|
+
"@types/node": "^20.0.0",
|
|
72
|
+
"@eslint/js": "^9.39.1",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^8.46.4",
|
|
74
|
+
"@typescript-eslint/parser": "^8.46.4",
|
|
75
|
+
"eslint": "^9.39.1",
|
|
76
|
+
"eslint-config-octaviaflow": "^2.0.0",
|
|
77
|
+
"jest": "^29.7.0",
|
|
78
|
+
"jest-config-octaviaflow": "^1.1.1",
|
|
79
|
+
"prettier": "^3.6.2",
|
|
80
|
+
"prettier-config-octaviaflow": "^1.1.2",
|
|
62
81
|
"rimraf": "^6.0.1",
|
|
63
|
-
"
|
|
64
|
-
"typescript": "^5.
|
|
65
|
-
"
|
|
82
|
+
"tslib": "^2.8.1",
|
|
83
|
+
"typescript": "^5.8.3",
|
|
84
|
+
"typescript-config-octaviaflow": "^1.1.1",
|
|
85
|
+
"vitest": "^2.1.8"
|
|
66
86
|
},
|
|
67
87
|
"bin": {
|
|
68
88
|
"octaviaflow-achecker": "bin/achecker.js"
|
package/types/checker/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as axe from 'axe-core';
|
|
1
2
|
export type Issue = {
|
|
2
3
|
type: string;
|
|
3
4
|
message: string;
|
|
@@ -5,6 +6,12 @@ export type Issue = {
|
|
|
5
6
|
helpUrl?: string;
|
|
6
7
|
source?: string;
|
|
7
8
|
};
|
|
9
|
+
export interface ResultMeta {
|
|
10
|
+
timestamp: string;
|
|
11
|
+
source: string;
|
|
12
|
+
format?: string;
|
|
13
|
+
version?: string;
|
|
14
|
+
}
|
|
8
15
|
export type Result = {
|
|
9
16
|
summary: {
|
|
10
17
|
totalIssues: number;
|
|
@@ -12,7 +19,9 @@ export type Result = {
|
|
|
12
19
|
axeViolations?: number;
|
|
13
20
|
};
|
|
14
21
|
issues: Issue[];
|
|
15
|
-
axe?:
|
|
16
|
-
|
|
22
|
+
axe?: axe.AxeResults | {
|
|
23
|
+
error: string;
|
|
24
|
+
};
|
|
25
|
+
meta?: ResultMeta;
|
|
17
26
|
};
|
|
18
27
|
export declare function analyze(html: string): Promise<Result>;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { analyze } from './checker/index.js';
|
|
2
|
+
export { saveReport } from './storage/reportWriter.js';
|
|
3
|
+
export type { Issue, Result, ResultMeta } from './checker/index.js';
|
|
4
|
+
export interface CliOptions {
|
|
5
|
+
input?: string;
|
|
6
|
+
i?: string;
|
|
7
|
+
output?: string;
|
|
8
|
+
o?: string;
|
|
9
|
+
sample?: boolean;
|
|
10
|
+
format?: 'json' | 'html' | 'csv' | 'excel';
|
|
11
|
+
verbose?: boolean;
|
|
12
|
+
v?: boolean;
|
|
13
|
+
help?: boolean;
|
|
14
|
+
h?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function main(args?: string[]): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface WCAGRule {
|
|
2
|
+
id: string;
|
|
3
|
+
level: 'A' | 'AA' | 'AAA';
|
|
4
|
+
principle: 'perceivable' | 'operable' | 'understandable' | 'robust';
|
|
5
|
+
guideline: string;
|
|
6
|
+
description: string;
|
|
7
|
+
helpUrl: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const WCAG_RULES: Record<string, WCAGRule>;
|
|
10
|
+
export declare function getWCAGRule(ruleId: string): WCAGRule | undefined;
|