@webability/core 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 WebAbility Inc.
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,61 @@
1
+ # @webability/core
2
+
3
+ WCAG accessibility scanner engine with 200+ rules and fix suggestions.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @webability/core playwright
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { scan } from '@webability/core'
15
+
16
+ const result = await scan('https://example.com')
17
+
18
+ console.log(result.summary)
19
+ // { total: 12, critical: 1, serious: 3, moderate: 8, minor: 0 }
20
+
21
+ for (const issue of result.issues) {
22
+ console.log(`[${issue.impact}] WCAG ${issue.wcag}: ${issue.message}`)
23
+ if (issue.fix?.suggestedValue) {
24
+ console.log(` Fix: ${issue.fix.attribute}="${issue.fix.suggestedValue}"`)
25
+ }
26
+ }
27
+ ```
28
+
29
+ ## Scan a live page
30
+
31
+ ```typescript
32
+ import { scan } from '@webability/core'
33
+
34
+ // Pass a Playwright page object
35
+ const result = await scan(page)
36
+ ```
37
+
38
+ ## Options
39
+
40
+ ```typescript
41
+ const result = await scan('https://example.com', {
42
+ viewport: 'mobile', // 'desktop' | 'tablet' | 'mobile'
43
+ rootSelector: '#main', // limit scan scope
44
+ includeAxe: true, // include additional checks (default: true)
45
+ dismissModals: true, // dismiss cookie banners (default: true)
46
+ })
47
+ ```
48
+
49
+ ## Reports
50
+
51
+ ```typescript
52
+ import { scan, toHtmlReport } from '@webability/core'
53
+
54
+ const result = await scan('https://example.com')
55
+ const html = toHtmlReport(result)
56
+ fs.writeFileSync('report.html', html)
57
+ ```
58
+
59
+ ## License
60
+
61
+ MIT