@wcag-checkr/ci 1.0.0-rc.13

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 (50) hide show
  1. package/README.md +135 -0
  2. package/dist/assets/ErrorBoundary-BPz4qckm.js +524 -0
  3. package/dist/assets/_commonjsHelpers-Cpj98o6Y.js +1 -0
  4. package/dist/assets/ai-usage-log-DFkwAfmW.js +1 -0
  5. package/dist/assets/content-script.ts-D7yXcBUr.js +181 -0
  6. package/dist/assets/content-script.ts-loader-Cn8Y9Xod.js +13 -0
  7. package/dist/assets/crash-reporter-wxu43qbG.js +4 -0
  8. package/dist/assets/devtools-panel-D2fL4guz.js +1 -0
  9. package/dist/assets/devtools.html-DQBohI9U.js +1 -0
  10. package/dist/assets/diff-D4sCAdXf.js +1 -0
  11. package/dist/assets/forensic-log-B3iX62mE.js +129 -0
  12. package/dist/assets/main-CqDdt0Iq.js +6 -0
  13. package/dist/assets/main-DyQfCbPM.js +1 -0
  14. package/dist/assets/modulepreload-polyfill-B5Qt9EMX.js +1 -0
  15. package/dist/assets/options.html-jfjpxZBp.js +1 -0
  16. package/dist/assets/preload-helper-D7HrI6pR.js +1 -0
  17. package/dist/assets/reflow-analyzer-DNgBX8N_.js +1 -0
  18. package/dist/assets/service-worker.ts-DaHvU8nE.js +715 -0
  19. package/dist/assets/side-panel.html-DW1tssqQ.js +1 -0
  20. package/dist/assets/site-report-renderer-JH44v2hK.js +147 -0
  21. package/dist/assets/state-DnzwwNxZ.js +1 -0
  22. package/dist/assets/styles-DP9v_aMy.css +1 -0
  23. package/dist/assets/styles-kHMb1Lda.js +84 -0
  24. package/dist/devtools/devtools.html +11 -0
  25. package/dist/devtools/panel.html +20 -0
  26. package/dist/fonts/mona-sans-variable.woff2 +0 -0
  27. package/dist/icons/icon-128.png +0 -0
  28. package/dist/icons/icon-16.png +0 -0
  29. package/dist/icons/icon-32.png +0 -0
  30. package/dist/icons/icon-48.png +0 -0
  31. package/dist/manifest.json +70 -0
  32. package/dist/options/options.html +19 -0
  33. package/dist/service-worker-loader.js +1 -0
  34. package/dist/side-panel/App.tsx +174 -0
  35. package/dist/side-panel/README.md +57 -0
  36. package/dist/side-panel/audit-launcher.test.ts +56 -0
  37. package/dist/side-panel/audit-launcher.ts +65 -0
  38. package/dist/side-panel/format-component-id.test.ts +89 -0
  39. package/dist/side-panel/format-component-id.ts +40 -0
  40. package/dist/side-panel/github-issue.test.ts +102 -0
  41. package/dist/side-panel/github-issue.ts +66 -0
  42. package/dist/side-panel/jira-issue.ts +64 -0
  43. package/dist/side-panel/main.tsx +19 -0
  44. package/dist/side-panel/side-panel.html +21 -0
  45. package/dist/side-panel/store.ts +264 -0
  46. package/dist/side-panel/styles.css +16 -0
  47. package/dist/side-panel/wire-messaging.test.ts +202 -0
  48. package/dist/side-panel/wire-messaging.ts +285 -0
  49. package/package.json +39 -0
  50. package/wcagcheckr-ci.mjs +559 -0
