@instructure/ui-axe-check 11.6.0 → 11.6.1-pr-snapshot-1779894247159
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/CHANGELOG.md +8 -0
- package/{lib/index.js → babel.config.cjs} +14 -15
- package/package.json +4 -6
- package/lib/package.json +0 -1
- package/lib/runAxeCheck.js +0 -70
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.6.1-pr-snapshot-1779894247159](https://github.com/instructure/instructure-ui/compare/v11.6.0...v11.6.1-pr-snapshot-1779894247159) (2026-05-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-axe-check
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [11.6.0](https://github.com/instructure/instructure-ui/compare/v11.5.0...v11.6.0) (2026-02-18)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @instructure/ui-axe-check
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
Object.defineProperty(exports, "runAxeCheck", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () {
|
|
11
|
-
return _runAxeCheck.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
var _runAxeCheck = _interopRequireDefault(require("./runAxeCheck"));
|
|
15
1
|
/*
|
|
16
2
|
* The MIT License (MIT)
|
|
17
3
|
*
|
|
@@ -35,4 +21,17 @@ var _runAxeCheck = _interopRequireDefault(require("./runAxeCheck"));
|
|
|
35
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
36
22
|
* SOFTWARE.
|
|
37
23
|
*/
|
|
38
|
-
|
|
24
|
+
|
|
25
|
+
module.exports = {
|
|
26
|
+
presets: [
|
|
27
|
+
[
|
|
28
|
+
require('@instructure/ui-babel-preset'),
|
|
29
|
+
{
|
|
30
|
+
coverage: Boolean(process.env.COVERAGE),
|
|
31
|
+
esModules: Boolean(process.env.ES_MODULES),
|
|
32
|
+
removeConsole: false,
|
|
33
|
+
transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
]
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-axe-check",
|
|
3
|
-
"version": "11.6.
|
|
3
|
+
"version": "11.6.1-pr-snapshot-1779894247159",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "A UI a11y testing library made by Instructure Inc.",
|
|
5
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
7
|
"module": "./es/index.js",
|
|
7
|
-
"main": "./lib/index.js",
|
|
8
8
|
"types": "./types/index.d.ts",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"axe-core": "^4.10.3"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@instructure/ui-babel-preset": "11.6.
|
|
21
|
+
"@instructure/ui-babel-preset": "11.6.1-pr-snapshot-1779894247159"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
@@ -27,10 +27,8 @@
|
|
|
27
27
|
".": {
|
|
28
28
|
"types": "./types/index.d.ts",
|
|
29
29
|
"import": "./es/index.js",
|
|
30
|
-
"require": "./lib/index.js",
|
|
31
30
|
"default": "./es/index.js"
|
|
32
31
|
},
|
|
33
|
-
"./lib/*": "./lib/*",
|
|
34
32
|
"./es/*": "./es/*",
|
|
35
33
|
"./types/*": "./types/*",
|
|
36
34
|
"./package.json": "./package.json",
|
|
@@ -40,7 +38,7 @@
|
|
|
40
38
|
"lint": "ui-scripts lint",
|
|
41
39
|
"lint:fix": "ui-scripts lint --fix",
|
|
42
40
|
"clean": "ui-scripts clean",
|
|
43
|
-
"build": "ui-scripts build
|
|
41
|
+
"build": "ui-scripts build",
|
|
44
42
|
"build:watch": "ui-scripts build --watch",
|
|
45
43
|
"build:types": "tsc -p tsconfig.build.json"
|
|
46
44
|
}
|
package/lib/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"commonjs"}
|
package/lib/runAxeCheck.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = runAxe;
|
|
8
|
-
var _axeCore = _interopRequireDefault(require("axe-core"));
|
|
9
|
-
/*
|
|
10
|
-
* The MIT License (MIT)
|
|
11
|
-
*
|
|
12
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
13
|
-
*
|
|
14
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
16
|
-
* in the Software without restriction, including without limitation the rights
|
|
17
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
19
|
-
* furnished to do so, subject to the following conditions:
|
|
20
|
-
*
|
|
21
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
22
|
-
* copies or substantial portions of the Software.
|
|
23
|
-
*
|
|
24
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
-
* SOFTWARE.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
async function runAxe(element, options = {}) {
|
|
34
|
-
let result = true;
|
|
35
|
-
const context = {
|
|
36
|
-
include: [element],
|
|
37
|
-
exclude: options.exclude
|
|
38
|
-
};
|
|
39
|
-
const config = {
|
|
40
|
-
runOnly: {
|
|
41
|
-
type: 'tag',
|
|
42
|
-
values: ['wcag2a', 'wcag2aa', 'section508', 'best-practice']
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
try {
|
|
46
|
-
const axeResult = await _axeCore.default.run(context, config);
|
|
47
|
-
|
|
48
|
-
// violations to ignore/filter out
|
|
49
|
-
const ignores = [...(options.ignores || []), 'color-contrast' // because we test color contrast in theme tests
|
|
50
|
-
];
|
|
51
|
-
const violations = (axeResult.violations || []).filter(violation => !ignores.includes(violation.id));
|
|
52
|
-
if (violations.length > 0) {
|
|
53
|
-
result = new Error(formatError(violations));
|
|
54
|
-
}
|
|
55
|
-
} catch (err) {
|
|
56
|
-
result = err;
|
|
57
|
-
}
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
60
|
-
function formatError(violations) {
|
|
61
|
-
let msg = '';
|
|
62
|
-
for (const violation of violations) {
|
|
63
|
-
msg += `[${violation.id}] rule violation:\n`;
|
|
64
|
-
for (const node of violation.nodes) {
|
|
65
|
-
msg += `${node.failureSummary}:\n${node.html}\n`;
|
|
66
|
-
}
|
|
67
|
-
msg += `${violation.help} ${violation.helpUrl}\n`;
|
|
68
|
-
}
|
|
69
|
-
return msg;
|
|
70
|
-
}
|