diff --git a/.travis.yml b/.travis.yml index f7173d1603..46bcbd30d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,9 @@ jobs: name: Spellcheck script: npm run lint:spelling env: ALLOW_FAILURE=true + - stage: Test + name: Build Linting + script: npm run lint:build - stage: Test name: AVA Regression Tests diff --git a/README.md b/README.md index c0e98126c3..ac8d47af5a 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,16 @@ Run locally: npm run lint:js ``` +### Regenerate `examples/index.html` + +If you have changed something in `examples/`, the index may need to be regenerated. + +Run locally: + +```sh +npm run build +``` + ### Test and fix your code 1. Open a terminal window to the directory that contains the `aria-practices` repository diff --git a/examples/accordion/accordion.html b/examples/accordion/accordion.html index 7dfbc7ebdc..77942309e9 100644 --- a/examples/accordion/accordion.html +++ b/examples/accordion/accordion.html @@ -273,13 +273,13 @@
aria-expanded="true"
aria-busy="true"
button
true
when the Accordion panel is expanded, otherwise set to false
.
diff --git a/package.json b/package.json
index 6937baf1f0..4509ff162b 100644
--- a/package.json
+++ b/package.json
@@ -7,13 +7,15 @@
"example": "examples"
},
"scripts": {
+ "build": "node scripts/reference-tables.js",
"fix": "npm run lint:es -- --fix && npm run lint:css -- --fix",
- "lint": "npm run lint:es && npm run lint:css && npm run vnu-jar && npm run lint:spelling",
+ "lint": "npm run lint:es && npm run lint:css && npm run vnu-jar && npm run lint:spelling && npm run lint:build",
"lint:css": "stylelint **/*.css",
"lint:es": "eslint .",
"lint:js": "npm run lint:es",
"lint:html": "npm run vnu-jar",
"lint:spelling": "cspell \"examples/**/*.html\" \"aria-practices.html\"",
+ "lint:build": "./scripts/lint-build.sh",
"regression": "ava --timeout=1m",
"regression-report": "node test/util/report",
"test": "npm run lint && npm run regression",
diff --git a/scripts/lint-build.sh b/scripts/lint-build.sh
new file mode 100755
index 0000000000..435fcec930
--- /dev/null
+++ b/scripts/lint-build.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+cp examples/index.html examples/index.tmp.html &&
+npm run build &&
+diff examples/index.html examples/index.tmp.html
+rv=$?
+cp examples/index.tmp.html examples/index.html
+rm examples/index.tmp.html
+[ $rv -ne 0 ] && echo 'Please generate examples/index.html by running: npm run build'
+exit $rv