Skip to content

Commit

Permalink
Merge pull request #3824 from dequelabs/release-2022-12-12
Browse files Browse the repository at this point in the history
chore(release): v4.6.0
  • Loading branch information
WilcoFiers authored Dec 12, 2022
2 parents 8212b9e + d4b53cc commit 54eb9be
Show file tree
Hide file tree
Showing 101 changed files with 3,629 additions and 1,654 deletions.
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ defaults: &defaults

unix_box: &unix_box
docker:
- image: cimg/node:16.14-browsers
- image: cimg/node:16.18-browsers

unix_nightly_box: &unix_nightly_box
docker:
- image: cimg/node:lts-browsers

orbs:
puppeteer: threetreeslight/[email protected]
browser-tools: circleci/browser-tools@1.1.0
browser-tools: circleci/browser-tools@1.4.0

set_npm_auth: &set_npm_auth
run: npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
Expand Down Expand Up @@ -141,6 +141,7 @@ jobs:
steps:
- checkout
- <<: *restore_dependency_cache_unix
- run: sudo apt-get update -y
- run: npm run build
- run:
name: Install Chrome and ChromeDriver Beta
Expand Down Expand Up @@ -245,7 +246,7 @@ jobs:
# Create a GitHub release.
github_release:
docker:
- image: cimg/go:1.17.1
- image: cimg/go:1.19
steps:
- checkout
- run: go get gopkg.in/aktau/github-release.v0
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prettify the code
uses: creyD/[email protected]
with:
prettier_options: '--write .'
ref: ${{ github.event.pull_request.head.ref }}
- name: Install dependencies
run: npm ci
- name: Cache node_modules
uses: actions/cache@v3
with:
path: |
./node_modules
key: npm-workspace-cache-${{ runner.os }}-${{ hashFiles('./package-lock.json') }}
- uses: actions/setup-node@v1
with:
node-version: 16
# Workflows are not allowed to edit workflows. As result, we need to prevent Prettier from formatting them.
- name: Prevent workflows from being formatted
run: echo ".github" >> .prettierignore
- run: npm run fmt
# Prevent the prettierignore change from being committed.
- run: git checkout .prettierignore
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: ':robot: Automated formatting fixes'
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Create release candidate

on: [workflow_dispatch]

jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: ./node_modules
key: npm-cache-${{ runner.os }}-${{ hashFiles('./package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Run release script and open PR
run: |
git config user.name "API Team CI User"
git config user.email "[email protected]"
Branch="release-$(date +%Y-%m-%d)"
echo "Branch: $Branch"
git checkout -b "$Branch"
npm ci
npm run release
git push origin "$Branch" --force
Version=$(jq -r .version ./package.json)
echo "Version: $Version"
# Get the additions to the changelog as the commit body and generate the PR url
ReleaseNotes=$(
git show \
--no-color \
--no-prefix \
--output-indicator-new=! CHANGELOG.md | egrep '^!' | awk -F'^[!]' '{print $2}' | sed -e 's/\n/$0A/g'
)
echo "chore(release): v$Version" > /tmp/pr.txt
echo "" >> /tmp/pr.txt
echo "$ReleaseNotes" >> /tmp/pr.txt
echo "" >> /tmp/pr.txt
echo "This PR was opened by a robot :robot: :tada:" >> /tmp/pr.txt
hub pull-request --file /tmp/pr.txt --base master
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
15 changes: 15 additions & 0 deletions .github/workflows/semantic-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Semantic PR title

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
semantic-pr-title:
runs-on: ubuntu-latest
steps:
- uses: dequelabs/semantic-pr-title@v1
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [4.6.0](https://github.com/dequelabs/axe-core/compare/v4.5.2...v4.6.0) (2022-12-12)

### Features

- **aria-required-attr:** require aria-controls on combobox and aria-valuenow on focusable separator ([#3786](https://github.com/dequelabs/axe-core/issues/3786)) ([5259e88](https://github.com/dequelabs/axe-core/commit/5259e8842e49d291d35aada0fefecfde3627299f))
- **checks/label-content-name-mismatch:** deprecate occuranceThreshold option in favor of occurrenceThreshold to fix typo ([#3782](https://github.com/dequelabs/axe-core/issues/3782)) ([5026d65](https://github.com/dequelabs/axe-core/commit/5026d65b5c93ca7ad1e52881fb5379a4a75ed9a1))
- **commons:** deprecate flattenShadowColors in favor of flattenColors ([#3792](https://github.com/dequelabs/axe-core/issues/3792)) ([af49daf](https://github.com/dequelabs/axe-core/commit/af49dafcde281443823c2d878ce4de23ee573212))
- **context:** allow selecting shadow DOM nodes ([#3798](https://github.com/dequelabs/axe-core/issues/3798)) ([9e1e31b](https://github.com/dequelabs/axe-core/commit/9e1e31b253398cc2a3e840c7cb9c5527f4e4ba66))
- **list,listitem:** do not allow group as allowed parent or child ([#3784](https://github.com/dequelabs/axe-core/issues/3784)) ([d1cbf6f](https://github.com/dequelabs/axe-core/commit/d1cbf6fe20a1920649566e521c0c6668efd0d470))
- **required-attr:** require aria-checked for checkbox-like and radio-like roles ([#3785](https://github.com/dequelabs/axe-core/issues/3785)) ([563e4e9](https://github.com/dequelabs/axe-core/commit/563e4e90facc9b955c1b2395b466cd65d72bf04e))
- **utils:** new shadowSelectAll utility ([#3796](https://github.com/dequelabs/axe-core/issues/3796)) ([5865462](https://github.com/dequelabs/axe-core/commit/586546261a9523077e1710cecf1751a5e6f172e6))

### Bug Fixes

- **aria-allowed-role:** allow combobox on button, checkbox and combobox on input[type=button] ([#3354](https://github.com/dequelabs/axe-core/issues/3354)) ([ac688c0](https://github.com/dequelabs/axe-core/commit/ac688c04b70d6bcdfa13ac4d7faf824d2bc4af01)), closes [#3353](https://github.com/dequelabs/axe-core/issues/3353)
- **aria-required-children:** allow menu as child of menu ([#3820](https://github.com/dequelabs/axe-core/issues/3820)) ([a6569e5](https://github.com/dequelabs/axe-core/commit/a6569e5dcad2fd32160b78fba86c988e7cb3d323))
- **color-contrast:** consider -webkit-text-stroke & -webkit-text-fill-color ([#3791](https://github.com/dequelabs/axe-core/issues/3791)) ([228daf1](https://github.com/dequelabs/axe-core/commit/228daf153b3c6e45933a2ca8feac765f942663f4))
- **color-contrast:** correctly calculate background color of text nodes with different size than their container ([#3703](https://github.com/dequelabs/axe-core/issues/3703)) ([123b83c](https://github.com/dequelabs/axe-core/commit/123b83c00f0e770dd784ce72ab1fddddf4a4961e))
- **get-role:** handle presentation role inheritance for vnodes with no parent ([#3801](https://github.com/dequelabs/axe-core/issues/3801)) ([b971caf](https://github.com/dequelabs/axe-core/commit/b971caf3eea03170c0710c5b00272fe13f65e825))
- **html-lang-valid:** only run rule when attribute has value ([#3663](https://github.com/dequelabs/axe-core/issues/3663)) ([1a7eecb](https://github.com/dequelabs/axe-core/commit/1a7eecb72c3b1c772392b7c18feee75e0f51dbcb)), closes [#3624](https://github.com/dequelabs/axe-core/issues/3624)
- **metadata:** Map aria-required-children to ACT rule bc4a75 ([#3790](https://github.com/dequelabs/axe-core/issues/3790)) ([a33a523](https://github.com/dequelabs/axe-core/commit/a33a523eb4dfdc62743d78aab124e74afc98a59e))

### [4.5.2](https://github.com/dequelabs/axe-core/compare/v4.5.1...v4.5.2) (2022-11-14)

### Bug Fixes
Expand Down
99 changes: 75 additions & 24 deletions axe.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,65 @@ declare namespace axe {
| 'embedded'
| 'interactive';

// Array of length 2 or greater
type MultiArray<T> = [T, T, ...T[]];

// Selectors within a frame
type BaseSelector = string;
type CrossTreeSelector = BaseSelector | BaseSelector[];
type CrossFrameSelector = CrossTreeSelector[];

type ContextObject = {
include?: Node | BaseSelector | Array<Node | BaseSelector | BaseSelector[]>;
exclude?: Node | BaseSelector | Array<Node | BaseSelector | BaseSelector[]>;
};
type ShadowDomSelector = MultiArray<BaseSelector>;
type CrossTreeSelector = BaseSelector | ShadowDomSelector;
type LabelledShadowDomSelector = { fromShadowDom: ShadowDomSelector };

type SerialContextObject = {
include?: BaseSelector | Array<BaseSelector | BaseSelector[]>;
exclude?: BaseSelector | Array<BaseSelector | BaseSelector[]>;
};
// Cross-frame selectors
type FramesSelector = Array<CrossTreeSelector | LabelledShadowDomSelector>;
type UnlabelledFrameSelector = CrossTreeSelector[];
type LabelledFramesSelector = { fromFrames: MultiArray<FramesSelector[0]> };
/**
* @deprecated Use UnlabelledFrameSelector instead
*/
type CrossFrameSelector = UnlabelledFrameSelector;

// Context options
type Selector =
| Node
| BaseSelector
| LabelledShadowDomSelector
| LabelledFramesSelector;
type SelectorList = Array<Selector | FramesSelector> | NodeList;
type ContextObject =
| {
include: Selector | SelectorList;
exclude?: Selector | SelectorList;
}
| {
exclude: Selector | SelectorList;
};
type ElementContext = Selector | SelectorList | ContextObject;

type RunCallback = (error: Error, results: AxeResults) => void;
type SerialSelector =
| BaseSelector
| LabelledShadowDomSelector
| LabelledFramesSelector;
type SerialFrameSelector = SerialSelector | FramesSelector;
type SerialSelectorList = Array<SerialFrameSelector>;

type ElementContext = Node | NodeList | string | ContextObject;
type SerialContextObject =
| {
include: SerialSelector | SerialSelectorList;
exclude?: SerialSelector | SerialSelectorList;
}
| {
exclude: SerialSelector | SerialSelectorList;
include?: SerialSelector | SerialSelectorList;
};

interface FrameContextObject {
include: UnlabelledFrameSelector[];
exclude: UnlabelledFrameSelector[];
}

type RunCallback<T = AxeResults> = (error: Error, results: T) => void;

interface TestEngine {
name: string;
Expand Down Expand Up @@ -255,9 +297,9 @@ declare namespace axe {
interface SerialDqElement {
source: string;
nodeIndexes: number[];
selector: CrossFrameSelector;
selector: UnlabelledFrameSelector;
xpath: string[];
ancestry: CrossFrameSelector;
ancestry: UnlabelledFrameSelector;
}
interface PartialRuleResult {
id: string;
Expand All @@ -274,14 +316,15 @@ declare namespace axe {
type PartialResults = Array<PartialResult | null>;
interface FrameContext {
frameSelector: CrossTreeSelector;
frameContext: SerialContextObject;
frameContext: FrameContextObject;
}
interface Utils {
getFrameContexts: (
context?: ElementContext,
options?: RunOptions
) => FrameContext[];
shadowSelect: (selector: CrossTreeSelector) => Element | null;
shadowSelectAll: (selector: CrossTreeSelector) => Element[];
}
interface EnvironmentData {
testEngine: TestEngine;
Expand Down Expand Up @@ -313,19 +356,27 @@ declare namespace axe {
* @param {RunCallback} callback Optional The function to invoke when analysis is complete.
* @returns {Promise<AxeResults>|void} If the callback was not defined, axe will return a Promise.
*/
function run(context?: ElementContext): Promise<AxeResults>;
function run(options: RunOptions): Promise<AxeResults>;
function run(callback: (error: Error, results: AxeResults) => void): void;
function run(context: ElementContext, callback: RunCallback): void;
function run(options: RunOptions, callback: RunCallback): void;
function run(
function run<T = AxeResults>(context?: ElementContext): Promise<T>;
function run<T = AxeResults>(options: RunOptions): Promise<T>;
function run<T = AxeResults>(
callback: (error: Error, results: T) => void
): void;
function run<T = AxeResults>(
context: ElementContext,
callback: RunCallback<T>
): void;
function run<T = AxeResults>(
options: RunOptions,
callback: RunCallback<T>
): void;
function run<T = AxeResults>(
context: ElementContext,
options: RunOptions
): Promise<AxeResults>;
function run(
): Promise<T>;
function run<T = AxeResults>(
context: ElementContext,
options: RunOptions,
callback: RunCallback
callback: RunCallback<T>
): void;

/**
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axe-core",
"version": "4.5.2",
"version": "4.6.0",
"contributors": [
{
"name": "David Sturley",
Expand Down
Loading

0 comments on commit 54eb9be

Please sign in to comment.