Skip to content

Commit

Permalink
Merge pull request #723 from dequelabs/release-1683060243
Browse files Browse the repository at this point in the history
chore: release v4.7.1
  • Loading branch information
dequejenn authored May 3, 2023
2 parents 623da3a + 49161f5 commit 32caffd
Show file tree
Hide file tree
Showing 32 changed files with 249 additions and 34 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.7.1](https://github.com/dequelabs/axe-core-npm/compare/v4.7.0...v4.7.1) (2023-05-02)


### Bug Fixes

* proper imports in esm context ([#718](https://github.com/dequelabs/axe-core-npm/issues/718)) ([f2a41bc](https://github.com/dequelabs/axe-core-npm/commit/f2a41bcaf33f5000fa1cd08f1a3e184b5d6360be))
* **react:** include .mjs file in publish ([#722](https://github.com/dequelabs/axe-core-npm/issues/722)) ([a7bf92f](https://github.com/dequelabs/axe-core-npm/commit/a7bf92fd9856b7be0fea4f3c8bd38a79a3c9fde3))





# [4.7.0](https://github.com/dequelabs/axe-core-npm/compare/v4.6.1...v4.7.0) (2023-04-28)


Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"packages/webdriverjs/tests/example",
"axe_core_test"
],
"version": "4.7.0"
"version": "4.7.1"
}
8 changes: 8 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.7.1](https://github.com/dequelabs/axe-core-npm/compare/v4.7.0...v4.7.1) (2023-05-02)

**Note:** Version bump only for package @axe-core/cli





# [4.7.0](https://github.com/dequelabs/axe-core-npm/compare/v4.6.1...v4.7.0) (2023-04-28)


Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axe-core/cli",
"version": "4.7.0",
"version": "4.7.1",
"description": "A CLI for accessibility testing using axe-core",
"author": {
"name": "Wilco Fiers",
Expand Down Expand Up @@ -53,7 +53,7 @@
"testing"
],
"dependencies": {
"@axe-core/webdriverjs": "^4.7.0",
"@axe-core/webdriverjs": "^4.7.1",
"axe-core": "^4.7.0",
"chromedriver": "^112.0.0",
"colors": "^1.4.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/playwright/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.7.1](https://github.com/dequelabs/axe-core-npm/compare/v4.7.0...v4.7.1) (2023-05-02)

**Note:** Version bump only for package @axe-core/playwright





# [4.7.0](https://github.com/dequelabs/axe-core-npm/compare/v4.6.1...v4.7.0) (2023-04-28)


Expand Down
4 changes: 2 additions & 2 deletions packages/playwright/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axe-core/playwright",
"version": "4.7.0",
"version": "4.7.1",
"description": "Provides a method to inject and analyze web pages using axe",
"contributors": [
{
Expand Down
11 changes: 11 additions & 0 deletions packages/puppeteer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.7.1](https://github.com/dequelabs/axe-core-npm/compare/v4.7.0...v4.7.1) (2023-05-02)


### Bug Fixes

* proper imports in esm context ([#718](https://github.com/dequelabs/axe-core-npm/issues/718)) ([f2a41bc](https://github.com/dequelabs/axe-core-npm/commit/f2a41bcaf33f5000fa1cd08f1a3e184b5d6360be))





# [4.7.0](https://github.com/dequelabs/axe-core-npm/compare/v4.6.1...v4.7.0) (2023-04-28)


Expand Down
27 changes: 27 additions & 0 deletions packages/puppeteer/esmTest.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
import defaultExport, { AxePuppeteer } from './dist/index.mjs';
import assert from 'assert';
import puppeteer from 'puppeteer';
import { fileURLToPath, pathToFileURL } from 'url';
import { join } from 'path';

const exportIsFunction = typeof(defaultExport) === 'function';
const exportIsSame = defaultExport === AxePuppeteer;
assert(exportIsFunction, 'export is not a function');
assert(exportIsSame, 'default and named export is not the same');


const options = {};

if (process.env.CI) {
options.args = [];
options.args.push('--no-sandbox', '--disable-setuid-sandbox');
options.executablePath = '/usr/bin/google-chrome-stable';
}

async function integrationTest() {
let path = fileURLToPath(new URL('.', import.meta.url));
path = join(path, './node_modules/axe-test-fixtures/fixtures/index.html');

const browser = await puppeteer.launch(options);
const page = await browser.newPage();
await page.setBypassCSP(true);
await page.goto(pathToFileURL(path));
const results = await new AxePuppeteer(page).analyze();
assert(results.violations.length > 0, 'could not find violations');
await page.close();
await browser.close();
}
integrationTest();
17 changes: 15 additions & 2 deletions packages/puppeteer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/puppeteer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axe-core/puppeteer",
"version": "4.7.0",
"version": "4.7.1",
"description": "Provides a chainable axe API for Puppeteer and automatically injects into all frames",
"repository": {
"type": "git",
Expand Down Expand Up @@ -40,6 +40,7 @@
"@types/test-listen": "^1.1.0",
"axe-test-fixtures": "github:dequelabs/axe-test-fixtures#v1",
"chai": "^4.3.6",
"cross-dirname": "^0.1.0",
"express": "^4.18.2",
"mocha": "^10.0.0",
"nyc": "^15.1.0",
Expand Down
16 changes: 15 additions & 1 deletion packages/puppeteer/src/legacy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as fs from 'fs';
import { Frame } from 'puppeteer';
import { getFilename } from 'cross-dirname';
import { pathToFileURL } from 'url';

interface IInjectAxeArgs {
source?: string | Function;
Expand Down Expand Up @@ -52,7 +54,19 @@ export async function injectJS(
}

async function injectJSModule(frame: Frame): Promise<void> {
const source = fs.readFileSync(require.resolve('axe-core'), 'utf8');
let axeCorePath = '';
if (typeof require === 'function' && typeof require.resolve === 'function') {
axeCorePath = require.resolve('axe-core');
} else {
const { createRequire } = (await import('node:module')) as any;
// `getFilename` is needed because esm's `import.meta.url` is illegal syntax in cjs
const filename = pathToFileURL(getFilename()).toString();

const require = createRequire(filename);
axeCorePath = require.resolve('axe-core');
}

const source = fs.readFileSync(axeCorePath, 'utf8');
await injectJSSource(frame, source);
}

Expand Down
20 changes: 18 additions & 2 deletions packages/puppeteer/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as fs from 'fs';
import * as Axe from 'axe-core';
import { Frame } from 'puppeteer';
import { axeConfigure, axeShadowSelect } from './browser';
import { getFilename } from 'cross-dirname';
import { pathToFileURL } from 'url';
import { pageIsLoaded } from './browser';

export async function frameSourceInject(
Expand All @@ -11,8 +13,22 @@ export async function frameSourceInject(
): Promise<void> {
await assertFrameReady(frame);
if (!source) {
const pathFile = require.resolve('axe-core');
source = fs.readFileSync(pathFile, 'utf8');
let axeCorePath = '';
if (
typeof require === 'function' &&
typeof require.resolve === 'function'
) {
axeCorePath = require.resolve('axe-core');
} else {
const { createRequire } = (await import('node:module')) as any;
// `getFilename` is needed because esm's `import.meta.url` is illegal syntax in cjs
const filename = pathToFileURL(getFilename()).toString();

const require = createRequire(filename);
axeCorePath = require.resolve('axe-core');
}

source = fs.readFileSync(axeCorePath, 'utf8');
}
await frame.evaluate(source);
await frame.evaluate(axeConfigure, config as Axe.Spec);
Expand Down
11 changes: 11 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.7.1](https://github.com/dequelabs/axe-core-npm/compare/v4.7.0...v4.7.1) (2023-05-02)


### Bug Fixes

* **react:** include .mjs file in publish ([#722](https://github.com/dequelabs/axe-core-npm/issues/722)) ([a7bf92f](https://github.com/dequelabs/axe-core-npm/commit/a7bf92fd9856b7be0fea4f3c8bd38a79a3c9fde3))





# [4.7.0](https://github.com/dequelabs/axe-core-npm/compare/v4.6.1...v4.7.0) (2023-04-28)


Expand Down
8 changes: 8 additions & 0 deletions packages/react/examples/shadow-dom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.7.1](https://github.com/dequelabs/axe-core-npm/compare/v4.7.0...v4.7.1) (2023-05-02)

**Note:** Version bump only for package @axe-core/react-example





# [4.7.0](https://github.com/dequelabs/axe-core-npm/compare/v4.6.1...v4.7.0) (2023-04-28)

**Note:** Version bump only for package @axe-core/react-example
Expand Down
4 changes: 2 additions & 2 deletions packages/react/examples/shadow-dom/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/react/examples/shadow-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axe-core/react-example",
"version": "4.7.0",
"version": "4.7.1",
"description": "Example of react-axe with a React.js application",
"main": "index.js",
"private": true,
Expand All @@ -13,7 +13,7 @@
"author": "Dylan Barrell (dylan@barrell.com)",
"license": "MIT",
"dependencies": {
"@axe-core/react": "^4.7.0",
"@axe-core/react": "^4.7.1",
"create-react-class": "^15.6.3",
"react": "^16.8.6",
"react-dom": "^16.8.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axe-core/react",
"version": "4.7.0",
"version": "4.7.1",
"description": "Dynamic accessibility analysis for React using axe-core",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand All @@ -20,6 +20,7 @@
"dist/cache.d.ts",
"dist/cache.js.map",
"dist/index.js",
"dist/index.mjs",
"dist/index.d.ts",
"dist/index.js.map"
],
Expand Down
Loading

0 comments on commit 32caffd

Please sign in to comment.