@kodalabs-io/eqo 1.0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Koda Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,162 @@
1
+ <div align="center">
2
+ <a href="https://kodalabs-io.github.io/eqo">
3
+ <img src="https://github.com/kodalabs-io/eqo/blob/main/docs/public/banner.png?raw=true" alt="eqo - RGAA accessibility engine" width="100%" style="max-width: 800px;">
4
+ </a>
5
+
6
+ <h1>eqo</h1>
7
+
8
+ <p><strong>RGAA v4.1.2 accessibility compliance analyzer for NextJS projects.</strong></p>
9
+
10
+ <a href="https://kodalabs-io.github.io/eqo">
11
+ <img alt="Documentation" src="https://img.shields.io/badge/DOCUMENTATION-Check%20it-000?style=for-the-badge&logo=gitbook&labelColor=31c553">
12
+ </a>
13
+ <a href="https://www.npmjs.com/package/@kodalabs-io/eqo">
14
+ <img alt="NPM version" src="https://img.shields.io/npm/v/@kodalabs-io/eqo?style=for-the-badge&labelColor=000000&color=cb3837">
15
+ </a>
16
+ <a href="LICENSE">
17
+ <img alt="License" src="https://img.shields.io/badge/LICENSE-MIT-000?style=for-the-badge&labelColor=000000&color=4488ff">
18
+ </a>
19
+ <a href="https://github.com/kodalabs-io/eqo/actions">
20
+ <img alt="CI Status" src="https://img.shields.io/github/check-runs/kodalabs-io/eqo/main?style=for-the-badge&logo=github&labelColor=000000">
21
+ </a>
22
+
23
+ <br />
24
+ <br />
25
+ </div>
26
+
27
+ Audit your Next.js source code and rendered pages against all 106 [RGAA v4.1.2](https://accessibilite.numerique.gouv.fr/) criteria (aligned with WCAG 2.1 A/AA). Automate ~65% of the criteria, generate reports in 5 formats, block CI on regressions, and feed your legal accessibility declaration — without false promises about what automation can and cannot do.
28
+
29
+ **[→ Full documentation](https://kodalabs-io.github.io/eqo)**
30
+
31
+ ---
32
+
33
+ ## Features
34
+
35
+ - **106 RGAA v4.1.2 criteria** — complete catalog, automation level stated per criterion
36
+ - **Two-phase analysis** — Babel AST static analysis + Playwright runtime (real Chromium)
37
+ - **5 output formats** — JSON, HTML, SARIF (GitHub Code Scanning), Markdown, JUnit
38
+ - **CI/CD native** — configurable threshold, exit code 1 on failure, inline PR annotations
39
+ - **Honest by design** — `needs-review` criteria are clearly marked, never inflated
40
+ - **GitHub Action** included
41
+ - **i18n** — `en-US` (default) and `fr-FR`
42
+
43
+ ---
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ pnpm add -D @kodalabs-io/eqo
49
+ # npm install -D @kodalabs-io/eqo
50
+ # bun add -D @kodalabs-io/eqo
51
+ ```
52
+
53
+ For runtime analysis (browser), install the Playwright peer dependencies:
54
+
55
+ ```bash
56
+ pnpm add -D playwright @axe-core/playwright axe-core
57
+ pnpm exec playwright install chromium
58
+ ```
59
+
60
+ > **No browser?** Start with `--static-only`. Themes 1, 2, 5, 6, 8, 9, 11 — no Playwright needed.
61
+
62
+ ---
63
+
64
+ ## Quick Start
65
+
66
+ ### 1. Initialize
67
+
68
+ ```bash
69
+ pnpm eqo init # npx eqo init · bunx eqo init
70
+ ```
71
+
72
+ Creates `rgaa.config.ts` in your project root.
73
+
74
+ ### 2. Configure
75
+
76
+ ```typescript
77
+ // rgaa.config.ts
78
+ import { defineConfig } from "@kodalabs-io/eqo";
79
+
80
+ export default defineConfig({
81
+ baseUrl: "http://localhost:3000",
82
+ projectName: "my-app",
83
+ locale: "fr-FR",
84
+
85
+ pages: [
86
+ { path: "/", name: "Home" },
87
+ { path: "/contact", name: "Contact" },
88
+ { path: "/accessibilite", name: "Accessibility" },
89
+ ],
90
+
91
+ output: [
92
+ { format: "json", path: "./public/rgaa-report.json" },
93
+ { format: "sarif", path: "./reports/rgaa.sarif" },
94
+ { format: "markdown", path: "./reports/rgaa.md" },
95
+ ],
96
+
97
+ thresholds: {
98
+ complianceRate: 0, // 0 = never block CI. Set to 80 to enforce a threshold.
99
+ failOn: "threshold",
100
+ },
101
+ });
102
+ ```
103
+
104
+ ### 3. Run
105
+
106
+ ```bash
107
+ npx eqo analyze # Full audit: static + browser
108
+ npx eqo analyze --static-only # No browser — runs in seconds
109
+ npx eqo analyze --threshold 80 # Override threshold for a one-off check
110
+ ```
111
+
112
+ ---
113
+
114
+ ## GitHub Actions
115
+
116
+ ```yaml
117
+ name: Accessibility Audit
118
+ on:
119
+ push:
120
+ branches: [main]
121
+ pull_request:
122
+
123
+ jobs:
124
+ rgaa:
125
+ runs-on: ubuntu-latest
126
+ steps:
127
+ - uses: actions/checkout@v4
128
+
129
+ - name: Start Next.js app
130
+ run: |
131
+ npm install && npm run build && npm start &
132
+ npx wait-on http://localhost:3000
133
+
134
+ - name: Run RGAA audit
135
+ uses: kodalabs-io/eqo@v1
136
+ with:
137
+ threshold: 0 # 0 = report only, never blocks CI
138
+ locale: fr-FR
139
+ upload-sarif: true # Adds inline annotations to your PR diff
140
+ ```
141
+
142
+ > Set `threshold: 80` to fail the pipeline if compliance drops below 80%.
143
+
144
+ ---
145
+
146
+ ## Documentation
147
+
148
+ | | |
149
+ |---|---|
150
+ | [Introduction](https://kodalabs-io.github.io/eqo/introduction/) | RGAA law, who must comply, and Eqo's honest scope |
151
+ | [Getting Started](https://kodalabs-io.github.io/eqo/getting-started/) | Install, configure, and run your first audit in 5 minutes |
152
+ | [Configuration](https://kodalabs-io.github.io/eqo/configuration/) | Full `rgaa.config.ts` reference — every option explained |
153
+ | [Accessibility Page](https://kodalabs-io.github.io/eqo/guides/accessibility-page/) | Build your `/accessibilite` page in Next.js |
154
+ | [CI/CD Integration](https://kodalabs-io.github.io/eqo/guides/ci-cd/) | Blocking strategies, thresholds, PR comments |
155
+ | [CLI Reference](https://kodalabs-io.github.io/eqo/reference/cli/) | All `eqo` commands and flags |
156
+ | [API Reference](https://kodalabs-io.github.io/eqo/reference/api/) | Programmatic usage as a library |
157
+
158
+ ---
159
+
160
+ ## License
161
+
162
+ [MIT](LICENSE) — Copyright © 2026 Koda Labs
package/action.yml ADDED
@@ -0,0 +1,77 @@
1
+ name: "RGAA Accessibility Audit"
2
+ description: "Analyze RGAA v4.1.2 accessibility compliance for NextJS projects"
3
+ author: "Koda Labs"
4
+
5
+ branding:
6
+ icon: "eye"
7
+ color: "blue"
8
+
9
+ inputs:
10
+ config:
11
+ description: "Path to the configuration file (default: rgaa.config.ts)"
12
+ required: false
13
+ default: "rgaa.config.ts"
14
+ threshold:
15
+ description: >
16
+ Minimum compliance rate (0–100).
17
+ Set to 0 to never block CI — the report is still generated.
18
+ required: false
19
+ default: "0"
20
+ locale:
21
+ description: "Report locale (en-US or fr-FR)"
22
+ required: false
23
+ default: "en-US"
24
+ static-only:
25
+ description: "Run static source analysis only (skip browser)"
26
+ required: false
27
+ default: "false"
28
+ runtime-only:
29
+ description: "Run browser analysis only (skip static source analysis)"
30
+ required: false
31
+ default: "false"
32
+ upload-sarif:
33
+ description: "Upload SARIF results to GitHub Code Scanning (requires write permissions)"
34
+ required: false
35
+ default: "true"
36
+
37
+ outputs:
38
+ compliance-rate:
39
+ description: "Compliance rate as a percentage (0–100)"
40
+ report-path:
41
+ description: "Path to the generated JSON report"
42
+ issue-count:
43
+ description: "Total number of detected issues"
44
+
45
+ runs:
46
+ using: "composite"
47
+ steps:
48
+ - name: Set up Node.js
49
+ uses: actions/setup-node@v4
50
+ with:
51
+ node-version: "22"
52
+
53
+ - name: Install kodalabs-io/eqo
54
+ shell: bash
55
+ run: npm install --global @kodalabs-io/eqo@latest
56
+
57
+ - name: Install Playwright browsers
58
+ if: ${{ inputs.static-only != 'true' }}
59
+ shell: bash
60
+ run: npx playwright install chromium --with-deps
61
+
62
+ - name: Run RGAA audit
63
+ shell: bash
64
+ env:
65
+ INPUT_CONFIG: ${{ inputs.config }}
66
+ INPUT_THRESHOLD: ${{ inputs.threshold }}
67
+ INPUT_LOCALE: ${{ inputs.locale }}
68
+ INPUT_STATIC_ONLY: ${{ inputs.static-only }}
69
+ INPUT_RUNTIME_ONLY: ${{ inputs.runtime-only }}
70
+ run: eqo analyze --config "$INPUT_CONFIG" --threshold "$INPUT_THRESHOLD" --locale "$INPUT_LOCALE"
71
+
72
+ - name: Upload SARIF to GitHub Code Scanning
73
+ if: ${{ inputs.upload-sarif == 'true' && always() }}
74
+ uses: github/codeql-action/upload-sarif@v3
75
+ with:
76
+ sarif_file: reports/rgaa.sarif
77
+ continue-on-error: true