package/README.md ADDED
@@ -0,0 +1,135 @@
1
+ # @wcag-checkr/ci
2
+
3
+ Headless wcagcheckr accessibility audit runner for CI/CD pipelines.
4
+
5
+ Drives the wcagcheckr Chrome extension via Playwright, running full-page WCAG audits **across the same 108-state matrix** (hover, focus, dark mode, RTL, breakpoints, etc.) the extension uses interactively. So your CI catches what your developer sees.
6
+
7
+ ## Why this matters
8
+
9
+ Competing tools (axe DevTools Pro, Siteimprove Enterprise) charge for CI/CD integration. We ship it free. And ours is the **only** CI runner that audits at hover/focus/dark/RTL/breakpoint state combinations — competitors run a single default-state audit.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install --save-dev @wcag-checkr/ci playwright
15
+ npx playwright install chromium
16
+ ```
17
+
18
+ ## Use
19
+
20
+ ```bash
21
+ npx wcagcheckr-ci audit https://your-site.com/
22
+ ```
23
+
24
+ Default: outputs JSON to stdout, exits non-zero if any **serious** or **critical** violations.
25
+
26
+ ### Common flags
27
+
28
+ ```bash
29
+ # Write SARIF for GitHub PR annotations
30
+ npx wcagcheckr-ci audit https://your-site.com/ --format sarif --output a11y.sarif
31
+
32
+ # Write JUnit XML for Jenkins/GitLab CI
33
+ npx wcagcheckr-ci audit https://your-site.com/ --format junit --output a11y.xml
34
+
35
+ # Strict — fail on any violation, even minor
36
+ npx wcagcheckr-ci audit https://your-site.com/ --threshold minor
37
+
38
+ # Permissive — never fail (just collect findings)
39
+ npx wcagcheckr-ci audit https://your-site.com/ --threshold none
40
+
41
+ # Audit with a license token (unlocks paid features like forensic anchoring)
42
+ npx wcagcheckr-ci audit https://your-site.com/ --license $WCAGCHECKR_LICENSE
43
+
44
+ # Use your own built extension (e.g. self-hosted fork)
45
+ npx wcagcheckr-ci audit https://your-site.com/ --extension-dir ./path/to/dist
46
+ ```
47
+
48
+ ## Verifying a forensic log
49
+
50
+ The extension's Forensic tab can export your full audit log as JSON (the **export JSON** button). That file contains every audit's identity hash, RFC 3161 trusted-timestamp token, and ed25519 server signature. `wcagcheckr-ci verify` validates it offline (the server is only contacted to fetch the public key by fingerprint):
51
+
52
+ ```bash
53
+ npx wcagcheckr-ci verify wcagcheckr-forensic-log.json
54
+ ```
55
+
56
+ Per entry, the verifier:
57
+
58
+ 1. Recomputes the SHA-256 identity hash from the stored fields and checks it against the recorded hash.
59
+ 2. Fetches the server's ed25519 public key matching the receipt's fingerprint and verifies the signature over `(hash, anchoredAt, tsaName, productSlug, prevAuditHash)`.
60
+ 3. If `prevAuditHash` references another entry in the same export, validates the chain link. (Deep chain links require exporting the full history.)
61
+
62
+ Exit code is `0` only when every entry's hash and signature verify cleanly.
63
+
64
+ To fully verify the RFC 3161 timestamp (which proves the hash was witnessed by a public TSA at the recorded time), save the receipt's `rfc3161TokenBase64` to a `.tsr` file and run `openssl ts -verify` against FreeTSA's certificate chain. That step is out-of-scope for v0 of the CLI verifier — the ed25519 signature already commits to the same TSA token bytes, so a verified ed25519 signature is strong evidence the receipt was issued by our server in response to that TSA timestamp.
65
+
66
+ ## Exit codes
67
+
68
+ | Code | Meaning |
69
+ |---|---|
70
+ | 0 | Success — threshold not exceeded |
71
+ | 1 | Threshold exceeded — CI failure signal |
72
+ | 2 | Runtime error (target unreachable, extension didn't load, etc.) |
73
+
74
+ ## GitHub Actions example
75
+
76
+ ```yaml
77
+ name: a11y
78
+ on: [pull_request]
79
+ jobs:
80
+ wcagcheckr:
81
+ runs-on: ubuntu-latest
82
+ steps:
83
+ - uses: actions/checkout@v4
84
+ - uses: actions/setup-node@v4
85
+ with: { node-version: '20' }
86
+ - run: npm ci
87
+ - run: npx playwright install chromium --with-deps
88
+ - run: npx wcagcheckr-ci audit ${{ env.PREVIEW_URL }} --format sarif --output a11y.sarif
89
+ - uses: github/codeql-action/upload-sarif@v3
90
+ if: always()
91
+ with: { sarif_file: a11y.sarif }
92
+ ```
93
+
94
+ ## GitLab CI example
95
+
96
+ ```yaml
97
+ a11y:
98
+ image: node:20
99
+ before_script:
100
+ - npm ci
101
+ - npx playwright install chromium --with-deps
102
+ script:
103
+ - npx wcagcheckr-ci audit "$PREVIEW_URL" --format junit --output a11y.xml
104
+ artifacts:
105
+ reports:
106
+ junit: a11y.xml
107
+ when: always
108
+ ```
109
+
110
+ ## License gating
111
+
112
+ The `audit` command can run without a license — free-tier audits work. To unlock paid features (forensic anchoring, AI summaries) in a CI run, pass `--license <token>`. The CLI activates the token via the same `LICENSE_SET_REQUEST` message the extension UI uses; failures are surfaced via a non-zero exit code.
113
+
114
+ For verification, **no license is required.** The forensic anchor verifier reads a public-key endpoint and recomputes signatures — anyone who receives a forensic-log JSON can validate it without any wcagcheckr credentials.
115
+
116
+ ## Programmatic API (planned)
117
+
118
+ A Node-importable API is on the roadmap:
119
+
120
+ ```js
121
+ import { audit } from '@wcag-checkr/ci';
122
+ const { violations, sarif } = await audit('https://your-site.com/');
123
+ ```
124
+
125
+ Until then, parse the JSON output of the CLI — same shape as the extension's "Export → JSON" output.
126
+
127
+ ## Limitations (v0)
128
+
129
+ - Auditing happens against the **rendered DOM at the URL you pass** — preview-deploy URLs work great; localhost requires the CI runner to also be the host (use `npm run start &` then audit `http://localhost:PORT`).
130
+ - Authentication: log-in flows aren't yet supported; pass URLs that don't require auth, or fork to inject cookies/auth headers via Playwright's `storageState`.
131
+ - The runner uses `headless: 'new'` (Chromium's modern headless mode); some sites that detect headless browsers may behave differently. Workaround: use `--extension-dir` with a forked runner that switches to `headless: false` on a virtual display.
132
+
133
+ ## License
134
+
135
+ UNLICENSED until commercial release. See `wcagcheckr.com/license`.