From 5a6508ed18410bfb4c97fd19ff834012faa256f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:07:34 +0000 Subject: [PATCH 1/2] chore: bump braces from 3.0.2 to 3.0.3 Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index cfd8fddf..3375634a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "browser-driver-manager": "1.0.4", "chai": "^4.3.7", "chalk": "^4.x", - "chromedriver": "latest", + "chromedriver": "*", "clean-jsdoc-theme": "^4.2.17", "clone": "^2.1.2", "colorjs.io": "^0.5.0", @@ -3108,12 +3108,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -5693,9 +5693,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -15528,12 +15528,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-driver-manager": { @@ -17470,9 +17470,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" From 10bd5a0c5bd3d1b330092e79b7ce98da2ac5e1e2 Mon Sep 17 00:00:00 2001 From: Suyash Sonawane Date: Tue, 30 Jul 2024 14:07:55 +0530 Subject: [PATCH 2/2] adding custom stub --- Gruntfile.js | 8 +++++--- build/tasks/aria-supported.js | 3 ++- lib/custom/intro.stub | 15 +++++++++++++++ lib/custom/outro.stub | 2 ++ package.json | 1 + 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 lib/custom/intro.stub create mode 100644 lib/custom/outro.stub diff --git a/Gruntfile.js b/Gruntfile.js index 0a888fe1..47d9e078 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,6 +15,7 @@ module.exports = function (grunt) { grunt.loadTasks('build/tasks'); var langs; + var wrapper = !!grunt.option('wrapper'); if (grunt.option('lang')) { langs = (grunt.option('lang') || '').split(/[,;]/g).map(function (lang) { lang = lang.trim(); @@ -85,11 +86,11 @@ module.exports = function (grunt) { files: langs.map(function (lang, i) { return { src: [ - 'lib/intro.stub', + wrapper ? 'lib/custom/intro.stub' : 'lib/intro.stub', '<%= concat.engine.coreFiles %>', // include rules / checks / commons '<%= configure.rules.files[' + i + '].dest.auto %>', - 'lib/outro.stub' + wrapper ? 'lib/custom/outro.stub' : 'lib/outro.stub' ], dest: 'axe' + lang + '.js' }; @@ -127,7 +128,8 @@ module.exports = function (grunt) { entry: 'lib/commons/aria/index.js', destFile: 'doc/aria-supported.md', options: { - langs: langs + langs: langs, + wrapper: wrapper }, listType: 'unsupported' // Possible values for listType: 'supported', 'unsupported', 'all' } diff --git a/build/tasks/aria-supported.js b/build/tasks/aria-supported.js index 257b52ed..efe43437 100644 --- a/build/tasks/aria-supported.js +++ b/build/tasks/aria-supported.js @@ -16,7 +16,8 @@ module.exports = function (grunt) { * hence cannot be required at the top of the file. */ const done = this.async(); - const { langs } = this.options(); + const { langs, wrapper } = this.options(); + if (wrapper) return true; const fileNameSuffix = langs && langs.length > 0 ? `${langs[0]}` : ''; const axe = require(`../../axe${fileNameSuffix}`); const listType = this.data.listType.toLowerCase(); diff --git a/lib/custom/intro.stub b/lib/custom/intro.stub new file mode 100644 index 00000000..9ed8b3c4 --- /dev/null +++ b/lib/custom/intro.stub @@ -0,0 +1,15 @@ +/*! axe v<%= pkg.version %> + * Copyright (c) 2015 - <%= grunt.template.today("yyyy") %> Deque Systems, Inc. + * + * Your use of this Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This entire copyright notice must appear in every copy of this file you + * distribute or in any file that contains substantial portions of this source + * code. + */ +const createAxe = () => (function axeFunction (window) { + // A window reference is required to access the axe object in a "global". + var global = window; + var document = window.document; diff --git a/lib/custom/outro.stub b/lib/custom/outro.stub new file mode 100644 index 00000000..19fd22a6 --- /dev/null +++ b/lib/custom/outro.stub @@ -0,0 +1,2 @@ + +}( typeof window === 'object' ? window : this )); diff --git a/package.json b/package.json index 6c9a3e1f..5d5beb35 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "develop": "grunt dev --force", "api-docs": "jsdoc --configure .jsdoc.json", "build": "grunt", + "build:wrapper": "grunt --wrapper=true", "eslint": "eslint --color --format stylish '{lib,test,build,doc}/**/*.js' 'Gruntfile.js'", "test": "npm run test:tsc && run-s \"test:unit:* -- {@}\" --", "test:tsc": "tsc",