Skip to content

Commit 21e6ef5

Browse files
authored
Merge branch 'master' into chore-remove-plugin-name
2 parents e180546 + 6f34422 commit 21e6ef5

File tree

5 files changed

+16
-19
lines changed

5 files changed

+16
-19
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: 4 additions & 2 deletions
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": {
@@ -30,5 +29,8 @@
3029
"gh-release": "^3.5.0",
3130
"jest": "^25.1.0"
3231
},
33-
"repository": "https://github.com/sw-yx/netlify-plugin-a11y"
32+
"repository": "https://github.com/sw-yx/netlify-plugin-a11y",
33+
"bugs": {
34+
"url": "https://github.com/sw-yx/netlify-plugin-a11y/issues"
35+
}
3436
}

plugin/index.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,15 @@
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

12-
function netlifyPlugin(conf) {
13-
return {
10+
module.exports = {
1411
async onPostBuild({
15-
pluginConfig: { checkPaths, resultMode = 'error', debugMode },
12+
inputs: { checkPaths, resultMode, debugMode },
1613
constants: { PUBLISH_DIR },
1714
utils: { build }
1815
}) {
19-
if (!checkPaths) {
20-
build.failBuild(
21-
`checkPaths is undefined - please specify some checkPaths`
22-
);
23-
}
2416
const htmlFilePaths = await pluginCore.generateFilePaths({
2517
fileAndDirPaths: checkPaths,
2618
PUBLISH_DIR
@@ -73,7 +65,4 @@ function netlifyPlugin(conf) {
7365
}
7466
}
7567
}
76-
};
7768
}
78-
79-
module.exports = netlifyPlugin;

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)