@axe-core/react 4.8.2-e8094c1.0 → 4.8.3-854eeb3.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/dist/index.d.ts CHANGED
@@ -2,6 +2,11 @@ import axeCore from 'axe-core';
2
2
 
3
3
  declare let React: any;
4
4
  declare let ReactDOM: any;
5
+ /**
6
+ * Log axe violations to console.
7
+ * @param {AxeResults} results
8
+ */
9
+ declare function logToConsole(results: axeCore.AxeResults): void;
5
10
  /**
6
11
  * To support paramater of type runOnly
7
12
  */
@@ -19,8 +24,5 @@ interface ReactSpec extends axeCore.Spec {
19
24
  * @param {Function} _logger Logger implementation
20
25
  */
21
26
  declare function reactAxe(_React: typeof React, _ReactDOM: typeof ReactDOM, _timeout: number, _conf?: ReactSpec, _context?: axeCore.ElementContext, _logger?: (results: axeCore.AxeResults) => void): Promise<void>;
22
- declare namespace reactAxe {
23
- var logToConsole: (results: axeCore.AxeResults) => void;
24
- }
25
27
 
26
- export { reactAxe as default };
28
+ export { reactAxe as default, logToConsole };
package/dist/index.js CHANGED
@@ -29,7 +29,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // index.ts
30
30
  var react_exports = {};
31
31
  __export(react_exports, {
32
- default: () => reactAxe
32
+ default: () => reactAxe,
33
+ logToConsole: () => logToConsole
33
34
  });
34
35
  module.exports = __toCommonJS(react_exports);
35
36
  var import_axe_core = __toESM(require("axe-core"));
@@ -347,7 +348,20 @@ function reactAxe(_React, _ReactDOM, _timeout, _conf = {}, _context, _logger) {
347
348
  }
348
349
  return checkAndReport(document.body, timeout);
349
350
  }
350
- reactAxe.logToConsole = logToConsole;
351
- if (typeof module === "object") {
352
- exports = module.exports = reactAxe;
351
+ // Annotate the CommonJS export names for ESM import in node:
352
+ 0 && (module.exports = {
353
+ logToConsole
354
+ });
355
+
356
+ if (module.exports.default) {
357
+ var ___default_export = module.exports.default;
358
+ var ___export_entries = Object.entries(module.exports);
359
+ module.exports = ___default_export;
360
+ ___export_entries.forEach(([key, value]) => {
361
+ if (module.exports[key]) {
362
+ throw new Error(`Export "${key}" already exists on default export`);
363
+ }
364
+
365
+ module.exports[key] = value;
366
+ });
353
367
  }
package/dist/index.mjs CHANGED
@@ -314,10 +314,7 @@ function reactAxe(_React, _ReactDOM, _timeout, _conf = {}, _context, _logger) {
314
314
  }
315
315
  return checkAndReport(document.body, timeout);
316
316
  }
317
- reactAxe.logToConsole = logToConsole;
318
- if (typeof module === "object") {
319
- exports = module.exports = reactAxe;
320
- }
321
317
  export {
322
- reactAxe as default
318
+ reactAxe as default,
319
+ logToConsole
323
320
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axe-core/react",
3
- "version": "4.8.2-e8094c1.0+e8094c1",
3
+ "version": "4.8.3-854eeb3.0+854eeb3",
4
4
  "description": "Dynamic accessibility analysis for React using axe-core",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -28,7 +28,10 @@
28
28
  "build": "tsup index.ts --dts --format esm,cjs",
29
29
  "prepare": "npm run build",
30
30
  "test": "tsc && npm run test:types && jest",
31
- "test:esm": "node esmTest.mjs",
31
+ "test:export": "npm run test:esm && npm run test:commonjs && npm run test:ts",
32
+ "test:esm": "node test/esmTest.mjs",
33
+ "test:commonjs": "node test/commonjsTest.js",
34
+ "test:ts": "tsc test/tsTest.ts --noEmit --skipLibCheck --esModuleInterop",
32
35
  "test:types": "cd test && tsc"
33
36
  },
34
37
  "keywords": [
@@ -76,7 +79,7 @@
76
79
  "jest-environment-jsdom": "^29.1.2",
77
80
  "react": "17.0.0",
78
81
  "react-dom": "17.0.0",
79
- "react-shadow": "^19.0.3",
82
+ "react-shadow": "^20.4.0",
80
83
  "sinon": "^14.0.1",
81
84
  "ts-node": "^10.9.1",
82
85
  "tsup": "^7.2.0",
@@ -92,5 +95,5 @@
92
95
  "<rootDir>/test/jest.setup.js"
93
96
  ]
94
97
  },
95
- "gitHead": "e8094c18cde388c7c4b7218e1daa22151b8054f0"
98
+ "gitHead": "854eeb31d9b540ed30d602452c1d833600ecad20"
96
99
  }