Skip to content

Commit

Permalink
Merge branch 'core-utils-modules' into core-base-modules
Browse files Browse the repository at this point in the history
Had several conflicts, may be a bad merge.... 🤷

* core-utils-modules:
  refactor: update filenames of check evaluate and rule matches (#2160)
  feat(metadata-function-map): add metadata function map to support check evaulate functions as an id string (#2162)
  put back check
  skip rather than comment
  comment for now
  moar tests
  refactor(core/reporters): Convert to ES modules (#2154)
  fix(duplicate-id): list the duplicate id in message (#2163)
  chore: convert commons to ES Modules (#2155)
  refactor(Audit): Convert to ES5 class (#2157)
  refactor(core/utils): Convert to ES modules
  • Loading branch information
stephenmathieson committed Apr 16, 2020
2 parents eeaa0cb + f59eb4c commit f563a41
Show file tree
Hide file tree
Showing 335 changed files with 2,684 additions and 2,934 deletions.
13 changes: 4 additions & 9 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,11 @@
"overrides": [
{
"files": [
"lib/commons/aria/*.js",
"lib/commons/color/*.js",
"lib/commons/dom/*.js",
"lib/commons/forms/*.js",
"lib/commons/matches/*.js",
"lib/commons/table/*.js",
"lib/commons/text/*.js",
"lib/commons/utils/*.js",
"lib/core/base/*/*.js",
"lib/core/base/*.js"
"lib/core/base/*.js",
"lib/core/reporters/**/*.js",
"lib/core/utils/*.js",
"lib/commons/**/*.js"
],
"parserOptions":{
"sourceType": "module"
Expand Down
70 changes: 22 additions & 48 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ camelcase: ["error", {"properties": "never"}]
*/
var testConfig = require('./build/test/config');

function createWebpackConfig(input, output) {
function createWebpackConfig(input, output, outputFilename = 'index.js') {
return {
devtool: false,
mode: 'development',
entry: path.resolve(__dirname, input),
output: {
filename: 'index.js',
filename: outputFilename,
path: path.resolve(__dirname, output)
}
};
Expand Down Expand Up @@ -98,7 +98,12 @@ module.exports = function(grunt) {
{
expand: true,
cwd: 'lib/core',
src: ['**/*.js', '!imports/index.js'],
src: [
'**/*.js',
'!reporters/**/*.js',
'!utils/**/*.js',
'!imports/index.js'
],
dest: 'tmp/core'
}
]
Expand All @@ -108,7 +113,7 @@ module.exports = function(grunt) {
{
expand: true,
cwd: 'tmp',
src: ['*.js'],
src: ['*.js', 'core/reporters/reporters.js', 'core/utils/utils.js'],
dest: 'tmp'
}
]
Expand All @@ -129,6 +134,7 @@ module.exports = function(grunt) {
},
coreFiles: [
'tmp/core/index.js',
'tmp/core/constants.js',
'tmp/core/*/index.js',
'tmp/core/**/index.js',
'tmp/core/**/*.js'
Expand All @@ -149,61 +155,29 @@ module.exports = function(grunt) {
commons: {
src: [
'lib/commons/intro.stub',
'lib/commons/index.js',
'lib/commons/*/index.js',
'lib/commons/**/*.js',

// directories we've converted to ES Modules
'!lib/commons/aria/*.js',
'!lib/commons/color/*.js',
'!lib/commons/dom/*.js',
'!lib/commons/forms/*.js',
'!lib/commons/matches/*.js',
'!lib/commons/table/*.js',
'!lib/commons/text/*.js',
'!lib/commons/utils/*.js',

// output of webpack directories
'tmp/commons/**/*.js',
'tmp/commons/index.js',

'lib/commons/outro.stub'
],
dest: 'tmp/commons.js'
}
},
webpack: {
commonsUtils: createWebpackConfig(
'lib/commons/utils/index.js',
'tmp/commons/utils'
),
commonsAria: createWebpackConfig(
'lib/commons/aria/index.js',
'tmp/commons/aria'
),
commonsColor: createWebpackConfig(
'lib/commons/color/index.js',
'tmp/commons/color'
),
commonsDOM: createWebpackConfig(
'lib/commons/dom/index.js',
'tmp/commons/dom'
),
commonsForms: createWebpackConfig(
'lib/commons/forms/index.js',
'tmp/commons/forms'
),
commonsMatches: createWebpackConfig(
'lib/commons/matches/index.js',
'tmp/commons/matches'
coreReporters: createWebpackConfig(
'lib/core/reporters/reporters.js',
'tmp/core/reporters',
// Due to how the Babel/concat stuff works, this cannot be called `index.js`.
'reporters.js'
),
commonsTable: createWebpackConfig(
'lib/commons/table/index.js',
'tmp/commons/table'
coreUtils: createWebpackConfig(
'lib/core/utils/utils.js',
'tmp/core/utils',
// Due to how the Babel/concat stuff works, this cannot be called `index.js`.
'utils.js'
),
commonsText: createWebpackConfig(
'lib/commons/text/index.js',
'tmp/commons/text'
)
commons: createWebpackConfig('lib/commons/index.js', 'tmp/commons')
},
'aria-supported': {
data: {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/aria/abstractrole.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "abstractrole",
"evaluate": "abstractrole.js",
"evaluate": "abstractrole-evaluate.js",
"metadata": {
"impact": "serious",
"messages": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-allowed-attr",
"evaluate": "allowed-attr.js",
"evaluate": "aria-allowed-attr-evaluate.js",
"metadata": {
"impact": "critical",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/aria/aria-allowed-role.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-allowed-role",
"evaluate": "aria-allowed-role.js",
"evaluate": "aria-allowed-role-evaluate.js",
"options": {
"allowImplicit": true,
"ignoredTags": []
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-errormessage",
"evaluate": "errormessage.js",
"evaluate": "aria-errormessage-evaluate.js",
"metadata": {
"impact": "critical",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/aria/aria-hidden-body.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-hidden-body",
"evaluate": "aria-hidden-body.js",
"evaluate": "aria-hidden-body-evaluate.js",
"metadata": {
"impact": "critical",
"messages": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-required-attr",
"evaluate": "required-attr.js",
"evaluate": "aria-required-attr-evaluate.js",
"metadata": {
"impact": "critical",
"messages": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-required-children",
"evaluate": "required-children.js",
"evaluate": "aria-required-children-evaluate.js",
"options": {
"reviewEmpty": [
"doc-bibliography",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-required-parent",
"evaluate": "required-parent.js",
"evaluate": "aria-required-parent-evaluate.js",
"metadata": {
"impact": "critical",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/aria/aria-roledescription.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-roledescription",
"evaluate": "aria-roledescription.js",
"evaluate": "aria-roledescription-evaluate.js",
"options": {
"supportedRoles": [
"button",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-unsupported-attr",
"evaluate": "unsupportedattr.js",
"evaluate": "aria-unsupported-attr-evaluate.js",
"metadata": {
"impact": "critical",
"messages": {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-valid-attr-value",
"evaluate": "valid-attr-value.js",
"evaluate": "aria-valid-attr-value-evaluate.js",
"options": [],
"metadata": {
"impact": "critical",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aria-valid-attr",
"evaluate": "valid-attr.js",
"evaluate": "aria-valid-attr-evaluate.js",
"options": [],
"metadata": {
"impact": "critical",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/aria/fallbackrole.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "fallbackrole",
"evaluate": "fallbackrole.js",
"evaluate": "fallbackrole-evaluate.js",
"metadata": {
"impact": "serious",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/aria/has-widget-role.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "has-widget-role",
"evaluate": "has-widget-role.js",
"evaluate": "has-widget-role-evaluate.js",
"options": [],
"metadata": {
"impact": "minor",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/aria/implicit-role-fallback.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "implicit-role-fallback",
"evaluate": "implicit-role-fallback.js",
"evaluate": "implicit-role-fallback-evaluate.js",
"deprecated": true,
"metadata": {
"impact": "moderate",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/aria/invalidrole.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "invalidrole",
"evaluate": "invalidrole.js",
"evaluate": "invalidrole-evaluate.js",
"metadata": {
"impact": "critical",
"messages": {
Expand Down
2 changes: 1 addition & 1 deletion lib/checks/aria/no-implicit-explicit-label.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "no-implicit-explicit-label",
"evaluate": "no-implicit-explicit-label.js",
"evaluate": "no-implicit-explicit-label-evaluate.js",
"metadata": {
"impact": "moderate",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/aria/unsupportedrole.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "unsupportedrole",
"evaluate": "unsupportedrole.js",
"evaluate": "unsupportedrole-evaluate.js",
"metadata": {
"impact": "critical",
"messages": {
Expand Down
2 changes: 1 addition & 1 deletion lib/checks/aria/valid-scrollable-semantics.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "valid-scrollable-semantics",
"evaluate": "valid-scrollable-semantics.js",
"evaluate": "valid-scrollable-semantics-evaluate.js",
"options": [],
"metadata": {
"impact": "minor",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/color/color-contrast.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "color-contrast",
"evaluate": "color-contrast.js",
"evaluate": "color-contrast-evaluate.js",
"options": {
"noScroll": false,
"ignoreUnicode": true,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/color/link-in-text-block.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "link-in-text-block",
"evaluate": "link-in-text-block.js",
"evaluate": "link-in-text-block-evaluate.js",
"metadata": {
"impact": "serious",
"messages": {
Expand Down
2 changes: 1 addition & 1 deletion lib/checks/forms/autocomplete-appropriate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "autocomplete-appropriate",
"evaluate": "autocomplete-appropriate.js",
"evaluate": "autocomplete-appropriate-evaluate.js",
"metadata": {
"impact": "serious",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/forms/autocomplete-valid.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "autocomplete-valid",
"evaluate": "autocomplete-valid.js",
"evaluate": "autocomplete-valid-evaluate.js",
"metadata": {
"impact": "serious",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/forms/fieldset.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "fieldset",
"evaluate": "fieldset.js",
"evaluate": "fieldset-evaluate.js",
"after": "fieldset-after.js",
"deprecated": true,
"metadata": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/forms/group-labelledby.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "group-labelledby",
"evaluate": "group-labelledby.js",
"evaluate": "group-labelledby-evaluate.js",
"after": "group-labelledby-after.js",
"deprecated": true,
"metadata": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/keyboard/accesskeys.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "accesskeys",
"evaluate": "accesskeys.js",
"evaluate": "accesskeys-evaluate.js",
"after": "accesskeys-after.js",
"metadata": {
"impact": "serious",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/keyboard/focusable-content.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "focusable-content",
"evaluate": "focusable-content.js",
"evaluate": "focusable-content-evaluate.js",
"metadata": {
"impact": "moderate",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/keyboard/focusable-disabled.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "focusable-disabled",
"evaluate": "focusable-disabled.js",
"evaluate": "focusable-disabled-evaluate.js",
"metadata": {
"impact": "serious",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/keyboard/focusable-element.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "focusable-element",
"evaluate": "focusable-element.js",
"evaluate": "focusable-element-evaluate.js",
"metadata": {
"impact": "moderate",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/keyboard/focusable-modal-open.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "focusable-modal-open",
"evaluate": "focusable-modal-open.js",
"evaluate": "focusable-modal-open-evaluate.js",
"metadata": {
"impact": "serious",
"messages": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/checks/keyboard/focusable-no-name.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "focusable-no-name",
"evaluate": "focusable-no-name.js",
"evaluate": "focusable-no-name-evaluate.js",
"metadata": {
"impact": "serious",
"messages": {
Expand Down
2 changes: 1 addition & 1 deletion lib/checks/keyboard/focusable-not-tabbable.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "focusable-not-tabbable",
"evaluate": "focusable-not-tabbable.js",
"evaluate": "focusable-not-tabbable-evaluate.js",
"metadata": {
"impact": "serious",
"messages": {
Expand Down
Loading

0 comments on commit f563a41

Please sign in to comment.