aria-ease 6.4.8 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +15 -27
  2. package/bin/{chunk-TQBS54MM.js → chunk-AUJAN4RK.js} +35 -19
  3. package/bin/cli.cjs +952 -513
  4. package/bin/cli.js +1 -1
  5. package/bin/contractTestRunnerPlaywright-7F756CFB.js +984 -0
  6. package/bin/{test-WICJJ62P.js → test-C3CMRHSI.js} +39 -32
  7. package/dist/{chunk-TQBS54MM.js → chunk-AUJAN4RK.js} +35 -19
  8. package/dist/contractTestRunnerPlaywright-7F756CFB.js +984 -0
  9. package/dist/index.cjs +958 -519
  10. package/dist/index.js +46 -39
  11. package/dist/src/{Types.d-DYfYR3Vc.d.cts → Types.d-yGC2bBaB.d.cts} +1 -1
  12. package/dist/src/{Types.d-DYfYR3Vc.d.ts → Types.d-yGC2bBaB.d.ts} +1 -1
  13. package/dist/src/accordion/index.d.cts +1 -1
  14. package/dist/src/accordion/index.d.ts +1 -1
  15. package/dist/src/block/index.d.cts +1 -1
  16. package/dist/src/block/index.d.ts +1 -1
  17. package/dist/src/checkbox/index.d.cts +1 -1
  18. package/dist/src/checkbox/index.d.ts +1 -1
  19. package/dist/src/combobox/index.d.cts +1 -1
  20. package/dist/src/combobox/index.d.ts +1 -1
  21. package/dist/src/menu/index.cjs +7 -7
  22. package/dist/src/menu/index.d.cts +1 -1
  23. package/dist/src/menu/index.d.ts +1 -1
  24. package/dist/src/menu/index.js +7 -7
  25. package/dist/src/radio/index.d.cts +1 -1
  26. package/dist/src/radio/index.d.ts +1 -1
  27. package/dist/src/tabs/index.d.cts +1 -1
  28. package/dist/src/tabs/index.d.ts +1 -1
  29. package/dist/src/toggle/index.d.cts +1 -1
  30. package/dist/src/toggle/index.d.ts +1 -1
  31. package/dist/src/utils/test/{contracts/AccordionContract.json → aria-contracts/accordion/accordion.contract.json} +20 -7
  32. package/dist/src/utils/test/{contracts/ComboboxContract.json → aria-contracts/combobox/combobox.listbox.contract.json} +18 -17
  33. package/dist/src/utils/test/{contracts/MenuContract.json → aria-contracts/menu/menu.contract.json} +42 -1
  34. package/dist/src/utils/test/{contracts/TabsContract.json → aria-contracts/tabs/tabs.contract.json} +20 -7
  35. package/dist/src/utils/test/{chunk-TQBS54MM.js → chunk-AUJAN4RK.js} +34 -18
  36. package/dist/src/utils/test/contractTestRunnerPlaywright-HL73FADJ.js +955 -0
  37. package/dist/src/utils/test/index.cjs +921 -505
  38. package/dist/src/utils/test/index.d.cts +6 -1
  39. package/dist/src/utils/test/index.d.ts +6 -1
  40. package/dist/src/utils/test/index.js +38 -31
  41. package/package.json +2 -2
  42. package/bin/contractTestRunnerPlaywright-D57V4RSU.js +0 -628
  43. package/dist/contractTestRunnerPlaywright-D57V4RSU.js +0 -628
  44. package/dist/src/utils/test/contractTestRunnerPlaywright-HV4EIRDH.js +0 -610
@@ -3,6 +3,11 @@ interface JestAxeResult {
3
3
  raw: unknown;
4
4
  contract: unknown;
5
5
  }
6
+ interface ContractTestResult {
7
+ passes: string[];
8
+ failures: string[];
9
+ skipped: string[];
10
+ }
6
11
 
7
12
  /**
8
13
  * Runs static and interactions accessibility test on UI components.
@@ -12,7 +17,7 @@ interface JestAxeResult {
12
17
  */
13
18
 
14
19
  declare function testUiComponent(componentName: string, component: HTMLElement | null, url: string | null): Promise<JestAxeResult>;
