aria-ease 2.2.3 → 2.3.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 +387 -30
- package/bin/cli.cjs +475 -0
- package/bin/cli.cjs.map +1 -0
- package/bin/cli.d.ts.map +1 -0
- package/bin/cli.js +452 -0
- package/bin/cli.js.map +1 -0
- package/bin/{audit-cli.ts → cli.ts} +25 -20
- package/bin/configLoader.d.ts +19 -0
- package/bin/configLoader.d.ts.map +1 -0
- package/bin/configLoader.js +155 -0
- package/bin/configLoader.ts +170 -0
- package/bin/contractTestRunnerPlaywright-2LQHVMXT.js +426 -0
- package/bin/contractTestRunnerPlaywright-2LQHVMXT.js.map +1 -0
- package/dist/chunk-4F6O5RKZ.js +207 -0
- package/dist/chunk-4F6O5RKZ.js.map +1 -0
- package/dist/contractTestRunnerPlaywright-FM6MK6DY.js +255 -0
- package/dist/contractTestRunnerPlaywright-FM6MK6DY.js.map +1 -0
- package/dist/index.cjs +13642 -233
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -7
- package/dist/index.d.ts +100 -7
- package/dist/index.js +13189 -7
- package/dist/index.js.map +1 -1
- package/dist/{Types.d-p85gN5m_.d.cts → src/Types.d-BbztRe-S.d.cts} +0 -5
- package/dist/{Types.d-p85gN5m_.d.ts → src/Types.d-BbztRe-S.d.ts} +0 -5
- package/dist/src/accordion/index.cjs +25 -19
- package/dist/src/accordion/index.cjs.map +1 -1
- package/dist/src/accordion/index.d.cts +1 -1
- package/dist/src/accordion/index.d.ts +1 -1
- package/dist/src/accordion/index.js +28 -1
- package/dist/src/accordion/index.js.map +1 -1
- package/dist/src/block/index.cjs +98 -99
- package/dist/src/block/index.cjs.map +1 -1
- package/dist/src/block/index.d.cts +2 -2
- package/dist/src/block/index.d.ts +2 -2
- package/dist/src/block/index.js +41 -2
- package/dist/src/block/index.js.map +1 -1
- package/dist/src/checkbox/index.cjs +30 -13
- package/dist/src/checkbox/index.cjs.map +1 -1
- package/dist/src/checkbox/index.d.cts +1 -1
- package/dist/src/checkbox/index.d.ts +1 -1
- package/dist/src/checkbox/index.js +33 -1
- package/dist/src/checkbox/index.js.map +1 -1
- package/dist/src/chunk-MNMWQWXH.js +117 -0
- package/dist/src/chunk-MNMWQWXH.js.map +1 -0
- package/dist/src/menu/index.cjs +208 -130
- package/dist/src/menu/index.cjs.map +1 -1
- package/dist/src/menu/index.d.cts +9 -3
- package/dist/src/menu/index.d.ts +9 -3
- package/dist/src/menu/index.js +118 -2
- package/dist/src/menu/index.js.map +1 -1
- package/dist/src/radio/index.cjs +29 -16
- package/dist/src/radio/index.cjs.map +1 -1
- package/dist/src/radio/index.d.cts +1 -1
- package/dist/src/radio/index.d.ts +1 -1
- package/dist/src/radio/index.js +32 -1
- package/dist/src/radio/index.js.map +1 -1
- package/dist/src/toggle/index.cjs +26 -16
- package/dist/src/toggle/index.cjs.map +1 -1
- package/dist/src/toggle/index.d.cts +1 -1
- package/dist/src/toggle/index.d.ts +1 -1
- package/dist/src/toggle/index.js +29 -1
- package/dist/src/toggle/index.js.map +1 -1
- package/dist/src/utils/test/chunk-UAS6V5MH.js +203 -0
- package/dist/src/utils/test/chunk-UAS6V5MH.js.map +1 -0
- package/dist/src/utils/test/contractTestRunnerPlaywright-IBC4FHWK.js +251 -0
- package/dist/src/utils/test/contractTestRunnerPlaywright-IBC4FHWK.js.map +1 -0
- package/dist/src/utils/test/contracts/MenuContract.json +343 -0
- package/dist/src/utils/test/index.cjs +13092 -0
- package/dist/src/utils/test/index.cjs.map +1 -0
- package/dist/src/utils/test/index.d.cts +16 -0
- package/dist/src/utils/test/index.d.ts +16 -0
- package/dist/src/utils/test/index.js +12608 -0
- package/dist/src/utils/test/index.js.map +1 -0
- package/package.json +27 -12
- package/bin/audit-cli.cjs +0 -876
- package/bin/audit-cli.cjs.map +0 -1
- package/bin/audit-cli.js +0 -779
- package/bin/audit-cli.js.map +0 -1
- package/dist/chunk-4366LRNM.js +0 -38
- package/dist/chunk-4366LRNM.js.map +0 -1
- package/dist/chunk-5HQ6LLC5.js +0 -21
- package/dist/chunk-5HQ6LLC5.js.map +0 -1
- package/dist/chunk-FBQ5LF2T.js +0 -21
- package/dist/chunk-FBQ5LF2T.js.map +0 -1
- package/dist/chunk-KVTLMA4J.js +0 -58
- package/dist/chunk-KVTLMA4J.js.map +0 -1
- package/dist/chunk-MEA5U2G4.js +0 -24
- package/dist/chunk-MEA5U2G4.js.map +0 -1
- package/dist/chunk-RK3JUAFZ.js +0 -18
- package/dist/chunk-RK3JUAFZ.js.map +0 -1
- package/dist/chunk-RT5IROW4.js +0 -99
- package/dist/chunk-RT5IROW4.js.map +0 -1
- package/dist/src/utils/audit/audit.cjs +0 -239
- package/dist/src/utils/audit/audit.cjs.map +0 -1
- package/dist/src/utils/audit/audit.d.cts +0 -5
- package/dist/src/utils/audit/audit.d.ts +0 -5
- package/dist/src/utils/audit/audit.js +0 -232
- package/dist/src/utils/audit/audit.js.map +0 -1
- /package/bin/{audit-cli.d.cts → cli.d.cts} +0 -0
- /package/bin/{audit-cli.d.ts → cli.d.ts} +0 -0
package/bin/audit-cli.cjs
DELETED
|
@@ -1,876 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
function _array_like_to_array(arr, len) {
|
|
4
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
5
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
6
|
-
return arr2;
|
|
7
|
-
}
|
|
8
|
-
function _array_with_holes(arr) {
|
|
9
|
-
if (Array.isArray(arr)) return arr;
|
|
10
|
-
}
|
|
11
|
-
function _array_without_holes(arr) {
|
|
12
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
13
|
-
}
|
|
14
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
15
|
-
try {
|
|
16
|
-
var info = gen[key](arg);
|
|
17
|
-
var value = info.value;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
reject(error);
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (info.done) {
|
|
23
|
-
resolve(value);
|
|
24
|
-
} else {
|
|
25
|
-
Promise.resolve(value).then(_next, _throw);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _async_to_generator(fn) {
|
|
29
|
-
return function() {
|
|
30
|
-
var self = this, args = arguments;
|
|
31
|
-
return new Promise(function(resolve, reject) {
|
|
32
|
-
var gen = fn.apply(self, args);
|
|
33
|
-
function _next(value) {
|
|
34
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
35
|
-
}
|
|
36
|
-
function _throw(err) {
|
|
37
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
38
|
-
}
|
|
39
|
-
_next(undefined);
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function _instanceof(left, right) {
|
|
44
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
45
|
-
return !!right[Symbol.hasInstance](left);
|
|
46
|
-
} else {
|
|
47
|
-
return left instanceof right;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
51
|
-
if (typeof WeakMap !== "function") return null;
|
|
52
|
-
var cacheBabelInterop = new WeakMap();
|
|
53
|
-
var cacheNodeInterop = new WeakMap();
|
|
54
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
55
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
56
|
-
})(nodeInterop);
|
|
57
|
-
}
|
|
58
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
59
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
60
|
-
return obj;
|
|
61
|
-
}
|
|
62
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
63
|
-
return {
|
|
64
|
-
default: obj
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
68
|
-
if (cache && cache.has(obj)) {
|
|
69
|
-
return cache.get(obj);
|
|
70
|
-
}
|
|
71
|
-
var newObj = {
|
|
72
|
-
__proto__: null
|
|
73
|
-
};
|
|
74
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
75
|
-
for(var key in obj){
|
|
76
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
77
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
78
|
-
if (desc && (desc.get || desc.set)) {
|
|
79
|
-
Object.defineProperty(newObj, key, desc);
|
|
80
|
-
} else {
|
|
81
|
-
newObj[key] = obj[key];
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
newObj.default = obj;
|
|
86
|
-
if (cache) {
|
|
87
|
-
cache.set(obj, newObj);
|
|
88
|
-
}
|
|
89
|
-
return newObj;
|
|
90
|
-
}
|
|
91
|
-
function _iterable_to_array(iter) {
|
|
92
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
93
|
-
}
|
|
94
|
-
function _iterable_to_array_limit(arr, i) {
|
|
95
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
96
|
-
if (_i == null) return;
|
|
97
|
-
var _arr = [];
|
|
98
|
-
var _n = true;
|
|
99
|
-
var _d = false;
|
|
100
|
-
var _s, _e;
|
|
101
|
-
try {
|
|
102
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
103
|
-
_arr.push(_s.value);
|
|
104
|
-
if (i && _arr.length === i) break;
|
|
105
|
-
}
|
|
106
|
-
} catch (err) {
|
|
107
|
-
_d = true;
|
|
108
|
-
_e = err;
|
|
109
|
-
} finally{
|
|
110
|
-
try {
|
|
111
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
112
|
-
} finally{
|
|
113
|
-
if (_d) throw _e;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return _arr;
|
|
117
|
-
}
|
|
118
|
-
function _non_iterable_rest() {
|
|
119
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
120
|
-
}
|
|
121
|
-
function _non_iterable_spread() {
|
|
122
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
123
|
-
}
|
|
124
|
-
function _sliced_to_array(arr, i) {
|
|
125
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
126
|
-
}
|
|
127
|
-
function _to_consumable_array(arr) {
|
|
128
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
129
|
-
}
|
|
130
|
-
function _type_of(obj) {
|
|
131
|
-
"@swc/helpers - typeof";
|
|
132
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
133
|
-
}
|
|
134
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
135
|
-
if (!o) return;
|
|
136
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
137
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
138
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
139
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
140
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
141
|
-
}
|
|
142
|
-
function _ts_generator(thisArg, body) {
|
|
143
|
-
var f, y, t, _ = {
|
|
144
|
-
label: 0,
|
|
145
|
-
sent: function() {
|
|
146
|
-
if (t[0] & 1) throw t[1];
|
|
147
|
-
return t[1];
|
|
148
|
-
},
|
|
149
|
-
trys: [],
|
|
150
|
-
ops: []
|
|
151
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
152
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
153
|
-
return this;
|
|
154
|
-
}), g;
|
|
155
|
-
function verb(n) {
|
|
156
|
-
return function(v) {
|
|
157
|
-
return step([
|
|
158
|
-
n,
|
|
159
|
-
v
|
|
160
|
-
]);
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
function step(op) {
|
|
164
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
165
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
166
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
167
|
-
if (y = 0, t) op = [
|
|
168
|
-
op[0] & 2,
|
|
169
|
-
t.value
|
|
170
|
-
];
|
|
171
|
-
switch(op[0]){
|
|
172
|
-
case 0:
|
|
173
|
-
case 1:
|
|
174
|
-
t = op;
|
|
175
|
-
break;
|
|
176
|
-
case 4:
|
|
177
|
-
_.label++;
|
|
178
|
-
return {
|
|
179
|
-
value: op[1],
|
|
180
|
-
done: false
|
|
181
|
-
};
|
|
182
|
-
case 5:
|
|
183
|
-
_.label++;
|
|
184
|
-
y = op[1];
|
|
185
|
-
op = [
|
|
186
|
-
0
|
|
187
|
-
];
|
|
188
|
-
continue;
|
|
189
|
-
case 7:
|
|
190
|
-
op = _.ops.pop();
|
|
191
|
-
_.trys.pop();
|
|
192
|
-
continue;
|
|
193
|
-
default:
|
|
194
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
195
|
-
_ = 0;
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
198
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
199
|
-
_.label = op[1];
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
203
|
-
_.label = t[1];
|
|
204
|
-
t = op;
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
if (t && _.label < t[2]) {
|
|
208
|
-
_.label = t[2];
|
|
209
|
-
_.ops.push(op);
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
if (t[2]) _.ops.pop();
|
|
213
|
-
_.trys.pop();
|
|
214
|
-
continue;
|
|
215
|
-
}
|
|
216
|
-
op = body.call(thisArg, _);
|
|
217
|
-
} catch (e) {
|
|
218
|
-
op = [
|
|
219
|
-
6,
|
|
220
|
-
e
|
|
221
|
-
];
|
|
222
|
-
y = 0;
|
|
223
|
-
} finally{
|
|
224
|
-
f = t = 0;
|
|
225
|
-
}
|
|
226
|
-
if (op[0] & 5) throw op[1];
|
|
227
|
-
return {
|
|
228
|
-
value: op[0] ? op[1] : void 0,
|
|
229
|
-
done: true
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
var __create = Object.create;
|
|
234
|
-
var __defProp = Object.defineProperty;
|
|
235
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
236
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
237
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
238
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
239
|
-
var __copyProps = function(to, from, except, desc) {
|
|
240
|
-
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
241
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
242
|
-
try {
|
|
243
|
-
var _loop = function() {
|
|
244
|
-
var key = _step.value;
|
|
245
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
246
|
-
get: function() {
|
|
247
|
-
return from[key];
|
|
248
|
-
},
|
|
249
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
250
|
-
});
|
|
251
|
-
};
|
|
252
|
-
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
253
|
-
} catch (err) {
|
|
254
|
-
_didIteratorError = true;
|
|
255
|
-
_iteratorError = err;
|
|
256
|
-
} finally{
|
|
257
|
-
try {
|
|
258
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
259
|
-
_iterator.return();
|
|
260
|
-
}
|
|
261
|
-
} finally{
|
|
262
|
-
if (_didIteratorError) {
|
|
263
|
-
throw _iteratorError;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return to;
|
|
269
|
-
};
|
|
270
|
-
var __toESM = function(mod, isNodeMode, target) {
|
|
271
|
-
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
272
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
273
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
274
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
275
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
276
|
-
value: mod,
|
|
277
|
-
enumerable: true
|
|
278
|
-
}) : target, mod);
|
|
279
|
-
};
|
|
280
|
-
// bin/audit-cli.ts
|
|
281
|
-
var import_commander = require("commander");
|
|
282
|
-
var import_chalk = __toESM(require("chalk"), 1);
|
|
283
|
-
var import_path = __toESM(require("path"), 1);
|
|
284
|
-
var import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
285
|
-
// dist/src/utils/audit/audit.js
|
|
286
|
-
var import_playwright = __toESM(require("@axe-core/playwright"), 1);
|
|
287
|
-
var import_playwright2 = require("playwright");
|
|
288
|
-
function asyncGeneratorStep1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
289
|
-
try {
|
|
290
|
-
var info = gen[key](arg);
|
|
291
|
-
var value = info.value;
|
|
292
|
-
} catch (error) {
|
|
293
|
-
reject(error);
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
if (info.done) {
|
|
297
|
-
resolve(value);
|
|
298
|
-
} else {
|
|
299
|
-
Promise.resolve(value).then(_next, _throw);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
function _async_to_generator1(fn) {
|
|
303
|
-
return function() {
|
|
304
|
-
var self = this, args = arguments;
|
|
305
|
-
return new Promise(function(resolve, reject) {
|
|
306
|
-
var gen = fn.apply(self, args);
|
|
307
|
-
function _next(value) {
|
|
308
|
-
asyncGeneratorStep1(gen, resolve, reject, _next, _throw, "next", value);
|
|
309
|
-
}
|
|
310
|
-
function _throw(err) {
|
|
311
|
-
asyncGeneratorStep1(gen, resolve, reject, _next, _throw, "throw", err);
|
|
312
|
-
}
|
|
313
|
-
_next(void 0);
|
|
314
|
-
});
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
function _instanceof1(left, right) {
|
|
318
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
319
|
-
return !!right[Symbol.hasInstance](left);
|
|
320
|
-
} else {
|
|
321
|
-
return _instanceof(left, right);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
function _ts_generator1(thisArg, body) {
|
|
325
|
-
var f, y, t, _ = {
|
|
326
|
-
label: 0,
|
|
327
|
-
sent: function sent() {
|
|
328
|
-
if (t[0] & 1) throw t[1];
|
|
329
|
-
return t[1];
|
|
330
|
-
},
|
|
331
|
-
trys: [],
|
|
332
|
-
ops: []
|
|
333
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
334
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
335
|
-
return this;
|
|
336
|
-
}), g;
|
|
337
|
-
function verb(n) {
|
|
338
|
-
return function(v) {
|
|
339
|
-
return step([
|
|
340
|
-
n,
|
|
341
|
-
v
|
|
342
|
-
]);
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
function step(op) {
|
|
346
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
347
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
348
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
349
|
-
if (y = 0, t) op = [
|
|
350
|
-
op[0] & 2,
|
|
351
|
-
t.value
|
|
352
|
-
];
|
|
353
|
-
switch(op[0]){
|
|
354
|
-
case 0:
|
|
355
|
-
case 1:
|
|
356
|
-
t = op;
|
|
357
|
-
break;
|
|
358
|
-
case 4:
|
|
359
|
-
_.label++;
|
|
360
|
-
return {
|
|
361
|
-
value: op[1],
|
|
362
|
-
done: false
|
|
363
|
-
};
|
|
364
|
-
case 5:
|
|
365
|
-
_.label++;
|
|
366
|
-
y = op[1];
|
|
367
|
-
op = [
|
|
368
|
-
0
|
|
369
|
-
];
|
|
370
|
-
continue;
|
|
371
|
-
case 7:
|
|
372
|
-
op = _.ops.pop();
|
|
373
|
-
_.trys.pop();
|
|
374
|
-
continue;
|
|
375
|
-
default:
|
|
376
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
377
|
-
_ = 0;
|
|
378
|
-
continue;
|
|
379
|
-
}
|
|
380
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
381
|
-
_.label = op[1];
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
385
|
-
_.label = t[1];
|
|
386
|
-
t = op;
|
|
387
|
-
break;
|
|
388
|
-
}
|
|
389
|
-
if (t && _.label < t[2]) {
|
|
390
|
-
_.label = t[2];
|
|
391
|
-
_.ops.push(op);
|
|
392
|
-
break;
|
|
393
|
-
}
|
|
394
|
-
if (t[2]) _.ops.pop();
|
|
395
|
-
_.trys.pop();
|
|
396
|
-
continue;
|
|
397
|
-
}
|
|
398
|
-
op = body.call(thisArg, _);
|
|
399
|
-
} catch (e) {
|
|
400
|
-
op = [
|
|
401
|
-
6,
|
|
402
|
-
e
|
|
403
|
-
];
|
|
404
|
-
y = 0;
|
|
405
|
-
} finally{
|
|
406
|
-
f = t = 0;
|
|
407
|
-
}
|
|
408
|
-
if (op[0] & 5) throw op[1];
|
|
409
|
-
return {
|
|
410
|
-
value: op[0] ? op[1] : void 0,
|
|
411
|
-
done: true
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
function runAudit(url) {
|
|
416
|
-
return _async_to_generator1(function() {
|
|
417
|
-
var browser, context, page, axe, axeResults, error;
|
|
418
|
-
return _ts_generator1(this, function(_state) {
|
|
419
|
-
switch(_state.label){
|
|
420
|
-
case 0:
|
|
421
|
-
_state.trys.push([
|
|
422
|
-
0,
|
|
423
|
-
6,
|
|
424
|
-
7,
|
|
425
|
-
10
|
|
426
|
-
]);
|
|
427
|
-
return [
|
|
428
|
-
4,
|
|
429
|
-
import_playwright2.chromium.launch({
|
|
430
|
-
headless: true
|
|
431
|
-
})
|
|
432
|
-
];
|
|
433
|
-
case 1:
|
|
434
|
-
browser = _state.sent();
|
|
435
|
-
return [
|
|
436
|
-
4,
|
|
437
|
-
browser.newContext()
|
|
438
|
-
];
|
|
439
|
-
case 2:
|
|
440
|
-
context = _state.sent();
|
|
441
|
-
return [
|
|
442
|
-
4,
|
|
443
|
-
context.newPage()
|
|
444
|
-
];
|
|
445
|
-
case 3:
|
|
446
|
-
page = _state.sent();
|
|
447
|
-
return [
|
|
448
|
-
4,
|
|
449
|
-
page.goto(url, {
|
|
450
|
-
waitUntil: "networkidle"
|
|
451
|
-
})
|
|
452
|
-
];
|
|
453
|
-
case 4:
|
|
454
|
-
_state.sent();
|
|
455
|
-
axe = new import_playwright.default({
|
|
456
|
-
page: page
|
|
457
|
-
});
|
|
458
|
-
return [
|
|
459
|
-
4,
|
|
460
|
-
axe.analyze()
|
|
461
|
-
];
|
|
462
|
-
case 5:
|
|
463
|
-
axeResults = _state.sent();
|
|
464
|
-
return [
|
|
465
|
-
2,
|
|
466
|
-
axeResults
|
|
467
|
-
];
|
|
468
|
-
case 6:
|
|
469
|
-
error = _state.sent();
|
|
470
|
-
if (_instanceof1(error, Error)) {
|
|
471
|
-
if (error.message.includes("Executable doesn't exist")) {
|
|
472
|
-
console.error("\n\u274C Playwright browsers not found!\n");
|
|
473
|
-
console.log("\uD83D\uDCE6 First-time setup required:");
|
|
474
|
-
console.log(" Run: npx playwright install chromium\n");
|
|
475
|
-
console.log("\uD83D\uDCA1 This downloads the browser needed for auditing (~200MB)");
|
|
476
|
-
console.log(" You only need to do this once.\n");
|
|
477
|
-
} else if (error.message.includes("page.goto: net::ERR_CONNECTION_REFUSED")) {
|
|
478
|
-
console.error("\n\u274C Server Not Running!\n");
|
|
479
|
-
console.log(" Make sure your server is running before auditing URL");
|
|
480
|
-
console.log(" Run: npm run dev # or your start command");
|
|
481
|
-
} else if (error.message.includes("page.goto: Protocol error (Page.navigate): Cannot navigate to invalid URL")) {
|
|
482
|
-
console.error("\n\u274C Cannot audit invalid URL\n");
|
|
483
|
-
} else {
|
|
484
|
-
console.error("\u274C Audit error:", error.message);
|
|
485
|
-
console.log(" Make sure you provide a valid URL");
|
|
486
|
-
}
|
|
487
|
-
} else {
|
|
488
|
-
console.error("\u274C Audit error (non-Error):", String(error));
|
|
489
|
-
}
|
|
490
|
-
throw error;
|
|
491
|
-
case 7:
|
|
492
|
-
if (!browser) return [
|
|
493
|
-
3,
|
|
494
|
-
9
|
|
495
|
-
];
|
|
496
|
-
return [
|
|
497
|
-
4,
|
|
498
|
-
browser.close()
|
|
499
|
-
];
|
|
500
|
-
case 8:
|
|
501
|
-
_state.sent();
|
|
502
|
-
_state.label = 9;
|
|
503
|
-
case 9:
|
|
504
|
-
return [
|
|
505
|
-
7
|
|
506
|
-
];
|
|
507
|
-
case 10:
|
|
508
|
-
return [
|
|
509
|
-
2
|
|
510
|
-
];
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
})();
|
|
514
|
-
}
|
|
515
|
-
// src/utils/audit/formatters.ts
|
|
516
|
-
function formatResults(allResults, format) {
|
|
517
|
-
switch(format){
|
|
518
|
-
case "json":
|
|
519
|
-
return JSON.stringify(allResults.flatMap(function(param) {
|
|
520
|
-
var url = param.url, result = param.result;
|
|
521
|
-
return result ? result.violations.flatMap(function(v) {
|
|
522
|
-
return v.nodes.map(function(n) {
|
|
523
|
-
return {
|
|
524
|
-
URL: url,
|
|
525
|
-
Rule: v.id,
|
|
526
|
-
Impact: v.impact,
|
|
527
|
-
Description: v.description,
|
|
528
|
-
Target: n.target,
|
|
529
|
-
FailureSummary: n.failureSummary
|
|
530
|
-
};
|
|
531
|
-
});
|
|
532
|
-
}) : [];
|
|
533
|
-
}), null, 2);
|
|
534
|
-
case "csv":
|
|
535
|
-
return toCSV(allResults);
|
|
536
|
-
case "html":
|
|
537
|
-
return toHTML(allResults);
|
|
538
|
-
default:
|
|
539
|
-
return "";
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
function toCSV(allResults) {
|
|
543
|
-
var rows = [
|
|
544
|
-
"URL,Rule,Impact,Description,Target,FailureSummary"
|
|
545
|
-
];
|
|
546
|
-
allResults.forEach(function(param) {
|
|
547
|
-
var url = param.url, result = param.result;
|
|
548
|
-
if (result) {
|
|
549
|
-
result.violations.forEach(function(v) {
|
|
550
|
-
v.nodes.forEach(function(n) {
|
|
551
|
-
var _n_failureSummary;
|
|
552
|
-
rows.push(escapeCSV(url) + "," + escapeCSV(v.id) + "," + escapeCSV(v.impact) + "," + escapeCSV(v.description) + "," + escapeCSV(Array.isArray(n.target) ? n.target.join("; ") : String(n.target)) + "," + escapeCSV((_n_failureSummary = n.failureSummary) !== null && _n_failureSummary !== void 0 ? _n_failureSummary : ""));
|
|
553
|
-
});
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
});
|
|
557
|
-
return rows.join("\n");
|
|
558
|
-
}
|
|
559
|
-
function escapeCSV(value) {
|
|
560
|
-
var s = String(value !== null && value !== void 0 ? value : "");
|
|
561
|
-
return '"'.concat(s.replace(/"/g, '""'), '"');
|
|
562
|
-
}
|
|
563
|
-
function toHTML(allResults) {
|
|
564
|
-
var summary = {
|
|
565
|
-
pagesAudited: 0,
|
|
566
|
-
pagesWithViolations: 0,
|
|
567
|
-
totalViolations: 0,
|
|
568
|
-
distinctRules: /* @__PURE__ */ new Set(),
|
|
569
|
-
impactCounts: /* @__PURE__ */ new Map()
|
|
570
|
-
};
|
|
571
|
-
allResults.forEach(function(param) {
|
|
572
|
-
var result = param.result;
|
|
573
|
-
if (!result) return;
|
|
574
|
-
summary.pagesAudited++;
|
|
575
|
-
var pageViolations = result.violations.reduce(function(acc, v) {
|
|
576
|
-
var nodesCount = (v.nodes || []).length;
|
|
577
|
-
if (nodesCount > 0) {
|
|
578
|
-
summary.distinctRules.add(v.id);
|
|
579
|
-
summary.totalViolations += nodesCount;
|
|
580
|
-
acc += nodesCount;
|
|
581
|
-
var _v_impact;
|
|
582
|
-
var impact = String((_v_impact = v.impact) !== null && _v_impact !== void 0 ? _v_impact : "unknown");
|
|
583
|
-
summary.impactCounts.set(impact, (summary.impactCounts.get(impact) || 0) + nodesCount);
|
|
584
|
-
}
|
|
585
|
-
return acc;
|
|
586
|
-
}, 0);
|
|
587
|
-
if (pageViolations > 0) summary.pagesWithViolations++;
|
|
588
|
-
});
|
|
589
|
-
var rows = [];
|
|
590
|
-
allResults.forEach(function(param) {
|
|
591
|
-
var url = param.url, result = param.result;
|
|
592
|
-
if (!result) return;
|
|
593
|
-
result.violations.forEach(function(v) {
|
|
594
|
-
v.nodes.forEach(function(n) {
|
|
595
|
-
var target = Array.isArray(n.target) ? n.target.join("; ") : String(n.target);
|
|
596
|
-
var _v_impact, _v_impact1, _v_description, _n_failureSummary;
|
|
597
|
-
rows.push('\n <tr>\n <td class="nowrap">'.concat(escapeHTML(url), '</td>\n <td class="nowrap">').concat(escapeHTML(v.id), '</td>\n <td class="impact ').concat(escapeClass(String((_v_impact = v.impact) !== null && _v_impact !== void 0 ? _v_impact : "unknown")), '">').concat(escapeHTML(String((_v_impact1 = v.impact) !== null && _v_impact1 !== void 0 ? _v_impact1 : "")), '</td>\n <td class="desc">').concat(escapeHTML((_v_description = v.description) !== null && _v_description !== void 0 ? _v_description : ""), '</td>\n <td class="target"><code>').concat(escapeHTML(target), '</code></td>\n <td class="fail">').concat(escapeHTML((_n_failureSummary = n.failureSummary) !== null && _n_failureSummary !== void 0 ? _n_failureSummary : "").split(/\r?\n/).join("<br/>"), "</td>\n </tr>\n "));
|
|
598
|
-
});
|
|
599
|
-
});
|
|
600
|
-
});
|
|
601
|
-
var impactSummary = Array.from(summary.impactCounts.entries()).map(function(param) {
|
|
602
|
-
var _param = _sliced_to_array(param, 2), impact = _param[0], count = _param[1];
|
|
603
|
-
return '<li><strong class="impact '.concat(escapeClass(impact), '">').concat(escapeHTML(impact), "</strong>: ").concat(count, "</li>");
|
|
604
|
-
}).join("\n");
|
|
605
|
-
var d = /* @__PURE__ */ new Date();
|
|
606
|
-
var pad = function(n) {
|
|
607
|
-
return String(n).padStart(2, "0");
|
|
608
|
-
};
|
|
609
|
-
var reportDateTime = "".concat(pad(d.getDate()), "-").concat(pad(d.getMonth() + 1), "-").concat(d.getFullYear(), " ").concat(pad(d.getHours()), ":").concat(pad(d.getMinutes()), ":").concat(pad(d.getSeconds()));
|
|
610
|
-
var headerSummary = '\n <section class="summary">\n <h2>Report summary</h2>\n <ul>\n <li><strong>Date:</strong> '.concat(reportDateTime, "</li>\n <li><strong>Pages audited:</strong> ").concat(summary.pagesAudited, "</li>\n <li><strong>Pages with violations:</strong> ").concat(summary.pagesWithViolations, "</li>\n <li><strong>Total violations:</strong> ").concat(summary.totalViolations, "</li>\n <li><strong>Distinct rules:</strong> ").concat(summary.distinctRules.size, '</li>\n </ul>\n <div class="impact-summary">\n <h3>By impact</h3>\n <ul class="summary-list">\n ').concat(impactSummary || "<li>None</li>", "\n </ul>\n </div>\n </section>\n ").trim();
|
|
611
|
-
var html = '\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8"/>\n <title>Aria-Ease Accessibility Audit Report</title>\n <meta name="viewport" content="width=device-width, initial-scale=1"/>\n <style>\n :root{\n --bg:#ffffff; --muted:#6b7280; --border:#e6e9ee;\n --impact-critical: red; --impact-moderate:#fff4dd; --impact-serious:rgb(255, 123, 0);\n }\n body{font-family:Inter,ui-sans-serif,system-ui,Segoe UI,Roboto,Helvetica,Arial; background:var(--bg); color:#111827; padding:24px; line-height:1.4}\n h1{margin:0 0 8px}\n .summary{background:#f8fafc;border:1px solid var(--border);padding:12px 16px;border-radius:8px;margin-bottom:18px}\n .summary ul{margin:6px 0 0 0;padding:0 18px}\n .impact-summary h3{margin:12px 0 6px}\n table{width:100%; border-collapse:collapse; margin-top:12px}\n th,td{border:1px solid var(--border); padding:10px; text-align:left; vertical-align:top}\n th{background:#f3f4f6; font-weight:600; position:sticky; top:0; z-index:1}\n .nowrap{white-space:nowrap}\n .target code{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace; white-space:pre-wrap}\n .desc{max-width:380px}\n tr:nth-child(even){background:#fbfbfb}\n td.fail{color:#7b1e1e}\n .impact.critical{background:var(--impact-critical); font-weight:600}\n .impact.moderate{background:var(--impact-moderate); font-weight:600}\n .impact.serious{background:var(--impact-serious); font-weight:600}\n @media (max-width:900px){\n .desc{max-width:200px}\n table, thead, tbody, th, td, tr{display:block}\n thead{display:none}\n tr{margin-bottom:10px; border: 1px solid var(--border);}\n td{border:1px solid var(--border); padding:6px}\n td::before{font-weight:600; display:inline-block; width:120px}\n }\n .summary-list strong,\n .summary-list li {\n padding: 2px 4px;\n }\n </style>\n </head>\n <body>\n <h1>Aria-Ease Accessibility Audit Report</h1>\n '.concat(headerSummary, "\n <table>\n <thead>\n <tr>\n <th>URL</th><th>Rule</th><th>Impact</th><th>Description</th><th>Target</th><th>FailureSummary</th>\n </tr>\n </thead>\n <tbody>\n ").concat(rows.join("\n") || '<tr><td colspan="6"><em>No violations found.</em></td></tr>', "\n </tbody>\n </table>\n </body>\n </html>\n ").trim();
|
|
612
|
-
return html;
|
|
613
|
-
}
|
|
614
|
-
function escapeHTML(str) {
|
|
615
|
-
return String(str !== null && str !== void 0 ? str : "").replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
616
|
-
}
|
|
617
|
-
function escapeClass(s) {
|
|
618
|
-
return String(s !== null && s !== void 0 ? s : "").toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
619
|
-
}
|
|
620
|
-
// bin/audit-cli.ts
|
|
621
|
-
var program = new import_commander.Command();
|
|
622
|
-
program.name("aria-ease").description("Run accessibility tests and audits").version("2.1.1");
|
|
623
|
-
program.command("audit").description("Run axe-core powered accessibility audit on webpages").option("-u, --url <url>", "Single URL to audit").option("-f, --format <format>", "Output format for the audit report: json | csv | html", "all").option("-o, --out <path>", "Directory to save the audit report", "./accessibility-reports/audit").action(function(opts) {
|
|
624
|
-
return _async_to_generator(function() {
|
|
625
|
-
var _urls, _opts_audit, _config_audit, _config_audit1, _opts_audit1, configPath, config, _tmp, urls, format, allResults, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, url, result, error, err, hasResults, auditedCount;
|
|
626
|
-
function createReport(format2) {
|
|
627
|
-
return _async_to_generator(function() {
|
|
628
|
-
var _config_audit, formatted, out, d, pad, timestamp, fileName, filePath;
|
|
629
|
-
return _ts_generator(this, function(_state) {
|
|
630
|
-
switch(_state.label){
|
|
631
|
-
case 0:
|
|
632
|
-
formatted = formatResults(allResults, format2);
|
|
633
|
-
out = ((_config_audit = config.audit) === null || _config_audit === void 0 ? void 0 : _config_audit.output) && config.audit.output.out || opts.audit.out;
|
|
634
|
-
return [
|
|
635
|
-
4,
|
|
636
|
-
import_fs_extra.default.ensureDir(out)
|
|
637
|
-
];
|
|
638
|
-
case 1:
|
|
639
|
-
_state.sent();
|
|
640
|
-
d = /* @__PURE__ */ new Date();
|
|
641
|
-
pad = function(n) {
|
|
642
|
-
return String(n).padStart(2, "0");
|
|
643
|
-
};
|
|
644
|
-
timestamp = "".concat(pad(d.getDate()), "-").concat(pad(d.getMonth() + 1), "-").concat(d.getFullYear(), " ").concat(pad(d.getHours()), ":").concat(pad(d.getMinutes()), ":").concat(pad(d.getSeconds()));
|
|
645
|
-
fileName = "ariaease-report-".concat(timestamp, ".").concat(format2);
|
|
646
|
-
filePath = import_path.default.join(out, fileName);
|
|
647
|
-
return [
|
|
648
|
-
4,
|
|
649
|
-
import_fs_extra.default.writeFile(filePath, formatted, "utf-8")
|
|
650
|
-
];
|
|
651
|
-
case 2:
|
|
652
|
-
_state.sent();
|
|
653
|
-
console.log(import_chalk.default.magentaBright("\uD83D\uDCC1 Report saved to ".concat(filePath)));
|
|
654
|
-
return [
|
|
655
|
-
2
|
|
656
|
-
];
|
|
657
|
-
}
|
|
658
|
-
});
|
|
659
|
-
})();
|
|
660
|
-
}
|
|
661
|
-
return _ts_generator(this, function(_state) {
|
|
662
|
-
switch(_state.label){
|
|
663
|
-
case 0:
|
|
664
|
-
console.log(import_chalk.default.cyanBright("\uD83D\uDE80 Starting accessibility audit...\n"));
|
|
665
|
-
configPath = import_path.default.resolve(process.cwd(), "ariaease.config.js");
|
|
666
|
-
config = {};
|
|
667
|
-
return [
|
|
668
|
-
4,
|
|
669
|
-
import_fs_extra.default.pathExists(configPath)
|
|
670
|
-
];
|
|
671
|
-
case 1:
|
|
672
|
-
if (!_state.sent()) return [
|
|
673
|
-
3,
|
|
674
|
-
5
|
|
675
|
-
];
|
|
676
|
-
return [
|
|
677
|
-
4,
|
|
678
|
-
Promise.resolve(configPath).then(function(p) {
|
|
679
|
-
return /*#__PURE__*/ _interop_require_wildcard(require(p));
|
|
680
|
-
})
|
|
681
|
-
];
|
|
682
|
-
case 2:
|
|
683
|
-
_tmp = _state.sent().default;
|
|
684
|
-
if (_tmp) return [
|
|
685
|
-
3,
|
|
686
|
-
4
|
|
687
|
-
];
|
|
688
|
-
return [
|
|
689
|
-
4,
|
|
690
|
-
Promise.resolve(configPath).then(function(p) {
|
|
691
|
-
return /*#__PURE__*/ _interop_require_wildcard(require(p));
|
|
692
|
-
})
|
|
693
|
-
];
|
|
694
|
-
case 3:
|
|
695
|
-
_tmp = _state.sent();
|
|
696
|
-
_state.label = 4;
|
|
697
|
-
case 4:
|
|
698
|
-
config = _tmp;
|
|
699
|
-
console.log(import_chalk.default.green("\u2705 Loaded config from ariaease.config.js\n"));
|
|
700
|
-
return [
|
|
701
|
-
3,
|
|
702
|
-
6
|
|
703
|
-
];
|
|
704
|
-
case 5:
|
|
705
|
-
console.log(import_chalk.default.yellow("\u2139\uFE0F No ariaease.config.js found at project root, using CLI configurations."));
|
|
706
|
-
_state.label = 6;
|
|
707
|
-
case 6:
|
|
708
|
-
urls = [];
|
|
709
|
-
if ((_opts_audit = opts.audit) === null || _opts_audit === void 0 ? void 0 : _opts_audit.url) urls.push(opts.audit.url);
|
|
710
|
-
if (((_config_audit = config.audit) === null || _config_audit === void 0 ? void 0 : _config_audit.urls) && Array.isArray(config.audit.urls)) (_urls = urls).push.apply(_urls, _to_consumable_array(config.audit.urls));
|
|
711
|
-
format = ((_config_audit1 = config.audit) === null || _config_audit1 === void 0 ? void 0 : _config_audit1.output) && config.audit.output.format || ((_opts_audit1 = opts.audit) === null || _opts_audit1 === void 0 ? void 0 : _opts_audit1.format);
|
|
712
|
-
if (![
|
|
713
|
-
"json",
|
|
714
|
-
"csv",
|
|
715
|
-
"html",
|
|
716
|
-
"all"
|
|
717
|
-
].includes(format)) {
|
|
718
|
-
console.log(import_chalk.default.red('\u274C Invalid format. Use "json", "csv", "html" or "all".'));
|
|
719
|
-
process.exit(1);
|
|
720
|
-
}
|
|
721
|
-
if (urls.length === 0) {
|
|
722
|
-
console.log(import_chalk.default.red('\u274C No URLs provided. Use --url option or add "urls" in ariaease.config.js'));
|
|
723
|
-
process.exit(1);
|
|
724
|
-
}
|
|
725
|
-
allResults = [];
|
|
726
|
-
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
727
|
-
_state.label = 7;
|
|
728
|
-
case 7:
|
|
729
|
-
_state.trys.push([
|
|
730
|
-
7,
|
|
731
|
-
14,
|
|
732
|
-
15,
|
|
733
|
-
16
|
|
734
|
-
]);
|
|
735
|
-
_iterator = urls[Symbol.iterator]();
|
|
736
|
-
_state.label = 8;
|
|
737
|
-
case 8:
|
|
738
|
-
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
739
|
-
3,
|
|
740
|
-
13
|
|
741
|
-
];
|
|
742
|
-
url = _step.value;
|
|
743
|
-
console.log(import_chalk.default.yellow("\uD83D\uDD0E Auditing: ".concat(url)));
|
|
744
|
-
_state.label = 9;
|
|
745
|
-
case 9:
|
|
746
|
-
_state.trys.push([
|
|
747
|
-
9,
|
|
748
|
-
11,
|
|
749
|
-
,
|
|
750
|
-
12
|
|
751
|
-
]);
|
|
752
|
-
return [
|
|
753
|
-
4,
|
|
754
|
-
runAudit(url)
|
|
755
|
-
];
|
|
756
|
-
case 10:
|
|
757
|
-
result = _state.sent();
|
|
758
|
-
allResults.push({
|
|
759
|
-
url: url,
|
|
760
|
-
result: result
|
|
761
|
-
});
|
|
762
|
-
console.log(import_chalk.default.green("✅ Completed audit for ".concat(url, "\n")));
|
|
763
|
-
return [
|
|
764
|
-
3,
|
|
765
|
-
12
|
|
766
|
-
];
|
|
767
|
-
case 11:
|
|
768
|
-
error = _state.sent();
|
|
769
|
-
if (_instanceof(error, Error) && error.message) {
|
|
770
|
-
console.log(import_chalk.default.red("❌ Failed auditing ".concat(url, ": ").concat(error.message)));
|
|
771
|
-
}
|
|
772
|
-
return [
|
|
773
|
-
3,
|
|
774
|
-
12
|
|
775
|
-
];
|
|
776
|
-
case 12:
|
|
777
|
-
_iteratorNormalCompletion = true;
|
|
778
|
-
return [
|
|
779
|
-
3,
|
|
780
|
-
8
|
|
781
|
-
];
|
|
782
|
-
case 13:
|
|
783
|
-
return [
|
|
784
|
-
3,
|
|
785
|
-
16
|
|
786
|
-
];
|
|
787
|
-
case 14:
|
|
788
|
-
err = _state.sent();
|
|
789
|
-
_didIteratorError = true;
|
|
790
|
-
_iteratorError = err;
|
|
791
|
-
return [
|
|
792
|
-
3,
|
|
793
|
-
16
|
|
794
|
-
];
|
|
795
|
-
case 15:
|
|
796
|
-
try {
|
|
797
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
798
|
-
_iterator.return();
|
|
799
|
-
}
|
|
800
|
-
} finally{
|
|
801
|
-
if (_didIteratorError) {
|
|
802
|
-
throw _iteratorError;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
return [
|
|
806
|
-
7
|
|
807
|
-
];
|
|
808
|
-
case 16:
|
|
809
|
-
hasResults = allResults.some(function(r) {
|
|
810
|
-
return r.result && r.result.violations && r.result.violations.length > 0;
|
|
811
|
-
});
|
|
812
|
-
if (!hasResults) {
|
|
813
|
-
auditedCount = allResults.filter(function(r) {
|
|
814
|
-
return r.result;
|
|
815
|
-
}).length;
|
|
816
|
-
if (auditedCount === 0) {
|
|
817
|
-
console.log(import_chalk.default.red("\u274C No pages were successfully audited."));
|
|
818
|
-
process.exit(1);
|
|
819
|
-
}
|
|
820
|
-
console.log(import_chalk.default.green("\n\uD83C\uDF89 Great news! No accessibility violations found!"));
|
|
821
|
-
console.log(import_chalk.default.gray(" Audited ".concat(auditedCount, " page").concat(auditedCount > 1 ? "s" : "", " successfully.\n")));
|
|
822
|
-
process.exit(0);
|
|
823
|
-
}
|
|
824
|
-
if (![
|
|
825
|
-
"json",
|
|
826
|
-
"csv",
|
|
827
|
-
"html"
|
|
828
|
-
].includes(format)) return [
|
|
829
|
-
3,
|
|
830
|
-
18
|
|
831
|
-
];
|
|
832
|
-
return [
|
|
833
|
-
4,
|
|
834
|
-
createReport(format)
|
|
835
|
-
];
|
|
836
|
-
case 17:
|
|
837
|
-
_state.sent();
|
|
838
|
-
return [
|
|
839
|
-
3,
|
|
840
|
-
20
|
|
841
|
-
];
|
|
842
|
-
case 18:
|
|
843
|
-
if (!(format === "all")) return [
|
|
844
|
-
3,
|
|
845
|
-
20
|
|
846
|
-
];
|
|
847
|
-
return [
|
|
848
|
-
4,
|
|
849
|
-
Promise.all([
|
|
850
|
-
"json",
|
|
851
|
-
"csv",
|
|
852
|
-
"html"
|
|
853
|
-
].map(function(format2) {
|
|
854
|
-
return createReport(format2);
|
|
855
|
-
}))
|
|
856
|
-
];
|
|
857
|
-
case 19:
|
|
858
|
-
_state.sent();
|
|
859
|
-
_state.label = 20;
|
|
860
|
-
case 20:
|
|
861
|
-
console.log(import_chalk.default.green("\n\uD83C\uDF89 All audits completed."));
|
|
862
|
-
return [
|
|
863
|
-
2
|
|
864
|
-
];
|
|
865
|
-
}
|
|
866
|
-
});
|
|
867
|
-
})();
|
|
868
|
-
});
|
|
869
|
-
program.command("test").description("Run core a11y accessibility standard tests on UI components").option("-f, --format <format>", "Output format for the test report: json | csv | html", "html").option("-o, --out <path>", "Directory to save the test report", "./accessibility-reports/test").action(function() {
|
|
870
|
-
console.log("Coming soon");
|
|
871
|
-
});
|
|
872
|
-
program.command("help").description("Display help information").action(function() {
|
|
873
|
-
program.outputHelp();
|
|
874
|
-
});
|
|
875
|
-
program.parse(process.argv);
|
|
876
|
-
//# sourceMappingURL=audit-cli.cjs.map
|