@diegovelasquezweb/a11y-engine 0.11.29 → 0.11.31

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegovelasquezweb/a11y-engine",
3
- "version": "0.11.29",
3
+ "version": "0.11.31",
4
4
  "description": "WCAG 2.2 accessibility audit engine — scanner, analyzer, and report builders",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -32,9 +32,6 @@
32
32
  "CHANGELOG.md",
33
33
  "LICENSE"
34
34
  ],
35
- "scripts": {
36
- "test": "vitest run"
37
- },
38
35
  "dependencies": {
39
36
  "@axe-core/playwright": "^4.11.1",
40
37
  "axe-core": "^4.11.1",
@@ -44,5 +41,7 @@
44
41
  "devDependencies": {
45
42
  "vitest": "^4.0.18"
46
43
  },
47
- "packageManager": "pnpm@10.22.0+sha512.bf049efe995b28f527fd2b41ae0474ce29186f7edcb3bf545087bd61fbbebb2bf75362d1307fda09c2d288e1e499787ac12d4fcb617a974718a6051f2eee741c"
48
- }
44
+ "scripts": {
45
+ "test": "vitest run"
46
+ }
47
+ }
File without changes
@@ -316,22 +316,16 @@ function parseJsonBlock(text) {
316
316
  }
317
317
 
318
318
  async function callClaudeForPatch({ apiKey, model, aiInput }) {
319
- const isMulti = Array.isArray(aiInput.findings);
320
319
  const system = [
321
320
  "You are an accessibility fix engine.",
322
321
  "Return JSON only.",
323
322
  "Generate deterministic text replacements for provided files.",
324
- "Use finding.fixDescription and constraints.must as guidance for what to fix and how.",
323
+ "Use finding.fixDescription and execution.constraints.must as guidance for what to fix and how.",
325
324
  "For insertions (new element that does not yet exist in the file), use the nearest existing parent element as the search anchor. The replace value must include that anchor plus the new content.",
326
325
  "Do not create files. Do not modify paths outside provided filePath values.",
327
- isMulti
328
- ? "You are fixing MULTIPLE findings at once. Generate at least one change per finding. Set findingId on each change to the exact finding ID it addresses."
329
- : "",
330
326
  "Schema:",
331
- isMulti
332
- ? "{\"changes\":[{\"findingId\":\"...(required: exact finding id)\",\"filePath\":\"...\",\"search\":\"...\",\"replace\":\"...\"}],\"notes\":\"...\"}"
333
- : "{\"changes\":[{\"filePath\":\"...\",\"search\":\"...\",\"replace\":\"...\"}],\"notes\":\"...\"}",
334
- ].filter(Boolean).join("\n");
327
+ "{\"changes\":[{\"filePath\":\"...\",\"search\":\"...\",\"replace\":\"...\"}],\"verifyRule\":\"...\",\"verifyRoute\":\"...\",\"notes\":\"...\"}",
328
+ ].join("\n");
335
329
 
336
330
  const userMessage = JSON.stringify(aiInput, null, 2);
337
331
 
@@ -608,8 +608,15 @@ async function analyzeRoute(
608
608
  const rules = onlyRule.includes(",")
609
609
  ? onlyRule.split(",").map((r) => r.trim()).filter(Boolean)
610
610
  : [onlyRule];
611
- log.info(`Targeted Audit: Only checking rules "${rules.join(", ")}"`);
612
- builder.withRules(rules);
611
+ const axeRules = rules.filter(
612
+ (r) => !r.startsWith("pa11y-") && !r.startsWith("WCAG") && !r.includes(".") && r !== "missing-skip-link",
613
+ );
614
+ log.info(`Targeted Audit: Only checking rules "${rules.join(", ")}" (axe-valid: ${axeRules.join(", ") || "none"})`);
615
+ if (axeRules.length > 0) {
616
+ builder.withRules(axeRules);
617
+ } else {
618
+ builder.withTags(axeTags || AXE_TAGS);
619
+ }
613
620
  } else {
614
621
  const tagsToUse = axeTags || AXE_TAGS;
615
622
  builder.withTags(tagsToUse);
File without changes