@webability/cli 1.1.1 → 1.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webability/cli",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Abilyo by WebAbility — WCAG accessibility scanner for your terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,7 +31,7 @@
31
31
  "ora": "^8.1.0",
32
32
  "playwright": "^1.49.0",
33
33
  "yaml": "^2.6.0",
34
- "@webability/core": "1.1.1"
34
+ "@webability/core": "1.2.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^25.6.0",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "homepage": "https://abilyo.com",
46
46
  "scripts": {
47
- "build": "tsup src/cli.ts --format esm --dts --clean",
47
+ "build": "tsup src/cli.ts --format esm --dts --minify --clean",
48
48
  "dev": "tsx src/cli.ts",
49
49
  "typecheck": "tsc --noEmit",
50
50
  "clean": "rm -rf dist"
@@ -0,0 +1,55 @@
1
+ // Visual dogfood test — runs structural scan + visual audit on webability.io
2
+ // to compare what each catches.
3
+
4
+ import { chromium } from 'playwright'
5
+ import fs from 'fs/promises'
6
+
7
+ const URL = 'https://webability.io'
8
+ const API_URL = 'https://api.webability.io'
9
+
10
+ const browser = await chromium.launch({ headless: true })
11
+ const ctx = await browser.newContext({ viewport: { width: 1280, height: 720 }, deviceScaleFactor: 1 })
12
+ const page = await ctx.newPage()
13
+ console.log(`Loading ${URL}...`)
14
+ await page.goto(URL, { waitUntil: 'domcontentloaded', timeout: 30000 })
15
+ await page.waitForTimeout(1500) // let JS settle
16
+
17
+ console.log('Capturing screenshot...')
18
+ const buf = await page.screenshot({ type: 'png', fullPage: false })
19
+ const screenshot = buf.toString('base64')
20
+ console.log(` Size: ${(buf.length / 1024).toFixed(0)}KB`)
21
+
22
+ console.log('Calling /cli/visual-audit...')
23
+ const t0 = Date.now()
24
+ const res = await fetch(`${API_URL}/cli/visual-audit`, {
25
+ method: 'POST',
26
+ headers: { 'Content-Type': 'application/json' },
27
+ body: JSON.stringify({
28
+ screenshot,
29
+ platform: 'web',
30
+ screenName: URL,
31
+ brandColors: ['#0052CC', '#47FFF7', '#1B3DB4'], // WebAbility brand
32
+ knownIssues: [], // empty so vision model gets full scope
33
+ }),
34
+ })
35
+ const elapsed = ((Date.now() - t0) / 1000).toFixed(1)
36
+ console.log(` HTTP ${res.status} in ${elapsed}s`)
37
+
38
+ if (!res.ok) {
39
+ console.error('Error:', await res.text())
40
+ await browser.close()
41
+ process.exit(1)
42
+ }
43
+
44
+ const data = await res.json()
45
+ console.log(`\n=== Visual issues found: ${data.count} ===\n`)
46
+ for (const issue of data.issues) {
47
+ const region = issue.region ? `[${issue.region.x},${issue.region.y} ${issue.region.width}x${issue.region.height}]` : ''
48
+ console.log(` ${issue.severity.toUpperCase().padEnd(8)} WCAG ${issue.wcag} — ${issue.message}`)
49
+ if (issue.fix?.suggestedValue) console.log(` fix: ${issue.fix.suggestedValue}`)
50
+ if (region) console.log(` region: ${region}`)
51
+ }
52
+
53
+ await fs.writeFile('/tmp/visual-dogfood-result.json', JSON.stringify(data, null, 2))
54
+ console.log('\nFull result saved to /tmp/visual-dogfood-result.json')
55
+ await browser.close()