@a11ied/wcag-data
v0.4.0
Published
Normalized WCAG, ACT, and APG data. Internal package of a11ied, published because the a1 CLI depends on it. Its API can change in any release; install a11ied instead.
Readme
@a11ied/wcag-data
@a11ied/wcag-data is the pinned local data workspace for WCAG source sync and normalized artifact generation.
This is an internal package of a11ied. It is published because a11ied depends on it, and its API can change in any release. Install a11ied instead.
This package is responsible for:
- keeping raw upstream sync inputs under
data/raw/ - keeping committed generated artifacts under
data/generated/ - emitting a committed
generated-provenance.jsonmanifest for the normalized outputs - exposing the shared package paths that later sync and engine code will use
Current scaffold commands:
npm run sync --workspace @a11ied/wcag-data
npm run validate --workspace @a11ied/wcag-dataRepository-wide quality gate:
npm run standardsupdate workflow
Use this package from the repo root. The boring path is the right path:
npm run wcag:sync
npm run wcag:validate
npm run standardsIf you only want the workspace-local form, these are the equivalent commands:
npm run sync --workspace @a11ied/wcag-data
npm run validate --workspace @a11ied/wcag-data
npm run standardsWhat to review after a sync:
mobile-guidance.jsonshould keep an entry for every criterion WCAG2Mobile covers; entries move fromplaceholdertoguidanceas the task force writes them, never backapg-patterns.jsonshould keep 28 patterns and 68 examples, and 8 of those examples have no tables because the APG documents the landmarks with prose alone- raw inputs should change only under
packages/wcag-data/data/raw/ - committed normalized artifacts should change only under
packages/wcag-data/data/generated/ generated-provenance.jsonshould point back to the approved WCAG, ACT, Quickref, APG, andaxe-coresources- regression fixtures and tests should still agree on representative criteria like
1.3.1,2.4.3,3.3.8, and4.1.3
notes
- Raw synced inputs are committed under
packages/wcag-data/data/raw/and should only change when re-running the data sync scripts. - Generated artifacts are intentionally not ignored, because later normalization output and provenance manifests are meant to be committed.
- The generated layer currently emits:
criteria.<version>.jsoncriteria-by-level.<version>.jsontest-methods.<version>.jsonstrategy.<version>.jsontest-method-summary.<version>.jsonslug-index.<version>.jsontechnique-index.<version>.jsonfailure-index.<version>.jsonaxe-rules.<version>.jsonact-rules.<version>.jsonunderstanding.<version>.jsontechnique-bodies.<version>.jsondocuments-content.jsonmobile-guidance.jsonapg-patterns.jsongenerated-provenance.json
data/generated/ships in the published package next todist/;@a11ied/wcag-enginereads it from there.- Techniques carry a
urlto the W3C technique page and criteria carryunderstandingUrl. The Understanding document and the technique body are also copied into the data, converted from HTML to Markdown, underunderstanding.<version>.jsonandtechnique-bodies.<version>.json. The W3C Document License permits this conversion to help implementation. SeeNOTICE.md. npm run wcag:syncfetches 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.- A third step (
syncMobileGuidance) fetches WCAG2Mobile's per-criterion guidance from thew3c/matfsource files and writesmobile-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. SeeNOTICE.md. - 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 toapg-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. SeeNOTICE.md.
