@surea11y/puppeteer 1.0.0 → 1.0.2

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/README.md CHANGED
@@ -1,25 +1,14 @@
1
- # surea11y-puppeteer
1
+ # @surea11y/puppeteer
2
2
 
3
- A Puppeteer binding for [`surea11y`](../surea11y) — scans a real, already-rendered page for accessibility issues using surea11y's DOM-rules engine.
3
+ A Puppeteer binding for [`@surea11y/core`](https://github.com/SureA11y/core) — scans a real, already-rendered page for accessibility issues using surea11y's DOM-rules engine.
4
4
 
5
- This is a **separate project/package** from `surea11y` itself and from its sibling [`surea11y-playwright`](../surea11y-playwright), kept as its own sibling directory rather than a monorepo subfolder — see `ROADMAP.md` §1 for the reasoning (same reasoning `surea11y-playwright` already used).
6
-
7
- ## Install (local development)
8
-
9
- `surea11y` isn't published to npm yet, so this package depends on it via a relative `file:` path (see `package.json`):
10
-
11
- ```json
12
- "dependencies": { "surea11y": "file:../core" }
13
- ```
14
-
15
- That means this project must stay a sibling of `surea11y` (or you update the path) for `npm install` to resolve it.
5
+ ## Install
16
6
 
17
7
  ```bash
18
- npm install
19
- npm test
8
+ npm install @surea11y/puppeteer puppeteer
20
9
  ```
21
10
 
22
- `puppeteer` (not `puppeteer-core`) is a `devDependency` here, which downloads its own bundled Chrome — unlike the Playwright binding, there's no separate `npx playwright install` step needed for `npm test` to work.
11
+ Puppeteer downloads its own bundled Chrome as part of `npm install` — unlike the Playwright binding, there's no separate browser-install step needed for `npm test` to work.
23
12
 
24
13
  The cross-browser regression test in `tests/cross-browser.test.js` (proving this works against Firefox too, not just Chrome) additionally needs `npx puppeteer browsers install firefox`.
25
14
 
@@ -27,7 +16,7 @@ The cross-browser regression test in `tests/cross-browser.test.js` (proving this
27
16
 
28
17
  ```js
29
18
  const puppeteer = require('puppeteer');
30
- const { A11yCoreBuilder } = require('surea11y-puppeteer');
19
+ const { A11yCoreBuilder } = require('@surea11y/puppeteer');
31
20
 
32
21
  const browser = await puppeteer.launch();
33
22
  const page = await browser.newPage();
@@ -45,11 +34,11 @@ console.log(results.checksResults.filter(r => r.outcome === 'fail'));
45
34
  await browser.close();
46
35
  ```
47
36
 
48
- `results` is surea11y's own native result shape — see [`../surea11y/docs/OUTPUT_SCHEMA.md`](../surea11y/docs/OUTPUT_SCHEMA.md) — not the `violations`/`passes`/`incomplete`/`inapplicable` shape used by other popular accessibility testing tools. The builder's *method names* are modeled on common conventions in this space for migration familiarity; the richer result schema is kept as-is.
37
+ `results` is `@surea11y/core`'s own native result shape — see its [`OUTPUT_SCHEMA.md`](https://github.com/SureA11y/core/blob/main/docs/OUTPUT_SCHEMA.md) — not the `violations`/`passes`/`incomplete`/`inapplicable` shape used by other popular accessibility testing tools. The builder's *method names* are modeled on common conventions in this space for migration familiarity; the richer result schema is kept as-is.
49
38
 
50
39
  Also see `examples/basic-scan.js` for a runnable script (`npm run example -- <url>`).
51
40
 
52
- `withTags()`/`disableRules()` above have counterparts: `.withRules([...])` (only run these specific rule IDs) and `.disableTags([...])` (never run rules carrying any of these tags). All four compose the same way similar allow/deny-list options do in other accessibility testing tools, with one non-obvious rule worth knowing: a "disable" always wins over a "with" on the same ID/tag (e.g. `.withRules(['a']).disableRules(['a'])` drops `'a'` entirely), and combining `.withRules()` **and** `.withTags()` together requires a rule to satisfy *both* (surea11y's default `includeMode: 'and'` — see `../surea11y/docs/ENGINE_OPTIONS.md`), not either one.
41
+ `withTags()`/`disableRules()` above have counterparts: `.withRules([...])` (only run these specific rule IDs) and `.disableTags([...])` (never run rules carrying any of these tags). All four compose the same way similar allow/deny-list options do in other accessibility testing tools, with one non-obvious rule worth knowing: a "disable" always wins over a "with" on the same ID/tag (e.g. `.withRules(['a']).disableRules(['a'])` drops `'a'` entirely), and combining `.withRules()` **and** `.withTags()` together requires a rule to satisfy *both* (`@surea11y/core`'s default `includeMode: 'and'` — see [`ENGINE_OPTIONS.md`](https://github.com/SureA11y/core/blob/main/docs/ENGINE_OPTIONS.md)), not either one.
53
42
 
54
43
  `.exclude(selector)` above excludes globally. Pass a second argument to scope it to specific rule IDs instead: `.exclude('.mat-select', { rules: ['aria-required-children'] })` skips `.mat-select` for that rule only — every other rule still sees it. Global and rule-scoped `.exclude()` calls compose freely.
55
44
 
@@ -63,7 +52,7 @@ The pattern above works unchanged inside a real test:
63
52
 
64
53
  ```js
65
54
  const puppeteer = require('puppeteer');
66
- const { A11yCoreBuilder, formatFailures } = require('surea11y-puppeteer');
55
+ const { A11yCoreBuilder, formatFailures } = require('@surea11y/puppeteer');
67
56
 
68
57
  const browser = await puppeteer.launch();
69
58
  const page = await browser.newPage();
@@ -74,7 +63,7 @@ const results = await new A11yCoreBuilder({ page }).reportOnly(['fail']).analyze
74
63
  assert.strictEqual(results.checksResults.length, 0, formatFailures(results.checksResults));
75
64
  ```
76
65
 
77
- See `examples/e2e-test-example.test.js` for a fuller, runnable version (`npm run example:e2e`) — one test proving real violations get caught (unlabeled button, missing `alt`), one proving a well-formed page passes cleanly. It uses `node:test` directly rather than a dedicated test-runner package: Puppeteer has no first-party test runner the way `@playwright/test` is the default for Playwright, and `node:test` is a zero-new-dependency choice that already matches this project's own test suite (see `ROADMAP.md` §6 for the full reasoning, including the other runners considered).
66
+ See `examples/e2e-test-example.test.js` for a fuller, runnable version (`npm run example:e2e`) — one test proving real violations get caught (unlabeled button, missing `alt`), one proving a well-formed page passes cleanly. It uses `node:test` directly rather than a dedicated test-runner package: Puppeteer has no first-party test runner the way `@playwright/test` is the default for Playwright, and `node:test` is a zero-new-dependency choice that already matches this project's own test suite.
78
67
 
79
68
  ### Readable console/CI output on failure
80
69
 
@@ -89,7 +78,7 @@ Error: 1) button-name-present (serious): This button has no accessible name.
89
78
  Add an alt attribute (use alt="" only for decorative images).
90
79
  ```
91
80
 
92
- Deliberately a plain function, not a custom `expect` matcher — no dependency on any particular assertion library, so it works the same with `node:assert`, Jest, Vitest, or a hand-rolled `if`/`throw`. Defaults to `fail`/`cantTell` outcomes (the only two that ever carry occurrences); pass `{ outcomes: [...] }` to narrow further. A thrown rule (`occurrences: []`, `error` set — see `../surea11y/docs/OUTPUT_SCHEMA.md`) is still surfaced using its `error` message rather than silently dropped.
81
+ Deliberately a plain function, not a custom `expect` matcher — no dependency on any particular assertion library, so it works the same with `node:assert`, Jest, Vitest, or a hand-rolled `if`/`throw`. Defaults to `fail`/`cantTell` outcomes (the only two that ever carry occurrences); pass `{ outcomes: [...] }` to narrow further. A thrown rule (`occurrences: []`, `error` set — see [`OUTPUT_SCHEMA.md`](https://github.com/SureA11y/core/blob/main/docs/OUTPUT_SCHEMA.md)) is still surfaced using its `error` message rather than silently dropped.
93
82
 
94
83
  ### Scanning every frame, including cross-origin iframes
95
84
 
@@ -102,11 +91,11 @@ for (const frame of results.frames) {
102
91
  }
103
92
  ```
104
93
 
105
- Unlike script-injection-based accessibility tools (which need a `postMessage`-based protocol to reach cross-origin iframes, since they're injected as a plain `<script>` fully subject to the browser's same-origin policy), this needs no `surea11y` engine support at all — Puppeteer drives every frame via CDP at the automation-process level, so cross-origin `frame.evaluate()` already just works. Verified against a real cross-origin page (`example.org` embedded in an unrelated origin) — see `ROADMAP.md` §2c and `tests/builder.test.js`. Default off, so plain `.analyze()` is unaffected unless you opt in.
94
+ Unlike script-injection-based accessibility tools (which need a `postMessage`-based protocol to reach cross-origin iframes, since they're injected as a plain `<script>` fully subject to the browser's same-origin policy), this needs no extra `@surea11y/core` engine support at all — Puppeteer drives every frame via CDP at the automation-process level, so cross-origin `frame.evaluate()` already just works. Verified against a real cross-origin page (`example.org` embedded in an unrelated origin) — see `tests/builder.test.js`. Default off, so plain `.analyze()` is unaffected unless you opt in.
106
95
 
107
96
  ### Trimming the result to just violations
108
97
 
109
- By default `analyze()` returns every rule's outcome, including `pass`/`notApplicable` — surea11y's own deliberate "not a violations-only list" design (see `../surea11y/docs/OUTPUT_SCHEMA.md`). Use `.reportOnly()` to post-filter down to only the outcomes you care about:
98
+ By default `analyze()` returns every rule's outcome, including `pass`/`notApplicable` — `@surea11y/core`'s own deliberate "not a violations-only list" design (see [`OUTPUT_SCHEMA.md`](https://github.com/SureA11y/core/blob/main/docs/OUTPUT_SCHEMA.md)). Use `.reportOnly()` to post-filter down to only the outcomes you care about:
110
99
 
111
100
  ```js
112
101
  const results = await new A11yCoreBuilder({ page })
@@ -116,7 +105,7 @@ const results = await new A11yCoreBuilder({ page })
116
105
  console.log(results.checksResults); // only fail/cantTell entries, pass/notApplicable dropped
117
106
  ```
118
107
 
119
- Valid outcome values are `'pass'`, `'fail'`, `'cantTell'`, `'notApplicable'`. This is pure binding-layer filtering — surea11y itself still computes every rule; nothing about the scan itself changes. Combines with `.frames(true)`: the filter is applied to `results.topFrame` and each entry of `results.frames` independently.
108
+ Valid outcome values are `'pass'`, `'fail'`, `'cantTell'`, `'notApplicable'`. This is pure binding-layer filtering — the engine itself still computes every rule; nothing about the scan itself changes. Combines with `.frames(true)`: the filter is applied to `results.topFrame` and each entry of `results.frames` independently.
120
109
 
121
110
  ### Getting a live element handle, not just a selector string
122
111
 
@@ -136,7 +125,7 @@ Each `ElementHandle` holds a browser-side reference until garbage collected or e
136
125
 
137
126
  ### Registering a custom rule at runtime
138
127
 
139
- `surea11y` supports registering additional rules per-scan via `engineOptions.customRules`. Use `.withCustomRules()` to register one:
128
+ `@surea11y/core` supports registering additional rules per-scan via `engineOptions.customRules`. Use `.withCustomRules()` to register one:
140
129
 
141
130
  ```js
142
131
  const results = await new A11yCoreBuilder({ page })
@@ -153,7 +142,7 @@ const results = await new A11yCoreBuilder({ page })
153
142
  .analyze();
154
143
  ```
155
144
 
156
- A custom rule descriptor is the same shape as one of surea11y's own internal rule modules (`{ id, meta, runInPage, applicability?, data? }`) — see `../surea11y/docs/ENGINE_OPTIONS.md` for the full contract. Results appear in `checksResults` exactly like a built-in rule's, including automatic `selector`/`html`/`structuralPath` fill-in. Registered per-scan only (nothing persists between calls or shows up in any catalog listing), and a custom rule whose `id` collides with a built-in one overrides it for that scan.
145
+ A custom rule descriptor is the same shape as one of `@surea11y/core`'s own internal rule modules (`{ id, meta, runInPage, applicability?, data? }`) — see its [`ENGINE_OPTIONS.md`](https://github.com/SureA11y/core/blob/main/docs/ENGINE_OPTIONS.md) for the full contract. Results appear in `checksResults` exactly like a built-in rule's, including automatic `selector`/`html`/`structuralPath` fill-in. Registered per-scan only (nothing persists between calls or shows up in any catalog listing), and a custom rule whose `id` collides with a built-in one overrides it for that scan.
157
146
 
158
147
  Pass an array to register several at once, or call `.withCustomRules()` again to add more — like `.withRules()`/`.withTags()`, it accumulates rather than replacing what was already registered:
159
148
 
@@ -164,24 +153,34 @@ const results = await new A11yCoreBuilder({ page })
164
153
  .analyze();
165
154
  ```
166
155
 
167
- **Why `.withCustomRules()` instead of the raw `.options({ customRules })` passthrough** (still supported, and composes with this method if you use both): `runInPage`/`applicability` must reach the page as a function-source *string*, not a live `Function` — a Puppeteer `page.evaluate()` argument crosses a serialization boundary that can't carry a live function reference, only a string surea11y can reconstruct with `new Function` on the page side. Passing a raw live function via `.options()` directly would silently fail to serialize; `.withCustomRules()` calls `.toString()` on a live function for you, so you can write a normal function and not have to remember that constraint yourself. A string is still accepted as-is if you already have one.
156
+ **Why `.withCustomRules()` instead of the raw `.options({ customRules })` passthrough** (still supported, and composes with this method if you use both): `runInPage`/`applicability` must reach the page as a function-source *string*, not a live `Function` — a Puppeteer `page.evaluate()` argument crosses a serialization boundary that can't carry a live function reference, only a string `@surea11y/core` can reconstruct with `new Function` on the page side. Passing a raw live function via `.options()` directly would silently fail to serialize; `.withCustomRules()` calls `.toString()` on a live function for you, so you can write a normal function and not have to remember that constraint yourself. A string is still accepted as-is if you already have one.
168
157
 
169
- Invalid input (a missing/empty `id`, or a `runInPage`/`applicability` that's neither a function nor a non-empty string) throws immediately from `.withCustomRules()` itself, rather than surfacing later as a silently-skipped rule deep inside the page — easier to catch during development. (Note: a *raw* `.options({ customRules })` call bypasses this check entirely and defers to surea11y's own engine-side behavior, which silently skips an invalid descriptor rather than throwing — see `../surea11y/docs/ENGINE_OPTIONS.md`.)
158
+ Invalid input (a missing/empty `id`, or a `runInPage`/`applicability` that's neither a function nor a non-empty string) throws immediately from `.withCustomRules()` itself, rather than surfacing later as a silently-skipped rule deep inside the page — easier to catch during development. (Note: a *raw* `.options({ customRules })` call bypasses this check entirely and defers to `@surea11y/core`'s own engine-side behavior, which silently skips an invalid descriptor rather than throwing.)
170
159
 
171
160
  ### Element addressing beyond a CSS selector
172
161
 
173
- Every occurrence already carries `selector` and (with `.elementRef(true)`, above) a live `ElementHandle`. It also carries `structuralPath` — a sibling-index path from the document root down to the flagged element (e.g. `[1, 0, 2]`) — a more robust identity than a selector string alone, since it survives some DOM changes a selector wouldn't (an id/class rename, for instance). No opt-in needed; it's already on every `fail`/`cantTell` occurrence today. See `../surea11y/docs/OUTPUT_SCHEMA.md` for the full field description.
162
+ Every occurrence already carries `selector` and (with `.elementRef(true)`, above) a live `ElementHandle`. It also carries `structuralPath` — a sibling-index path from the document root down to the flagged element (e.g. `[1, 0, 2]`) — a more robust identity than a selector string alone, since it survives some DOM changes a selector wouldn't (an id/class rename, for instance). No opt-in needed; it's already on every `fail`/`cantTell` occurrence today. See [`OUTPUT_SCHEMA.md`](https://github.com/SureA11y/core/blob/main/docs/OUTPUT_SCHEMA.md) for the full field description.
174
163
 
175
164
  ## TypeScript
176
165
 
177
- `src/A11yCoreBuilder.d.ts` (re-exported from `src/index.d.ts`, wired up via `package.json`'s `types` field) ships hand-written types for the whole builder API plus surea11y's native result shapes (`A11yCoreResult`, `CheckResult`, `Occurrence`, `CompositeResult`, etc.), mirrored from `../surea11y/docs/OUTPUT_SCHEMA.md`. `analyze()` is typed `Promise<A11yCoreResult | A11yCoreMultiFrameResult>` — narrow on `'topFrame' in results` (or cast, if you already know which mode you called) to get the specific shape back, since a fluent builder can't statically track that `.frames(true)` was called earlier in the chain. `puppeteer` is a `peerDependencies` entry (not just `devDependencies`) since the class's `page` argument and `Occurrence#elementHandle` both come from it — consumers need their own `puppeteer` install for the types to resolve, same as they already do to construct a `Page` in the first place.
166
+ `src/A11yCoreBuilder.d.ts` (re-exported from `src/index.d.ts`, wired up via `package.json`'s `types` field) ships hand-written types for the whole builder API plus `@surea11y/core`'s native result shapes (`A11yCoreResult`, `CheckResult`, `Occurrence`, `CompositeResult`, etc.), mirrored from [`OUTPUT_SCHEMA.md`](https://github.com/SureA11y/core/blob/main/docs/OUTPUT_SCHEMA.md). `analyze()` is typed `Promise<A11yCoreResult | A11yCoreMultiFrameResult>` — narrow on `'topFrame' in results` (or cast, if you already know which mode you called) to get the specific shape back, since a fluent builder can't statically track that `.frames(true)` was called earlier in the chain. `puppeteer` is a `peerDependencies` entry (not just `devDependencies`) since the class's `page` argument and `Occurrence#elementHandle` both come from it — consumers need their own `puppeteer` install for the types to resolve, same as they already do to construct a `Page` in the first place.
167
+
168
+ ## Relationship to `@surea11y/playwright`
169
+
170
+ This binding's builder API is deliberately identical to `@surea11y/playwright`'s — same method names, same mutability contract, same result shapes — so switching between the two (or running the same accessibility gate logic against both) is a drop-in swap of `puppeteer.launch()`/`playwright.chromium.launch()` and nothing else. The one real implementation difference is internal: `analyze()`'s injection call is simpler here, since Puppeteer's `page.evaluate()` is genuinely variadic and doesn't need the wrapper/`eval()` trick Playwright's single-argument `evaluate()` requires.
171
+
172
+ ## Building another framework binding?
173
+
174
+ See `@surea11y/core`'s [`BINDING_AUTHORS_GUIDE.md`](https://github.com/SureA11y/core/blob/main/docs/BINDING_AUTHORS_GUIDE.md) — a reference for building a new binding, covering which parity features are engine-level (work through a generic `.options()`/`runOnly` passthrough with zero binding code, including WCAG-version tag filtering) vs. binding-layer (element refs, `reportOnly`-style verbosity filtering, the `page.evaluate()`/`frame.evaluate()` serialization-boundary caveat that `.withCustomRules()` exists to paper over). It cites this project's `.elementRef()`, `.reportOnly()`, `.frames(true)`, and `.withCustomRules()` by name as worked examples alongside `@surea11y/playwright`'s.
175
+
176
+ `A11yCoreBuilder` here extends `A11yCoreBuilderBase` from [`@surea11y/binding-base`](https://github.com/SureA11y/binding-base), a small shared package holding the scaffolding common to every framework binding. A new binding should depend on that package from the start.
178
177
 
179
- ## Relationship to `surea11y-playwright`
178
+ ## Maintainer
180
179
 
181
- This binding's builder API is deliberately identical to [`surea11y-playwright`](../surea11y-playwright)'s — same method names, same mutability contract, same result shapes — so switching between the two (or running the same accessibility gate logic against both) is a drop-in swap of `puppeteer.launch()`/`playwright.chromium.launch()` and nothing else. As of `ROADMAP.md` §8, that's no longer just parallel implementation: `A11yCoreBuilder` here extends `A11yCoreBuilderBase` from [`../surea11y-binding-base`](../surea11y-binding-base), a small shared package every surea11y binding now depends on for the logic that genuinely has nothing to do with any particular driver. The one real implementation difference left is internal: `analyze()`'s injection call is simpler here, since Puppeteer's `page.evaluate()` is genuinely variadic and doesn't need the wrapper/`eval()` trick Playwright's single-argument `evaluate()` requires — see `ROADMAP.md` §2b.
180
+ Maintained by [Jorge Rumoroso](https://github.com/rumoroso).
182
181
 
183
- Also see [`../surea11y/docs/BINDING_AUTHORS_GUIDE.md`](../surea11y/docs/BINDING_AUTHORS_GUIDE.md) — `surea11y`'s own reference for building a binding like this one, distinguishing what's already engine-level (a generic `.options()`/`runOnly` passthrough, e.g. WCAG-version tag filtering, `structuralPath`) from what every binding has to build itself (element refs, `reportOnly`-style verbosity filtering, the `page.evaluate()`/`frame.evaluate()` serialization-boundary caveat `.withCustomRules()` exists to paper over). It cites this project's `.elementRef()`, `.reportOnly()`, `.frames(true)`, and `.withCustomRules()` by name as worked examples alongside `surea11y-playwright`'s.
182
+ ## License
184
183
 
185
- ## Status and what's next
184
+ MIT — see [`LICENSE`](./LICENSE).
186
185
 
187
- See `ROADMAP.md` — it documents what's built, what's verified, and what's still open.
186
+ This package depends on [`@surea11y/core`](https://github.com/SureA11y/core), which is MPL-2.0. MPL-2.0's copyleft is file-level and applies only to `@surea11y/core`'s own source files; consuming it as a normal package dependency doesn't affect this package's license.
package/package.json CHANGED
@@ -1,21 +1,34 @@
1
1
  {
2
2
  "name": "@surea11y/puppeteer",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Puppeteer binding for surea11y -- scan real, live-rendered pages for accessibility issues.",
5
+ "keywords": [
6
+ "accessibility",
7
+ "a11y",
8
+ "wcag",
9
+ "wcag22",
10
+ "accessibility-testing",
11
+ "puppeteer",
12
+ "e2e",
13
+ "e2e-testing",
14
+ "audit",
15
+ "aria",
16
+ "surea11y"
17
+ ],
5
18
  "main": "src/index.js",
6
19
  "types": "src/index.d.ts",
7
20
  "author": "Jorge Rumoroso",
8
21
  "license": "MIT",
9
22
  "repository": {
10
23
  "type": "git",
11
- "url": "git+https://github.com/rumoroso/surea11y-core-puppeteer.git"
24
+ "url": "git+https://github.com/SureA11y/puppeteer.git"
12
25
  },
13
- "homepage": "https://github.com/rumoroso/surea11y-core-puppeteer#readme",
26
+ "homepage": "https://github.com/SureA11y/puppeteer#readme",
14
27
  "bugs": {
15
- "url": "https://github.com/rumoroso/surea11y-core-puppeteer/issues"
28
+ "url": "https://github.com/SureA11y/puppeteer/issues"
16
29
  },
17
30
  "engines": {
18
- "node": ">=22.12.0"
31
+ "node": "^20.19.0 || ^22.13.0 || >=24.0.0"
19
32
  },
20
33
  "publishConfig": {
21
34
  "access": "public"
@@ -36,7 +49,7 @@
36
49
  "puppeteer": "^25.3.0"
37
50
  },
38
51
  "scripts": {
39
- "test": "node --test \"tests/**/*.test.js\"",
52
+ "test": "node --test tests/*.test.js",
40
53
  "example": "node examples/basic-scan.js",
41
54
  "example:e2e": "node --test examples/e2e-test-example.test.js"
42
55
  }
@@ -14,15 +14,15 @@ const { A11yCoreBuilderBase } = require('@surea11y/binding-base');
14
14
  * .options({ contrast: { mode: 'auditorAssist' } })
15
15
  * .analyze();
16
16
  *
17
- * `results` is surea11y's own native result shape (checksResults /
18
- * rulesResults -- see surea11y's docs/OUTPUT_SCHEMA.md), not the
17
+ * `results` is @surea11y/core's own native result shape (checksResults /
18
+ * rulesResults -- see ../core/docs/OUTPUT_SCHEMA.md), not the
19
19
  * violations/passes/incomplete/inapplicable shape used by other tools in
20
20
  * this space. Method names are modeled on common conventions in this space
21
21
  * for migration ease, but the richer native schema (severity, confidence,
22
22
  * occurrences, policy contract, WCAG SC mappings) is kept as-is rather than
23
23
  * reshaped to match.
24
24
  *
25
- * Extends `A11yCoreBuilderBase` (from `surea11y-binding-base`), which owns
25
+ * Extends `A11yCoreBuilderBase` (from `@surea11y/binding-base`), which owns
26
26
  * every method with no driver-specific work at all -- `include()`/
27
27
  * `exclude()`/`withTags()`/`disableTags()`/`withRules()`/`disableRules()`/
28
28
  * `options()`/`reportOnly()`/`elementRef()`/`frames()`/`withCustomRules()`'s
@@ -31,7 +31,7 @@ const { A11yCoreBuilderBase } = require('@surea11y/binding-base');
31
31
  * boundary), and `_buildEngineArgs()`. This class adds exactly the parts
32
32
  * that are genuinely Puppeteer-specific: `analyze()`'s injection mechanics,
33
33
  * frame traversal, and `_attachElementRefs()`. See
34
- * `../surea11y-binding-base/README.md` for what's shared and why.
34
+ * `../binding-base/README.md` for what's shared and why.
35
35
  *
36
36
  * Opt in to scanning every frame on the page (including cross-origin
37
37
  * iframes) via .frames(true):
@@ -43,17 +43,17 @@ const { A11yCoreBuilderBase } = require('@surea11y/binding-base');
43
43
  * Unlike script-injection-based accessibility engines (which need a
44
44
  * postMessage-based protocol, runPartial/finishRun, to reach cross-origin
45
45
  * iframes, since they're injected as a plain <script> and are fully subject
46
- * to the browser's same-origin policy), this doesn't need any surea11y
46
+ * to the browser's same-origin policy), this doesn't need any @surea11y/core
47
47
  * engine support: Puppeteer drives every frame
48
48
  * via CDP at the automation-process level, not as in-page script, so
49
49
  * cross-origin frame.evaluate() already just works -- verified empirically
50
- * against a real cross-origin iframe, see ../ROADMAP.md and
51
- * tests/builder.test.js. Default off, so plain .analyze() keeps returning
50
+ * against a real cross-origin iframe, see tests/builder.test.js. Default
51
+ * off, so plain .analyze() keeps returning
52
52
  * the single native result object it always has.
53
53
  *
54
54
  * By default `analyze()` returns every rule's outcome, including
55
- * `pass`/`notApplicable` -- surea11y's own deliberate "not a
56
- * violations-only list" design (see surea11y's docs/OUTPUT_SCHEMA.md).
55
+ * `pass`/`notApplicable` -- @surea11y/core's own deliberate "not a
56
+ * violations-only list" design (see ../core/docs/OUTPUT_SCHEMA.md).
57
57
  * Opt in to a lighter payload with `.reportOnly(['fail', 'cantTell'])`,
58
58
  * which post-filters `checksResults` by `outcome` (applied per-frame when
59
59
  * combined with `.frames(true)`, since `checksResults` lives at
@@ -73,12 +73,12 @@ const { A11yCoreBuilderBase } = require('@surea11y/binding-base');
73
73
  * await firstFail.occurrences[0].elementHandle.screenshot({ path: 'flagged.png' });
74
74
  *
75
75
  * Register your own rule(s) for just this scan with
76
- * `.withCustomRules([...])` (surea11y's `engineOptions.customRules`
77
- * escape hatch -- see surea11y's docs/ENGINE_OPTIONS.md). Pass a real,
76
+ * `.withCustomRules([...])` (@surea11y/core's `engineOptions.customRules`
77
+ * escape hatch -- see ../core/docs/ENGINE_OPTIONS.md). Pass a real,
78
78
  * live `runInPage`/
79
79
  * `applicability` function -- unlike the raw `.options({ customRules })`
80
80
  * passthrough, this method converts them to the function-source string
81
- * surea11y needs on this side of the page.evaluate() JSON boundary for
81
+ * @surea11y/core needs on this side of the page.evaluate() JSON boundary for
82
82
  * you, so you don't have to remember to call .toString() yourself:
83
83
  *
84
84
  * const results = await new A11yCoreBuilder({ page })
@@ -118,23 +118,23 @@ class A11yCoreBuilder extends A11yCoreBuilderBase {
118
118
  }
119
119
 
120
120
  /**
121
- * Runs the scan and returns surea11y's native result object.
122
- * @returns {Promise<object>} see surea11y's docs/OUTPUT_SCHEMA.md
121
+ * Runs the scan and returns @surea11y/core's native result object.
122
+ * @returns {Promise<object>} see ../core/docs/OUTPUT_SCHEMA.md
123
123
  */
124
124
  async analyze() {
125
125
  const { contextSelector, engineOptions, runOnly } = this._buildEngineArgs();
126
126
 
127
127
  // Unlike Playwright's page.evaluate(fn, arg), which only accepts a
128
128
  // SINGLE argument (forcing a hand-built single-arg wrapper there --
129
- // see surea11y-playwright's own A11yCoreBuilder.js for the full
129
+ // see @surea11y/playwright's own A11yCoreBuilder.js for the full
130
130
  // story), Puppeteer's page.evaluate()/frame.evaluate() is genuinely
131
131
  // variadic: evaluate<Params extends unknown[], Func>(pageFunction: Func
132
132
  // | string, ...args: Params) (confirmed against a real Puppeteer 25.x
133
133
  // install's own puppeteer-core/lib/types.d.ts, on the shared abstract
134
134
  // Realm class both Page and Frame implement). That means
135
135
  // runa11yCoreInPage's own 4 positional args can be passed straight
136
- // through with no wrapper/eval() trick needed -- see surea11y's own
137
- // docs/INTEGRATION.md for the documented example this mirrors.
136
+ // through with no wrapper/eval() trick needed -- see
137
+ // ../core/docs/INTEGRATION.md for the documented example this mirrors.
138
138
  const runInFrame = async (frameOrPage) => {
139
139
  const frameUrl = this._url || (typeof frameOrPage.url === 'function' ? frameOrPage.url() : null);
140
140
  const result = await frameOrPage.evaluate(runa11yCoreInPage, frameUrl, contextSelector, engineOptions, runOnly);
@@ -1,11 +1,10 @@
1
1
  'use strict';
2
2
 
3
- // Re-exported from surea11y-binding-base, which now holds the single
3
+ // Re-exported from @surea11y/binding-base, which now holds the single
4
4
  // canonical copy shared across every surea11y binding -- see
5
- // ../ROADMAP.md's note on the shared-package extraction, and
6
- // ../surea11y-binding-base/README.md for the full rationale. Kept as a
5
+ // ../binding-base/README.md for the full rationale. Kept as a
7
6
  // real file here (not just re-exporting straight from src/index.js) so
8
- // `require('surea11y-puppeteer/src/formatFailures')` keeps working for
7
+ // `require('@surea11y/puppeteer/src/formatFailures')` keeps working for
9
8
  // anyone importing the submodule path directly.
10
9
  const { formatFailures } = require('@surea11y/binding-base');
11
10