@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/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@octaviaflow/accessibility-checker",
3
- "version": "1.0.0",
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": "yarn clean && yarn build:cjs && yarn build:mjs && yarn build:types",
34
- "test": "vitest",
35
- "ci-check": "yarn build && yarn test",
36
- "start": "node ./cjs/index.js --sample"
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/node": "^24.10.0",
60
- "eslint": "^9.31.1",
61
- "jest": "^30.2.0",
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
- "ts-node": "^10.9.2",
64
- "typescript": "^5.9.3",
65
- "vitest": "^4.0.8"
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"
@@ -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?: any;
16
- meta?: any;
22
+ axe?: axe.AxeResults | {
23
+ error: string;
24
+ };
25
+ meta?: ResultMeta;
17
26
  };
18
27
  export declare function analyze(html: string): Promise<Result>;
@@ -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,3 @@
1
+ import { Result } from '../checker/index.js';
2
+ export type OutputFormat = 'json' | 'html' | 'csv' | 'excel';
3
+ export declare function saveReport(result: Result, filePath: string, format?: OutputFormat): 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;