aria-ease 2.8.2 → 2.8.4

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.
@@ -0,0 +1,47 @@
1
+ import "./chunk-JSBRDJBE.js";
2
+
3
+ // src/utils/audit/src/audit/audit.js
4
+ import AxeBuilder from "@axe-core/playwright";
5
+ import { chromium } from "playwright";
6
+ async function runAudit(url, options) {
7
+ let browser;
8
+ const timeout = options?.timeout || 6e4;
9
+ const waitUntil = options?.waitUntil || "domcontentloaded";
10
+ try {
11
+ browser = await chromium.launch({ headless: true });
12
+ const context = await browser.newContext();
13
+ const page = await context.newPage();
14
+ await page.goto(url, { waitUntil, timeout });
15
+ const axe = new AxeBuilder({ page });
16
+ const axeResults = await axe.analyze();
17
+ return axeResults;
18
+ } catch (error) {
19
+ if (error instanceof Error) {
20
+ if (error.message.includes("Executable doesn't exist")) {
21
+ console.error("\n\u274C Playwright browsers not found!\n");
22
+ console.log("\u{1F4E6} First-time setup required:");
23
+ console.log(" Run: npx playwright install chromium\n");
24
+ console.log("\u{1F4A1} This downloads the browser needed for auditing (~200MB)");
25
+ console.log(" You only need to do this once.\n");
26
+ } else if (error.message.includes("page.goto: net::ERR_CONNECTION_REFUSED")) {
27
+ console.error("\n\u274C Server Not Running!\n");
28
+ console.log(" Make sure your server is running before auditing URL");
29
+ console.log(" Run: npm run dev # or your start command");
30
+ } else if (error.message.includes("page.goto: Protocol error (Page.navigate): Cannot navigate to invalid URL")) {
31
+ console.error("\n\u274C Cannot audit invalid URL\n");
32
+ } else {
33
+ console.error("\u274C Audit error:", error.message);
34
+ console.log(" Make sure you provide a valid URL");
35
+ }
36
+ } else {
37
+ console.error("\u274C Audit error (non-Error):", String(error));
38
+ }
39
+ throw error;
40
+ } finally {
41
+ if (browser)
42
+ await browser.close();
43
+ }
44
+ }
45
+ export {
46
+ runAudit
47
+ };
@@ -1,35 +1,3 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __commonJS = (cb, mod) => function __require2() {
14
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
- };
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") {
18
- for (let key of __getOwnPropNames(from))
19
- if (!__hasOwnProp.call(to, key) && key !== except)
20
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
- mod
31
- ));
32
-
33
1
  // src/utils/test/contract/contract.json
34
2
  var contract_default = {
35
3
  menu: {
@@ -205,9 +173,6 @@ ${"\u2550".repeat(60)}`);
205
173
  };
206
174
 
207
175
  export {
208
- __require,
209
- __commonJS,
210
- __toESM,
211
176
  contract_default,
212
177
  ContractReporter
213
178
  };
@@ -0,0 +1,30 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ export {
28
+ __commonJS,
29
+ __toESM
30
+ };