Skip to content

Commit 86923dc

Browse files
committed
Drop support for user-defined runner
1 parent 0eb8b18 commit 86923dc

File tree

4 files changed

+7
-22
lines changed

4 files changed

+7
-22
lines changed

manifest.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ inputs:
88
- name: failWithIssues
99
default: true
1010
- name: ignoreDirectories
11+
default: []
1112
required: false
12-
- name: runners
13-
default: ['axe']
1413
- name: standard
1514
default: 'WCAG2AA'
1615
- name: testMode

netlify.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212
# # optional config
1313
failWithIssues = false # true by default
1414

15-
standard = 'WCAG2A'
1615
# # Developer only
1716
# debugMode = true # extra logging for plugin developers

plugin/config.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
1-
const AXE = 'axe';
2-
const HTMLCS = 'htmlcs';
3-
const INSTALLED_RUNNERS = [AXE, HTMLCS];
4-
5-
const DEFAULT_RUNNERS = [AXE];
6-
const DEFAULT_STANDARD = 'WCAG2AA';
71
const DEFAULT_CHECK_PATHS = ['/'];
82
const DEFAULT_FAIL_WITH_ISSUES = true;
93
const DEFAULT_IGNORE_DIRECTORIES = [];
104

5+
const PA11Y_DEFAULT_STANDARD = 'WCAG2AA';
6+
const PA11Y_RUNNERS = ['axe'];
117
const PA11Y_USER_AGENT = 'netlify-plugin-a11y';
128

13-
const isInvalidRunner = runners => (
14-
(runners && !Array.isArray(runners) || !runners.every(val => INSTALLED_RUNNERS.includes(val)))
15-
);
16-
179
const getConfiguration = ({
1810
constants: { PUBLISH_DIR },
19-
inputs: { checkPaths, debugMode, ignoreDirectories, failWithIssues, runners, standard }
11+
inputs: { checkPaths, debugMode, ignoreDirectories, failWithIssues, standard }
2012
}) => {
2113

22-
runners = runners || DEFAULT_RUNNERS;
23-
24-
if (isInvalidRunner(runners)) {
25-
throw new Error(`Invalid value for \`runners\` input. Runners must be \`${AXE}\` or \`${HTMLCS}\`.`);
26-
}
2714
return {
2815
absolutePublishDir: PUBLISH_DIR || process.env.PUBLISH_DIR,
2916
checkPaths: checkPaths || DEFAULT_CHECK_PATHS,
3017
debugMode: debugMode || false,
3118
ignoreDirectories: ignoreDirectories || DEFAULT_IGNORE_DIRECTORIES,
3219
failWithIssues: failWithIssues !== undefined ? failWithIssues : DEFAULT_FAIL_WITH_ISSUES,
3320
pa11yOpts: {
34-
runners,
21+
runners: PA11Y_RUNNERS,
3522
userAgent: PA11Y_USER_AGENT,
36-
standard: standard || DEFAULT_STANDARD,
23+
standard: standard || PA11Y_DEFAULT_STANDARD,
3724
}
3825
}
3926
}

plugin/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ module.exports = {
1919
} = getConfiguration({ constants, inputs })
2020
const htmlFilePaths = await pluginCore.generateFilePaths({
2121
absolutePublishDir,
22+
ignoreDirectories,
2223
fileAndDirPaths: checkPaths,
23-
ignoreDirectories: ignoreDirectories,
2424
});
2525
if (debugMode) {
2626
console.log({ htmlFilePaths });

0 commit comments

Comments
 (0)