Skip to content

Commit c4d1316

Browse files
authored
Merge branch 'master' into chore/comment-test-mode
2 parents 197e45b + 184b994 commit c4d1316

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

manifest.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
name: netlify-plugin-axe
1+
name: netlify-plugin-a11y
22
inputs:
33
- name: checkPaths
4+
required: true
45
- name: resultMode
6+
default: error
57
- name: debugMode
6-
# - name: testMode
8+
default: false
9+
- name: testMode
10+
default: false

package-lock.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"main": "plugin/index.js",
66
"dependencies": {
77
"chalk": "^3.0.0",
8-
"make-dir": "^3.0.0",
98
"pa11y": "^5.3.0"
109
},
1110
"scripts": {

plugin/index.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,17 @@
44
// } = require('process');
55

66
const chalk = require('chalk');
7-
const makeDir = require('make-dir');
8-
const pa11y = require('pa11y');
97
const path = require('path');
108
const pluginCore = require('./pluginCore');
119

1210
function netlifyPlugin(conf) {
1311
return {
1412
name: 'netlify-plugin-a11y',
1513
async onPostBuild({
16-
pluginConfig: { checkPaths, resultMode = 'error', debugMode },
14+
pluginConfig: { checkPaths, resultMode, debugMode },
1715
constants: { PUBLISH_DIR },
1816
utils: { build }
1917
}) {
20-
if (!checkPaths) {
21-
build.failBuild(
22-
`checkPaths is undefined - please specify some checkPaths`
23-
);
24-
}
2518
const htmlFilePaths = await pluginCore.generateFilePaths({
2619
fileAndDirPaths: checkPaths,
2720
PUBLISH_DIR

plugin/pluginCore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ exports.generateFilePaths = async function({
3434
}) {
3535
let htmlFilePaths = [];
3636
for (fileAndDirPath of fileAndDirPaths) {
37-
const fullDirPath = path.join(process.cwd(), PUBLISH_DIR, fileAndDirPath);
37+
const fullDirPath = path.join(PUBLISH_DIR, fileAndDirPath);
3838
if (fs.statSync(fullDirPath).isDirectory()) {
3939
let subPaths = await walk(fullDirPath);
4040
htmlFilePaths = htmlFilePaths.concat(subPaths);

0 commit comments

Comments
 (0)