a11y_agent 0.0.5.pre.alpha.4 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/a11y_agent/version.rb +1 -1
- data/lib/agents/a11y_agent.rb +60 -89
- data/lib/generators/confirmable_fix_generator.rb +56 -0
- data/lib/tasks/release.rake +3 -3
- data/package.json +12 -12
- data/yarn.lock +105 -2459
- metadata +60 -9
- data/fixtures/sample.tsx +0 -100
- data/lib/bin/axe.ts +0 -19
- data/lib/generators/hydrate_document_generator.rb +0 -27
metadata
CHANGED
@@ -1,15 +1,28 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: a11y_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Cundiff
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-04 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: axe-core-api
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '4.9'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - "~>"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '4.9'
|
13
26
|
- !ruby/object:Gem::Dependency
|
14
27
|
name: diffy
|
15
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -24,6 +37,20 @@ dependencies:
|
|
24
37
|
- - "~>"
|
25
38
|
- !ruby/object:Gem::Version
|
26
39
|
version: '3.4'
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: dotenv
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '3.1'
|
47
|
+
type: :runtime
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.1'
|
27
54
|
- !ruby/object:Gem::Dependency
|
28
55
|
name: rainbow
|
29
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +65,20 @@ dependencies:
|
|
38
65
|
- - "~>"
|
39
66
|
- !ruby/object:Gem::Version
|
40
67
|
version: '3.0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: selenium-webdriver
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '4.23'
|
75
|
+
type: :runtime
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '4.23'
|
41
82
|
- !ruby/object:Gem::Dependency
|
42
83
|
name: sublayer
|
43
84
|
requirement: !ruby/object:Gem::Requirement
|
@@ -68,6 +109,20 @@ dependencies:
|
|
68
109
|
version: '0.23'
|
69
110
|
- !ruby/object:Gem::Dependency
|
70
111
|
name: rake
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '13.2'
|
117
|
+
type: :development
|
118
|
+
prerelease: false
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '13.2'
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: rubocop
|
71
126
|
requirement: !ruby/object:Gem::Requirement
|
72
127
|
requirements:
|
73
128
|
- - ">="
|
@@ -92,12 +147,10 @@ files:
|
|
92
147
|
- LICENSE
|
93
148
|
- README.md
|
94
149
|
- Rakefile
|
95
|
-
- fixtures/sample.tsx
|
96
150
|
- lib/a11y_agent/version.rb
|
97
151
|
- lib/agents/a11y_agent.rb
|
98
|
-
- lib/
|
152
|
+
- lib/generators/confirmable_fix_generator.rb
|
99
153
|
- lib/generators/fix_a11y_generator.rb
|
100
|
-
- lib/generators/hydrate_document_generator.rb
|
101
154
|
- lib/tasks/release.rake
|
102
155
|
- package.json
|
103
156
|
- trigger.txt
|
@@ -109,7 +162,6 @@ metadata:
|
|
109
162
|
allowed_push_host: https://rubygems.org
|
110
163
|
homepage_uri: https://github.com/accesslint/a11y-agent
|
111
164
|
source_code_uri: https://github.com/accesslint/a11y-agent
|
112
|
-
post_install_message:
|
113
165
|
rdoc_options: []
|
114
166
|
require_paths:
|
115
167
|
- lib
|
@@ -124,8 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
176
|
- !ruby/object:Gem::Version
|
125
177
|
version: '0'
|
126
178
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
128
|
-
signing_key:
|
179
|
+
rubygems_version: 3.6.2
|
129
180
|
specification_version: 4
|
130
181
|
summary: AI agent that fixes accessibility issues
|
131
182
|
test_files: []
|
data/fixtures/sample.tsx
DELETED
@@ -1,100 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
|
3
|
-
const AccessibilityViolations = () => {
|
4
|
-
return (
|
5
|
-
<div>
|
6
|
-
<html>
|
7
|
-
<head>
|
8
|
-
<title>Accessibility Violations</title>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div>
|
12
|
-
<p>Here is an emoji not wrapped in a span: 😀</p>
|
13
|
-
|
14
|
-
<img src="image.jpg" alt="image" />
|
15
|
-
|
16
|
-
<a href="https://example.com">Click here</a>
|
17
|
-
|
18
|
-
<a href="#"></a>
|
19
|
-
|
20
|
-
<a href="invalid-url">Invalid Link</a>
|
21
|
-
|
22
|
-
<div aria-activedescendant="some-id"></div>
|
23
|
-
|
24
|
-
<div aria-bogus="true"></div>
|
25
|
-
|
26
|
-
<div aria-hidden="false"></div>
|
27
|
-
|
28
|
-
<div role="invalidRole"></div>
|
29
|
-
|
30
|
-
<input type="text" autoComplete="off" />
|
31
|
-
|
32
|
-
<div onClick={() => alert("Clicked!")}></div>
|
33
|
-
|
34
|
-
<input type="text" />
|
35
|
-
|
36
|
-
<h1></h1>
|
37
|
-
|
38
|
-
<iframe src="some-video.mp4"></iframe>
|
39
|
-
|
40
|
-
<img src="photo.jpg" alt="photo" />
|
41
|
-
|
42
|
-
<div onClick={() => alert("Clicked!")} tabIndex={-1}></div>
|
43
|
-
|
44
|
-
<label>Username</label>
|
45
|
-
<input type="text" id="username" />
|
46
|
-
|
47
|
-
<label htmlFor="username">Username</label>
|
48
|
-
<input type="text" id="username" />
|
49
|
-
|
50
|
-
<audio controls>
|
51
|
-
<source src="audio.mp3" type="audio/mp3" />
|
52
|
-
</audio>
|
53
|
-
|
54
|
-
<div onMouseOver={() => {}}></div>
|
55
|
-
|
56
|
-
<div accessKey="s"></div>
|
57
|
-
|
58
|
-
<div aria-hidden="true" tabIndex={0}></div>
|
59
|
-
|
60
|
-
<input type="text" autoFocus />
|
61
|
-
|
62
|
-
<marquee>Scrolling text</marquee>
|
63
|
-
|
64
|
-
<div role="button" onClick={() => {}}></div>
|
65
|
-
|
66
|
-
<div onClick={() => {}}></div>
|
67
|
-
|
68
|
-
<div role="link"></div>
|
69
|
-
|
70
|
-
<div tabIndex={1}></div>
|
71
|
-
|
72
|
-
<select onChange={() => {}}>
|
73
|
-
<option>Option 1</option>
|
74
|
-
<option>Option 2</option>
|
75
|
-
</select>
|
76
|
-
|
77
|
-
<div role="banner"></div>
|
78
|
-
|
79
|
-
<button role="button">Click me</button>
|
80
|
-
|
81
|
-
<table>
|
82
|
-
<tr>
|
83
|
-
<th>Header</th>
|
84
|
-
<th>Another Header</th>
|
85
|
-
</tr>
|
86
|
-
<tr>
|
87
|
-
<td>Data</td>
|
88
|
-
<td>More Data</td>
|
89
|
-
</tr>
|
90
|
-
</table>
|
91
|
-
|
92
|
-
<div tabIndex={5}></div>
|
93
|
-
</div>
|
94
|
-
</body>
|
95
|
-
</html>
|
96
|
-
</div>
|
97
|
-
);
|
98
|
-
};
|
99
|
-
|
100
|
-
export default AccessibilityViolations;
|
data/lib/bin/axe.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
|
3
|
-
import { readFileSync } from "node:fs";
|
4
|
-
import axe from "axe-core"
|
5
|
-
import { JSDOM } from "jsdom";
|
6
|
-
|
7
|
-
const markup = readFileSync(process.argv[2], "utf8");
|
8
|
-
const { window: { document } } = new JSDOM(markup);
|
9
|
-
|
10
|
-
const config = {
|
11
|
-
rules: {
|
12
|
-
'color-contrast': { enabled: false },
|
13
|
-
'region': { enabled: false },
|
14
|
-
}
|
15
|
-
};
|
16
|
-
|
17
|
-
axe.run(document.body, config).then((results) => {
|
18
|
-
console.log(JSON.stringify(results.violations));
|
19
|
-
});
|
@@ -1,27 +0,0 @@
|
|
1
|
-
class HydrateDocumentGenerator < Sublayer::Generators::Base
|
2
|
-
llm_output_adapter type: :single_string,
|
3
|
-
name: 'hydrate_web_document_with_fake_variables',
|
4
|
-
description: 'Given a web document template, generate a new file with fake data interpolated into the template.'
|
5
|
-
|
6
|
-
def initialize(contents:, extension: '')
|
7
|
-
@contents = contents
|
8
|
-
@extension = extension
|
9
|
-
end
|
10
|
-
|
11
|
-
def generate
|
12
|
-
super
|
13
|
-
end
|
14
|
-
|
15
|
-
def prompt
|
16
|
-
<<~PROMPT
|
17
|
-
Given the following #{@extension} template contents, generate a new file by
|
18
|
-
replacing any undefined variables with fake data. Only replace undefined variables,
|
19
|
-
do not generate new markup.
|
20
|
-
|
21
|
-
#{@extension} code:
|
22
|
-
#{@contents}
|
23
|
-
|
24
|
-
Return the contents with the fake data interpolated.
|
25
|
-
PROMPT
|
26
|
-
end
|
27
|
-
end
|