aria-ease 2.2.2 → 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} +35 -26
- 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 -841
- package/bin/audit-cli.cjs.map +0 -1
- package/bin/audit-cli.js +0 -744
- 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 -234
- 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 -227
- 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
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3
|
-
try {
|
|
4
|
-
var info = gen[key](arg);
|
|
5
|
-
var value = info.value;
|
|
6
|
-
} catch (error) {
|
|
7
|
-
reject(error);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if (info.done) {
|
|
11
|
-
resolve(value);
|
|
12
|
-
} else {
|
|
13
|
-
Promise.resolve(value).then(_next, _throw);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function _async_to_generator(fn) {
|
|
17
|
-
return function() {
|
|
18
|
-
var self = this, args = arguments;
|
|
19
|
-
return new Promise(function(resolve, reject) {
|
|
20
|
-
var gen = fn.apply(self, args);
|
|
21
|
-
function _next(value) {
|
|
22
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
23
|
-
}
|
|
24
|
-
function _throw(err) {
|
|
25
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
26
|
-
}
|
|
27
|
-
_next(undefined);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function _instanceof(left, right) {
|
|
32
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
33
|
-
return !!right[Symbol.hasInstance](left);
|
|
34
|
-
} else {
|
|
35
|
-
return left instanceof right;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function _ts_generator(thisArg, body) {
|
|
39
|
-
var f, y, t, _ = {
|
|
40
|
-
label: 0,
|
|
41
|
-
sent: function() {
|
|
42
|
-
if (t[0] & 1) throw t[1];
|
|
43
|
-
return t[1];
|
|
44
|
-
},
|
|
45
|
-
trys: [],
|
|
46
|
-
ops: []
|
|
47
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
48
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
49
|
-
return this;
|
|
50
|
-
}), g;
|
|
51
|
-
function verb(n) {
|
|
52
|
-
return function(v) {
|
|
53
|
-
return step([
|
|
54
|
-
n,
|
|
55
|
-
v
|
|
56
|
-
]);
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function step(op) {
|
|
60
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
61
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
62
|
-
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;
|
|
63
|
-
if (y = 0, t) op = [
|
|
64
|
-
op[0] & 2,
|
|
65
|
-
t.value
|
|
66
|
-
];
|
|
67
|
-
switch(op[0]){
|
|
68
|
-
case 0:
|
|
69
|
-
case 1:
|
|
70
|
-
t = op;
|
|
71
|
-
break;
|
|
72
|
-
case 4:
|
|
73
|
-
_.label++;
|
|
74
|
-
return {
|
|
75
|
-
value: op[1],
|
|
76
|
-
done: false
|
|
77
|
-
};
|
|
78
|
-
case 5:
|
|
79
|
-
_.label++;
|
|
80
|
-
y = op[1];
|
|
81
|
-
op = [
|
|
82
|
-
0
|
|
83
|
-
];
|
|
84
|
-
continue;
|
|
85
|
-
case 7:
|
|
86
|
-
op = _.ops.pop();
|
|
87
|
-
_.trys.pop();
|
|
88
|
-
continue;
|
|
89
|
-
default:
|
|
90
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
91
|
-
_ = 0;
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
95
|
-
_.label = op[1];
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
99
|
-
_.label = t[1];
|
|
100
|
-
t = op;
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
if (t && _.label < t[2]) {
|
|
104
|
-
_.label = t[2];
|
|
105
|
-
_.ops.push(op);
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
if (t[2]) _.ops.pop();
|
|
109
|
-
_.trys.pop();
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
op = body.call(thisArg, _);
|
|
113
|
-
} catch (e) {
|
|
114
|
-
op = [
|
|
115
|
-
6,
|
|
116
|
-
e
|
|
117
|
-
];
|
|
118
|
-
y = 0;
|
|
119
|
-
} finally{
|
|
120
|
-
f = t = 0;
|
|
121
|
-
}
|
|
122
|
-
if (op[0] & 5) throw op[1];
|
|
123
|
-
return {
|
|
124
|
-
value: op[0] ? op[1] : void 0,
|
|
125
|
-
done: true
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
var AxeBuilder = require('@axe-core/playwright');
|
|
130
|
-
var playwright = require('playwright');
|
|
131
|
-
function _interopDefault(e) {
|
|
132
|
-
return e && e.__esModule ? e : {
|
|
133
|
-
default: e
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
var AxeBuilder__default = /*#__PURE__*/ _interopDefault(AxeBuilder);
|
|
137
|
-
// src/utils/audit/audit.ts
|
|
138
|
-
function runAudit(url) {
|
|
139
|
-
return _async_to_generator(function() {
|
|
140
|
-
var browser, context, page, axe, axeResults, error;
|
|
141
|
-
return _ts_generator(this, function(_state) {
|
|
142
|
-
switch(_state.label){
|
|
143
|
-
case 0:
|
|
144
|
-
_state.trys.push([
|
|
145
|
-
0,
|
|
146
|
-
6,
|
|
147
|
-
7,
|
|
148
|
-
10
|
|
149
|
-
]);
|
|
150
|
-
return [
|
|
151
|
-
4,
|
|
152
|
-
playwright.chromium.launch({
|
|
153
|
-
headless: true
|
|
154
|
-
})
|
|
155
|
-
];
|
|
156
|
-
case 1:
|
|
157
|
-
browser = _state.sent();
|
|
158
|
-
return [
|
|
159
|
-
4,
|
|
160
|
-
browser.newContext()
|
|
161
|
-
];
|
|
162
|
-
case 2:
|
|
163
|
-
context = _state.sent();
|
|
164
|
-
return [
|
|
165
|
-
4,
|
|
166
|
-
context.newPage()
|
|
167
|
-
];
|
|
168
|
-
case 3:
|
|
169
|
-
page = _state.sent();
|
|
170
|
-
return [
|
|
171
|
-
4,
|
|
172
|
-
page.goto(url, {
|
|
173
|
-
waitUntil: "networkidle"
|
|
174
|
-
})
|
|
175
|
-
];
|
|
176
|
-
case 4:
|
|
177
|
-
_state.sent();
|
|
178
|
-
axe = new AxeBuilder__default.default({
|
|
179
|
-
page: page
|
|
180
|
-
});
|
|
181
|
-
return [
|
|
182
|
-
4,
|
|
183
|
-
axe.analyze()
|
|
184
|
-
];
|
|
185
|
-
case 5:
|
|
186
|
-
axeResults = _state.sent();
|
|
187
|
-
return [
|
|
188
|
-
2,
|
|
189
|
-
axeResults
|
|
190
|
-
];
|
|
191
|
-
case 6:
|
|
192
|
-
error = _state.sent();
|
|
193
|
-
if (_instanceof(error, Error)) {
|
|
194
|
-
if (error.message.includes("Executable doesn't exist")) {
|
|
195
|
-
console.error("\n\u274C Playwright browsers not found!\n");
|
|
196
|
-
console.log("\uD83D\uDCE6 First-time setup required:");
|
|
197
|
-
console.log(" Run: npx playwright install chromium\n");
|
|
198
|
-
console.log("\uD83D\uDCA1 This downloads the browser needed for auditing (~200MB)");
|
|
199
|
-
console.log(" You only need to do this once.\n");
|
|
200
|
-
} else if (error.message.includes("page.goto: net::ERR_CONNECTION_REFUSED")) {
|
|
201
|
-
console.error("\n\u274C Server Not Running!\n");
|
|
202
|
-
console.log(" Make sure your server is running before auditing URL");
|
|
203
|
-
console.log(" Run: npm run dev # or your start command");
|
|
204
|
-
}
|
|
205
|
-
process.exit(1);
|
|
206
|
-
}
|
|
207
|
-
console.error("Error during audit:", error);
|
|
208
|
-
throw error;
|
|
209
|
-
case 7:
|
|
210
|
-
if (!browser) return [
|
|
211
|
-
3,
|
|
212
|
-
9
|
|
213
|
-
];
|
|
214
|
-
return [
|
|
215
|
-
4,
|
|
216
|
-
browser.close()
|
|
217
|
-
];
|
|
218
|
-
case 8:
|
|
219
|
-
_state.sent();
|
|
220
|
-
_state.label = 9;
|
|
221
|
-
case 9:
|
|
222
|
-
return [
|
|
223
|
-
7
|
|
224
|
-
];
|
|
225
|
-
case 10:
|
|
226
|
-
return [
|
|
227
|
-
2
|
|
228
|
-
];
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
})();
|
|
232
|
-
}
|
|
233
|
-
exports.runAudit = runAudit; //# sourceMappingURL=audit.cjs.map
|
|
234
|
-
//# sourceMappingURL=audit.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/macx/aria-ease/package/dist/src/utils/audit/audit.cjs"],"names":[],"mappings":"AAAA","sourcesContent":["'use strict';\n\nvar AxeBuilder = require('@axe-core/playwright');\nvar playwright = require('playwright');\n\nfunction _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }\n\nvar AxeBuilder__default = /*#__PURE__*/_interopDefault(AxeBuilder);\n\n// src/utils/audit/audit.ts\nasync function runAudit() {\n const browser = await playwright.chromium.launch({ headless: true });\n const context = await browser.newContext();\n const page = await context.newPage();\n await page.goto(\"http://localhost:5173/\");\n try {\n const axe = new AxeBuilder__default.default({ page });\n const axeResults = await axe.analyze();\n console.log(\"--- AXE-CORE RESULTS ---\");\n console.log(axeResults);\n const snapshot = await page.accessibility.snapshot();\n console.log(\"\\n--- PLAYWRIGHT SNAPSHOT ---\");\n console.log(snapshot);\n } catch (error) {\n console.log(error);\n }\n await browser.close();\n}\n\nexports.runAudit = runAudit;\n//# sourceMappingURL=audit.cjs.map\n"]}
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
-
try {
|
|
3
|
-
var info = gen[key](arg);
|
|
4
|
-
var value = info.value;
|
|
5
|
-
} catch (error) {
|
|
6
|
-
reject(error);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (info.done) {
|
|
10
|
-
resolve(value);
|
|
11
|
-
} else {
|
|
12
|
-
Promise.resolve(value).then(_next, _throw);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _async_to_generator(fn) {
|
|
16
|
-
return function() {
|
|
17
|
-
var self = this, args = arguments;
|
|
18
|
-
return new Promise(function(resolve, reject) {
|
|
19
|
-
var gen = fn.apply(self, args);
|
|
20
|
-
function _next(value) {
|
|
21
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
-
}
|
|
23
|
-
function _throw(err) {
|
|
24
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
-
}
|
|
26
|
-
_next(undefined);
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function _instanceof(left, right) {
|
|
31
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
32
|
-
return !!right[Symbol.hasInstance](left);
|
|
33
|
-
} else {
|
|
34
|
-
return left instanceof right;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function _ts_generator(thisArg, body) {
|
|
38
|
-
var f, y, t, _ = {
|
|
39
|
-
label: 0,
|
|
40
|
-
sent: function() {
|
|
41
|
-
if (t[0] & 1) throw t[1];
|
|
42
|
-
return t[1];
|
|
43
|
-
},
|
|
44
|
-
trys: [],
|
|
45
|
-
ops: []
|
|
46
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
47
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
48
|
-
return this;
|
|
49
|
-
}), g;
|
|
50
|
-
function verb(n) {
|
|
51
|
-
return function(v) {
|
|
52
|
-
return step([
|
|
53
|
-
n,
|
|
54
|
-
v
|
|
55
|
-
]);
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function step(op) {
|
|
59
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
60
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
61
|
-
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;
|
|
62
|
-
if (y = 0, t) op = [
|
|
63
|
-
op[0] & 2,
|
|
64
|
-
t.value
|
|
65
|
-
];
|
|
66
|
-
switch(op[0]){
|
|
67
|
-
case 0:
|
|
68
|
-
case 1:
|
|
69
|
-
t = op;
|
|
70
|
-
break;
|
|
71
|
-
case 4:
|
|
72
|
-
_.label++;
|
|
73
|
-
return {
|
|
74
|
-
value: op[1],
|
|
75
|
-
done: false
|
|
76
|
-
};
|
|
77
|
-
case 5:
|
|
78
|
-
_.label++;
|
|
79
|
-
y = op[1];
|
|
80
|
-
op = [
|
|
81
|
-
0
|
|
82
|
-
];
|
|
83
|
-
continue;
|
|
84
|
-
case 7:
|
|
85
|
-
op = _.ops.pop();
|
|
86
|
-
_.trys.pop();
|
|
87
|
-
continue;
|
|
88
|
-
default:
|
|
89
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
90
|
-
_ = 0;
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
94
|
-
_.label = op[1];
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
98
|
-
_.label = t[1];
|
|
99
|
-
t = op;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
if (t && _.label < t[2]) {
|
|
103
|
-
_.label = t[2];
|
|
104
|
-
_.ops.push(op);
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
if (t[2]) _.ops.pop();
|
|
108
|
-
_.trys.pop();
|
|
109
|
-
continue;
|
|
110
|
-
}
|
|
111
|
-
op = body.call(thisArg, _);
|
|
112
|
-
} catch (e) {
|
|
113
|
-
op = [
|
|
114
|
-
6,
|
|
115
|
-
e
|
|
116
|
-
];
|
|
117
|
-
y = 0;
|
|
118
|
-
} finally{
|
|
119
|
-
f = t = 0;
|
|
120
|
-
}
|
|
121
|
-
if (op[0] & 5) throw op[1];
|
|
122
|
-
return {
|
|
123
|
-
value: op[0] ? op[1] : void 0,
|
|
124
|
-
done: true
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
import AxeBuilder from '@axe-core/playwright';
|
|
129
|
-
import { chromium } from 'playwright';
|
|
130
|
-
// src/utils/audit/audit.ts
|
|
131
|
-
function runAudit(url) {
|
|
132
|
-
return _async_to_generator(function() {
|
|
133
|
-
var browser, context, page, axe, axeResults, error;
|
|
134
|
-
return _ts_generator(this, function(_state) {
|
|
135
|
-
switch(_state.label){
|
|
136
|
-
case 0:
|
|
137
|
-
_state.trys.push([
|
|
138
|
-
0,
|
|
139
|
-
6,
|
|
140
|
-
7,
|
|
141
|
-
10
|
|
142
|
-
]);
|
|
143
|
-
return [
|
|
144
|
-
4,
|
|
145
|
-
chromium.launch({
|
|
146
|
-
headless: true
|
|
147
|
-
})
|
|
148
|
-
];
|
|
149
|
-
case 1:
|
|
150
|
-
browser = _state.sent();
|
|
151
|
-
return [
|
|
152
|
-
4,
|
|
153
|
-
browser.newContext()
|
|
154
|
-
];
|
|
155
|
-
case 2:
|
|
156
|
-
context = _state.sent();
|
|
157
|
-
return [
|
|
158
|
-
4,
|
|
159
|
-
context.newPage()
|
|
160
|
-
];
|
|
161
|
-
case 3:
|
|
162
|
-
page = _state.sent();
|
|
163
|
-
return [
|
|
164
|
-
4,
|
|
165
|
-
page.goto(url, {
|
|
166
|
-
waitUntil: "networkidle"
|
|
167
|
-
})
|
|
168
|
-
];
|
|
169
|
-
case 4:
|
|
170
|
-
_state.sent();
|
|
171
|
-
axe = new AxeBuilder({
|
|
172
|
-
page: page
|
|
173
|
-
});
|
|
174
|
-
return [
|
|
175
|
-
4,
|
|
176
|
-
axe.analyze()
|
|
177
|
-
];
|
|
178
|
-
case 5:
|
|
179
|
-
axeResults = _state.sent();
|
|
180
|
-
return [
|
|
181
|
-
2,
|
|
182
|
-
axeResults
|
|
183
|
-
];
|
|
184
|
-
case 6:
|
|
185
|
-
error = _state.sent();
|
|
186
|
-
if (_instanceof(error, Error)) {
|
|
187
|
-
if (error.message.includes("Executable doesn't exist")) {
|
|
188
|
-
console.error("\n\u274C Playwright browsers not found!\n");
|
|
189
|
-
console.log("\uD83D\uDCE6 First-time setup required:");
|
|
190
|
-
console.log(" Run: npx playwright install chromium\n");
|
|
191
|
-
console.log("\uD83D\uDCA1 This downloads the browser needed for auditing (~200MB)");
|
|
192
|
-
console.log(" You only need to do this once.\n");
|
|
193
|
-
} else if (error.message.includes("page.goto: net::ERR_CONNECTION_REFUSED")) {
|
|
194
|
-
console.error("\n\u274C Server Not Running!\n");
|
|
195
|
-
console.log(" Make sure your server is running before auditing URL");
|
|
196
|
-
console.log(" Run: npm run dev # or your start command");
|
|
197
|
-
}
|
|
198
|
-
process.exit(1);
|
|
199
|
-
}
|
|
200
|
-
console.error("Error during audit:", error);
|
|
201
|
-
throw error;
|
|
202
|
-
case 7:
|
|
203
|
-
if (!browser) return [
|
|
204
|
-
3,
|
|
205
|
-
9
|
|
206
|
-
];
|
|
207
|
-
return [
|
|
208
|
-
4,
|
|
209
|
-
browser.close()
|
|
210
|
-
];
|
|
211
|
-
case 8:
|
|
212
|
-
_state.sent();
|
|
213
|
-
_state.label = 9;
|
|
214
|
-
case 9:
|
|
215
|
-
return [
|
|
216
|
-
7
|
|
217
|
-
];
|
|
218
|
-
case 10:
|
|
219
|
-
return [
|
|
220
|
-
2
|
|
221
|
-
];
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
})();
|
|
225
|
-
}
|
|
226
|
-
export { runAudit }; //# sourceMappingURL=audit.js.map
|
|
227
|
-
//# sourceMappingURL=audit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/macx/aria-ease/package/dist/src/utils/audit/audit.js","../../../../src/utils/audit/audit.ts"],"names":[],"mappings":"","sourcesContent":["import AxeBuilder from '@axe-core/playwright';\nimport { chromium } from 'playwright';\n\n// src/utils/audit/audit.ts\nasync function runAudit() {\n const browser = await chromium.launch({ headless: true });\n const context = await browser.newContext();\n const page = await context.newPage();\n await page.goto(\"http://localhost:5173/\");\n try {\n const axe = new AxeBuilder({ page });\n const axeResults = await axe.analyze();\n console.log(\"--- AXE-CORE RESULTS ---\");\n console.log(axeResults);\n const snapshot = await page.accessibility.snapshot();\n console.log(\"\\n--- PLAYWRIGHT SNAPSHOT ---\");\n console.log(snapshot);\n } catch (error) {\n console.log(error);\n }\n await browser.close();\n}\n\nexport { runAudit };\n//# sourceMappingURL=audit.js.map\n","import AxeBuilder from \"@axe-core/playwright\";\nimport { chromium } from \"playwright\";\nimport { AxeResults } from \"Types\";\n\nexport async function runAudit(url: string) {\n let browser;\n\n try{ \n browser = await chromium.launch({ headless: true });\n const context = await browser.newContext();\n const page = await context.newPage();\n await page.goto(url, { waitUntil: 'networkidle' });\n const axe = new AxeBuilder({ page });\n const axeResults: AxeResults = await axe.analyze();\n return axeResults;\n } catch(error: unknown) {\n if (error instanceof Error) {\n if (error.message.includes(\"Executable doesn't exist\")) {\n console.error('\\n❌ Playwright browsers not found!\\n');\n console.log('📦 First-time setup required:');\n console.log(' Run: npx playwright install chromium\\n');\n console.log('💡 This downloads the browser needed for auditing (~200MB)');\n console.log(' You only need to do this once.\\n');\n } else if(error.message.includes(\"page.goto: net::ERR_CONNECTION_REFUSED\")) {\n console.error('\\n❌ Server Not Running!\\n');\n console.log(' Make sure your server is running before auditing URL')\n console.log(' Run: npm run dev # or your start command');\n }\n process.exit(1);\n }\n console.error('Error during audit:', error);\n throw error;\n } finally {\n if(browser) await browser.close(); \n }\n}"]}
|
|
File without changes
|
|
File without changes
|