rachnasutra 0.4.0 → 0.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.
- package/CHANGELOG.md +19 -2
- package/CITATION.cff +2 -2
- package/Dockerfile +9 -0
- package/README.gu.md +35 -0
- package/README.md +14 -12
- package/ROADMAP.md +8 -1
- package/case-studies/clean-blog/fixes.diff +152 -152
- package/dist/audit.js +24 -6
- package/dist/browser.js +147 -0
- package/dist/cli.js +117 -17
- package/dist/report.js +23 -0
- package/dist/rules.js +176 -0
- package/dist/tw-color.js +36 -0
- package/docs/cli-reference.md +1 -1
- package/docs/compatibility.md +1 -1
- package/docs/status.md +13 -6
- package/documents/rachnasutra/00-overview.md +4 -4
- package/documents/rachnasutra/02-functional-specification.md +6 -6
- package/documents/rachnasutra/03-architecture.md +1 -1
- package/documents/rachnasutra/04-technical-reference.md +2 -2
- package/documents/rachnasutra/05-user-guide.md +1 -1
- package/documents/rachnasutra/06-audit-rules-reference.md +46 -1
- package/documents/rachnasutra/10-testing-and-evidence.md +22 -21
- package/documents/rachnasutra/11-deployment-and-ci.md +26 -6
- package/documents/rachnasutra/12-roadmap-and-status.md +13 -11
- package/documents/rachnasutra/13-maintainer-handbook.md +1 -1
- package/documents/rachnasutra/15-rule-examples.md +456 -0
- package/documents/rachnasutra/16-validation-and-benchmarks.md +3 -3
- package/examples/prime-session-example.md +2 -2
- package/fixtures/rule-cases.mjs +85 -70
- package/llms.txt +4 -3
- package/package.json +7 -2
- package/samples/broken-ui/latest.html +42 -30
- package/samples/broken-ui/latest.json +39 -14
- package/samples/broken-ui/latest.md +24 -13
- package/samples/broken-ui/latest.sarif +48 -10
- package/samples/good-ui/latest.html +1 -1
- package/samples/good-ui/latest.json +3 -3
- package/samples/good-ui/latest.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,25 @@ All notable changes follow [Semantic Versioning](https://semver.org/). Report sc
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
7
|
+
- `.github/workflows/publish.yml` publishes the `package.json` version to npm on a manual run or a `vX.Y.Z` tag. It uses npm trusted publishing. No npm token is stored in GitHub.
|
|
8
|
+
|
|
9
|
+
## 0.5.0
|
|
10
|
+
|
|
11
|
+
- `audit --mode browser` launches Microsoft Edge or Chromium through Playwright, writes `screenshot.png`, runs axe-core, and attempts Lighthouse. `visual baseline` and `visual compare` save and byte-compare that screenshot. Exit 3 only when Playwright or a browser binary is missing. No result is invented.
|
|
12
|
+
- RS-A11Y-013 now measures Tailwind named colours in `src/tw-color.ts` (`text-gray-400`, `bg-white`, and the listed gray, slate, red, blue, and green steps), `.module.css` files, and `styled.x` / `css` template strings.
|
|
13
|
+
- Seven static rules: duplicate `id` (RS-A11Y-016), frame title (017), skip link when a page has `<nav>` (018), `autocomplete` on email and tel (019), empty heading (020), control border contrast under 3:1 (021), empty `lang` on part of a page (022). `role="img"` is now an image for RS-A11Y-001. RS-A11Y-013 also measures Tailwind `text-[#hex]` with `bg-[#hex]` and a JSX `style={{ color, background }}` object.
|
|
14
|
+
- `rachnasutra history <dir>` writes `history.md` and `history.html` with finding counts from saved JSON. It is not a screenshot comparison.
|
|
15
|
+
- `doctor` prints NOTE for browser, visual review and host smoke tests. Those lines are not a pass. The command still exits 0 when the installed files are fine.
|
|
16
|
+
- `failOn` in `rachnasutra.config.json` accepts `confirmed-critical`. That gate fails on confirmed high and confirmed critical. The name is historical.
|
|
17
|
+
- Docs home title no longer repeats. `package.json` homepage is the live docs site. `package-lock.json` version matches the package.
|
|
18
|
+
- `Dockerfile` runs the static CLI on Node 22. No browser is installed in the image. `.github/workflows/docker.yml` builds that image on Ubuntu. `.github/workflows/browser.yml` installs Chromium and checks that a broken page writes `screenshot.png` and axe findings.
|
|
19
|
+
- Short Gujarati overview: `README.gu.md`.
|
|
20
|
+
- CI rebuilds the HTML docs and fails if the committed HTML drifted.
|
|
21
|
+
- Documentation site is live at <https://shahvatsalofficial.github.io/rachnasutra/>.
|
|
22
|
+
- npm `rachnasutra@0.4.0` is still the registry `latest` until 0.5.0 is published. A placeholder `0.0.0-stage` is also still listed. A normal install gets 0.4.0 until publish.
|
|
23
|
+
- macOS stays out of CI. GitHub cancelled the queued jobs with zero steps. No macOS result is claimed.
|
|
24
|
+
|
|
25
|
+
Not in 0.5.0, because a fake result would be worse than a gap: live proof that Claude, Cursor, Codex, Copilot or Gemini loads the 13 skills; beating the published static axe-core numbers (92% / 83% against 81% / 73%); a blind re-label of the benchmarks; a macOS CI run; Windsurf and Kiro adapters (their skill paths are not confirmed). Browser mode calls axe-core on the rendered page. That does not change the static-rule comparison.
|
|
9
26
|
|
|
10
27
|
## 0.4.0
|
|
11
28
|
|
package/CITATION.cff
CHANGED
|
@@ -8,8 +8,8 @@ authors:
|
|
|
8
8
|
repository-code: "https://github.com/shahvatsalofficial/rachnasutra"
|
|
9
9
|
url: "https://github.com/shahvatsalofficial/rachnasutra"
|
|
10
10
|
license: Apache-2.0
|
|
11
|
-
version: 0.
|
|
12
|
-
date-released: "2026-11-
|
|
11
|
+
version: 0.5.0
|
|
12
|
+
date-released: "2026-11-07"
|
|
13
13
|
keywords:
|
|
14
14
|
- ui-ux
|
|
15
15
|
- accessibility
|
package/Dockerfile
ADDED
package/README.gu.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# RachnaSutra AI
|
|
2
|
+
|
|
3
|
+
UI/UX ઓડિટ અને Agent Skills. CLI કી વગર ચાલે છે. નેટવર્ક કે મોડેલ વગર સોર્સ વાંચે છે. રિપોર્ટ Markdown, HTML, JSON અને SARIF માં આવે છે.
|
|
4
|
+
|
|
5
|
+
આ પાનું અંગ્રેજી [README](README.md) નો ટૂંકો અનુવાદ છે. સંપૂર્ણ દસ્તાવેજ અંગ્રેજીમાં છે: <https://shahvatsalofficial.github.io/rachnasutra/>
|
|
6
|
+
|
|
7
|
+
## ઇન્સ્ટોલ
|
|
8
|
+
|
|
9
|
+
Node.js 20 અથવા નવું.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx rachnasutra audit .
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
પ્રોજેક્ટમાં:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install --save-dev rachnasutra
|
|
19
|
+
npx rachnasutra audit .
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
રિપોર્ટ `./rachnasutra-reports/` માં `latest.md` અને `latest.html` તરીકે લખાય છે.
|
|
23
|
+
|
|
24
|
+
## શું ચાલે છે
|
|
25
|
+
|
|
26
|
+
- સ્ટેટિક ઓડિટ. ફાઇલ અને લાઇન સાથે.
|
|
27
|
+
- ઍક્સેસિબિલિટી, રિસ્પોન્સિવ, ડિઝાઇન ટોકન, કન્ટેન્ટ અને ટ્રસ્ટ નિયમો.
|
|
28
|
+
- `plan-fixes` અને `verify --report` થી ફિક્સ પ્લાન અને રિગ્રેશન તપાસ.
|
|
29
|
+
- 13 Agent Skills. હોસ્ટમાં લોડ થાય છે કે નહીં તે હજુ લાઇવ ચકાસાયું નથી.
|
|
30
|
+
|
|
31
|
+
## શું ચાલતું નથી
|
|
32
|
+
|
|
33
|
+
બ્રાઉઝર ઓડિટ Playwright ઇન્સ્ટોલ હોય ત્યારે ચાલે છે: `npx rachnasutra audit --mode browser`. સ્ક્રીનશોટ, axe-core અને Lighthouse લેબ સ્કોર લખાય છે. Playwright ન હોય તો exit 3. બનાવટી પરિણામ નથી.
|
|
34
|
+
|
|
35
|
+
બનાવનાર [Vatsal Shah](https://github.com/shahvatsalofficial). Apache-2.0.
|
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
[](LICENSE)
|
|
9
9
|

|
|
10
10
|

|
|
11
|
-

|
|
12
12
|
|
|
13
|
-
**Quick links:** [Documentation](documents/rachnasutra/00-overview.md) | [Validation](documents/rachnasutra/16-validation-and-benchmarks.md) | [Sample report](samples/broken-ui/latest.md) | [Test evidence](documents/rachnasutra/10-testing-and-evidence.md) | [Rules](documents/rachnasutra/06-audit-rules-reference.md) | [Legal and limits](documents/rachnasutra/09-legal-and-compliance.md)
|
|
13
|
+
**Quick links:** [Live docs](https://shahvatsalofficial.github.io/rachnasutra/) | [Documentation](documents/rachnasutra/00-overview.md) | [Validation](documents/rachnasutra/16-validation-and-benchmarks.md) | [Sample report](samples/broken-ui/latest.md) | [Test evidence](documents/rachnasutra/10-testing-and-evidence.md) | [Rules](documents/rachnasutra/06-audit-rules-reference.md) | [Legal and limits](documents/rachnasutra/09-legal-and-compliance.md)
|
|
14
14
|
|
|
15
15
|
RachnaSutra AI is an open-source **UI/UX design engineering and auditing agent**: 13 portable [Agent Skills](https://agentskills.io/specification) led by **RachnaSutra Prime**, plus a **keyless CLI** that audits front-end code for accessibility (WCAG 2.2 AA oriented), responsive design, design-system, content and performance risks. Reports come out as JSON, Markdown, accessible HTML and SARIF 2.1.0.
|
|
16
16
|
|
|
@@ -31,7 +31,7 @@ Created by **[Vatsal Shah](https://github.com/shahvatsalofficial)**. Licensed un
|
|
|
31
31
|
| Fix plan and fix verification against a saved baseline | `rachnasutra plan-fixes`, `rachnasutra verify --report` (each writes Markdown and HTML next to the JSON report) | No |
|
|
32
32
|
| CI gate with stable exit codes | `rachnasutra ci` | No |
|
|
33
33
|
| Visual critique, flows, copy, redesign proposals, implementation | the `rachnasutra-*` skills | Yes (your IDE's model) |
|
|
34
|
-
| Browser, screenshot, axe and Lighthouse
|
|
34
|
+
| Browser, screenshot, axe and Lighthouse | `rachnasutra audit --mode browser` when Playwright is installed. Exit 3 if it is not. No invented result | [docs/status.md](docs/status.md) |
|
|
35
35
|
|
|
36
36
|
## Quick start
|
|
37
37
|
|
|
@@ -48,7 +48,7 @@ npx rachnasutra audit . --format json,md,html,sarif --out my-reports
|
|
|
48
48
|
|
|
49
49
|
# install the skills for your AI IDE (dry run first)
|
|
50
50
|
npx rachnasutra skills install --host claude --target . --dry-run
|
|
51
|
-
npx
|
|
51
|
+
npx rachnasutra skills install --host claude --target .
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Then ask your assistant: *"Use rachnasutra-prime to review this project's UI and suggest the most valuable accessible and responsive improvements with source evidence."*
|
|
@@ -58,7 +58,7 @@ Then ask your assistant: *"Use rachnasutra-prime to review this project's UI and
|
|
|
58
58
|
```bash
|
|
59
59
|
git clone https://github.com/shahvatsalofficial/rachnasutra.git
|
|
60
60
|
cd rachnasutra && npm install && npm run build
|
|
61
|
-
node dist/cli.js audit fixtures/intentionally-broken-ui #
|
|
61
|
+
node dist/cli.js audit fixtures/intentionally-broken-ui # 22 findings with file:line evidence
|
|
62
62
|
node dist/cli.js audit fixtures/good-ui # 0 findings
|
|
63
63
|
```
|
|
64
64
|
|
|
@@ -118,24 +118,24 @@ Everything below is reproducible from this repository.
|
|
|
118
118
|
|
|
119
119
|
| Evidence | Result | Where |
|
|
120
120
|
|---|---|---|
|
|
121
|
-
| Automated tests | **
|
|
122
|
-
| Every rule tested both ways | A failing and a passing input for all
|
|
121
|
+
| Automated tests | **140 of 140 passing** locally on Node 24 (this machine). Blocking CI is Windows and Linux on Node 20, 22, 24 and 26. macOS is not in CI: GitHub cancels those jobs before a runner starts | [test-results.txt](documents/rachnasutra/evidence/test-results.txt) |
|
|
122
|
+
| Every rule tested both ways | A failing and a passing input for all 33 rules, plus false-positive guards; the same inputs generate the docs | [rule examples](documents/rachnasutra/15-rule-examples.md) |
|
|
123
123
|
| W3C ACT test cases | 154 cases, 10 rules: **71% precision, 65% recall** after fixing defects the benchmark found (first run: 53% and 38%) | [act.md](benchmarks/results/act.md) |
|
|
124
124
|
| Comparison with axe-core | axe-core is **more accurate** (92% / 83% against 81% / 73% on 7 comparable rules); RachnaSutra works on source files, offline, in CI | [act-vs-axe.md](benchmarks/results/act-vs-axe.md) |
|
|
125
125
|
| 12 public repositories | 1,360 files, 767 findings; manual check of 95 findings: **77% clearly real, 93% real or context-dependent**; 7 false-positive patterns found and fixed | [real-world.md](benchmarks/results/real-world.md) |
|
|
126
126
|
| Before and after on a real template | 14 findings resolved, 0 introduced; axe-core agrees | [case study](case-studies/clean-blog/README.md) |
|
|
127
|
-
| Intentionally flawed fixture | **
|
|
127
|
+
| Intentionally flawed fixture | **22 findings**, each with file and line; identical on every run | [sample report](samples/broken-ui/latest.md) |
|
|
128
128
|
| Correct fixture | **0 findings** | [sample report](samples/good-ui/latest.md) |
|
|
129
129
|
| Contrast maths | Matches WCAG reference ratios (21:1 black on white; 4.54:1 for `#767676` on white) | [tests](test/rachnasutra.test.mjs) |
|
|
130
130
|
| Security tests | Secret redaction, path traversal, report escaping, prompt-injection text in audited files | [security doc](documents/rachnasutra/08-security-and-privacy.md) |
|
|
131
|
-
|
|
|
131
|
+
| Browser mode | `audit --mode browser` on this machine used Edge, wrote `screenshot.png`, ran axe-core, and recorded Lighthouse lab scores. Exit 3 only when Playwright or a browser binary is missing | [status](docs/status.md) |
|
|
132
132
|
|
|
133
|
-
What is **not** proven: the skills have not yet been verified inside live AI IDEs ([protocol and status](documents/rachnasutra/17-host-smoke-tests.md)); manual labelling of findings was done by the author with AI assistance, not independently;
|
|
133
|
+
What is **not** proven: the skills have not yet been verified inside live AI IDEs ([protocol and status](documents/rachnasutra/17-host-smoke-tests.md)); manual labelling of findings was done by the author with AI assistance, not independently; screen-reader and keyboard testing are still manual. The published static comparison with axe-core is unchanged (92% / 83% against 81% / 73%). Browser mode calls axe-core; it does not replace that comparison. Full discussion: [Validation and benchmarks](documents/rachnasutra/16-validation-and-benchmarks.md).
|
|
134
134
|
|
|
135
135
|
Example output:
|
|
136
136
|
|
|
137
137
|
```text
|
|
138
|
-
Scanned 2 file(s).
|
|
138
|
+
Scanned 2 file(s). 22 finding(s): 0 critical, 8 high, 8 medium, 5 low, 1 info.
|
|
139
139
|
RS-0001 [high/confirmed] RS-A11Y-001 index.html:11 - Image has no alt attribute
|
|
140
140
|
RS-0007 [high/confirmed] RS-A11Y-013 index.html:20 - Text contrast 2.32:1 is below 4.5:1 (#aaaaaa on #ffffff)
|
|
141
141
|
RS-0006 [high/confirmed] RS-A11Y-010 styles.css:2 - Focus indicator removed (button:focus, a:focus)
|
|
@@ -143,7 +143,9 @@ Scanned 2 file(s). 21 finding(s): 0 critical, 8 high, 7 medium, 5 low, 1 info.
|
|
|
143
143
|
|
|
144
144
|
## Documentation
|
|
145
145
|
|
|
146
|
-
The full documentation set is in [`documents/rachnasutra/`](documents/rachnasutra/00-overview.md)
|
|
146
|
+
The full documentation set is live at <https://shahvatsalofficial.github.io/rachnasutra/>. The same pages are in [`documents/rachnasutra/`](documents/rachnasutra/00-overview.md) as Markdown and as a self-contained HTML site (`documents/rachnasutra/html/index.html` works offline, in light and dark themes, and on phones). A short Gujarati overview is in [README.gu.md](README.gu.md).
|
|
147
|
+
|
|
148
|
+
`rachnasutra history <dir>` writes `history.md` and `history.html` from saved JSON reports. It counts findings. It does not compare screenshots. A container for the static CLI is `Dockerfile` (`node:22-bookworm-slim`). It does not add a browser.
|
|
147
149
|
|
|
148
150
|
| Audience | Document |
|
|
149
151
|
|---|---|
|
package/ROADMAP.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Status of each item is tracked in [docs/status.md](docs/status.md). Dates are intentionally absent; items ship when tested.
|
|
4
4
|
|
|
5
|
+
## Done in 0.5.0
|
|
6
|
+
- 33 static rules, including `role="img"`, duplicate ids, frame titles, skip links, email/tel autocomplete, empty headings, non-text border contrast, empty `lang`, Tailwind arbitrary hex and JSX style colours
|
|
7
|
+
- `history` counts for saved JSON reports, a static-CLI Dockerfile, a short Gujarati README, and doctor NOTE lines
|
|
8
|
+
- Browser mode (screenshot, axe-core, Lighthouse lab) when Playwright is installed
|
|
9
|
+
- Named Tailwind colours, CSS modules, and styled-component template strings
|
|
10
|
+
- 140 tests
|
|
11
|
+
|
|
5
12
|
## Done in 0.2.0
|
|
6
13
|
- A failing and a passing test for every rule (111 tests); generated rule examples
|
|
7
14
|
- Validation against W3C ACT test cases, axe-core and 12 real repositories, with a before/after case study; rule defects found by that work were fixed
|
|
@@ -21,7 +28,7 @@ Status of each item is tracked in [docs/status.md](docs/status.md). Dates are in
|
|
|
21
28
|
4a. Blind re-test of the rules on new repositories, with independent labelling
|
|
22
29
|
5. JSX style-object and CSS-in-JS contrast analysis
|
|
23
30
|
6. Optional Lighthouse integration with lab-vs-field separation
|
|
24
|
-
7.
|
|
31
|
+
7. macOS CI, when GitHub assigns a runner. Linux and Windows already run in `.github/workflows/ci.yml`. A macOS job was removed after GitHub cancelled it with zero steps.
|
|
25
32
|
|
|
26
33
|
## Not planned
|
|
27
34
|
Telemetry, hosted accounts, mandatory API keys, automatic global installs.
|
|
@@ -1,172 +1,172 @@
|
|
|
1
1
|
--- a/dist/index.html
|
|
2
2
|
+++ b/dist/index.html
|
|
3
3
|
@@ -47,7 +47,8 @@
|
|
4
|
-
</div>
|
|
5
|
-
</div>
|
|
6
|
-
</header>
|
|
7
|
-
- <!-- Main Content-->
|
|
4
|
+
</div>
|
|
5
|
+
</div>
|
|
6
|
+
</header>
|
|
7
|
+
- <!-- Main Content-->
|
|
8
8
|
+ <main>
|
|
9
|
-
+<!-- Main Content-->
|
|
10
|
-
<div class="container px-4 px-lg-5">
|
|
11
|
-
<div class="row gx-4 gx-lg-5 justify-content-center">
|
|
12
|
-
<div class="col-md-10 col-lg-8 col-xl-7">
|
|
9
|
+
+<!-- Main Content-->
|
|
10
|
+
<div class="container px-4 px-lg-5">
|
|
11
|
+
<div class="row gx-4 gx-lg-5 justify-content-center">
|
|
12
|
+
<div class="col-md-10 col-lg-8 col-xl-7">
|
|
13
13
|
@@ -108,7 +109,8 @@
|
|
14
|
-
<div class="d-flex justify-content-end mb-4"><a class="btn btn-primary text-uppercase" href="#!">Older Posts →</a></div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
- </div>
|
|
14
|
+
<div class="d-flex justify-content-end mb-4"><a class="btn btn-primary text-uppercase" href="#!">Older Posts →</a></div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
- </div>
|
|
18
18
|
+ </div>
|
|
19
|
-
+ </main>
|
|
20
|
-
<!-- Footer-->
|
|
21
|
-
<footer class="border-top">
|
|
22
|
-
<div class="container px-4 px-lg-5">
|
|
19
|
+
+ </main>
|
|
20
|
+
<!-- Footer-->
|
|
21
|
+
<footer class="border-top">
|
|
22
|
+
<div class="container px-4 px-lg-5">
|
|
23
23
|
@@ -116,24 +118,24 @@
|
|
24
|
-
<div class="col-md-10 col-lg-8 col-xl-7">
|
|
25
|
-
<ul class="list-inline text-center">
|
|
26
|
-
<li class="list-inline-item">
|
|
27
|
-
- <a href="#!">
|
|
28
|
-
- <span class="fa-stack fa-lg">
|
|
29
|
-
+ <a href="#!" aria-label="Twitter">
|
|
30
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
31
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
32
|
-
<i class="fab fa-twitter fa-stack-1x fa-inverse"></i>
|
|
33
|
-
</span>
|
|
34
|
-
</a>
|
|
35
|
-
</li>
|
|
36
|
-
<li class="list-inline-item">
|
|
37
|
-
- <a href="#!">
|
|
38
|
-
- <span class="fa-stack fa-lg">
|
|
39
|
-
+ <a href="#!" aria-label="Facebook">
|
|
40
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
41
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
42
|
-
<i class="fab fa-facebook-f fa-stack-1x fa-inverse"></i>
|
|
43
|
-
</span>
|
|
44
|
-
</a>
|
|
45
|
-
</li>
|
|
46
|
-
<li class="list-inline-item">
|
|
47
|
-
- <a href="#!">
|
|
48
|
-
- <span class="fa-stack fa-lg">
|
|
49
|
-
+ <a href="#!" aria-label="GitHub">
|
|
50
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
51
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
52
|
-
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
|
53
|
-
</span>
|
|
24
|
+
<div class="col-md-10 col-lg-8 col-xl-7">
|
|
25
|
+
<ul class="list-inline text-center">
|
|
26
|
+
<li class="list-inline-item">
|
|
27
|
+
- <a href="#!">
|
|
28
|
+
- <span class="fa-stack fa-lg">
|
|
29
|
+
+ <a href="#!" aria-label="Twitter">
|
|
30
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
31
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
32
|
+
<i class="fab fa-twitter fa-stack-1x fa-inverse"></i>
|
|
33
|
+
</span>
|
|
34
|
+
</a>
|
|
35
|
+
</li>
|
|
36
|
+
<li class="list-inline-item">
|
|
37
|
+
- <a href="#!">
|
|
38
|
+
- <span class="fa-stack fa-lg">
|
|
39
|
+
+ <a href="#!" aria-label="Facebook">
|
|
40
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
41
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
42
|
+
<i class="fab fa-facebook-f fa-stack-1x fa-inverse"></i>
|
|
43
|
+
</span>
|
|
44
|
+
</a>
|
|
45
|
+
</li>
|
|
46
|
+
<li class="list-inline-item">
|
|
47
|
+
- <a href="#!">
|
|
48
|
+
- <span class="fa-stack fa-lg">
|
|
49
|
+
+ <a href="#!" aria-label="GitHub">
|
|
50
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
51
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
52
|
+
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
|
53
|
+
</span>
|
|
54
54
|
--- a/dist/about.html
|
|
55
55
|
+++ b/dist/about.html
|
|
56
56
|
@@ -66,24 +66,24 @@
|
|
57
|
-
<div class="col-md-10 col-lg-8 col-xl-7">
|
|
58
|
-
<ul class="list-inline text-center">
|
|
59
|
-
<li class="list-inline-item">
|
|
60
|
-
- <a href="#!">
|
|
61
|
-
- <span class="fa-stack fa-lg">
|
|
62
|
-
+ <a href="#!" aria-label="Twitter">
|
|
63
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
64
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
65
|
-
<i class="fab fa-twitter fa-stack-1x fa-inverse"></i>
|
|
66
|
-
</span>
|
|
67
|
-
</a>
|
|
68
|
-
</li>
|
|
69
|
-
<li class="list-inline-item">
|
|
70
|
-
- <a href="#!">
|
|
71
|
-
- <span class="fa-stack fa-lg">
|
|
72
|
-
+ <a href="#!" aria-label="Facebook">
|
|
73
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
74
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
75
|
-
<i class="fab fa-facebook-f fa-stack-1x fa-inverse"></i>
|
|
76
|
-
</span>
|
|
77
|
-
</a>
|
|
78
|
-
</li>
|
|
79
|
-
<li class="list-inline-item">
|
|
80
|
-
- <a href="#!">
|
|
81
|
-
- <span class="fa-stack fa-lg">
|
|
82
|
-
+ <a href="#!" aria-label="GitHub">
|
|
83
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
84
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
85
|
-
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
|
86
|
-
</span>
|
|
57
|
+
<div class="col-md-10 col-lg-8 col-xl-7">
|
|
58
|
+
<ul class="list-inline text-center">
|
|
59
|
+
<li class="list-inline-item">
|
|
60
|
+
- <a href="#!">
|
|
61
|
+
- <span class="fa-stack fa-lg">
|
|
62
|
+
+ <a href="#!" aria-label="Twitter">
|
|
63
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
64
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
65
|
+
<i class="fab fa-twitter fa-stack-1x fa-inverse"></i>
|
|
66
|
+
</span>
|
|
67
|
+
</a>
|
|
68
|
+
</li>
|
|
69
|
+
<li class="list-inline-item">
|
|
70
|
+
- <a href="#!">
|
|
71
|
+
- <span class="fa-stack fa-lg">
|
|
72
|
+
+ <a href="#!" aria-label="Facebook">
|
|
73
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
74
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
75
|
+
<i class="fab fa-facebook-f fa-stack-1x fa-inverse"></i>
|
|
76
|
+
</span>
|
|
77
|
+
</a>
|
|
78
|
+
</li>
|
|
79
|
+
<li class="list-inline-item">
|
|
80
|
+
- <a href="#!">
|
|
81
|
+
- <span class="fa-stack fa-lg">
|
|
82
|
+
+ <a href="#!" aria-label="GitHub">
|
|
83
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
84
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
85
|
+
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
|
86
|
+
</span>
|
|
87
87
|
--- a/dist/contact.html
|
|
88
88
|
+++ b/dist/contact.html
|
|
89
89
|
@@ -116,24 +116,24 @@
|
|
90
|
-
<div class="col-md-10 col-lg-8 col-xl-7">
|
|
91
|
-
<ul class="list-inline text-center">
|
|
92
|
-
<li class="list-inline-item">
|
|
93
|
-
- <a href="#!">
|
|
94
|
-
- <span class="fa-stack fa-lg">
|
|
95
|
-
+ <a href="#!" aria-label="Twitter">
|
|
96
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
97
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
98
|
-
<i class="fab fa-twitter fa-stack-1x fa-inverse"></i>
|
|
99
|
-
</span>
|
|
100
|
-
</a>
|
|
101
|
-
</li>
|
|
102
|
-
<li class="list-inline-item">
|
|
103
|
-
- <a href="#!">
|
|
104
|
-
- <span class="fa-stack fa-lg">
|
|
105
|
-
+ <a href="#!" aria-label="Facebook">
|
|
106
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
107
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
108
|
-
<i class="fab fa-facebook-f fa-stack-1x fa-inverse"></i>
|
|
109
|
-
</span>
|
|
110
|
-
</a>
|
|
111
|
-
</li>
|
|
112
|
-
<li class="list-inline-item">
|
|
113
|
-
- <a href="#!">
|
|
114
|
-
- <span class="fa-stack fa-lg">
|
|
115
|
-
+ <a href="#!" aria-label="GitHub">
|
|
116
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
117
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
118
|
-
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
|
119
|
-
</span>
|
|
90
|
+
<div class="col-md-10 col-lg-8 col-xl-7">
|
|
91
|
+
<ul class="list-inline text-center">
|
|
92
|
+
<li class="list-inline-item">
|
|
93
|
+
- <a href="#!">
|
|
94
|
+
- <span class="fa-stack fa-lg">
|
|
95
|
+
+ <a href="#!" aria-label="Twitter">
|
|
96
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
97
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
98
|
+
<i class="fab fa-twitter fa-stack-1x fa-inverse"></i>
|
|
99
|
+
</span>
|
|
100
|
+
</a>
|
|
101
|
+
</li>
|
|
102
|
+
<li class="list-inline-item">
|
|
103
|
+
- <a href="#!">
|
|
104
|
+
- <span class="fa-stack fa-lg">
|
|
105
|
+
+ <a href="#!" aria-label="Facebook">
|
|
106
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
107
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
108
|
+
<i class="fab fa-facebook-f fa-stack-1x fa-inverse"></i>
|
|
109
|
+
</span>
|
|
110
|
+
</a>
|
|
111
|
+
</li>
|
|
112
|
+
<li class="list-inline-item">
|
|
113
|
+
- <a href="#!">
|
|
114
|
+
- <span class="fa-stack fa-lg">
|
|
115
|
+
+ <a href="#!" aria-label="GitHub">
|
|
116
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
117
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
118
|
+
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
|
119
|
+
</span>
|
|
120
120
|
--- a/dist/post.html
|
|
121
121
|
+++ b/dist/post.html
|
|
122
122
|
@@ -52,7 +52,8 @@
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
</header>
|
|
126
|
-
- <!-- Post Content-->
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</header>
|
|
126
|
+
- <!-- Post Content-->
|
|
127
127
|
+ <main>
|
|
128
|
-
+<!-- Post Content-->
|
|
129
|
-
<article class="mb-4">
|
|
130
|
-
<div class="container px-4 px-lg-5">
|
|
131
|
-
<div class="row gx-4 gx-lg-5 justify-content-center">
|
|
128
|
+
+<!-- Post Content-->
|
|
129
|
+
<article class="mb-4">
|
|
130
|
+
<div class="container px-4 px-lg-5">
|
|
131
|
+
<div class="row gx-4 gx-lg-5 justify-content-center">
|
|
132
132
|
@@ -82,7 +83,8 @@
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
- </article>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
- </article>
|
|
137
137
|
+ </article>
|
|
138
|
-
+ </main>
|
|
139
|
-
<!-- Footer-->
|
|
140
|
-
<footer class="border-top">
|
|
141
|
-
<div class="container px-4 px-lg-5">
|
|
138
|
+
+ </main>
|
|
139
|
+
<!-- Footer-->
|
|
140
|
+
<footer class="border-top">
|
|
141
|
+
<div class="container px-4 px-lg-5">
|
|
142
142
|
@@ -90,24 +92,24 @@
|
|
143
|
-
<div class="col-md-10 col-lg-8 col-xl-7">
|
|
144
|
-
<ul class="list-inline text-center">
|
|
145
|
-
<li class="list-inline-item">
|
|
146
|
-
- <a href="#!">
|
|
147
|
-
- <span class="fa-stack fa-lg">
|
|
148
|
-
+ <a href="#!" aria-label="Twitter">
|
|
149
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
150
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
151
|
-
<i class="fab fa-twitter fa-stack-1x fa-inverse"></i>
|
|
152
|
-
</span>
|
|
153
|
-
</a>
|
|
154
|
-
</li>
|
|
155
|
-
<li class="list-inline-item">
|
|
156
|
-
- <a href="#!">
|
|
157
|
-
- <span class="fa-stack fa-lg">
|
|
158
|
-
+ <a href="#!" aria-label="Facebook">
|
|
159
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
160
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
161
|
-
<i class="fab fa-facebook-f fa-stack-1x fa-inverse"></i>
|
|
162
|
-
</span>
|
|
163
|
-
</a>
|
|
164
|
-
</li>
|
|
165
|
-
<li class="list-inline-item">
|
|
166
|
-
- <a href="#!">
|
|
167
|
-
- <span class="fa-stack fa-lg">
|
|
168
|
-
+ <a href="#!" aria-label="GitHub">
|
|
169
|
-
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
170
|
-
<i class="fas fa-circle fa-stack-2x"></i>
|
|
171
|
-
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
|
172
|
-
</span>
|
|
143
|
+
<div class="col-md-10 col-lg-8 col-xl-7">
|
|
144
|
+
<ul class="list-inline text-center">
|
|
145
|
+
<li class="list-inline-item">
|
|
146
|
+
- <a href="#!">
|
|
147
|
+
- <span class="fa-stack fa-lg">
|
|
148
|
+
+ <a href="#!" aria-label="Twitter">
|
|
149
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
150
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
151
|
+
<i class="fab fa-twitter fa-stack-1x fa-inverse"></i>
|
|
152
|
+
</span>
|
|
153
|
+
</a>
|
|
154
|
+
</li>
|
|
155
|
+
<li class="list-inline-item">
|
|
156
|
+
- <a href="#!">
|
|
157
|
+
- <span class="fa-stack fa-lg">
|
|
158
|
+
+ <a href="#!" aria-label="Facebook">
|
|
159
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
160
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
161
|
+
<i class="fab fa-facebook-f fa-stack-1x fa-inverse"></i>
|
|
162
|
+
</span>
|
|
163
|
+
</a>
|
|
164
|
+
</li>
|
|
165
|
+
<li class="list-inline-item">
|
|
166
|
+
- <a href="#!">
|
|
167
|
+
- <span class="fa-stack fa-lg">
|
|
168
|
+
+ <a href="#!" aria-label="GitHub">
|
|
169
|
+
+ <span class="fa-stack fa-lg" aria-hidden="true">
|
|
170
|
+
<i class="fas fa-circle fa-stack-2x"></i>
|
|
171
|
+
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
|
172
|
+
</span>
|
package/dist/audit.js
CHANGED
|
@@ -5,9 +5,21 @@ import { exists, readText, walk, clearTextCache } from './fsutil.js';
|
|
|
5
5
|
import { MARKUP_EXT, RULE_CATALOG, STYLE_EXT, runRules } from './rules.js';
|
|
6
6
|
import { inspectTokens } from './tokens.js';
|
|
7
7
|
export const SEVERITY_ORDER = ['critical', 'high', 'medium', 'low', 'info'];
|
|
8
|
+
const CODE_EXT = new Set(['.js', '.jsx', '.ts', '.tsx', '.mjs', '.cjs']);
|
|
9
|
+
/** Pull CSS out of styled-components and the css`` helper. Other CSS-in-JS shapes are left alone. */
|
|
10
|
+
export function extractCssInJs(text) {
|
|
11
|
+
const parts = [];
|
|
12
|
+
for (const m of text.matchAll(/(?:styled(?:\.[A-Za-z0-9]+|\([^)]*\))|css)`([^`]*)`/g)) {
|
|
13
|
+
const body = m[1].trim();
|
|
14
|
+
if (!body)
|
|
15
|
+
continue;
|
|
16
|
+
parts.push(body.includes('{') ? body : `.extracted {\n${body}\n}`);
|
|
17
|
+
}
|
|
18
|
+
return parts.join('\n');
|
|
19
|
+
}
|
|
8
20
|
export const CONFIG_FILE = 'rachnasutra.config.json';
|
|
9
21
|
export function toolVersion() {
|
|
10
|
-
return '0.
|
|
22
|
+
return '0.5.0';
|
|
11
23
|
}
|
|
12
24
|
export async function loadConfig(root) {
|
|
13
25
|
const p = path.join(root, CONFIG_FILE);
|
|
@@ -32,8 +44,8 @@ export function validateConfig(o) {
|
|
|
32
44
|
if (c[k] !== undefined && !(Array.isArray(c[k]) && c[k].every((x) => typeof x === 'string')))
|
|
33
45
|
errs.push(`${k} must be a string array`);
|
|
34
46
|
}
|
|
35
|
-
if (c.failOn !== undefined && !SEVERITY_ORDER.includes(c.failOn))
|
|
36
|
-
errs.push('failOn must be critical|high|medium|low|info');
|
|
47
|
+
if (c.failOn !== undefined && c.failOn !== 'confirmed-critical' && !SEVERITY_ORDER.includes(c.failOn))
|
|
48
|
+
errs.push('failOn must be confirmed-critical|critical|high|medium|low|info');
|
|
37
49
|
for (const k of ['maxFiles', 'imageBudgetKb']) {
|
|
38
50
|
if (c[k] !== undefined && !(typeof c[k] === 'number' && c[k] > 0))
|
|
39
51
|
errs.push(`${k} must be a positive number`);
|
|
@@ -57,13 +69,19 @@ export async function runAudit(rootArg, opts = {}) {
|
|
|
57
69
|
for (const f of corpus.files) {
|
|
58
70
|
const isMarkup = MARKUP_EXT.has(f.ext);
|
|
59
71
|
const isStyle = STYLE_EXT.has(f.ext);
|
|
60
|
-
if (!isMarkup && !isStyle)
|
|
72
|
+
if (!isMarkup && !isStyle && !CODE_EXT.has(f.ext))
|
|
61
73
|
continue;
|
|
62
74
|
const text = await readText(f);
|
|
63
75
|
if (text === null)
|
|
64
76
|
continue;
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
if (isMarkup || isStyle) {
|
|
78
|
+
fileTypes[f.ext] = (fileTypes[f.ext] ?? 0) + 1;
|
|
79
|
+
docs.push({ file: f, text, kind: isMarkup ? 'markup' : 'style', isHtmlDoc: f.ext === '.html' || f.ext === '.htm' });
|
|
80
|
+
}
|
|
81
|
+
const extracted = extractCssInJs(text);
|
|
82
|
+
if (extracted && CODE_EXT.has(f.ext)) {
|
|
83
|
+
docs.push({ file: f, text: extracted, kind: 'style', isHtmlDoc: false });
|
|
84
|
+
}
|
|
67
85
|
}
|
|
68
86
|
const raw = runRules({ docs, assets: corpus.assets, imageBudgetBytes: (config.imageBudgetKb ?? 500) * 1024 })
|
|
69
87
|
.filter((h) => !config.disableRules.includes(h.rule))
|