@a11ied/wcag-data 0.0.0-stage → 0.1.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/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/NOTICE.md +94 -0
- package/README.md +78 -2
- package/data/generated/.gitkeep +1 -0
- package/data/generated/act-rules.2.1.json +663 -0
- package/data/generated/act-rules.2.2.json +663 -0
- package/data/generated/apg-patterns.json +11549 -0
- package/data/generated/axe-rules.2.1.json +1331 -0
- package/data/generated/axe-rules.2.2.json +1331 -0
- package/data/generated/criteria-by-level.2.1.json +89 -0
- package/data/generated/criteria-by-level.2.2.json +97 -0
- package/data/generated/criteria.2.1.json +9744 -0
- package/data/generated/criteria.2.2.json +10222 -0
- package/data/generated/documents-content.json +981 -0
- package/data/generated/failure-index.2.1.json +839 -0
- package/data/generated/failure-index.2.2.json +866 -0
- package/data/generated/generated-provenance.json +330 -0
- package/data/generated/mobile-guidance.json +850 -0
- package/data/generated/slug-index.2.1.json +83 -0
- package/data/generated/slug-index.2.2.json +91 -0
- package/data/generated/strategy.2.1.json +3217 -0
- package/data/generated/strategy.2.2.json +3460 -0
- package/data/generated/technique-bodies.2.1.json +3659 -0
- package/data/generated/technique-bodies.2.2.json +3686 -0
- package/data/generated/technique-index.2.1.json +3239 -0
- package/data/generated/technique-index.2.2.json +3293 -0
- package/data/generated/test-method-summary.2.1.json +129 -0
- package/data/generated/test-method-summary.2.2.json +137 -0
- package/data/generated/test-methods.2.1.json +882 -0
- package/data/generated/test-methods.2.2.json +966 -0
- package/data/generated/understanding.2.1.json +785 -0
- package/data/generated/understanding.2.2.json +865 -0
- package/dist/index.d.ts +320 -0
- package/dist/index.js +23795 -0
- package/package.json +54 -5
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 hypothesi
|
|
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/NOTICE.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
The files under `data/generated/` include material copied from or derived from the
|
|
4
|
+
following W3C documents:
|
|
5
|
+
|
|
6
|
+
- Web Content Accessibility Guidelines (WCAG) 2.2, https://www.w3.org/TR/WCAG22/, and
|
|
7
|
+
its machine-readable form, https://www.w3.org/WAI/WCAG22/wcag.json
|
|
8
|
+
- Web Content Accessibility Guidelines (WCAG) 2.1, https://www.w3.org/TR/WCAG21/, and
|
|
9
|
+
its machine-readable form, https://www.w3.org/WAI/WCAG21/wcag.json
|
|
10
|
+
- The Understanding documents for WCAG 2.2 and 2.1,
|
|
11
|
+
https://www.w3.org/WAI/WCAG22/Understanding/ and
|
|
12
|
+
https://www.w3.org/WAI/WCAG21/Understanding/
|
|
13
|
+
- The WCAG 2.2 and 2.1 technique and failure pages,
|
|
14
|
+
https://www.w3.org/WAI/WCAG22/Techniques/ and https://www.w3.org/WAI/WCAG21/Techniques/
|
|
15
|
+
- The ACT rules mapping from the `w3c/wcag` repository,
|
|
16
|
+
https://raw.githubusercontent.com/w3c/wcag/main/guidelines/act-mapping.json
|
|
17
|
+
- The WCAG quick reference tag data from the `w3c/wai-wcag-quickref` repository,
|
|
18
|
+
https://raw.githubusercontent.com/w3c/wai-wcag-quickref/main/_data/tags-sc.yml
|
|
19
|
+
- Guidance on Applying WCAG 2.2 to Mobile Applications (WCAG2Mobile),
|
|
20
|
+
https://w3c.github.io/matf/, from its source files in the `w3c/matf` repository,
|
|
21
|
+
https://github.com/w3c/matf/tree/main/comments
|
|
22
|
+
- The ARIA Authoring Practices Guide (APG), https://www.w3.org/WAI/ARIA/apg/, its example
|
|
23
|
+
index, https://www.w3.org/WAI/ARIA/apg/example-index/, and its pattern index,
|
|
24
|
+
https://www.w3.org/WAI/ARIA/apg/patterns/
|
|
25
|
+
- The APG example source files in the `w3c/aria-practices` repository,
|
|
26
|
+
https://github.com/w3c/aria-practices/tree/main/content/patterns
|
|
27
|
+
|
|
28
|
+
Copyright (c) World Wide Web Consortium. This software or document includes material
|
|
29
|
+
copied from or derived from the documents listed above. The material is used under the
|
|
30
|
+
W3C Document License, https://www.w3.org/copyright/document-license/.
|
|
31
|
+
|
|
32
|
+
The criterion identifiers, titles, levels, and normative text are copied verbatim, under
|
|
33
|
+
the license's first grant (permission to copy and distribute the contents of the
|
|
34
|
+
document). The Understanding documents and technique bodies are converted from HTML to
|
|
35
|
+
Markdown before storage. That conversion is a derivative work made to help
|
|
36
|
+
implementation, permitted under the license's second grant. a11ied is a testing tool, not
|
|
37
|
+
a republication of the W3C document as a technical specification, so this use falls
|
|
38
|
+
within that grant.
|
|
39
|
+
|
|
40
|
+
Copyright © 2023 W3C®. This software or document includes material copied from or
|
|
41
|
+
derived from the WCAG 2.2 and WCAG 2.1 Understanding documents
|
|
42
|
+
(https://www.w3.org/WAI/WCAG22/Understanding/, https://www.w3.org/WAI/WCAG21/Understanding/)
|
|
43
|
+
and the WCAG 2.2 and WCAG 2.1 techniques
|
|
44
|
+
(https://www.w3.org/WAI/WCAG22/Techniques/, https://www.w3.org/WAI/WCAG21/Techniques/).
|
|
45
|
+
|
|
46
|
+
Every stored Understanding document and technique body carries its own title, source
|
|
47
|
+
URL, and status alongside the converted text, in `understanding.<version>.json` and
|
|
48
|
+
`technique-bodies.<version>.json`. The converted bodies live in
|
|
49
|
+
`documents-content.json`, deduplicated by content hash so a document byte-identical
|
|
50
|
+
across WCAG 2.1 and 2.2 is stored once. The `a1 wcag understanding`, `a1 wcag show`, and
|
|
51
|
+
`a1 wcag <technique-id>` commands print a line naming the source document and its URL
|
|
52
|
+
whenever they print this material, because terminal output is a copy too.
|
|
53
|
+
|
|
54
|
+
The `act-rules.<version>.json` files list each ACT rule's identifier, name, page URL, and
|
|
55
|
+
process status, taken from `act-mapping.json`, alongside the criteria the rule maps to.
|
|
56
|
+
Only the name and the link are stored, so a command that prints one of these entries
|
|
57
|
+
prints a pointer to the rule rather than a copy of it. The rule's own text stays on the
|
|
58
|
+
W3C site.
|
|
59
|
+
|
|
60
|
+
The `mobile-guidance.json` file holds WCAG2Mobile's per-criterion guidance, copied from
|
|
61
|
+
the editor's draft's source files. Each entry keeps the document's prose, notes, and
|
|
62
|
+
examples as written, and carries its own section title, URL, and status, so a command that
|
|
63
|
+
prints any of it prints the attribution with it. WCAG2Mobile is a W3C Editor's Draft:
|
|
64
|
+
informative guidance that has not been published as a Recommendation, and a criterion the
|
|
65
|
+
Mobile Accessibility Task Force has not written up yet is stored with a `placeholder`
|
|
66
|
+
state and a link to the issue tracking it.
|
|
67
|
+
|
|
68
|
+
The `apg-patterns.json` file holds the ARIA Authoring Practices Guide's keyboard support
|
|
69
|
+
tables and its role, property, state, and tabindex tables, one entry per example, together
|
|
70
|
+
with the example titles and the role and attribute indexes the APG's own example index
|
|
71
|
+
publishes. Each entry keeps the example's title and its page URL, so a command that prints
|
|
72
|
+
any of it prints the attribution with it. The APG is a W3C WAI resource: informative guidance
|
|
73
|
+
that is not a W3C Recommendation and does not define conformance requirements.
|
|
74
|
+
|
|
75
|
+
The `w3c/aria-practices` repository is licensed under the W3C Software and Document License,
|
|
76
|
+
https://www.w3.org/Consortium/Legal/copyright-software, rather than the W3C Document License
|
|
77
|
+
that covers the WCAG material above. That license grants copying, modification, and
|
|
78
|
+
redistribution with the notice attached, so it permits both the stored tables and the
|
|
79
|
+
vendored example files described next.
|
|
80
|
+
|
|
81
|
+
The files under `packages/wcag-data/test/apg/` are unmodified copies of APG pages, kept as
|
|
82
|
+
inputs for the parser tests. The files under `packages/cli/test/fixtures/apg/` are copies of
|
|
83
|
+
APG examples used as known-good pages to test a11ied against. Those keep the upstream
|
|
84
|
+
directory layout, so the paths inside them resolve unchanged, and two things are removed from
|
|
85
|
+
each page's head: the stylesheet hosted on w3.org, so the tests need no network, and the four
|
|
86
|
+
scripts that run the guide's own documentation chrome. Nothing else in those files is
|
|
87
|
+
changed.
|
|
88
|
+
|
|
89
|
+
The `axe-rules.<version>.json` files list rule identifiers, tags, and ACT rule identifiers
|
|
90
|
+
read from the installed `axe-core` package (https://github.com/dequelabs/axe-core,
|
|
91
|
+
Mozilla Public License 2.0). No axe-core rule text is copied.
|
|
92
|
+
|
|
93
|
+
The HTML-to-Markdown conversion uses `turndown` (https://github.com/mixmark-io/turndown,
|
|
94
|
+
MIT License) and `jsdom` (https://github.com/jsdom/jsdom, MIT License).
|
package/README.md
CHANGED
|
@@ -1,3 +1,79 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @a11ied/wcag-data
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@a11ied/wcag-data` is the pinned local data workspace for WCAG source sync and normalized artifact generation.
|
|
4
|
+
|
|
5
|
+
This is an internal package of [`a11ied`](https://www.npmjs.com/package/a11ied). It is published because `a11ied` depends on it, and its API can change in any release. Install `a11ied` instead.
|
|
6
|
+
|
|
7
|
+
This package is responsible for:
|
|
8
|
+
|
|
9
|
+
- keeping raw upstream sync inputs under `data/raw/`
|
|
10
|
+
- keeping committed generated artifacts under `data/generated/`
|
|
11
|
+
- emitting a committed `generated-provenance.json` manifest for the normalized outputs
|
|
12
|
+
- exposing the shared package paths that later sync and engine code will use
|
|
13
|
+
|
|
14
|
+
Current scaffold commands:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm run sync --workspace @a11ied/wcag-data
|
|
18
|
+
npm run validate --workspace @a11ied/wcag-data
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Repository-wide quality gate:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm run standards
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## update workflow
|
|
28
|
+
|
|
29
|
+
Use this package from the repo root. The boring path is the right path:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npm run wcag:sync
|
|
33
|
+
npm run wcag:validate
|
|
34
|
+
npm run standards
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If you only want the workspace-local form, these are the equivalent commands:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
npm run sync --workspace @a11ied/wcag-data
|
|
41
|
+
npm run validate --workspace @a11ied/wcag-data
|
|
42
|
+
npm run standards
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
What to review after a sync:
|
|
46
|
+
|
|
47
|
+
- `mobile-guidance.json` should keep an entry for every criterion WCAG2Mobile covers; entries move from `placeholder` to `guidance` as the task force writes them, never back
|
|
48
|
+
- `apg-patterns.json` should keep 28 patterns and 68 examples, and 8 of those examples have no tables because the APG documents the landmarks with prose alone
|
|
49
|
+
- raw inputs should change only under `packages/wcag-data/data/raw/`
|
|
50
|
+
- committed normalized artifacts should change only under `packages/wcag-data/data/generated/`
|
|
51
|
+
- `generated-provenance.json` should point back to the approved WCAG, ACT, Quickref, APG, and `axe-core` sources
|
|
52
|
+
- regression fixtures and tests should still agree on representative criteria like `1.3.1`, `2.4.3`, `3.3.8`, and `4.1.3`
|
|
53
|
+
|
|
54
|
+
## notes
|
|
55
|
+
|
|
56
|
+
- Raw synced inputs are committed under `packages/wcag-data/data/raw/` and should only change when re-running the data sync scripts.
|
|
57
|
+
- Generated artifacts are intentionally not ignored, because later normalization output and provenance manifests are meant to be committed.
|
|
58
|
+
- The generated layer currently emits:
|
|
59
|
+
- `criteria.<version>.json`
|
|
60
|
+
- `criteria-by-level.<version>.json`
|
|
61
|
+
- `test-methods.<version>.json`
|
|
62
|
+
- `strategy.<version>.json`
|
|
63
|
+
- `test-method-summary.<version>.json`
|
|
64
|
+
- `slug-index.<version>.json`
|
|
65
|
+
- `technique-index.<version>.json`
|
|
66
|
+
- `failure-index.<version>.json`
|
|
67
|
+
- `axe-rules.<version>.json`
|
|
68
|
+
- `act-rules.<version>.json`
|
|
69
|
+
- `understanding.<version>.json`
|
|
70
|
+
- `technique-bodies.<version>.json`
|
|
71
|
+
- `documents-content.json`
|
|
72
|
+
- `mobile-guidance.json`
|
|
73
|
+
- `apg-patterns.json`
|
|
74
|
+
- `generated-provenance.json`
|
|
75
|
+
- `data/generated/` ships in the published package next to `dist/`; `@a11ied/wcag-engine` reads it from there.
|
|
76
|
+
- Techniques carry a `url` to the W3C technique page and criteria carry `understandingUrl`. The Understanding document and the technique body are also copied into the data, converted from HTML to Markdown, under `understanding.<version>.json` and `technique-bodies.<version>.json`. The W3C Document License permits this conversion to help implementation. See `NOTICE.md`.
|
|
77
|
+
- `npm run wcag:sync` fetches the Understanding documents and technique bodies with a separate step (`syncDocumentArtifacts`) that runs after the main sync, at low concurrency and with a pause between requests, and merges its results onto whatever is already committed so an incomplete run only adds to the corpus.
|
|
78
|
+
- A third step (`syncMobileGuidance`) fetches WCAG2Mobile's per-criterion guidance from the `w3c/matf` source files and writes `mobile-guidance.json`. It requests every Level A and AA criterion across both pinned WCAG versions and treats a 404 as "the document does not cover this criterion". The file is not version-scoped, because WCAG2Mobile applies WCAG 2.2 to mobile and criterion ids are stable across 2.1 and 2.2. See `NOTICE.md`.
|
|
79
|
+
- A fourth step (`syncApgPatterns`) fetches the ARIA Authoring Practices Guide's example index, its pattern index, and every example source file, and writes the keyboard support tables and the role, property, state, and tabindex tables to `apg-patterns.json`. That is 70 requests. The file is not version-scoped either: the APG describes ARIA patterns, which do not change between WCAG 2.1 and 2.2. The guide is published under the W3C Software and Document License rather than the W3C Document License. See `NOTICE.md`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|