15
- declare let runTest: () => Promise<void>;
20
+ declare let runTest: () => Promise<ContractTestResult>;
16
21
  /**
17
22
  * Cleanup function to close the shared Playwright browser
18
23
  * Call this in afterAll() or after all tests complete
@@ -3,6 +3,11 @@ interface JestAxeResult {
3
3
  raw: unknown;
4
4
  contract: unknown;
5
5
  }
6
+ interface ContractTestResult {
7
+ passes: string[];
8
+ failures: string[];
9
+ skipped: string[];
10
+ }
6
11
 
7
12
  /**
8
13
  * Runs static and interactions accessibility test on UI components.
@@ -12,7 +17,7 @@ interface JestAxeResult {
12
17
  */
13
18
 
14
19
  declare function testUiComponent(componentName: string, component: HTMLElement | null, url: string | null): Promise<JestAxeResult>;
15
- declare let runTest: () => Promise<void>;
20
+ declare let runTest: () => Promise<ContractTestResult>;
16
21
  /**
17
22
  * Cleanup function to close the shared Playwright browser
18
23
  * Call this in afterAll() or after all tests complete
@@ -1,4 +1,4 @@
1
- import { closeSharedBrowser, ContractReporter, contract_default } from './chunk-TQBS54MM.js';
1
+ import { closeSharedBrowser, ContractReporter, contract_default } from './chunk-AUJAN4RK.js';
2
2
  import { axe } from 'jest-axe';
3
3
  import fs from 'fs/promises';
4
4
 
@@ -17,6 +17,7 @@ async function runContractTests(componentName, component) {
17
17
  const failures = [];
18
18
  const passes = [];
19
19
  const skipped = [];
20
+ const failuresBeforeStatic = failures.length;
20
21
  for (const test of componentContract.static[0].assertions) {
21
22
  if (test.target !== "relative") {
22
23
  const selector = componentContract.selectors[test.target];
@@ -55,8 +56,9 @@ async function runContractTests(componentName, component) {
55
56
  skipped.push(dynamicTest.description);
56
57
  reporter.reportTest(dynamicTest, "skip");
57
58
  }
58
- const staticPassed = componentContract.static[0].assertions.length;
59
- const staticFailed = 0;
59
+ const staticTotal = componentContract.static[0].assertions.length;
60
+ const staticFailed = failures.length - failuresBeforeStatic;
61
+ const staticPassed = Math.max(0, staticTotal - staticFailed);
60
62
  reporter.reportStatic(staticPassed, staticFailed);
61
63
  reporter.summary(failures);
62
64
  return { passes, failures, skipped };
@@ -106,7 +108,7 @@ Error: ${error instanceof Error ? error.message : String(error)}`
106
108
  const devServerUrl = await checkDevServer(url);
107
109
  if (devServerUrl) {
108
110
  console.log(`\u{1F3AD} Running Playwright tests on ${devServerUrl}`);
109
- const { runContractTestsPlaywright } = await import('./contractTestRunnerPlaywright-HV4EIRDH.js');
111
+ const { runContractTestsPlaywright } = await import('./contractTestRunnerPlaywright-HL73FADJ.js');
110
112
  contract = await runContractTestsPlaywright(componentName, devServerUrl);
111
113
  } else {
112
114
  throw new Error(
@@ -161,6 +163,11 @@ ${violationDetails}
161
163
  return result;
162
164
  }
163
165
  var runTest = async () => {
166
+ return {
167
+ passes: [],
168
+ failures: [],
169
+ skipped: []
170
+ };
164
171
  };
165
172
  if (typeof window === "undefined") {
166
173
  runTest = async () => {
@@ -168,36 +175,36 @@ if (typeof window === "undefined") {
168
175
  `);
169
176
  const { exec } = await import('child_process');
170
177
  const chalk = (await import('chalk')).default;
171
- exec(
172
- `npx vitest --run --reporter verbose`,
173
- { cwd: process.cwd() },
174
- async (error, stdout, stderr) => {
175
- if (stdout) {
178
+ return new Promise((resolve, reject) => {
179
+ exec(
180
+ `npx vitest --run --reporter verbose`,
181
+ async (error, stdout, stderr) => {
176
182
  console.log(stdout);
177
- }
178
- if (stderr) {
179
- console.error(stderr);
180
- }
181
- if (!error || error.code === 0) {
182
- try {
183
- const { displayBadgeInfo, promptAddBadge } = await import('./badgeHelper-HZKGOPB4.js');
184
- displayBadgeInfo("component");
185
- await promptAddBadge("component", process.cwd());
186
- console.log(chalk.dim("\n" + "\u2500".repeat(60)));
187
- console.log(chalk.cyan("\u{1F499} Found aria-ease helpful?"));
188
- console.log(chalk.white(" \u2022 Star us on GitHub: ") + chalk.blue.underline("https://github.com/aria-ease/aria-ease"));
189
- console.log(chalk.white(" \u2022 Share feedback: ") + chalk.blue.underline("https://github.com/aria-ease/aria-ease/discussions"));
190
- console.log(chalk.dim("\u2500".repeat(60) + "\n"));
191
- } catch (badgeError) {
192
- console.error("Warning: Could not display badge prompt:", badgeError);
183
+ if (stderr) console.error(stderr);
184
+ const testsPassed = !error || error.code === 0;
185
+ if (testsPassed) {
186
+ try {
187
+ const { displayBadgeInfo, promptAddBadge } = await import('./badgeHelper-HZKGOPB4.js');
188
+ displayBadgeInfo("component");
189
+ await promptAddBadge("component", process.cwd());
190
+ console.log(chalk.dim("\n" + "\u2500".repeat(60)));
191
+ console.log(chalk.cyan("\u{1F499} Found aria-ease helpful?"));
192
+ console.log(chalk.white(" \u2022 Star us on GitHub: ") + chalk.blue.underline("https://github.com/aria-ease/aria-ease"));
193
+ console.log(chalk.white(" \u2022 Share feedback: ") + chalk.blue.underline("https://github.com/aria-ease/aria-ease/discussions"));
194
+ console.log(chalk.dim("\u2500".repeat(60) + "\n"));
195
+ } catch (badgeError) {
196
+ console.error("Warning: Could not display badge prompt:", badgeError);
197
+ }
198
+ resolve({ passes: [], failures: [], skipped: [] });
199
+ process.exit(0);
200
+ } else {
201
+ const exitCode = error?.code || 1;
202
+ reject(new Error(`Tests failed with code ${exitCode}`));
203
+ process.exit(exitCode);
193
204
  }
194
- process.exit(0);
195
- } else {
196
- const exitCode = error?.code || 1;
197
- process.exit(exitCode);
198
205
  }
199
- }
200
- );
206
+ );
207
+ });
201
208
  };
202
209
  }
203
210
  async function cleanupTests() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aria-ease",
3
- "version": "6.4.8",
3
+ "version": "6.5.0",
4
4
  "description": "Accessibility infrastructure for the entire frontend engineering lifecycle. Build accessible patterns, run automated audits, verify component interactions, and gate deployments — all in one system.",
5
5
  "main": "dist/index.cjs",
6
6
  "type": "module",
@@ -21,7 +21,7 @@
21
21
  "build:modules": "tsup ./src/combobox/index.ts ./src/accordion/index.ts ./src/block/index.ts ./src/checkbox/index.ts ./src/menu/index.ts ./src/tabs/index.ts ./src/radio/index.ts ./src/toggle/index.ts --format esm,cjs --dts --treeshake --outDir dist/src",
22
22
  "build:test": "tsup ./src/utils/test/index.ts --format esm,cjs --dts --treeshake --external jest-axe --external @testing-library/react --external playwright --external @playwright/test --outDir dist/src/utils/test",
23
23
  "build:cli": "tsup ./src/utils/cli/cli.ts --format esm,cjs --dts --outDir bin --external commander --external chalk --external jest-axe --external @testing-library/react --external @axe-core/playwright --external playwright",
24
- "build:contracts": "mkdir -p ./dist/src/utils/test && cp -r ./src/utils/test/contract/contracts ./dist/src/utils/test/",
24
+ "build:contracts": "mkdir -p ./dist/src/utils/test && cp -r ./src/utils/test/contract/aria-contracts ./dist/src/utils/test/",
25
25
  "build": "npm run clean && npm run build:core && npm run build:modules && npm run build:test && npm run build:cli && npm run build:contracts"
26
26
  },
27
27
  "repository": {