Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
darekkay committed Jan 6, 2024
1 parent e274c23 commit 273a5c5
Show file tree
Hide file tree
Showing 9 changed files with 1,534 additions and 2,077 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

- :boom: Drop Node 16 support.
- :rocket: Disable `html-validate` "wcag/h63" rule by default as [it reports errors for accessible tables](https://www.w3.org/WAI/tutorials/tables/one-header/).
- :hammer: Update dependencies.
- :hammer: Switch from Yarn to npm.
- :hammer: Update GitHub Action versions.

Expand Down
3,546 changes: 1,501 additions & 2,045 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Expand Up @@ -10,29 +10,29 @@
"url": "https://github.com/darekkay/evaluatory/issues"
},
"dependencies": {
"@darekkay/logger": "3.0.3",
"axe-core": "^4.7.2",
"axios": "1.4.0",
"dayjs": "1.11.7",
"fast-xml-parser": "4.2.5",
"fs-extra": "11.1.1",
"highlight.js": "11.8.0",
"html-validate": "7.18.0",
"@darekkay/logger": "4.0.0",
"axe-core": "^4.8.3",
"axios": "1.6.5",
"dayjs": "1.11.10",
"fast-xml-parser": "4.3.2",
"fs-extra": "11.2.0",
"highlight.js": "11.9.0",
"html-validate": "8.8.0",
"json5": "2.2.3",
"kleur": "4.1.5",
"lodash": "4.17.21",
"nunjucks": "3.2.4",
"open": "8.4.2",
"playwright": "1.34.3",
"playwright": "1.40.1",
"sywac": "1.3.0",
"tiny-async-pool": "1.3.0"
},
"devDependencies": {
"@darekkay/gulp": "3.0.1",
"@darekkay/scripts": "2.6.2",
"@darekkay/styles": "4.3.0",
"@darekkay/gulp": "4.0.0",
"@darekkay/scripts": "3.0.1",
"@darekkay/styles": "5.1.0",
"http-server": "14.1.1",
"rimraf": "5.0.1"
"rimraf": "5.0.5"
},
"engines": {
"node": ">=18.0.0"
Expand Down
14 changes: 7 additions & 7 deletions src/index.js
Expand Up @@ -55,7 +55,7 @@ const executeForSingleUrl = async ({ config, modules, url, ...parameters }) => {
await renderToFile(
join(__dirname, "templates", "module.njk"),
{ url, modules, results: htmlParts },
join(config.output, `${parameters.index}.html`)
join(config.output, `${parameters.index}.html`),
);
} catch (error) {
logger.error(error.message || error);
Expand Down Expand Up @@ -87,7 +87,7 @@ const execute = async (config) => {
.filter(Boolean);

logger.info(
`Evaluating ${config.urls.length} URL${config.urls.length > 1 ? "s" : ""}`
`Evaluating ${config.urls.length} URL${config.urls.length > 1 ? "s" : ""}`,
);
logger.info("Clearing output folder:", resolve(join(config.output)));
await emptyDir(config.output);
Expand All @@ -105,9 +105,9 @@ const execute = async (config) => {
modules,
},
],
[]
[],
),
executeForSingleUrl
executeForSingleUrl,
);

// group results by fail/success
Expand All @@ -121,12 +121,12 @@ const execute = async (config) => {
}
return accumulator;
},
{ fail: [], success: [] }
{ fail: [], success: [] },
);

const totalIssueCount = results.reduce(
(accumulator, result) => accumulator + result.issueCount,
0
0,
);

// create an index file
Expand All @@ -138,7 +138,7 @@ const execute = async (config) => {
totalIssueCount,
lastGenerated: dayjs().format("YYYY-MM-DD HH:mm:ss"),
},
join(config.output, "index.html")
join(config.output, "index.html"),
);

// copy static assets
Expand Down
10 changes: 5 additions & 5 deletions src/modules/axe-core/index.js
Expand Up @@ -45,7 +45,7 @@ module.exports = async ({ page, moduleName, index, config }) => {
({ moduleConfig }) => {
return window.axe.run(window.document, moduleConfig);
},
{ moduleConfig: config.modulesConfig[moduleName] }
{ moduleConfig: config.modulesConfig[moduleName] },
);

violationsPerDevice[deviceName] = axeResults.violations;
Expand All @@ -60,7 +60,7 @@ module.exports = async ({ page, moduleName, index, config }) => {
deviceViolations.forEach((violation) => {
const accumulatedViolation = _.find(
accumulator,
(value) => value.id === violation.id
(value) => value.id === violation.id,
);
if (!accumulatedViolation) {
violation.breakpoints = [deviceName];
Expand All @@ -74,7 +74,7 @@ module.exports = async ({ page, moduleName, index, config }) => {
!_.some(
accumulatedViolation.nodes,
(accumulatedNode) =>
node.target.join("") === accumulatedNode.target.join("")
node.target.join("") === accumulatedNode.target.join(""),
)
) {
accumulatedViolation.nodes.push(node);
Expand All @@ -84,12 +84,12 @@ module.exports = async ({ page, moduleName, index, config }) => {
});
return accumulator;
},
[]
[],
);

const issueCount = violations.reduce(
(accumulator, violation) => accumulator + violation.nodes.length,
0
0,
);

const jsonFileName = `${index}-${moduleName}.json`;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/html-validate/index.js
Expand Up @@ -9,7 +9,7 @@ const { render } = require("../../utils/render");
/** Module to validate HTML of a page */
module.exports = async ({ pageSource, moduleName, index, config }) => {
const htmlvalidate = new HtmlValidate(config.modulesConfig[moduleName]);
const validationResult = htmlvalidate.validateString(pageSource);
const validationResult = await htmlvalidate.validateString(pageSource);
const issueCount =
validationResult.errorCount + validationResult.warningCount;

Expand Down
6 changes: 3 additions & 3 deletions src/utils/__tests__/config.test.js
Expand Up @@ -16,7 +16,7 @@ describe("config", () => {

test("user config overrides default config", async () => {
await expect(
getConfig({ config: join(__dirname, "test-config.json") })
getConfig({ config: join(__dirname, "test-config.json") }),
).resolves.toEqual({
...defaultConfig,
maxConnections: 1,
Expand All @@ -29,7 +29,7 @@ describe("config", () => {
getConfig({
config: join(__dirname, "test-config.json"),
modules: "axe-core",
})
}),
).resolves.toEqual({
...defaultConfig,
maxConnections: 1,
Expand All @@ -42,7 +42,7 @@ describe("config", () => {
await expect(
getConfig({
config: join(__dirname, "nonexisting-config.json"),
})
}),
).resolves.toEqual(defaultConfig);
});
});
2 changes: 1 addition & 1 deletion src/utils/code-highlight.js
Expand Up @@ -37,7 +37,7 @@ class NunjucksExtension {
lang = code.language;
}
return new SafeString(
this.wrap(`<code class="language-${lang}">${code.value}</code>`)
this.wrap(`<code class="language-${lang}">${code.value}</code>`),
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/utils/config.js
Expand Up @@ -60,13 +60,13 @@ const getConfig = async (cliArguments = {}) => {
defaultConfig,
userConfig,
argvConfig,
configArrayCustomizer
configArrayCustomizer,
);

if (!["chromium", "firefox", "webkit"].includes(config.browser)) {
// verify browser value
throw new Error(
`Unknown Playwright browser '${config.browser}'. Please use one of "chromium", "firefox" or "webkit".`
`Unknown Playwright browser '${config.browser}'. Please use one of "chromium", "firefox" or "webkit".`,
);
}

Expand Down

0 comments on commit 273a5c5

Please sign in to comment.