Skip to content

Commit

Permalink
chore(naming): change package name
Browse files Browse the repository at this point in the history
  • Loading branch information
giamir committed Oct 23, 2023
1 parent 1a0d4f6 commit a88c8f6
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "StackExchange/axe-apca" }
{ "repo": "StackExchange/apca-check" }
],
"commit": false,
"access": "public",
Expand Down
9 changes: 9 additions & 0 deletions .changeset/red-hotels-bow.md
Original file line number Diff line number Diff line change
@@ -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).
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# axe-apca
# apca-check

[![ci status][gh-action-badge]][gh-action-url] [![npm version][npm-badge]][npm-url]

Expand All @@ -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({
Expand All @@ -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.


Expand All @@ -47,7 +47,7 @@ const customConformanceThresholdFn = (fontSize, fontWeight) => {
return size >= 32 || weight > 700 ? 45 : 60;
};

registerAxeAPCA('custom', customConformanceThresholdFn);
registerAPCACheck('custom', customConformanceThresholdFn);
```

## Development
Expand Down Expand Up @@ -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_.
Expand All @@ -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

[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
4 changes: 2 additions & 2 deletions package-lock.json

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

11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -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<AxeResults> => {
return new Promise((resolve, reject) => {
Expand All @@ -12,7 +12,7 @@ const runAxe = async (el: HTMLElement): Promise<AxeResults> => {
});
};

describe("axe-apca", () => {
describe("apca-check", () => {
describe("custom conformance level", () => {
beforeEach(() => {
const customConformanceThresholdFn = (
Expand All @@ -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",
);
Expand Down Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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 () => {
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const generateColorContrastAPCARule = (conformanceLevel: string): Rule => ({
tags: ["apca", "wcag3", `apca-${conformanceLevel}`],
});

const registerAxeAPCA = (
const registerAPCACheck = (
conformanceLevel: ConformanceLevel,
customConformanceThresholdFn?: ConformanceThresholdFn,
) => {
Expand Down Expand Up @@ -146,4 +146,4 @@ const registerAxeAPCA = (
};

export type { ConformanceLevel, ConformanceThresholdFn };
export default registerAxeAPCA;
export default registerAPCACheck;

0 comments on commit a88c8f6

Please sign in to comment.