@kiwa-test/a11y 0.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.
- package/LICENSE +21 -0
- package/dist/index.cjs +86 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +54 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/package.json +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cardene777
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
expectNoViolations: () => expectNoViolations,
|
|
34
|
+
reportViolations: () => reportViolations,
|
|
35
|
+
runAxe: () => runAxe
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(index_exports);
|
|
38
|
+
|
|
39
|
+
// src/audit.ts
|
|
40
|
+
var IMPACT_ORDER = {
|
|
41
|
+
minor: 0,
|
|
42
|
+
moderate: 1,
|
|
43
|
+
serious: 2,
|
|
44
|
+
critical: 3
|
|
45
|
+
};
|
|
46
|
+
async function loadAxeCore() {
|
|
47
|
+
try {
|
|
48
|
+
const mod = await import("axe-core");
|
|
49
|
+
return mod.default ?? mod;
|
|
50
|
+
} catch {
|
|
51
|
+
throw new Error('runAxe requires "axe-core" to be installed. Run `pnpm add -D axe-core`.');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function runAxe(opts = {}) {
|
|
55
|
+
const axe = await loadAxeCore();
|
|
56
|
+
const ctx = opts.context ?? (typeof document !== "undefined" ? document : void 0);
|
|
57
|
+
if (ctx === void 0) {
|
|
58
|
+
throw new Error("runAxe: no context and no global document (jsdom env required).");
|
|
59
|
+
}
|
|
60
|
+
return axe.run(ctx, opts.runOptions ?? {});
|
|
61
|
+
}
|
|
62
|
+
function reportViolations(results, opts = {}) {
|
|
63
|
+
const maxImpact = opts.maxImpact ?? "minor";
|
|
64
|
+
const threshold = IMPACT_ORDER[maxImpact];
|
|
65
|
+
const blocking = results.violations.filter((v) => {
|
|
66
|
+
if (!v.impact) return false;
|
|
67
|
+
return IMPACT_ORDER[v.impact] >= threshold;
|
|
68
|
+
});
|
|
69
|
+
const summary = blocking.length === 0 ? `No a11y violations at impact >= "${maxImpact}".` : `${blocking.length} a11y violation(s) at impact >= "${maxImpact}":
|
|
70
|
+
` + blocking.map((v) => ` - [${v.impact}] ${v.id}: ${v.help} (${v.nodes.length} node(s))`).join("\n");
|
|
71
|
+
return { violations: results.violations, blocking, summary };
|
|
72
|
+
}
|
|
73
|
+
function expectNoViolations(results, expect, opts = {}) {
|
|
74
|
+
const report = reportViolations(results, opts);
|
|
75
|
+
if (report.blocking.length > 0) {
|
|
76
|
+
throw new Error(report.summary);
|
|
77
|
+
}
|
|
78
|
+
expect(report.blocking.length).toBe(0);
|
|
79
|
+
}
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
expectNoViolations,
|
|
83
|
+
reportViolations,
|
|
84
|
+
runAxe
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/audit.ts"],"sourcesContent":["export type {\n AxeViolation,\n AxeResults,\n AxeRunModule,\n AuditOptions,\n} from './types.js';\nexport {\n runAxe,\n reportViolations,\n expectNoViolations,\n type ViolationReport,\n} from './audit.js';\n","import type {\n AuditOptions,\n AxeResults,\n AxeRunModule,\n AxeViolation,\n} from './types.js';\n\nconst IMPACT_ORDER: Record<NonNullable<AxeViolation['impact']>, number> = {\n minor: 0,\n moderate: 1,\n serious: 2,\n critical: 3,\n};\n\nasync function loadAxeCore(): Promise<AxeRunModule> {\n try {\n const mod = (await import('axe-core')) as unknown as { default?: AxeRunModule } & AxeRunModule;\n return mod.default ?? mod;\n } catch {\n throw new Error('runAxe requires \"axe-core\" to be installed. Run `pnpm add -D axe-core`.');\n }\n}\n\nexport async function runAxe(opts: AuditOptions = {}): Promise<AxeResults> {\n const axe = await loadAxeCore();\n const ctx =\n opts.context ?? (typeof document !== 'undefined' ? document : undefined);\n if (ctx === undefined) {\n throw new Error('runAxe: no context and no global document (jsdom env required).');\n }\n return axe.run(ctx as Element | Document | string, opts.runOptions ?? {});\n}\n\nexport interface ViolationReport {\n violations: AxeViolation[];\n blocking: AxeViolation[];\n summary: string;\n}\n\nexport function reportViolations(\n results: AxeResults,\n opts: { maxImpact?: AuditOptions['maxImpact'] } = {},\n): ViolationReport {\n const maxImpact = opts.maxImpact ?? 'minor';\n const threshold = IMPACT_ORDER[maxImpact];\n const blocking = results.violations.filter((v) => {\n if (!v.impact) return false;\n return IMPACT_ORDER[v.impact] >= threshold;\n });\n const summary = blocking.length === 0\n ? `No a11y violations at impact >= \"${maxImpact}\".`\n : `${blocking.length} a11y violation(s) at impact >= \"${maxImpact}\":\\n` +\n blocking.map((v) => ` - [${v.impact}] ${v.id}: ${v.help} (${v.nodes.length} node(s))`).join('\\n');\n return { violations: results.violations, blocking, summary };\n}\n\nexport function expectNoViolations(\n results: AxeResults,\n expect: { (actual: unknown): { toBe: (expected: unknown) => void } },\n opts: { maxImpact?: AuditOptions['maxImpact'] } = {},\n): void {\n const report = reportViolations(results, opts);\n if (report.blocking.length > 0) {\n throw new Error(report.summary);\n }\n expect(report.blocking.length).toBe(0);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,IAAM,eAAoE;AAAA,EACxE,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,eAAe,cAAqC;AAClD,MAAI;AACF,UAAM,MAAO,MAAM,OAAO,UAAU;AACpC,WAAO,IAAI,WAAW;AAAA,EACxB,QAAQ;AACN,UAAM,IAAI,MAAM,yEAAyE;AAAA,EAC3F;AACF;AAEA,eAAsB,OAAO,OAAqB,CAAC,GAAwB;AACzE,QAAM,MAAM,MAAM,YAAY;AAC9B,QAAM,MACJ,KAAK,YAAY,OAAO,aAAa,cAAc,WAAW;AAChE,MAAI,QAAQ,QAAW;AACrB,UAAM,IAAI,MAAM,iEAAiE;AAAA,EACnF;AACA,SAAO,IAAI,IAAI,KAAoC,KAAK,cAAc,CAAC,CAAC;AAC1E;AAQO,SAAS,iBACd,SACA,OAAkD,CAAC,GAClC;AACjB,QAAM,YAAY,KAAK,aAAa;AACpC,QAAM,YAAY,aAAa,SAAS;AACxC,QAAM,WAAW,QAAQ,WAAW,OAAO,CAAC,MAAM;AAChD,QAAI,CAAC,EAAE,OAAQ,QAAO;AACtB,WAAO,aAAa,EAAE,MAAM,KAAK;AAAA,EACnC,CAAC;AACD,QAAM,UAAU,SAAS,WAAW,IAChC,oCAAoC,SAAS,OAC7C,GAAG,SAAS,MAAM,oCAAoC,SAAS;AAAA,IAC/D,SAAS,IAAI,CAAC,MAAM,QAAQ,EAAE,MAAM,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,KAAK,EAAE,MAAM,MAAM,WAAW,EAAE,KAAK,IAAI;AACrG,SAAO,EAAE,YAAY,QAAQ,YAAY,UAAU,QAAQ;AAC7D;AAEO,SAAS,mBACd,SACA,QACA,OAAkD,CAAC,GAC7C;AACN,QAAM,SAAS,iBAAiB,SAAS,IAAI;AAC7C,MAAI,OAAO,SAAS,SAAS,GAAG;AAC9B,UAAM,IAAI,MAAM,OAAO,OAAO;AAAA,EAChC;AACA,SAAO,OAAO,SAAS,MAAM,EAAE,KAAK,CAAC;AACvC;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
interface AxeViolation {
|
|
2
|
+
id: string;
|
|
3
|
+
impact: 'minor' | 'moderate' | 'serious' | 'critical' | null;
|
|
4
|
+
description: string;
|
|
5
|
+
help: string;
|
|
6
|
+
helpUrl: string;
|
|
7
|
+
nodes: Array<{
|
|
8
|
+
target: string[];
|
|
9
|
+
html: string;
|
|
10
|
+
failureSummary?: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
interface AxeResults {
|
|
14
|
+
violations: AxeViolation[];
|
|
15
|
+
passes: Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
}>;
|
|
18
|
+
incomplete: Array<{
|
|
19
|
+
id: string;
|
|
20
|
+
}>;
|
|
21
|
+
inapplicable: Array<{
|
|
22
|
+
id: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
interface AuditOptions {
|
|
26
|
+
/** Element / selector / Document to scan (default: document) */
|
|
27
|
+
context?: Element | Document | string;
|
|
28
|
+
/** axe-core run options (passed verbatim) */
|
|
29
|
+
runOptions?: Record<string, unknown>;
|
|
30
|
+
/** Maximum impact level allowed before reportViolations throws */
|
|
31
|
+
maxImpact?: 'minor' | 'moderate' | 'serious' | 'critical';
|
|
32
|
+
}
|
|
33
|
+
interface AxeRunModule {
|
|
34
|
+
run: (context?: Element | Document | string, options?: Record<string, unknown>) => Promise<AxeResults>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare function runAxe(opts?: AuditOptions): Promise<AxeResults>;
|
|
38
|
+
interface ViolationReport {
|
|
39
|
+
violations: AxeViolation[];
|
|
40
|
+
blocking: AxeViolation[];
|
|
41
|
+
summary: string;
|
|
42
|
+
}
|
|
43
|
+
declare function reportViolations(results: AxeResults, opts?: {
|
|
44
|
+
maxImpact?: AuditOptions['maxImpact'];
|
|
45
|
+
}): ViolationReport;
|
|
46
|
+
declare function expectNoViolations(results: AxeResults, expect: {
|
|
47
|
+
(actual: unknown): {
|
|
48
|
+
toBe: (expected: unknown) => void;
|
|
49
|
+
};
|
|
50
|
+
}, opts?: {
|
|
51
|
+
maxImpact?: AuditOptions['maxImpact'];
|
|
52
|
+
}): void;
|
|
53
|
+
|
|
54
|
+
export { type AuditOptions, type AxeResults, type AxeRunModule, type AxeViolation, type ViolationReport, expectNoViolations, reportViolations, runAxe };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
interface AxeViolation {
|
|
2
|
+
id: string;
|
|
3
|
+
impact: 'minor' | 'moderate' | 'serious' | 'critical' | null;
|
|
4
|
+
description: string;
|
|
5
|
+
help: string;
|
|
6
|
+
helpUrl: string;
|
|
7
|
+
nodes: Array<{
|
|
8
|
+
target: string[];
|
|
9
|
+
html: string;
|
|
10
|
+
failureSummary?: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
interface AxeResults {
|
|
14
|
+
violations: AxeViolation[];
|
|
15
|
+
passes: Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
}>;
|
|
18
|
+
incomplete: Array<{
|
|
19
|
+
id: string;
|
|
20
|
+
}>;
|
|
21
|
+
inapplicable: Array<{
|
|
22
|
+
id: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
interface AuditOptions {
|
|
26
|
+
/** Element / selector / Document to scan (default: document) */
|
|
27
|
+
context?: Element | Document | string;
|
|
28
|
+
/** axe-core run options (passed verbatim) */
|
|
29
|
+
runOptions?: Record<string, unknown>;
|
|
30
|
+
/** Maximum impact level allowed before reportViolations throws */
|
|
31
|
+
maxImpact?: 'minor' | 'moderate' | 'serious' | 'critical';
|
|
32
|
+
}
|
|
33
|
+
interface AxeRunModule {
|
|
34
|
+
run: (context?: Element | Document | string, options?: Record<string, unknown>) => Promise<AxeResults>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare function runAxe(opts?: AuditOptions): Promise<AxeResults>;
|
|
38
|
+
interface ViolationReport {
|
|
39
|
+
violations: AxeViolation[];
|
|
40
|
+
blocking: AxeViolation[];
|
|
41
|
+
summary: string;
|
|
42
|
+
}
|
|
43
|
+
declare function reportViolations(results: AxeResults, opts?: {
|
|
44
|
+
maxImpact?: AuditOptions['maxImpact'];
|
|
45
|
+
}): ViolationReport;
|
|
46
|
+
declare function expectNoViolations(results: AxeResults, expect: {
|
|
47
|
+
(actual: unknown): {
|
|
48
|
+
toBe: (expected: unknown) => void;
|
|
49
|
+
};
|
|
50
|
+
}, opts?: {
|
|
51
|
+
maxImpact?: AuditOptions['maxImpact'];
|
|
52
|
+
}): void;
|
|
53
|
+
|
|
54
|
+
export { type AuditOptions, type AxeResults, type AxeRunModule, type AxeViolation, type ViolationReport, expectNoViolations, reportViolations, runAxe };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// src/audit.ts
|
|
2
|
+
var IMPACT_ORDER = {
|
|
3
|
+
minor: 0,
|
|
4
|
+
moderate: 1,
|
|
5
|
+
serious: 2,
|
|
6
|
+
critical: 3
|
|
7
|
+
};
|
|
8
|
+
async function loadAxeCore() {
|
|
9
|
+
try {
|
|
10
|
+
const mod = await import("axe-core");
|
|
11
|
+
return mod.default ?? mod;
|
|
12
|
+
} catch {
|
|
13
|
+
throw new Error('runAxe requires "axe-core" to be installed. Run `pnpm add -D axe-core`.');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function runAxe(opts = {}) {
|
|
17
|
+
const axe = await loadAxeCore();
|
|
18
|
+
const ctx = opts.context ?? (typeof document !== "undefined" ? document : void 0);
|
|
19
|
+
if (ctx === void 0) {
|
|
20
|
+
throw new Error("runAxe: no context and no global document (jsdom env required).");
|
|
21
|
+
}
|
|
22
|
+
return axe.run(ctx, opts.runOptions ?? {});
|
|
23
|
+
}
|
|
24
|
+
function reportViolations(results, opts = {}) {
|
|
25
|
+
const maxImpact = opts.maxImpact ?? "minor";
|
|
26
|
+
const threshold = IMPACT_ORDER[maxImpact];
|
|
27
|
+
const blocking = results.violations.filter((v) => {
|
|
28
|
+
if (!v.impact) return false;
|
|
29
|
+
return IMPACT_ORDER[v.impact] >= threshold;
|
|
30
|
+
});
|
|
31
|
+
const summary = blocking.length === 0 ? `No a11y violations at impact >= "${maxImpact}".` : `${blocking.length} a11y violation(s) at impact >= "${maxImpact}":
|
|
32
|
+
` + blocking.map((v) => ` - [${v.impact}] ${v.id}: ${v.help} (${v.nodes.length} node(s))`).join("\n");
|
|
33
|
+
return { violations: results.violations, blocking, summary };
|
|
34
|
+
}
|
|
35
|
+
function expectNoViolations(results, expect, opts = {}) {
|
|
36
|
+
const report = reportViolations(results, opts);
|
|
37
|
+
if (report.blocking.length > 0) {
|
|
38
|
+
throw new Error(report.summary);
|
|
39
|
+
}
|
|
40
|
+
expect(report.blocking.length).toBe(0);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
expectNoViolations,
|
|
44
|
+
reportViolations,
|
|
45
|
+
runAxe
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/audit.ts"],"sourcesContent":["import type {\n AuditOptions,\n AxeResults,\n AxeRunModule,\n AxeViolation,\n} from './types.js';\n\nconst IMPACT_ORDER: Record<NonNullable<AxeViolation['impact']>, number> = {\n minor: 0,\n moderate: 1,\n serious: 2,\n critical: 3,\n};\n\nasync function loadAxeCore(): Promise<AxeRunModule> {\n try {\n const mod = (await import('axe-core')) as unknown as { default?: AxeRunModule } & AxeRunModule;\n return mod.default ?? mod;\n } catch {\n throw new Error('runAxe requires \"axe-core\" to be installed. Run `pnpm add -D axe-core`.');\n }\n}\n\nexport async function runAxe(opts: AuditOptions = {}): Promise<AxeResults> {\n const axe = await loadAxeCore();\n const ctx =\n opts.context ?? (typeof document !== 'undefined' ? document : undefined);\n if (ctx === undefined) {\n throw new Error('runAxe: no context and no global document (jsdom env required).');\n }\n return axe.run(ctx as Element | Document | string, opts.runOptions ?? {});\n}\n\nexport interface ViolationReport {\n violations: AxeViolation[];\n blocking: AxeViolation[];\n summary: string;\n}\n\nexport function reportViolations(\n results: AxeResults,\n opts: { maxImpact?: AuditOptions['maxImpact'] } = {},\n): ViolationReport {\n const maxImpact = opts.maxImpact ?? 'minor';\n const threshold = IMPACT_ORDER[maxImpact];\n const blocking = results.violations.filter((v) => {\n if (!v.impact) return false;\n return IMPACT_ORDER[v.impact] >= threshold;\n });\n const summary = blocking.length === 0\n ? `No a11y violations at impact >= \"${maxImpact}\".`\n : `${blocking.length} a11y violation(s) at impact >= \"${maxImpact}\":\\n` +\n blocking.map((v) => ` - [${v.impact}] ${v.id}: ${v.help} (${v.nodes.length} node(s))`).join('\\n');\n return { violations: results.violations, blocking, summary };\n}\n\nexport function expectNoViolations(\n results: AxeResults,\n expect: { (actual: unknown): { toBe: (expected: unknown) => void } },\n opts: { maxImpact?: AuditOptions['maxImpact'] } = {},\n): void {\n const report = reportViolations(results, opts);\n if (report.blocking.length > 0) {\n throw new Error(report.summary);\n }\n expect(report.blocking.length).toBe(0);\n}\n"],"mappings":";AAOA,IAAM,eAAoE;AAAA,EACxE,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,eAAe,cAAqC;AAClD,MAAI;AACF,UAAM,MAAO,MAAM,OAAO,UAAU;AACpC,WAAO,IAAI,WAAW;AAAA,EACxB,QAAQ;AACN,UAAM,IAAI,MAAM,yEAAyE;AAAA,EAC3F;AACF;AAEA,eAAsB,OAAO,OAAqB,CAAC,GAAwB;AACzE,QAAM,MAAM,MAAM,YAAY;AAC9B,QAAM,MACJ,KAAK,YAAY,OAAO,aAAa,cAAc,WAAW;AAChE,MAAI,QAAQ,QAAW;AACrB,UAAM,IAAI,MAAM,iEAAiE;AAAA,EACnF;AACA,SAAO,IAAI,IAAI,KAAoC,KAAK,cAAc,CAAC,CAAC;AAC1E;AAQO,SAAS,iBACd,SACA,OAAkD,CAAC,GAClC;AACjB,QAAM,YAAY,KAAK,aAAa;AACpC,QAAM,YAAY,aAAa,SAAS;AACxC,QAAM,WAAW,QAAQ,WAAW,OAAO,CAAC,MAAM;AAChD,QAAI,CAAC,EAAE,OAAQ,QAAO;AACtB,WAAO,aAAa,EAAE,MAAM,KAAK;AAAA,EACnC,CAAC;AACD,QAAM,UAAU,SAAS,WAAW,IAChC,oCAAoC,SAAS,OAC7C,GAAG,SAAS,MAAM,oCAAoC,SAAS;AAAA,IAC/D,SAAS,IAAI,CAAC,MAAM,QAAQ,EAAE,MAAM,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,KAAK,EAAE,MAAM,MAAM,WAAW,EAAE,KAAK,IAAI;AACrG,SAAO,EAAE,YAAY,QAAQ,YAAY,UAAU,QAAQ;AAC7D;AAEO,SAAS,mBACd,SACA,QACA,OAAkD,CAAC,GAC7C;AACN,QAAM,SAAS,iBAAiB,SAAS,IAAI;AAC7C,MAAI,OAAO,SAAS,SAAS,GAAG;AAC9B,UAAM,IAAI,MAAM,OAAO,OAAO;AAAA,EAChC;AACA,SAAO,OAAO,SAAS,MAAM,EAAE,KAAK,CAAC;AACvC;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kiwa-test/a11y",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Accessibility (a11y) test adapter for kiwa — axe-core integration for jsdom + Playwright pages",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "cardene",
|
|
8
|
+
"url": "https://github.com/cardene777"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"kiwa",
|
|
12
|
+
"a11y",
|
|
13
|
+
"axe",
|
|
14
|
+
"accessibility",
|
|
15
|
+
"testing",
|
|
16
|
+
"wcag"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/cardene777/kiwa.git",
|
|
21
|
+
"directory": "packages/a11y"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/cardene777/kiwa#readme",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/cardene777/kiwa/issues"
|
|
26
|
+
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.cjs",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"default": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./dist/index.d.cts",
|
|
39
|
+
"default": "./dist/index.cjs"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist",
|
|
45
|
+
"README.md"
|
|
46
|
+
],
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"provenance": true
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=20"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@kiwa-test/spec": "0.1.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"axe-core": "^4",
|
|
59
|
+
"jsdom": "^25",
|
|
60
|
+
"vitest": "^2"
|
|
61
|
+
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"jsdom": {
|
|
64
|
+
"optional": true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/node": "^22.10.0",
|
|
69
|
+
"@vitest/coverage-v8": "^2.1.0",
|
|
70
|
+
"axe-core": "^4.10.2",
|
|
71
|
+
"jsdom": "^25.0.1",
|
|
72
|
+
"tsup": "^8.3.0",
|
|
73
|
+
"typescript": "^5.6.0",
|
|
74
|
+
"vitest": "^2.1.0"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "tsup",
|
|
78
|
+
"test": "node -e \"require('node:fs').rmSync('.vitest-dist',{recursive:true,force:true})\" && tsc -p tsconfig.vitest.json && vitest run .vitest-dist/tests --environment jsdom",
|
|
79
|
+
"test:cov": "node -e \"require('node:fs').rmSync('.vitest-dist',{recursive:true,force:true})\" && tsc -p tsconfig.vitest.json && vitest run .vitest-dist/tests --environment jsdom --coverage --coverage.provider=v8 --coverage.reporter=json --coverage.reporter=json-summary --coverage.reporter=text --coverage.reportsDirectory=coverage --coverage.include='.vitest-dist/src/audit.js' --coverage.include='.vitest-dist/src/index.js' --coverage.exclude='.vitest-dist/tests/**'",
|
|
80
|
+
"typecheck": "tsc --noEmit"
|
|
81
|
+
}
|
|
82
|
+
}
|