diff --git a/.changeset/config.json b/.changeset/config.json index 3523c7d..5e2964c 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -2,7 +2,7 @@ "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json", "changelog": [ "@changesets/changelog-github", - { "repo": "StackExchange/axe-apca" } + { "repo": "StackExchange/apca-check" } ], "commit": false, "access": "public", diff --git a/.changeset/red-hotels-bow.md b/.changeset/red-hotels-bow.md new file mode 100644 index 0000000..a16c7ab --- /dev/null +++ b/.changeset/red-hotels-bow.md @@ -0,0 +1,9 @@ +--- +"apca-check": minor +--- + +Rename package to `apca-check` to comply with Deque Systems, Inc. request (https://github.com/StackExchange/axe-apca/issues/8). + +BREAKING CHANGE: The [`axe-apca`](https://www.npmjs.com/package/axe-apca) package is now **deprecated**. +Please remove it from your dependencies and use [`apca-check`](https://www.npmjs.com/package/apca-check) instead. +For more information on installation and usage consult the [README.md](https://github.com/StackExchange/apca-check). \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e429a3f..f37dba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,27 +1,27 @@ -# axe-apca +# apca-check ## 0.0.4 ### Patch Changes -- [`95e3a68`](https://github.com/StackExchange/axe-apca/commit/95e3a68c581d6c54e7ec8d54ba5a5534943665e7) Thanks [@giamir](https://github.com/giamir)! - Compile distribution files so that they are compatible with node.js versions supporting ecmascript modules +- [`95e3a68`](https://github.com/StackExchange/apca-check/commit/95e3a68c581d6c54e7ec8d54ba5a5534943665e7) Thanks [@giamir](https://github.com/giamir)! - Compile distribution files so that they are compatible with node.js versions supporting ecmascript modules -- [`1e300c6`](https://github.com/StackExchange/axe-apca/commit/1e300c64de3d67798d4ee3214da61a102d699cd3) Thanks [@giamir](https://github.com/giamir)! - Fix typo in rules messages +- [`1e300c6`](https://github.com/StackExchange/apca-check/commit/1e300c64de3d67798d4ee3214da61a102d699cd3) Thanks [@giamir](https://github.com/giamir)! - Fix typo in rules messages ## 0.0.3 ### Patch Changes -- [`42d5b12`](https://github.com/StackExchange/axe-apca/commit/42d5b12035bfea11c37346613e6f8d91225bb80f) Thanks [@giamir](https://github.com/giamir)! - Fix package.json metadata +- [`42d5b12`](https://github.com/StackExchange/apca-check/commit/42d5b12035bfea11c37346613e6f8d91225bb80f) Thanks [@giamir](https://github.com/giamir)! - Fix package.json metadata ## 0.0.2 ### Patch Changes -- [`ccf1e94`](https://github.com/StackExchange/axe-apca/commit/ccf1e94bc1c8c231667fd84d943b2065cf6283fb) Thanks [@giamir](https://github.com/giamir)! - Typescript support for moduleResolution < node16 +- [`ccf1e94`](https://github.com/StackExchange/apca-check/commit/ccf1e94bc1c8c231667fd84d943b2065cf6283fb) Thanks [@giamir](https://github.com/giamir)! - Typescript support for moduleResolution < node16 ## 0.0.1 ### Patch Changes -- [`7728604`](https://github.com/StackExchange/axe-apca/commit/7728604acb78e886ce4b7989a1cf916354c167b2) Thanks [@giamir](https://github.com/giamir)! - Initial release +- [`7728604`](https://github.com/StackExchange/apca-check/commit/7728604acb78e886ce4b7989a1cf916354c167b2) Thanks [@giamir](https://github.com/giamir)! - Initial release diff --git a/README.md b/README.md index b0aa4bf..0694033 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# axe-apca +# apca-check [![ci status][gh-action-badge]][gh-action-url] [![npm version][npm-badge]][npm-url] @@ -9,16 +9,16 @@ This package contains custom axe rules and checks for [APCA](https://readtech.or ### Installation ```bash -npm install --save-dev axe-core axe-apca +npm install --save-dev axe-core apca-check ``` ### Setup ```js import axe from "axe-core"; -import { registerAxeAPCA } from 'axe-apca'; +import { registerAPCACheck } from 'apca-check'; -registerAxeAPCA('bronze'); // or registerAxeAPCA('silver'); +registerAPCACheck('bronze'); // or registerAPCACheck('silver'); // consider turning off default WCAG 2.2 AA color contrast rules when using APCA axe.configure({ @@ -35,7 +35,7 @@ axe.run(document, (err, results) => { To set custom thresholds for APCA checks, follow these steps: -1. Use `custom` as the first argument when calling `registerAxeAPCA`. +1. Use `custom` as the first argument when calling `registerAPCACheck`. 1. Provide a function as the second argument, optionally accepting `fontSize` and `fontWeight` arguments. @@ -47,7 +47,7 @@ const customConformanceThresholdFn = (fontSize, fontWeight) => { return size >= 32 || weight > 700 ? 45 : 60; }; -registerAxeAPCA('custom', customConformanceThresholdFn); +registerAPCACheck('custom', customConformanceThresholdFn); ``` ## Development @@ -85,7 +85,7 @@ We use [changesets](https://github.com/changesets/changesets) to automatize the - Every time you do work that requires a new release to be published, [add a changesets entry](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) by running `npx chageset` and follow the instrcutions on screen. (changes that do not require a new release - e.g. changing a test file - don't need a changeset). - When opening a PR without a corresponding changeset the [changesets-bot](https://github.com/apps/changeset-bot) will remind you to do so. It generally makes sense to have one changeset for PR (if the PR changes do not require a new release to be published the bot message can be safely ignored) -- The [release github workflow](.github/workflows/release.yml) continuosly check if there are new pending changesets in the main branch, if there are it creates a GH PR (`chore(release)` [see example](https://github.com/StackExchange/axe-apca/pull/2)) and continue updating it as more changesets are potentially pushed/merged to the main branch. +- The [release github workflow](.github/workflows/release.yml) continuosly check if there are new pending changesets in the main branch, if there are it creates a GH PR (`chore(release)` [see example](https://github.com/StackExchange/apca-check/pull/2)) and continue updating it as more changesets are potentially pushed/merged to the main branch. - When we are ready to cut a release we need to simply merge the `chore(release)` PR back to main and the release github workflow will take care of publishing the changes to NPM and create a GH release for us. The `chore(release)` PR also give us an opportunity to adjust the automatically generated changelog when necessary (the entry in the changelog file is also what will end up in the GH release notes). _The release github workflow only run if the CI workflow (running linter, formatter and tests) is successful: CI is blocking accidental releases_. @@ -94,8 +94,10 @@ _Despite using changesets to communicate the intent of creating releases in a mo ## License Copyright 2023 Stack Exchange, Inc and released under the [MIT License](/LICENSE.MD). +`axe-core®` and `axe®` are a trademark of Deque Systems, Inc. in the US and other countries. -[gh-action-url]: https://github.com/StackExchange/axe-apca/actions/workflows/CI.yml -[gh-action-badge]: https://github.com/StackExchange/axe-apca/actions/workflows/CI.yml/badge.svg?branch=main -[npm-url]: https://npmjs.org/package/axe-apca -[npm-badge]: https://img.shields.io/npm/v/axe-apca.svg \ No newline at end of file + +[gh-action-url]: https://github.com/StackExchange/apca-check/actions/workflows/CI.yml +[gh-action-badge]: https://github.com/StackExchange/apca-check/actions/workflows/CI.yml/badge.svg?branch=main +[npm-url]: https://npmjs.org/package/apca-check +[npm-badge]: https://img.shields.io/npm/v/apca-check.svg \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5aa2da8..9d99105 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "axe-apca", + "name": "apca-check", "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "axe-apca", + "name": "apca-check", "version": "0.0.3", "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 1a31dce..7181474 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "axe-apca", + "name": "apca-check", "description": "Axe rules to check against APCA bronze and silver+ conformance levels.", "version": "0.0.4", "type": "module", @@ -13,12 +13,19 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/StackExchange/axe-apca.git" + "url": "git+https://github.com/StackExchange/apca-check.git" }, "license": "MIT", "files": [ "dist" ], + "keywords": [ + "accessibility", + "a11y", + "axe", + "axe-core", + "apca" + ], "scripts": { "build": "tsc", "lint": "eslint ./src", diff --git a/src/index.test.ts b/src/index.test.ts index e573bdf..d5010a8 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,7 +1,7 @@ import { html, fixture, expect } from "@open-wc/testing"; import axe from "axe-core"; import type { AxeResults } from "axe-core"; -import registerAxeAPCA from "."; +import registerAPCACheck from "."; const runAxe = async (el: HTMLElement): Promise => { return new Promise((resolve, reject) => { @@ -12,7 +12,7 @@ const runAxe = async (el: HTMLElement): Promise => { }); }; -describe("axe-apca", () => { +describe("apca-check", () => { describe("custom conformance level", () => { beforeEach(() => { const customConformanceThresholdFn = ( @@ -21,12 +21,12 @@ describe("axe-apca", () => { return parseFloat(fontSize) >= 32 ? 45 : 60; }; - registerAxeAPCA("custom", customConformanceThresholdFn); + registerAPCACheck("custom", customConformanceThresholdFn); }); it("should throw an error if no custom conformance threshold function is provided", () => { expect(() => { - registerAxeAPCA("custom"); + registerAPCACheck("custom"); }).to.throw( "A custom conformance level requires a custom conformance threshold function", ); @@ -99,7 +99,7 @@ describe("axe-apca", () => { describe("bronze conformance level", () => { beforeEach(() => { - registerAxeAPCA("bronze"); + registerAPCACheck("bronze"); }); it("should check for APCA accessibility contrast violations", async () => { @@ -169,7 +169,7 @@ describe("axe-apca", () => { describe("silver conformance level", () => { beforeEach(() => { - registerAxeAPCA("silver"); + registerAPCACheck("silver"); }); it("should check for APCA accessibility contrast violations", async () => { diff --git a/src/index.ts b/src/index.ts index 692aa4d..dcf758e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -115,7 +115,7 @@ const generateColorContrastAPCARule = (conformanceLevel: string): Rule => ({ tags: ["apca", "wcag3", `apca-${conformanceLevel}`], }); -const registerAxeAPCA = ( +const registerAPCACheck = ( conformanceLevel: ConformanceLevel, customConformanceThresholdFn?: ConformanceThresholdFn, ) => { @@ -146,4 +146,4 @@ const registerAxeAPCA = ( }; export type { ConformanceLevel, ConformanceThresholdFn }; -export default registerAxeAPCA; +export default registerAPCACheck;