diff --git a/.babelrc b/.babelrc index f2b31b5064..f91ebace9b 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,6 @@ { "presets": [ - "es2015" + "env" ], "plugins": [ "transform-object-rest-spread" diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 7f06dc0fe4..0000000000 --- a/.jshintrc +++ /dev/null @@ -1,64 +0,0 @@ -{ - "globals": { - "axe": true - }, - - "browser" : false, - "node" : true, - "devel" : false, - - "bitwise": true, - "camelcase": true, - "curly": true, - "eqeqeq": true, - "forin": true, - "immed": true, - "indent": 1, - "latedef": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "nomen": false, - "onevar": false, - "plusplus": false, - "quotmark": "single", - "regexp": true, - "undef": true, - "unused": true, - "strict": false, - "trailing": true, - - "maxparams": 5, - "maxdepth": 5, - "maxstatements": 15, - "maxcomplexity": 10, - "maxlen": 120, - - "asi": false, - "boss" : false, - "debug": false, - "devel": false, - "eqnull": false, - "es5": false, - "esnext": false, - "evil": false, - "expr": false, - "funcscope": false, - "globalstrict": false, - "iterator": false, - "lastsemic": false, - "laxbreak": false, - "laxcomma": false, - "loopfunc": false, - "multistr": false, - "proto": false, - "regexdash": false, - "scripturl": false, - "smarttabs": false, - "shadow": false, - "sub": false, - "supernew": false, - - "white": true -} diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..29426fa836 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +package-lock=false +registry=https://registry.npmjs.org \ No newline at end of file diff --git a/build/tasks/generate-imports.js b/build/tasks/generate-imports.js index adeba64c02..277934c09e 100644 --- a/build/tasks/generate-imports.js +++ b/build/tasks/generate-imports.js @@ -78,6 +78,9 @@ module.exports = grunt => { writeLibrary(libName, factory); }); } else if (global) { + // The global variable exposed by the library. This is not necessarily the same as "libName". + const libraryGlobal = global; + // We wrap the library's source code in an IFFE which voids // existing globals (module, define, process, etc.) forces and // forces it to export a global. @@ -94,18 +97,18 @@ module.exports = grunt => { // If there was a global prior to our script, make sure we // "save" it (think "$.noConflict()"). - var __old_global__ = global["${global}"]; + var __old_global__ = global["${libraryGlobal}"]; ${sourceCode} // Preserve a reference to the library and remove it from // the global scope. - var lib = global["${global}"]; - delete global["${global}"]; + var lib = global["${libraryGlobal}"]; + delete global["${libraryGlobal}"]; // Reset a previous global when applicable. if (__old_global__) { - global["${global}"] = __old_global__; + global["${libraryGlobal}"] = __old_global__; } // Return the library to populate "axe.imports". diff --git a/circle.yml b/circle.yml index af110c51b7..48276abe01 100644 --- a/circle.yml +++ b/circle.yml @@ -3,11 +3,15 @@ jobs: build: docker: - image: circleci/node:6.12.3-browsers + working_directory: ~/axe-core steps: - checkout - - run: - name: install-npm - command: npm install - - run: - name: test - command: npm test + - restore_cache: + keys: + - npm-deps-{{ checksum "package.json" }} + - run: npm install + - save_cache: + key: npm-deps-{{ checksum "package.json" }} + paths: + - node_modules + - run: npm test \ No newline at end of file diff --git a/doc/examples/chrome-debugging-protocol/.eslintrc b/doc/examples/chrome-debugging-protocol/.eslintrc new file mode 100644 index 0000000000..672172555a --- /dev/null +++ b/doc/examples/chrome-debugging-protocol/.eslintrc @@ -0,0 +1,8 @@ +{ + "env": { + "es6": true + }, + "parserOptions": { + "ecmaVersion": 8 + } +} \ No newline at end of file diff --git a/doc/examples/chrome-debugging-protocol/.npmrc b/doc/examples/chrome-debugging-protocol/.npmrc new file mode 100644 index 0000000000..43c97e719a --- /dev/null +++ b/doc/examples/chrome-debugging-protocol/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/doc/examples/chrome-debugging-protocol/README.md b/doc/examples/chrome-debugging-protocol/README.md new file mode 100644 index 0000000000..f3797a9f77 --- /dev/null +++ b/doc/examples/chrome-debugging-protocol/README.md @@ -0,0 +1,13 @@ +# axe-chrome-debugging-protocol-example + +This (very minimal) example demonstrates how to use `axe-core` with the [Chrome Debugging Protocol](https://chromedevtools.github.io/devtools-protocol/). + +The example does not have feature parity with [`axe-webdriverjs`](https://github.com/dequelabs/axe-webdriverjs), and does not run on `