Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): v4.6.0 #3824

Merged
merged 28 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2acd005
Merge pull request #3781 from dequelabs/master
straker Nov 14, 2022
5259e88
feat(aria-required-attr): require aria-controls on combobox and aria-…
straker Nov 17, 2022
d1cbf6f
feat(list,listitem): do not allow group as allowed parent or child (#…
straker Nov 17, 2022
563e4e9
feat(required-attr): require aria-checked for checkbox-like and radio…
straker Nov 17, 2022
d5c3b91
ci: create semantic pr title GHA (#3783)
michael-siek Nov 17, 2022
a33a523
fix(metadata): Map aria-required-children to ACT rule bc4a75 (#3790)
WilcoFiers Nov 21, 2022
fc2f50c
ci: update semantic pr title action (#3795)
michael-siek Nov 22, 2022
757a6fc
refactor: break up context.js and clean it up a bit (#3794)
WilcoFiers Nov 23, 2022
5865462
feat(utils): new shadowSelectAll utility (#3796)
WilcoFiers Nov 23, 2022
228daf1
fix(color-contrast): consider -webkit-text-stroke & -webkit-text-fill…
WilcoFiers Nov 28, 2022
ac688c0
fix(aria-allowed-role): allow combobox on button, checkbox and combob…
scottaohara Nov 29, 2022
1a7eecb
fix(html-lang-valid): only run rule when attribute has value (#3663)
thibaudcolas Nov 29, 2022
5026d65
feat(checks/label-content-name-mismatch): deprecate occuranceThreshol…
nolandanley Nov 30, 2022
9e1e31b
feat(context): allow selecting shadow DOM nodes (#3798)
WilcoFiers Dec 1, 2022
af49daf
feat(commons): deprecate flattenShadowColors in favor of flattenColor…
WilcoFiers Dec 5, 2022
284a5c2
chore: improve type definitions (#3808)
WilcoFiers Dec 5, 2022
23f1d76
ci: fix nightly test (#3812)
michael-siek Dec 5, 2022
3fe4901
ci: fix prettier GHA (#3813)
michael-siek Dec 5, 2022
e5a6046
ci: bump circleci/browser-tools to 1.4.0 (#3810)
piwysocki Dec 5, 2022
551192a
ci: run on node 16.18 (#3815)
piwysocki Dec 6, 2022
6d01604
ci: Add a workflow for creating releases (#3804)
stephenmathieson Dec 6, 2022
b971caf
fix(get-role): handle presentation role inheritance for vnodes with n…
dbowling Dec 6, 2022
08e2d20
ci: bump cimg/go image (#3816)
piwysocki Dec 7, 2022
123b83c
fix(color-contrast): correctly calculate background color of text nod…
straker Dec 8, 2022
a0e2f49
ci: fix release script not installing (#3821)
WilcoFiers Dec 9, 2022
07a5dad
ci: fix the release script fix (#3822)
WilcoFiers Dec 9, 2022
a6569e5
fix(aria-required-children): allow menu as child of menu (#3820)
straker Dec 12, 2022
d4b53cc
chore(release): 4.6.0
attest-team-ci Dec 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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