@reqvire-org/ads 0.3.52 → 0.4.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/README.md +10 -9
- package/dist/assets.mjs +16 -2
- package/dist/behaviors.mjs +6 -5
- package/dist/boundaries.mjs +5 -5
- package/dist/browser-audit/first-render.mjs +22 -0
- package/dist/browser-audit/image-shape.mjs +36 -0
- package/dist/browser-audit/render-states.mjs +61 -35
- package/dist/browser-audit/worker.mjs +47 -12
- package/dist/browser-audit.mjs +75 -12
- package/dist/bun-compiler.mjs +14 -7
- package/dist/check-service.mjs +83 -0
- package/dist/check.mjs +20 -18
- package/dist/cli.mjs +5 -3
- package/dist/config.mjs +20 -41
- package/dist/contracts.d.mts +9 -0
- package/dist/finding-rules.mjs +8 -1
- package/dist/font-rules.mjs +103 -0
- package/dist/fonts-generated.mjs +32 -12
- package/dist/generated-entries.mjs +131 -0
- package/dist/icons.mjs +1 -1
- package/dist/init.mjs +11 -32
- package/dist/layers.mjs +7 -3
- package/dist/lint-config.mjs +4 -2
- package/dist/mcp/catalog.mjs +2 -1
- package/dist/mcp/context.mjs +3 -3
- package/dist/mcp/drafts.mjs +136 -121
- package/dist/mcp/mutations.mjs +65 -19
- package/dist/mcp/preview-watch.mjs +31 -5
- package/dist/mcp/preview-widget.bundle.js +50 -47
- package/dist/mcp/project-widget.bundle.js +45 -42
- package/dist/mcp/prompts.mjs +1 -1
- package/dist/mcp/server.mjs +81 -40
- package/dist/mcp/showcase-host.mjs +20 -7
- package/dist/mcp/widget.bundle.js +49 -46
- package/dist/oxlint.mjs +3 -2
- package/dist/program-cache.mjs +36 -0
- package/dist/public-api.mjs +2 -1
- package/dist/scenarios-compiler.mjs +82 -14
- package/dist/scenarios-vite.mjs +1 -1
- package/dist/scenarios.mjs +4 -3
- package/dist/showcase/client.bundle.js +27 -27
- package/dist/showcase/index.html +2 -2
- package/dist/skills/ads-break-ui/SKILL.md +25 -28
- package/dist/skills/ads-break-ui/references/behaviors.md +7 -6
- package/dist/skills/ads-break-ui/references/captures.md +7 -32
- package/dist/skills/ads-break-ui/references/contracts.md +58 -25
- package/dist/skills/ads-break-ui/references/drafts.md +59 -43
- package/dist/skills/ads-break-ui/references/evidence.md +1 -1
- package/dist/skills/ads-break-ui/references/guarded-editing.md +58 -47
- package/dist/skills/ads-break-ui/references/review.md +9 -8
- package/dist/skills/ads-break-ui/references/scenarios.md +1 -1
- package/dist/skills/ads-break-ui/references/validation.md +8 -4
- package/dist/skills/ads-break-ui/references/workflows.md +15 -8
- package/dist/skills/ads-designer/SKILL.md +30 -31
- package/dist/skills/ads-designer/references/accessibility.md +9 -5
- package/dist/skills/ads-designer/references/behaviors.md +7 -6
- package/dist/skills/ads-designer/references/branding.md +2 -2
- package/dist/skills/ads-designer/references/captures.md +7 -32
- package/dist/skills/ads-designer/references/cli.md +5 -1
- package/dist/skills/ads-designer/references/contracts.md +58 -25
- package/dist/skills/ads-designer/references/drafts.md +59 -43
- package/dist/skills/ads-designer/references/evidence.md +1 -1
- package/dist/skills/ads-designer/references/guarded-editing.md +58 -47
- package/dist/skills/ads-designer/references/performance.md +57 -6
- package/dist/skills/ads-designer/references/review.md +9 -8
- package/dist/skills/ads-designer/references/scenarios.md +1 -1
- package/dist/skills/ads-designer/references/validation.md +8 -4
- package/dist/skills/ads-designer/references/workflows.md +15 -8
- package/dist/skills/ads-import/SKILL.md +25 -28
- package/dist/skills/ads-import/references/behaviors.md +7 -6
- package/dist/skills/ads-import/references/captures.md +7 -32
- package/dist/skills/ads-import/references/cli.md +5 -1
- package/dist/skills/ads-import/references/contracts.md +58 -25
- package/dist/skills/ads-import/references/drafts.md +59 -43
- package/dist/skills/ads-import/references/evidence.md +1 -1
- package/dist/skills/ads-import/references/guarded-editing.md +58 -47
- package/dist/skills/ads-import/references/review.md +9 -8
- package/dist/skills/ads-import/references/scenarios.md +1 -1
- package/dist/skills/ads-import/references/validation.md +8 -4
- package/dist/skills/ads-import/references/workflows.md +15 -8
- package/dist/skills/ads-motion/SKILL.md +25 -28
- package/dist/skills/ads-motion/references/behaviors.md +7 -6
- package/dist/skills/ads-motion/references/captures.md +7 -32
- package/dist/skills/ads-motion/references/contracts.md +58 -25
- package/dist/skills/ads-motion/references/drafts.md +59 -43
- package/dist/skills/ads-motion/references/evidence.md +1 -1
- package/dist/skills/ads-motion/references/guarded-editing.md +58 -47
- package/dist/skills/ads-motion/references/review.md +9 -8
- package/dist/skills/ads-motion/references/scenarios.md +1 -1
- package/dist/skills/ads-motion/references/validation.md +8 -4
- package/dist/skills/ads-motion/references/workflows.md +15 -8
- package/dist/skills/ads-port/SKILL.md +25 -28
- package/dist/skills/ads-port/references/behaviors.md +7 -6
- package/dist/skills/ads-port/references/captures.md +7 -32
- package/dist/skills/ads-port/references/cli.md +5 -1
- package/dist/skills/ads-port/references/contracts.md +58 -25
- package/dist/skills/ads-port/references/drafts.md +59 -43
- package/dist/skills/ads-port/references/evidence.md +1 -1
- package/dist/skills/ads-port/references/guarded-editing.md +58 -47
- package/dist/skills/ads-port/references/native-implementation.md +6 -6
- package/dist/skills/ads-port/references/review.md +9 -8
- package/dist/skills/ads-port/references/scenarios.md +1 -1
- package/dist/skills/ads-port/references/validation.md +8 -4
- package/dist/skills/ads-port/references/workflows.md +15 -8
- package/dist/starters/preact/design-system/components/Layout/Grid/Grid.ads.contract.ts +6 -0
- package/dist/starters/preact/design-system/review/token-preview/TokenPreview.ads.contract.ts +6 -0
- package/dist/starters/preact/ds.config.json +0 -14
- package/dist/starters/react/README.md +9 -5
- package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.fixture.ts +1 -1
- package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.fixture.ts +2 -2
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +2 -2
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.contract.ts +6 -0
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/controllers/Palette/Palette.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/index.ts +3 -7
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/brand-preview/BrandPreview.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/grid-cell/GridCell.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/index.ts +4 -3
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/token-preview/TokenPreview.ads.contract.ts +6 -0
- package/dist/starters/react/design-system/review/token-preview/TokenPreview.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/styles.css +1 -0
- package/dist/starters/react/ds.config.json +0 -14
- package/dist/style-boundaries.mjs +7 -6
- package/dist/test-boundaries.mjs +2 -2
- package/dist/themes-watch.mjs +9 -3
- package/dist/token-fixtures.mjs +1 -1
- package/dist/unit-contracts.mjs +38 -4
- package/dist/units.mjs +16 -91
- package/dist/validation-checks.mjs +7 -1
- package/docs/ADS.md +10 -10
- package/docs/ARCHITECTURE.md +104 -44
- package/docs/BEHAVIORS.md +8 -7
- package/docs/CACHING.md +15 -6
- package/docs/CHANGELOG.md +107 -12
- package/docs/COMPARISON.md +1 -1
- package/docs/CONTRACTS.md +10 -25
- package/docs/GUIDE.md +98 -57
- package/docs/MCP.md +116 -151
- package/package.json +7 -7
- package/dist/contract-migration.mjs +0 -110
- package/dist/mcp/draft-exports.mjs +0 -40
- package/dist/mcp/edit-preparation.mjs +0 -115
package/docs/GUIDE.md
CHANGED
|
@@ -36,11 +36,13 @@ An agent uses the MCP tools to inspect, edit and review the project:
|
|
|
36
36
|
4. Select the editing route, independently of `mutations.enabled`. With direct
|
|
37
37
|
source access, edit owned files and use the existing compiler/preview; run
|
|
38
38
|
current gates and relevant project/behavior checks before finishing. With
|
|
39
|
-
MCP-only access and mutation tools enabled,
|
|
40
|
-
|
|
41
|
-
`
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
MCP-only access and mutation tools enabled, every change goes through a draft:
|
|
40
|
+
discover owners with `ads_units`, use `ads_create_draft`,
|
|
41
|
+
`ads_read_file`/`ads_update_draft` (file contents or a Git diff), rendered
|
|
42
|
+
`ads_show_draft` review, an optional `ads_accept` dry run and exact-revision
|
|
43
|
+
`ads_accept`. An owner is in at most one open draft. Accept dependencies first and
|
|
44
|
+
review dependents again. After a series of accepted drafts, run the stage check
|
|
45
|
+
`ads_validate` (validation policy, `scope:"changed"`). A read-only MCP connection
|
|
44
46
|
supports direct editors; it cannot edit for an MCP-only client.
|
|
45
47
|
5. Review diagnostics, registered behavior evidence and the rendered result.
|
|
46
48
|
`ads_behaviors` discovers guarantees; `ads_verify` executes selected registered
|
|
@@ -55,9 +57,8 @@ local, are untriaged, and do not bypass guards. Read `ads://guides/reporting` or
|
|
|
55
57
|
|
|
56
58
|
For an on-demand screenshot, call `ads_capture` with a discovered scenario ID and
|
|
57
59
|
optionally a named `captureTargets` element, theme and viewport. To compare a
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Normal patches and dry runs create no screenshots. Capture uses project-installed
|
|
60
|
+
draft with accepted source, pass its `draft` id and exact `revision`; acceptance and
|
|
61
|
+
its dry run create no screenshots. Capture uses project-installed
|
|
61
62
|
Playwright and its browser; ADS installs neither (`ads create` and `ads init` declare
|
|
62
63
|
`@playwright/test`; run `npx playwright install chromium` once).
|
|
63
64
|
|
|
@@ -70,6 +71,16 @@ changes mark images stale. There is no previous slot, history or TTL.
|
|
|
70
71
|
updates when supported, and explicitly reread otherwise. Screenshots provide visual
|
|
71
72
|
evidence for one state; they do not replace behavior checks.
|
|
72
73
|
|
|
74
|
+
ADS serves its skills over MCP, by what the client speaks:
|
|
75
|
+
|
|
76
|
+
| Client | How it gets skills |
|
|
77
|
+
|---|---|
|
|
78
|
+
| Protocol `2026-07-28` | The `io.modelcontextprotocol/skills` extension: `skills/list` and `skills/get` give each skill's frontmatter and its complete file list with digests and sizes, `resources/directory/read` lists a folder, and `resources/read` gets a file |
|
|
79
|
+
| Earlier protocols | `skill://` resources through `resources/list` and `resources/read`, and the `ads_skills` and `ads_read_skill` tools |
|
|
80
|
+
|
|
81
|
+
Whether a skill is loaded into an agent's context is up to the host. `npx skills` installs them locally
|
|
82
|
+
for a host that does not read them over MCP.
|
|
83
|
+
|
|
73
84
|
The [MCP guide](MCP.md) details tool/resource schemas, prompts, skills and
|
|
74
85
|
notifications. The portable [capture guide](../skills/ads-designer/references/captures.md)
|
|
75
86
|
explains screenshot setup, named targets, limits and comparison usage; MCP serves
|
|
@@ -438,11 +449,15 @@ Guarded MCP editing is opt-in. Its mandatory checks and optional project
|
|
|
438
449
|
`acceptance.checks` scripts run in a temporary project copy with installed
|
|
439
450
|
dependencies. Project scripts default to 60 seconds each; use the explicit
|
|
440
451
|
`mcp.mutationCheckTimeoutMs` budget (100–300000 ms) for measured slower builds.
|
|
452
|
+
A preview waits up to 5 minutes for its build, including the first build after the
|
|
453
|
+
MCP server starts; set `mcp.previewBuildTimeoutMs` (1000–3600000 ms) to change it.
|
|
441
454
|
Behavior profiles have a separate whole-run budget.
|
|
442
455
|
Set `acceptance.behaviorChecks` to require affected registered tests at acceptance.
|
|
443
456
|
Set `validation.checks` and `validation.behaviorChecks` independently for audits.
|
|
444
|
-
Both script lists default to empty; no names are inferred.
|
|
445
|
-
browser audit
|
|
457
|
+
Both script lists default to empty; no names are inferred. The validation policy runs
|
|
458
|
+
the full browser audit (`validation.browserAudit: false` turns it off); draft
|
|
459
|
+
acceptance audits per `acceptance.browserAudit`: `"owners"` (default), `"affected"` or
|
|
460
|
+
`false`. Direct source edits
|
|
446
461
|
can run `ads validate --policy acceptance`; ordinary `ads validate` selects the
|
|
447
462
|
validation policy. See [policy guidance](../skills/ads-designer/references/validation.md).
|
|
448
463
|
When the acceptance policy requires affected registered behavior checks (or
|
|
@@ -502,9 +517,12 @@ There is no warning level.
|
|
|
502
517
|
| `ads audit` | axe-core (WCAG A/AA rules), ADS's non-text contrast check, `layout-shift` and `layout-overflow` at 390, 768 and 1280 px in every component, pattern and composition scenario, once per brand and theme, and in a 240 px container for components and patterns |
|
|
503
518
|
| `ads validate` | The validation policy: `ads check` rules, `validation.checks` scripts, current previews, registered behavior checks (`validation.behaviorChecks`, default `true`) and the browser audit |
|
|
504
519
|
| `ads validate --policy acceptance` | The acceptance policy against current source, applying nothing: `ads check` rules, `acceptance.checks` scripts, affected behavior checks when `acceptance.behaviorChecks` is `true` (default `false`) and the browser audit |
|
|
505
|
-
| MCP acceptance | `ads_accept
|
|
520
|
+
| MCP acceptance | `ads_accept` runs the acceptance policy on the draft's candidate and writes no source unless it passes (`dryRun:true` writes nothing); `acceptance.browserAudit` audits the draft owners' own UI scenarios (`"owners"`, default), every scenario the change reaches (`"affected"`; all of them after configuration, foundation, token or asset changes) or none (`false`) |
|
|
521
|
+
| Stage check | After a series of accepted drafts, `ads_validate` with the validation policy and `scope:"changed"` audits everything they reached and runs the registered behavior checks |
|
|
506
522
|
|
|
507
|
-
**Browser audit.** Both policies run it by default
|
|
523
|
+
**Browser audit.** Both policies run it by default: the validation policy over every
|
|
524
|
+
scenario, acceptance over the draft owners' own scenarios unless set to `"affected"`.
|
|
525
|
+
`mcp.auditPages` (1–16, default 4) sets how many pages render at once. Each `a11y-axe`,
|
|
508
526
|
`a11y-non-text-contrast`, `layout-overflow` and `layout-shift` finding is an error that fails the policy, and an audit that cannot run fails it with a `browser-audit` error
|
|
509
527
|
naming what to install. Each `a11y-incomplete` finding is an info item that fails nothing: axe could
|
|
510
528
|
not decide that rule on those elements, so check it by hand. It names the axe rule, scenario, themes,
|
|
@@ -517,12 +535,12 @@ npx playwright install chromium # Bun: bunx playwright install chromium
|
|
|
517
535
|
```
|
|
518
536
|
|
|
519
537
|
`mcp.capture` selects `browser` (`chromium`, `firefox`, `webkit`), an installed Chrome
|
|
520
|
-
`channel` such as `"chrome"`, and `timeoutMs`. To
|
|
521
|
-
`browserAudit`
|
|
538
|
+
`channel` such as `"chrome"`, and `timeoutMs`. To choose the audits, set
|
|
539
|
+
`browserAudit` in `ds.config.json`:
|
|
522
540
|
|
|
523
541
|
```json
|
|
524
542
|
{
|
|
525
|
-
"acceptance": { "checks": [], "behaviorChecks": false, "browserAudit":
|
|
543
|
+
"acceptance": { "checks": [], "behaviorChecks": false, "browserAudit": "affected" },
|
|
526
544
|
"validation": { "checks": [], "behaviorChecks": true, "browserAudit": false }
|
|
527
545
|
}
|
|
528
546
|
```
|
|
@@ -647,10 +665,16 @@ Exempt: `overflow-x: auto` or `scroll` scrollers and their content, except the o
|
|
|
647
665
|
carousels (`aria-roledescription="carousel"`), pannable widgets (`role="application"`), native text fields, fixed-position layers and visually hidden content.
|
|
648
666
|
|
|
649
667
|
Each measurement waits for layout to stop moving, so a component that refits after a resize is
|
|
650
|
-
measured after it refits.
|
|
668
|
+
measured after it refits. Before measuring anything, the audit waits up to 5 s for the page to settle:
|
|
669
|
+
no change in the scenario for 500 ms, no finite animation running, and nothing still loading. Content
|
|
670
|
+
that arrives late, such as syntax colours, is then measured every run. A page that never settles is
|
|
671
|
+
measured anyway and reported as `content-still-changing`.
|
|
651
672
|
|
|
652
673
|
The audit also renders what a scenario shows after someone acts on it, in every theme and brand.
|
|
653
674
|
Findings name the state in the selector, such as `open overlay "Edit": button` or `hover: button`.
|
|
675
|
+
The result's `coverage`, also printed as a `Covered:` line, gives what was measured. What was skipped is
|
|
676
|
+
a `browser-audit-skipped` info item per reason, with up to 5 examples. A render that could measure none
|
|
677
|
+
of its targets is a `browser-audit-nothing-measured` review item.
|
|
654
678
|
|
|
655
679
|
- **Overlays.** It clicks each distinct control with `aria-haspopup`, up to 3 per render, once per
|
|
656
680
|
theme and brand across the audit. What opens
|
|
@@ -658,7 +682,10 @@ Findings name the state in the selector, such as `open overlay "Edit": button` o
|
|
|
658
682
|
contrast, and must fit the 390 px viewport. Give a trigger `aria-haspopup`, or render the overlay
|
|
659
683
|
open in its scenario. Tooltips are not opened.
|
|
660
684
|
- **Hover and focus.** Up to 6 controls per render, in document order, each distinct control once per
|
|
661
|
-
theme and brand on the same surface
|
|
685
|
+
theme and brand on the same surface, measured by the first scenario in request order. Focus skips a
|
|
686
|
+
control a keyboard cannot reach: `aria-hidden` on it or an ancestor, `inert`, or `tabindex="-1"`
|
|
687
|
+
outside a `group`, `tablist`, `menu`, `menubar`, `radiogroup`, `toolbar`, `listbox`, `tree` or `grid` that
|
|
688
|
+
holds a `tabindex="0"`. Under hover it runs axe
|
|
662
689
|
`color-contrast` and the non-text check. A `:focus-visible` outline needs 3:1 against what is around
|
|
663
690
|
it. A focus ring drawn with `box-shadow` is not read, and an outline beside one is left alone.
|
|
664
691
|
- **Busy.** A control with `aria-busy="true"` is checked even when disabled, and its icon even when it
|
|
@@ -683,13 +710,26 @@ demo frame to a maximum.
|
|
|
683
710
|
|---|---|---|
|
|
684
711
|
| `img-attributes` | `ads check` | A raw `<img>` in components, patterns or compositions without `loading`, or without `width` and `height`, a visible `aspect-ratio`, a width and height in its style, or out-of-flow positioning. A `srcset` with width descriptors and no `sizes`, on `<img>` or the project's `Image`. A spread or a class from elsewhere is an `img-attributes-unresolved` info item |
|
|
685
712
|
| `asset-image-budget` | `ads check` | An image in `assets/` over its limit: SVG 100 KB, WebP and AVIF 300 KB, JPEG 400 KB, PNG and GIF 500 KB. `assets.imageBudgetKb` is one limit for every format |
|
|
713
|
+
| `img-shape` | `ads audit` | A visible image whose box differs from its CSS `aspect-ratio`, or, with none and `object-fit: fill`, from its `width` and `height`. A height attribute beats `aspect-ratio`: add `height: auto`. `object-fit: cover` in a box of its own with no `aspect-ratio` is a deliberate crop |
|
|
686
714
|
| `layout-shift` | `ads audit` | A scenario with Cumulative Layout Shift above 0.1 on first render, where the browser reports it (Chromium) |
|
|
687
715
|
| `themes-generated` | `ads check` | A stale `tokens/fonts.preload.generated.ts` |
|
|
716
|
+
| `font-weight-missing` | `ads check` | CSS uses a weight of a family `tokens/fonts.css` declares and no face covers it. A range such as `100 900`, or a face with no `font-weight`, covers what it spans. A weight in a rule with no `font-family` counts against the body's family |
|
|
717
|
+
| `asset-font-budget` | `ads check` | A font file in `assets/` above 150 KB. `assets.fontBudgetKb` changes the limit |
|
|
718
|
+
|
|
719
|
+
Review items, which fail nothing: `font-file-unused` (a declared face no CSS uses; weights 400 and 700
|
|
720
|
+
count as used, since browsers apply them by default), `font-display` (none, or `optional`, which decides
|
|
721
|
+
per file and can leave some weights in the fallback on one page) and `font-format` (not WOFF2). A
|
|
722
|
+
project with no `@font-face` gets none of these.
|
|
688
723
|
|
|
689
724
|
The starters' `Image` lazily loads and reserves space; `priority` marks the view's main visible
|
|
690
725
|
image. When body or heading text uses a font from `tokens/fonts.css`, `ads assets` writes
|
|
691
|
-
`tokens/fonts.preload.generated.ts
|
|
692
|
-
render. It imports the files through the bundler, so the preload and the stylesheet share
|
|
726
|
+
`tokens/fonts.preload.generated.ts`, and the generated public barrel re-exports it: call
|
|
727
|
+
`preloadFonts()` from the public entry in the app entry before the first render. It imports the files through the bundler, Vite or Bun, so the preload and the stylesheet share
|
|
728
|
+
one URL. For a preload earlier than JavaScript, a build step or prerender can call `fontPreloadTags()`
|
|
729
|
+
for `<link>` tags or `fontPreloadHeader()` for a `Link` header value; `fontPreloads` is the same list.
|
|
730
|
+
A project that sets heading fonts per component names what to preload in `assets.preloadFonts`:
|
|
731
|
+
`[{ "family": "Body", "weight": 400 }, { "family": "Heading", "weight": 700 }]`. That list replaces the
|
|
732
|
+
reading of `base.css`, and an entry `tokens/fonts.css` cannot satisfy is a `font-preload-config` error.
|
|
693
733
|
ADS does not cover page metadata, `noindex`, sitemaps or hosting; run Lighthouse on a production
|
|
694
734
|
build with real URLs.
|
|
695
735
|
|
|
@@ -759,7 +799,7 @@ loads only the selected scenario's dependencies. TSX/Linaria compilation still
|
|
|
759
799
|
happens automatically. Accepted configuration-unit mutations replace the managed
|
|
760
800
|
compiler while keeping MCP connected. External compiler/configuration or dependency
|
|
761
801
|
changes may require restarting the runtime; ordinary owner/fixture/style/asset edits do not.
|
|
762
|
-
See [the compiler contract](MCP.md#
|
|
802
|
+
See [the compiler contract](MCP.md#one-client-command-managed-preview-builds) for revisions,
|
|
763
803
|
diagnostics, invalidation and the shared resource graph.
|
|
764
804
|
|
|
765
805
|
Colocate `<Owner>.ads.scenario.tsx` and `<Owner>.ads.fixture.ts` beside tokens and
|
|
@@ -996,10 +1036,10 @@ and composition scenario, once per declared brand and theme (`--scenario`, `--th
|
|
|
996
1036
|
`--brand` narrow it). Each violation is an `a11y-axe` error naming the axe rule, WCAG
|
|
997
1037
|
criterion, themes and brands, failing elements and help link, and `ads audit` exits 1. It
|
|
998
1038
|
needs the project's Playwright and browser, as captures do. The validation and acceptance
|
|
999
|
-
policies run it too unless their `browserAudit` is `false`; MCP draft acceptance
|
|
1000
|
-
|
|
1001
|
-
writing source, and an `a11y-axe`, `a11y-non-text-contrast` or
|
|
1002
|
-
the change.
|
|
1039
|
+
policies run it too unless their `browserAudit` is `false`; MCP draft acceptance audits
|
|
1040
|
+
the draft owners' own scenarios (or, with `"affected"`, every scenario the change
|
|
1041
|
+
reaches) before writing source, and an `a11y-axe`, `a11y-non-text-contrast` or
|
|
1042
|
+
`layout-overflow` error rejects the change.
|
|
1003
1043
|
`ads tokens --format dtcg` exports the tokens as W3C Design Tokens JSON for design tools
|
|
1004
1044
|
(`--theme <name>` and `--brand <name>` select one context).
|
|
1005
1045
|
|
|
@@ -1172,17 +1212,30 @@ and required MCP checks. The optional linter adapter is one project choice.
|
|
|
1172
1212
|
|
|
1173
1213
|
### Project boundaries and assets
|
|
1174
1214
|
|
|
1175
|
-
|
|
1176
|
-
|
|
1215
|
+
Style permissions belong to their owner, in its `<Owner>.ads.contract.ts`, with paths
|
|
1216
|
+
relative to the contract:
|
|
1217
|
+
|
|
1218
|
+
```ts
|
|
1219
|
+
export default {
|
|
1220
|
+
schemaVersion: 1,
|
|
1221
|
+
styles: { writes: { "./geometry.ts": ["--ds-panel-height"] }, inline: [] },
|
|
1222
|
+
customization: ["--ds-panel-gap"],
|
|
1223
|
+
} satisfies UnitContract;
|
|
1224
|
+
```
|
|
1225
|
+
|
|
1226
|
+
`styles.writes` permits only the listed CSS properties in that exact file. Use
|
|
1227
|
+
kebab-case (`user-select`) or an exact custom property. Static assignments,
|
|
1228
|
+
`setProperty`, and `removeProperty` can use that permission; `cssText`, computed
|
|
1229
|
+
property names, escaped style objects, and bulk writes remain forbidden. Plain
|
|
1230
|
+
property reads are allowed. `styles.inline` is a separate file-level JSX/type
|
|
1231
|
+
exception and never permits imperative writes by itself. `customization` lists a
|
|
1232
|
+
component's non-state `--ds-*` variables that patterns, the showcase and the
|
|
1233
|
+
application may set.
|
|
1234
|
+
|
|
1235
|
+
Optional asset configuration adds only the paths that the project actually uses:
|
|
1177
1236
|
|
|
1178
1237
|
```json
|
|
1179
1238
|
{
|
|
1180
|
-
"boundaries": {
|
|
1181
|
-
"styleWrites": [
|
|
1182
|
-
{ "file": "design-system/components/geometry.ts", "properties": ["--ds-panel-height"] }
|
|
1183
|
-
],
|
|
1184
|
-
"componentVariables": ["--ds-panel-gap"]
|
|
1185
|
-
},
|
|
1186
1239
|
"assets": {
|
|
1187
1240
|
"iconSource": "assets/brand/app-icon.svg",
|
|
1188
1241
|
"publicDirs": ["public/assets"],
|
|
@@ -1192,13 +1245,7 @@ actually uses; the tool contains no component or product-specific lists:
|
|
|
1192
1245
|
}
|
|
1193
1246
|
```
|
|
1194
1247
|
|
|
1195
|
-
Merge
|
|
1196
|
-
listed CSS properties in that exact file. Use kebab-case (`user-select`) or an
|
|
1197
|
-
exact custom property. Static assignments, `setProperty`, and `removeProperty`
|
|
1198
|
-
can use that boundary; `cssText`, computed property names, escaped style
|
|
1199
|
-
objects, and bulk writes remain forbidden. Plain property reads are allowed.
|
|
1200
|
-
`inlineStyleFiles` is a separate file-level JSX/type exception and never
|
|
1201
|
-
permits imperative writes by itself.
|
|
1248
|
+
Merge this section into `ds.config.json`.
|
|
1202
1249
|
|
|
1203
1250
|
Asset checks compare `design-system/assets/` with each configured public mount
|
|
1204
1251
|
and `design-system/showcase/public/assets/`, adjusting for `dsDir`. A relative
|
|
@@ -1230,14 +1277,17 @@ Paths stay within the receiving project:
|
|
|
1230
1277
|
"stylesEntry": "styles.css",
|
|
1231
1278
|
"tokenDir": "tokens",
|
|
1232
1279
|
"themes": [{ "name": "light", "scheme": "light" }, { "name": "dark", "scheme": "dark" }],
|
|
1233
|
-
"inlineStyleFiles": [],
|
|
1234
1280
|
"layout": { "widthTokens": [], "fixedWidthUnits": [] },
|
|
1235
1281
|
"oxlint": { "plugins": [], "rules": {} }
|
|
1236
1282
|
}
|
|
1237
1283
|
```
|
|
1238
1284
|
|
|
1239
1285
|
`layout` declares allowed width tokens and owners with fixed widths; see
|
|
1240
|
-
[Checks and guards](#checks-and-guards).
|
|
1286
|
+
[Checks and guards](#checks-and-guards). `publicEntry`, `reviewEntry` and
|
|
1287
|
+
`stylesEntry` name generated files: ADS writes the barrels from the owners'
|
|
1288
|
+
`<Owner>.ads.exports.ts` files and the styles entry from the token sheets (`ads
|
|
1289
|
+
assets`, the showcase and the MCP server); `ads check` reports one that is stale or
|
|
1290
|
+
edited by hand.
|
|
1241
1291
|
|
|
1242
1292
|
These source-layout defaults apply when the file is absent; the example omits
|
|
1243
1293
|
the required init-time framework choice. Run `ads init --framework react` (or
|
|
@@ -1268,15 +1318,13 @@ native ADS import guards enforce this boundary. It does not
|
|
|
1268
1318
|
allow application code to import private ADS modules or build helpers to import
|
|
1269
1319
|
private UI implementation.
|
|
1270
1320
|
|
|
1271
|
-
Unused `
|
|
1272
|
-
`stale-style-boundary` check. Inline permissions recognize
|
|
1273
|
-
factories and UI `CSSProperties` use; property permissions require
|
|
1274
|
-
or removal, not a read.
|
|
1275
|
-
|
|
1276
|
-
permissions and other settings. A future filename can be valid configuration,
|
|
1277
|
-
but the complete checked candidate must contain the matching use.
|
|
1321
|
+
Unused `styles.inline` entries and `styles.writes` properties fail the core
|
|
1322
|
+
`stale-style-boundary` check, reported on the contract. Inline permissions recognize
|
|
1323
|
+
JSX, imported UI factories and UI `CSSProperties` use; property permissions require
|
|
1324
|
+
an exact write or removal, not a read. Change an owner's source and its contract
|
|
1325
|
+
permissions together in its draft.
|
|
1278
1326
|
|
|
1279
|
-
`
|
|
1327
|
+
`styles.inline` should name only documented geometry/renderer boundaries,
|
|
1280
1328
|
not broad styling exceptions. Ignore `.ds/`; generated paths refer to the project
|
|
1281
1329
|
and its locally installed tool.
|
|
1282
1330
|
|
|
@@ -1328,14 +1376,7 @@ scenario, fixture, helpers, test, spec or behavior.spec. Optional
|
|
|
1328
1376
|
paint and declarative-consumer contracts. Production APIs/types stay in runtime
|
|
1329
1377
|
files. ADS reads contract data statically; no project import runs during discovery.
|
|
1330
1378
|
See [CONTRACTS.md](CONTRACTS.md) for exact fields, supported producer forms and
|
|
1331
|
-
source/browser limits.
|
|
1332
|
-
remain supported during migration.
|
|
1333
|
-
|
|
1334
|
-
With supporting tooling installed and MCP reconnected, discover one owner, call
|
|
1335
|
-
`ads_prepare_patch` with `action: "migrate"`, inspect the local draft/notes, and use
|
|
1336
|
-
normal diff, dry-run and apply gates. This never changes live source by itself.
|
|
1337
|
-
Review custom runner globs and unimportable private subjects before application;
|
|
1338
|
-
migrate passing owners in stages and preserve pending agent drafts.
|
|
1379
|
+
source/browser limits. Only `.ads.`-marked filenames are development roles.
|
|
1339
1380
|
|
|
1340
1381
|
Project scale policies remain explicit. A registered check can call
|
|
1341
1382
|
`inspectTokenOrigins(inspectTokens(root), target, {stopAt: allowedSharedTokens})`
|