Skip to content

Commit

Permalink
chore: update or replace pinned .x deps (#4180)
Browse files Browse the repository at this point in the history
* chore: update deps

* use glob instead of globby

* update html-entities@2

* remove markdown-table

* fix glob to use ignore

* Revert "chore: update deps"

This reverts commit a86d25d.
  • Loading branch information
straker authored Oct 12, 2023
1 parent 056fc1c commit 513b091
Show file tree
Hide file tree
Showing 7 changed files with 716 additions and 269 deletions.
4 changes: 2 additions & 2 deletions build/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var clone = require('clone');
var doT = require('@deque/dot');
var templates = require('./templates');
var buildManual = require('./build-manual');
var entities = new (require('html-entities').AllHtmlEntities)();
var { encode } = require('html-entities');
var packageJSON = require('../package.json');
var doTRegex = /\{\{.+?\}\}/g;

Expand Down Expand Up @@ -365,7 +365,7 @@ function buildRules(grunt, options, commons, callback) {

result.push([
`[${rule.id}](https://dequeuniversity.com/rules/axe/${axeVersion}/${rule.id}?application=RuleDescription)`,
entities.encode(rule.metadata.description),
encode(rule.metadata.description),
impact,
rule.tags.join(', '),
issueType.join(', '),
Expand Down
14 changes: 4 additions & 10 deletions build/rule-generator/questions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs');
const globby = require('globby');
const { glob } = require('glob');
const directories = require('./directories');

/**
Expand Down Expand Up @@ -33,9 +33,7 @@ const validateGetRuleName = async input => {
throw new Error(`RULE name conflicts with an existing rule's filename.`);
}
// 3) ensure no rule id overlaps
const ruleSpecs = await globby(directories.rules, {
expandDirectories: { extensions: ['json'] }
});
const ruleSpecs = await glob(`${directories.rules}/**/*.json`);
const axeRulesIds = ruleSpecs.reduce((out, specPath) => {
const spec = require(specPath);
out.push(spec.id);
Expand Down Expand Up @@ -64,9 +62,7 @@ const validateGetCheckName = async input => {
);
}
// 2) ensure no check filename overlaps
const checkSpecs = await globby(directories.checks, {
expandDirectories: { extensions: ['json'] }
});
const checkSpecs = await glob(`${directories.checks}/**/*.json`);
// cannot use `fs.existsSync` here, as we do not know which category of checks to look under
const axeChecksFileNames = checkSpecs.map(
f => f.replace('.json', '').split('/').reverse()[0]
Expand All @@ -75,9 +71,7 @@ const validateGetCheckName = async input => {
throw new Error('CHECK name conflicts with an existing filename.');
}
// 3) ensure no check id overlaps
const ruleSpecs = await globby(directories.rules, {
expandDirectories: { extensions: ['json'] }
});
const ruleSpecs = await glob(`${directories.rules}/**/*.json`);
const axe = require(directories.axePath);
const axeChecksIds = ruleSpecs.reduce((out, specPath) => {
const spec = require(specPath);
Expand Down
11 changes: 8 additions & 3 deletions build/tasks/aria-supported.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
'use strict';

const { roles, aria: props } = require('aria-query');
const mdTable = require('markdown-table');
const format = require('../shared/format');

module.exports = function (grunt) {
Expand Down Expand Up @@ -50,10 +49,16 @@ module.exports = function (grunt) {
ariaAttrs,
listType
);
const attributesTableMarkdown = mdTable([
const formatMarkdownTableRow = columnValues =>
`| ${columnValues.join(' | ')} |`;
const attributesTableWithHeader = [
headings.attributesMdTableHeader,
['---', '---'],
...attributesTable
]);
];
const attributesTableMarkdown = attributesTableWithHeader
.map(formatMarkdownTableRow)
.join('\n');

const footnotes = [...rolesFootnotes, ...attributesFootnotes].map(
(footnote, index) => `[^${index + 1}]: ${footnote}`
Expand Down
Loading

0 comments on commit 513b091

Please sign in to comment.