diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 93ebbf02934a..fa6c3482cd33 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -36,10 +36,14 @@ jobs: - name: Run accessibility tests run: npm run docs-accessibility + - name: Generate HTML accessibility results + run: npm run docs-pa11y-html + if: failure() + - name: Upload accessibility results uses: actions/upload-artifact@v2 if: failure() with: name: pa11yci-report - path: pa11yci-report.html + path: ./pa11y-ci-report/ if-no-files-found: error diff --git a/.gitignore b/.gitignore index 87f257f4b765..998b956b132d 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,5 @@ Thumbs.db # Folders to ignore /js/coverage/ /node_modules/ -/pa11yci-report.html +/pa11y-ci-report/ +/pa11y-ci-results.json diff --git a/build/pa11yci.js b/build/pa11yci.js index f6316e656d33..7128de2503ec 100644 --- a/build/pa11yci.js +++ b/build/pa11yci.js @@ -7,7 +7,7 @@ module.exports = { defaults: { reporters: [ 'cli', - 'pa11y-reporter-html' + ['json', { fileName: './pa11y-ci-results.json' }] ], runners: [ 'htmlcs' diff --git a/package-lock.json b/package-lock.json index ec56fc02412d..58b98d18454b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "nodemon": "^2.0.15", "npm-run-all": "^4.1.5", "pa11y-ci": "^3.0.0", - "pa11y-reporter-html": "^2.0.0", + "pa11y-ci-reporter-html": "^3.0.3", "postcss": "^8.4.4", "postcss-cli": "^9.0.2", "rollup": "^2.60.2", @@ -3576,6 +3576,12 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/chardet": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-1.4.0.tgz", + "integrity": "sha512-NpwMDdSIprbYx1CLnfbxEIarI0Z+s9MssEgggMNheGM+WD68yOhV7IEA/3r6tr0yTRgQD0HuZJDw32s99i6L+A==", + "dev": true + }, "node_modules/check-types": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/check-types/-/check-types-11.1.2.tgz", @@ -3686,6 +3692,30 @@ "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==", "dev": true }, + "node_modules/ci-logger": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/ci-logger/-/ci-logger-4.0.1.tgz", + "integrity": "sha512-8nv1ypT34pEeNn8Vo+LcI9GnMCvXrizPMRhjp8iDoHcu5mf28WbEPLri/pCagifik982NyIkDrI9j+Czn3HwTQ==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^4.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/ci-logger/node_modules/@sindresorhus/is": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz", + "integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, "node_modules/clean-css": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.2.tgz", @@ -6621,6 +6651,36 @@ "integrity": "sha1-7tO85CtDMgF1o/T4NP4gjl+iSho=", "dev": true }, + "node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/handlebars/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -8909,6 +8969,12 @@ "node": ">= 0.6" } }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, "node_modules/nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -9490,6 +9556,34 @@ "node": ">=12" } }, + "node_modules/pa11y-ci-reporter-html": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pa11y-ci-reporter-html/-/pa11y-ci-reporter-html-3.0.3.tgz", + "integrity": "sha512-PMeBYtghkoShPV67V4DsZHYBRUj9AZCJEzL3KUuQULNp59HwfhIc4YSukA1eiPK3Uttp8TtDreeDnh14mDghEw==", + "dev": true, + "dependencies": { + "chardet": "^1.4.0", + "ci-logger": "^4.0.1", + "commander": "^8.3.0", + "handlebars": "^4.7.7", + "pa11y-reporter-html": "^1.0.0" + }, + "bin": { + "pa11y-ci-reporter-html": "bin/pa11y-ci-reporter-html.js" + }, + "engines": { + "node": "^12.20.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/pa11y-ci-reporter-html/node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, "node_modules/pa11y-ci/node_modules/array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -9554,7 +9648,7 @@ "hogan.js": "^3.0.2" }, "engines": { - "node": ">=10" + "node": ">=8" } }, "node_modules/pa11y/node_modules/commander": { @@ -13247,6 +13341,19 @@ "node": "*" } }, + "node_modules/uglify-js": { + "version": "3.14.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.5.tgz", + "integrity": "sha512-qZukoSxOG0urUTvjc2ERMTcAy+BiFh3weWAkeurLwjrCba73poHmG3E36XEjd/JGukMzwTL7uCxZiAexj8ppvQ==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/unbox-primitive": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", @@ -16537,6 +16644,12 @@ "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", "dev": true }, + "chardet": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-1.4.0.tgz", + "integrity": "sha512-NpwMDdSIprbYx1CLnfbxEIarI0Z+s9MssEgggMNheGM+WD68yOhV7IEA/3r6tr0yTRgQD0HuZJDw32s99i6L+A==", + "dev": true + }, "check-types": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/check-types/-/check-types-11.1.2.tgz", @@ -16625,6 +16738,23 @@ "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==", "dev": true }, + "ci-logger": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/ci-logger/-/ci-logger-4.0.1.tgz", + "integrity": "sha512-8nv1ypT34pEeNn8Vo+LcI9GnMCvXrizPMRhjp8iDoHcu5mf28WbEPLri/pCagifik982NyIkDrI9j+Czn3HwTQ==", + "dev": true, + "requires": { + "@sindresorhus/is": "^4.0.1" + }, + "dependencies": { + "@sindresorhus/is": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz", + "integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==", + "dev": true + } + } + }, "clean-css": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.2.tgz", @@ -18884,6 +19014,27 @@ "integrity": "sha1-7tO85CtDMgF1o/T4NP4gjl+iSho=", "dev": true }, + "handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -20571,6 +20722,12 @@ "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", "dev": true }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -21073,9 +21230,29 @@ } } }, + "pa11y-ci-reporter-html": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pa11y-ci-reporter-html/-/pa11y-ci-reporter-html-3.0.3.tgz", + "integrity": "sha512-PMeBYtghkoShPV67V4DsZHYBRUj9AZCJEzL3KUuQULNp59HwfhIc4YSukA1eiPK3Uttp8TtDreeDnh14mDghEw==", + "dev": true, + "requires": { + "chardet": "^1.4.0", + "ci-logger": "^4.0.1", + "commander": "^8.3.0", + "handlebars": "^4.7.7", + "pa11y-reporter-html": "^1.0.0" + }, + "dependencies": { + "commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true + } + } + }, "pa11y-reporter-html": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pa11y-reporter-html/-/pa11y-reporter-html-2.0.0.tgz", + "version": "https://registry.npmjs.org/pa11y-reporter-html/-/pa11y-reporter-html-2.0.0.tgz", "integrity": "sha512-IuPxfb0P+uIAyoLSTkGyAv2jUHsN/iNEo3SHj0bUKQDRd84+tvEH3sHaO/ydIaECWcRYVGOADBNwMud6uQ5PNQ==", "dev": true, "requires": { @@ -23857,6 +24034,13 @@ "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==", "dev": true }, + "uglify-js": { + "version": "3.14.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.5.tgz", + "integrity": "sha512-qZukoSxOG0urUTvjc2ERMTcAy+BiFh3weWAkeurLwjrCba73poHmG3E36XEjd/JGukMzwTL7uCxZiAexj8ppvQ==", + "dev": true, + "optional": true + }, "unbox-primitive": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", diff --git a/package.json b/package.json index 429b0ad5481c..64ffb0c7ced1 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,8 @@ "docs-spellcheck": "cspell \"site/**/*.md\" --no-progress", "docs-vnu": "node build/vnu-jar.js", "docs-lint": "npm-run-all --aggregate-output --parallel docs-vnu docs-linkinator docs-spellcheck", - "docs-pa11y": "pa11y-ci --config build/pa11yci.js --sitemap http://localhost:9001/sitemap.xml --sitemap-find https://getbootstrap.com --sitemap-replace http://localhost:9001>pa11yci-report.html", + "docs-pa11y": "pa11y-ci --config build/pa11yci.js --sitemap http://localhost:9001/sitemap.xml --sitemap-find https://getbootstrap.com --sitemap-replace http://localhost:9001", + "docs-pa11y-html": "pa11y-ci-reporter-html", "docs-accessibility": "npm-run-all --parallel --race docs-serve-only docs-pa11y", "docs-serve": "hugo server --port 9001 --disableFastRender", "docs-serve-only": "sirv _site --no-clear --port 9001", @@ -140,7 +141,7 @@ "nodemon": "^2.0.15", "npm-run-all": "^4.1.5", "pa11y-ci": "^3.0.0", - "pa11y-reporter-html": "^2.0.0", + "pa11y-ci-reporter-html": "^3.0.3", "postcss": "^8.4.4", "postcss-cli": "^9.0.2", "rollup": "^2.60.2",