@reqvire-org/ads 0.3.25 → 0.3.27
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 +28 -15
- package/dist/bootstrap-ds/ADS.md +28 -30
- package/dist/bootstrap-ds/README.md +13 -11
- package/dist/bootstrap-ds/design-system/assets/brand/README.md +3 -2
- package/dist/bootstrap-ds/ds.config.json +1 -1
- package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +1 -1
- package/dist/boundaries.mjs +0 -3
- package/dist/capture.mjs +1 -1
- package/dist/check.mjs +15 -22
- package/dist/config.mjs +3 -7
- package/dist/contract-migration.mjs +2 -2
- package/dist/contracts.d.mts +0 -1
- package/dist/design-values.mjs +81 -0
- package/dist/development-runtime.mjs +17 -0
- package/dist/evidence.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/init.mjs +14 -12
- package/dist/mcp/apps.mjs +1 -1
- package/dist/mcp/context.mjs +8 -7
- package/dist/mcp/mutations.mjs +3 -2
- package/dist/mcp/preview-watch.mjs +2 -1
- package/dist/mcp/prompts.mjs +4 -4
- package/dist/mcp/reports.mjs +101 -0
- package/dist/mcp/server.mjs +41 -3
- package/dist/mcp/widget.bundle.js +1 -1
- package/dist/paint-contracts.mjs +4 -5
- package/dist/preview-files.mjs +33 -0
- package/dist/preview-inputs.mjs +6 -5
- package/dist/preview-resources.mjs +1 -2
- package/dist/scenarios-compiler.mjs +7 -7
- package/dist/scenarios.mjs +14 -14
- package/dist/showcase/sandbox.bundle.js +1 -1
- package/dist/skills/README.md +14 -4
- package/dist/skills/ads-break-ui/SKILL.md +29 -15
- package/dist/skills/ads-break-ui/references/atomic-styles.md +9 -2
- package/dist/skills/ads-break-ui/references/behaviors.md +396 -0
- package/dist/skills/ads-break-ui/references/captures.md +1 -1
- package/dist/skills/ads-break-ui/references/contracts.md +18 -37
- package/dist/skills/ads-break-ui/references/design-data.md +91 -0
- package/dist/skills/ads-break-ui/references/evidence.md +4 -0
- package/dist/skills/ads-break-ui/references/guarded-editing.md +7 -11
- package/dist/skills/ads-break-ui/references/layers.md +16 -0
- package/dist/skills/ads-break-ui/references/reporting.md +101 -0
- package/dist/skills/ads-break-ui/references/runtimes.md +110 -0
- package/dist/skills/ads-break-ui/references/scenarios.md +9 -15
- package/dist/skills/ads-designer/README.md +6 -0
- package/dist/skills/ads-designer/SKILL.md +35 -20
- package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +28 -30
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +13 -11
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +3 -2
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +1 -1
- package/dist/skills/ads-designer/references/atomic-styles.md +9 -2
- package/dist/skills/ads-designer/references/behaviors.md +396 -0
- package/dist/skills/ads-designer/references/captures.md +1 -1
- package/dist/skills/ads-designer/references/cli.md +10 -7
- package/dist/skills/ads-designer/references/contracts.md +18 -37
- package/dist/skills/ads-designer/references/design-craft.md +32 -1
- package/dist/skills/ads-designer/references/design-data.md +91 -0
- package/dist/skills/ads-designer/references/evidence.md +4 -0
- package/dist/skills/ads-designer/references/guarded-editing.md +7 -11
- package/dist/skills/ads-designer/references/layers.md +16 -0
- package/dist/skills/ads-designer/references/mobile.md +1 -1
- package/dist/skills/ads-designer/references/reporting.md +101 -0
- package/dist/skills/ads-designer/references/runtimes.md +110 -0
- package/dist/skills/ads-designer/references/scenarios.md +9 -15
- package/dist/skills/ads-import/SKILL.md +51 -20
- package/dist/skills/ads-import/agents/openai.yaml +2 -2
- package/dist/skills/ads-import/references/atomic-styles.md +9 -2
- package/dist/skills/ads-import/references/behaviors.md +396 -0
- package/dist/skills/ads-import/references/branding.md +1 -1
- package/dist/skills/ads-import/references/captures.md +1 -1
- package/dist/skills/ads-import/references/cli.md +10 -7
- package/dist/skills/ads-import/references/compatibility.md +113 -0
- package/dist/skills/ads-import/references/contracts.md +18 -37
- package/dist/skills/ads-import/references/design-data.md +91 -0
- package/dist/skills/ads-import/references/evidence.md +4 -0
- package/dist/skills/ads-import/references/guarded-editing.md +7 -11
- package/dist/skills/ads-import/references/implementation.md +9 -2
- package/dist/skills/ads-import/references/layers.md +16 -0
- package/dist/skills/ads-import/references/reporting.md +101 -0
- package/dist/skills/ads-import/references/runtimes.md +110 -0
- package/dist/skills/ads-import/references/scenarios.md +9 -15
- package/dist/skills/ads-import/references/tokens.md +11 -9
- package/dist/skills/ads-motion/SKILL.md +28 -14
- package/dist/skills/ads-motion/references/atomic-styles.md +9 -2
- package/dist/skills/ads-motion/references/behaviors.md +396 -0
- package/dist/skills/ads-motion/references/captures.md +1 -1
- package/dist/skills/ads-motion/references/contracts.md +18 -37
- package/dist/skills/ads-motion/references/design-data.md +91 -0
- package/dist/skills/ads-motion/references/evidence.md +4 -0
- package/dist/skills/ads-motion/references/guarded-editing.md +7 -11
- package/dist/skills/ads-motion/references/layers.md +16 -0
- package/dist/skills/ads-motion/references/reporting.md +101 -0
- package/dist/skills/ads-motion/references/runtimes.md +110 -0
- package/dist/skills/ads-motion/references/scenarios.md +9 -15
- package/dist/skills/{ads-migrate → ads-port}/SKILL.md +64 -33
- package/dist/skills/ads-port/agents/openai.yaml +4 -0
- package/dist/skills/{ads-migrate → ads-port}/references/atomic-styles.md +9 -2
- package/dist/skills/ads-port/references/behaviors.md +396 -0
- package/dist/skills/{ads-migrate → ads-port}/references/captures.md +1 -1
- package/dist/skills/{ads-migrate → ads-port}/references/cli.md +10 -7
- package/dist/skills/{ads-migrate → ads-port}/references/contracts.md +18 -37
- package/dist/skills/ads-port/references/design-data.md +91 -0
- package/dist/skills/{ads-migrate → ads-port}/references/evidence.md +4 -0
- package/dist/skills/{ads-migrate → ads-port}/references/guarded-editing.md +7 -11
- package/dist/skills/{ads-migrate → ads-port}/references/layers.md +16 -0
- package/dist/skills/{ads-migrate → ads-port}/references/lint-and-docs.md +5 -0
- package/dist/skills/{ads-migrate → ads-port}/references/native-implementation.md +49 -15
- package/dist/skills/ads-port/references/reporting.md +101 -0
- package/dist/skills/ads-port/references/runtimes.md +110 -0
- package/dist/skills/{ads-migrate → ads-port}/references/scenarios.md +9 -15
- package/dist/skills/{ads-migrate → ads-port}/references/testing.md +11 -1
- package/dist/tokens.mjs +5 -8
- package/dist/unit-contracts.mjs +1 -8
- package/dist/verification.mjs +4 -3
- package/docs/ADS.md +59 -73
- package/docs/ARCHITECTURE.md +68 -20
- package/docs/BEHAVIORS.md +46 -41
- package/docs/CHANGELOG.md +44 -1
- package/docs/COMPARISON.md +63 -0
- package/docs/CONTRACTS.md +18 -37
- package/docs/GUIDE.md +41 -23
- package/docs/MCP.md +100 -15
- package/package.json +5 -4
- package/dist/scoped-tokens.mjs +0 -68
- package/dist/skills/ads-migrate/agents/openai.yaml +0 -4
- /package/dist/skills/{ads-migrate → ads-port}/references/review.md +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Shared Data, component mappings and design consistency
|
|
2
|
+
|
|
3
|
+
ADS has three cooperating responsibilities: Data supplies one shared design
|
|
4
|
+
vocabulary; UX owns structure, behavior and accessibility; Skin maps Data to
|
|
5
|
+
states and variants. Components own their implementation, not separate design
|
|
6
|
+
systems. Project values and themes remain project-owned.
|
|
7
|
+
|
|
8
|
+
## One design catalogue
|
|
9
|
+
|
|
10
|
+
Define static design values, semantic roles, formulas and themes in the configured
|
|
11
|
+
shared token foundation: colors, typography, spacing and elevation. Reuse existing
|
|
12
|
+
roles before introducing another token. A new value is a visible project design
|
|
13
|
+
decision. Do not copy every imported library constant into another name merely to
|
|
14
|
+
satisfy a guard. Existing project font, text, spacing and other semantic roles
|
|
15
|
+
take precedence over divergent upstream constants. Preserve the capability and
|
|
16
|
+
interaction contract, then document deliberate visual differences from the
|
|
17
|
+
migration reference. Do not add a private or duplicate role to recover an
|
|
18
|
+
upstream font or size that project policy intentionally replaces.
|
|
19
|
+
|
|
20
|
+
Porting should converge on the destination's visual language. Different upstream
|
|
21
|
+
dependencies do not justify separate scales or duplicate roles. Consolidate
|
|
22
|
+
equivalent roles introduced by the selected port, update their consumers and
|
|
23
|
+
samples, and remove obsolete source sheets when unused. Compare semantics,
|
|
24
|
+
themes, states and actual use before merging; equal numbers alone are not enough.
|
|
25
|
+
For an empty destination, establish a coherent initial vocabulary across the
|
|
26
|
+
selected scope. Exact upstream pixels are not a default acceptance requirement.
|
|
27
|
+
Document intentional adaptations and verify consistency with existing UI while
|
|
28
|
+
preserving required behavior. Unrelated cleanup or removal of an existing public
|
|
29
|
+
token needs its own scope/compatibility decision.
|
|
30
|
+
|
|
31
|
+
There are no owner-local token namespaces, token manifests, component token value
|
|
32
|
+
sheets or `tokens` sections in owner contracts. Token previews and their fixtures
|
|
33
|
+
belong under the shared token directory. The public contract remains about shared
|
|
34
|
+
names, meanings, types and alias relationships; ADS supplies no hardcoded palette,
|
|
35
|
+
spacing grid or component catalogue.
|
|
36
|
+
|
|
37
|
+
## Component variables are mappings and runtime mechanics
|
|
38
|
+
|
|
39
|
+
`--ds-*` belongs to component implementations, `--ux-*` to patterns and review
|
|
40
|
+
presentation, and `--showcase-*` to development scaffolding. They are not additional
|
|
41
|
+
token vocabularies. State styling remains owned by the control. Documented non-state
|
|
42
|
+
customization hooks keep their narrow registration and ownership rules.
|
|
43
|
+
|
|
44
|
+
```css
|
|
45
|
+
/* In component Linaria: map project Data into a state. */
|
|
46
|
+
--ds-control-bg: var(--accent);
|
|
47
|
+
--ds-control-hover-bg: var(--accent-hover);
|
|
48
|
+
--ds-control-gap: var(--space-4);
|
|
49
|
+
--ds-control-font: var(--font-sans);
|
|
50
|
+
|
|
51
|
+
/* Rejected: private design values, even behind aliases or fallbacks. */
|
|
52
|
+
--ds-control-gap: 7px;
|
|
53
|
+
--ds-control-bg: red;
|
|
54
|
+
--ds-control-gap: var(--space-4, 7px);
|
|
55
|
+
--ds-control-font: Arial;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Styles and static interpolations from imports/helpers obey the same source rule.
|
|
59
|
+
Unknown interpolation is not proof of a valid design source. Typography/layering
|
|
60
|
+
roles follow variable references to their actual consuming properties; a different
|
|
61
|
+
variable name cannot conceal an independent font, weight or stacking level.
|
|
62
|
+
|
|
63
|
+
Zero, structural unitless geometry, percentages, grid fractions, responsive
|
|
64
|
+
viewport/container relationships and structural angles retain their existing use.
|
|
65
|
+
Measured instance geometry still uses exact, documented style-write boundaries;
|
|
66
|
+
those boundaries do not authorize another static design palette. Typed per-instance
|
|
67
|
+
paint bindings retain their provenance and browser checks. Inputs select shared
|
|
68
|
+
paints or local SVG resources, rather than supplying arbitrary visual strings.
|
|
69
|
+
|
|
70
|
+
A calculation containing a raw design length/color is still rejected. Structural
|
|
71
|
+
calculations using shared values can remain valid; static analysis cannot prove
|
|
72
|
+
whether a dimensionless factor represents real geometry or an invented scale.
|
|
73
|
+
Review that intent and do not disguise a new design decision as arithmetic.
|
|
74
|
+
|
|
75
|
+
## Review overlap without deleting legitimate roles
|
|
76
|
+
|
|
77
|
+
`token-overlap-review` is a nonblocking warning for shared tokens with identical
|
|
78
|
+
normalized definitions across their declared theme/condition scopes. It identifies
|
|
79
|
+
the tokens and source. Inspect their consumers and roles. If one decision is being
|
|
80
|
+
copied, reuse one shared token or make its relationship explicit with an alias.
|
|
81
|
+
Equal values alone do not prove equal purpose: body text and strong text, spacing
|
|
82
|
+
and control sizes, or two motion roles may intentionally differ later. A light-only
|
|
83
|
+
match does not justify merging tokens whose dark/reduced-motion values differ.
|
|
84
|
+
|
|
85
|
+
For our existing workspaces, convert independent component constants explicitly:
|
|
86
|
+
select an existing shared role when it means the same thing; centralize genuinely
|
|
87
|
+
missing decisions; remove private sheets/imports and contract fields; update token
|
|
88
|
+
sample coverage in the shared directory. Preserve themes, units, public APIs and
|
|
89
|
+
behavior unless changing the visual policy was explicitly intended. Review a Git
|
|
90
|
+
diff and run core, project and browser checks. There is no compatibility mode that
|
|
91
|
+
keeps independent component token definitions valid.
|
|
@@ -118,3 +118,7 @@ the smallest source/browser reproduction when ownership remains unprovable.
|
|
|
118
118
|
guard acceptance; registered tests establish only their actual cases/profiles.
|
|
119
119
|
Neither establishes untested states, visual parity, an accessibility audit or
|
|
120
120
|
another MCP host's compatibility. Captures show an appearance, not a transition.
|
|
121
|
+
|
|
122
|
+
When targeted investigation suggests a tooling defect or missing capability, read
|
|
123
|
+
[reporting.md](reporting.md), then use the matching intake tool. Reports preserve
|
|
124
|
+
compact evidence without certifying an ADS cause or changing validation policy.
|
|
@@ -19,7 +19,7 @@ managed preview, not the live showcase. Read the summary, then page failing
|
|
|
19
19
|
`outcomes`, `diagnostics` or pipeline `checks` through `ads_results` with its
|
|
20
20
|
`resultId`. Inspect one exact outcome with `ads_investigate({unit,check,runId})`;
|
|
21
21
|
fix the draft and diff again. See [evidence.md](evidence.md) for page/range limits.
|
|
22
|
-
Keep
|
|
22
|
+
Keep `<Owner>.ads.contract.ts` and specs with their owner and use registered checks; a scratchpad
|
|
23
23
|
run against live source cannot verify unapplied changes. After validation, apply
|
|
24
24
|
with `dryRun:false`; ADS revalidates before writing. Dry-run evidence is not saved
|
|
25
25
|
as passing evidence for the live project.
|
|
@@ -106,15 +106,11 @@ on the final candidate before live source is written. Dry-run first. Rejection,
|
|
|
106
106
|
conflict and cancellation publish nothing. Dependency installation remains local;
|
|
107
107
|
the candidate uses installed node_modules. Never bypass a rejected gate directly.
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
local tokens; aliases can use shared or own tokens. UI styles stay in Linaria.
|
|
115
|
-
Add a colocated token scenario with `kind:"tokens"`, real fixture `samples` and a
|
|
116
|
-
development-only review renderer. These inputs belong to the same owner and need real sample
|
|
117
|
-
coverage. Manifests and fixtures stay out of the product bundle.
|
|
109
|
+
Static design values and formulas belong in the shared Data foundation. Components
|
|
110
|
+
map those values with `--ds-*` variables; patterns use `--ux-*`. There are no private
|
|
111
|
+
token namespaces/value sheets or token sections in owner contracts. Keep measured
|
|
112
|
+
runtime geometry separate. Read [design-data.md](design-data.md) before adding a
|
|
113
|
+
design value or repairing an ownership/value-source diagnostic.
|
|
118
114
|
|
|
119
115
|
`ads_prepare_token_samples({id, bindings?})` preserves existing project samples,
|
|
120
116
|
removes undeclared names and returns an owner patchFile. Supply explicit
|
|
@@ -138,7 +134,7 @@ DOM. Source ownership must be proven; an `asChild` flag or a lookalike marker is
|
|
|
138
134
|
insufficient. Standalone controls and custom scenario styling remain rejected. See
|
|
139
135
|
[scenarios.md](scenarios.md) for evidence and limits. Preserve the intended
|
|
140
136
|
composition instead of substituting an unrelated styled control or adding a
|
|
141
|
-
demo-only component prop. Review framing belongs in public
|
|
137
|
+
demo-only component prop. Review framing belongs in development-only `review/`, through its separate public entry.
|
|
142
138
|
|
|
143
139
|
A complete runner report containing an ordinary failed assertion preserves each
|
|
144
140
|
passing check as `passed`; the failed check remains `failed`, and overall
|
|
@@ -30,6 +30,22 @@ Do not classify by import count, JSX element count, names or file length. Review
|
|
|
30
30
|
the capability and its consumer contract. Preserve valid APIs when tracing is
|
|
31
31
|
inconclusive; do not make an export private or add a product prop just to pass.
|
|
32
32
|
|
|
33
|
+
## Share UI across websites and MCP Apps
|
|
34
|
+
|
|
35
|
+
Build and adapt UI through the project's public design-system APIs. Websites
|
|
36
|
+
and MCP Apps use the same components, patterns, controllers, tokens and styles.
|
|
37
|
+
Application adapters supply data and actions and own mounting, routing, stores,
|
|
38
|
+
MCP communication, tool-result mapping and serving. Keep those integrations out
|
|
39
|
+
of reusable UI implementations. ADS's own MCP server supports design-system
|
|
40
|
+
development, inspection and rendered review.
|
|
41
|
+
|
|
42
|
+
The ADS showcase renders the real public implementation inside an MCP App.
|
|
43
|
+
Its previews and registered checks provide evidence for the exercised states,
|
|
44
|
+
themes, sizes and environment. Relevant application checks verify website
|
|
45
|
+
integration. Reuse existing verification; add targeted checks when a change
|
|
46
|
+
exposes an uncovered requirement. Record what was actually verified, including
|
|
47
|
+
any remaining host or integration assumptions.
|
|
48
|
+
|
|
33
49
|
## Demonstrate the production implementation
|
|
34
50
|
|
|
35
51
|
Product patterns are reusable application UI, not showcase replicas. A scenario
|
|
@@ -23,6 +23,11 @@ authors, and identify the influenced behavior, layout, or motion. Explain agreed
|
|
|
23
23
|
differences so the result's closeness to the reference can be assessed. Preserve
|
|
24
24
|
applicable license notices when implementation or assets are copied/adapted.
|
|
25
25
|
|
|
26
|
+
Record which source roles map to existing project tokens, which genuinely new
|
|
27
|
+
shared decisions were added, and why intentional visual differences follow
|
|
28
|
+
project policy. Keep this explanation focused on meaningful choices; a second
|
|
29
|
+
hand-maintained catalogue of every CSS declaration is unnecessary.
|
|
30
|
+
|
|
26
31
|
The receiving project's main README owns discovery/quick start and a short
|
|
27
32
|
upstream inspiration credit. Its project ADS guide (often `ADS.md`) owns shared
|
|
28
33
|
architecture, token and CSS ownership, central enforcement, and links to component
|
|
@@ -19,25 +19,58 @@ Use a small contract table during work:
|
|
|
19
19
|
| Concern | Original observation | Native requirement | Verification |
|
|
20
20
|
|---------|----------------------|--------------------|--------------|
|
|
21
21
|
| States | Defaults, active/loading/error, disabled | Supported states and transitions | Trigger each public path |
|
|
22
|
-
| Layout | Dimensions, gap, natural height, overflow |
|
|
22
|
+
| Layout | Dimensions, gap, natural height, overflow | Project token mapping and usable geometry | Computed styles and rectangles |
|
|
23
23
|
| Lifecycle | Updates, expiry, removal, route teardown | Observable timing and callbacks | Timed state assertions |
|
|
24
24
|
| Input | Pointer/touch, keys, focus targets | Same behavior or user-agreed change | Real input plus active-element checks |
|
|
25
|
-
| Motion | Entry/exit, interruption, transform origin |
|
|
25
|
+
| Motion | Entry/exit, interruption, transform origin | Required choreography using project motion roles | Transition events and sampled frames |
|
|
26
26
|
|
|
27
27
|
This is a working aid, not a required standalone report. Keep settled public
|
|
28
28
|
contracts in the component guide and executable evidence in appropriate tests.
|
|
29
29
|
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
## Converge on the project's design language
|
|
31
|
+
|
|
32
|
+
A port contributes to the destination design system; it does not preserve a
|
|
33
|
+
separate design system for each upstream package. A library assembled from
|
|
34
|
+
several dependencies may repeat font stacks, scales, radii, shadows or motion
|
|
35
|
+
constants under different names. Those source boundaries do not define project
|
|
36
|
+
design roles. Reuse existing primitives, controls and controllers where their
|
|
37
|
+
contracts fit, and map source styling into the one shared foundation.
|
|
38
|
+
|
|
39
|
+
Before introducing tokens, compare the selected source roles with destination
|
|
40
|
+
definitions and their actual consumers. Map by purpose, value type, theme/state
|
|
41
|
+
behavior and intended relationship, not by name or a matching number alone:
|
|
42
|
+
|
|
43
|
+
| Source finding | Port decision |
|
|
44
|
+
|----------------|---------------|
|
|
45
|
+
| A dependency uses its own system font and a slightly different label size | Use the project's font and label/text role; do not add a dependency-specific font or size to recover its exact pixels |
|
|
46
|
+
| Several source packages define the same muted surface or control gap | Map equivalent uses to the existing shared role; consolidate duplicates introduced during this port |
|
|
47
|
+
| Two tokens happen to have the same value but describe different states | Keep distinct semantic roles when their themes or future changes need to differ; alias a shared primitive only when that relationship is intended |
|
|
48
|
+
| A genuinely missing visual decision is needed | Add the smallest coherent shared role or scale extension, with themes and token samples; explain its purpose beyond copying one upstream constant |
|
|
49
|
+
|
|
50
|
+
When the destination is empty, establish a coherent initial vocabulary across
|
|
51
|
+
the selected scope instead of appending each package's constants independently.
|
|
52
|
+
When it already has a visual policy, that policy takes precedence by default.
|
|
53
|
+
Review [design-data.md](design-data.md) for value-source and overlap rules.
|
|
54
|
+
|
|
55
|
+
Consolidate equivalent roles created by the port and update all their affected
|
|
56
|
+
references and samples. Remove temporary duplicates and obsolete source sheets
|
|
57
|
+
once they have no consumers. Existing public-token removals or unrelated design
|
|
58
|
+
cleanup need their own scope/compatibility decision; do not sweep through the
|
|
59
|
+
whole project or merge distinct meanings just because values are equal.
|
|
60
|
+
|
|
61
|
+
Dependency installation does not establish styling ownership. Keep only needed,
|
|
62
|
+
declared runtime dependencies; inspect any stylesheet, reset, theme provider or
|
|
63
|
+
visual default they require. Do not introduce a dependency's styling system or
|
|
64
|
+
global reset to make its pixels match. Adapt owned styles through Linaria and
|
|
65
|
+
shared Data; preserve any supported headless dependency's behavior contract.
|
|
66
|
+
|
|
67
|
+
Preserve required capabilities, accessibility and interactions while applying
|
|
68
|
+
the project's visual language. Source pixels are a reference, not an automatic
|
|
69
|
+
acceptance target. Document intentional changes to type, spacing, color, motion
|
|
70
|
+
roles or composition; inspect related controls together to verify consistency.
|
|
71
|
+
Exact visual or API fidelity applies when the user requests it. Resolve a real
|
|
72
|
+
conflict with project policy explicitly rather than creating duplicate tokens
|
|
73
|
+
or silently dropping capabilities.
|
|
41
74
|
|
|
42
75
|
Keep the reference's state machine and motion choreography distinct from the
|
|
43
76
|
native skin. Typography and controls can change wrapping and natural height,
|
|
@@ -57,7 +90,8 @@ target framework. With the default root ADS layout:
|
|
|
57
90
|
|
|
58
91
|
Preserve the reference's required capabilities while assigning each concern to
|
|
59
92
|
its owner. Demo utilities for container size, border or framing become a public
|
|
60
|
-
review
|
|
93
|
+
development-only `review/` helper around the real component, exported through the
|
|
94
|
+
separate review entry. Add component props for a
|
|
61
95
|
deliberate runtime API requirement; missing demo layout alone is not justification.
|
|
62
96
|
For imperative geometry, register exact `styleWrites` properties. After migrating
|
|
63
97
|
from JSX inline geometry, change source and its own config companion together:
|
|
@@ -117,7 +151,7 @@ Document material adaptations and agreed deviations beside the public contract.
|
|
|
117
151
|
|
|
118
152
|
Keep private controllers in their owner; extract a shared controller only for a
|
|
119
153
|
real reuse need. Register optional behavior guarantees and real colocated checks;
|
|
120
|
-
see
|
|
154
|
+
see [behaviors.md](behaviors.md), also served as `ads://guides/behaviors`. Link
|
|
121
155
|
public hooks with scenario `exercises`, while `covers` still requires rendered UI.
|
|
122
156
|
Move reviewed scratchpad investigations into maintained owner checks. Disabling
|
|
123
157
|
StrictMode can isolate an upstream lifecycle defect; keep a development StrictMode
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Record an ADS problem or capability request
|
|
2
|
+
|
|
3
|
+
Use this reference when targeted investigation suggests an ADS defect or a
|
|
4
|
+
legitimate workflow needs a missing capability. MCP serves it as
|
|
5
|
+
`ads://guides/reporting`. Reports collect observations for later triage; they do
|
|
6
|
+
not prove an ADS cause, open an upstream issue or change architecture policy.
|
|
7
|
+
|
|
8
|
+
## Choose the tool
|
|
9
|
+
|
|
10
|
+
- `ads_report_bug`: existing ADS behavior appears broken, including an apparently
|
|
11
|
+
false guard rejection, stale preview, resource delivery or runner defect.
|
|
12
|
+
- `ads_request_feature`: an intended workflow needs a capability ADS does not
|
|
13
|
+
currently provide. Explain the workflow and impact before proposing a design.
|
|
14
|
+
|
|
15
|
+
When classification is uncertain, choose the best fit and state the uncertainty.
|
|
16
|
+
Both tools mark reports `untriaged` and classification `agent-supplied`.
|
|
17
|
+
|
|
18
|
+
Investigate the failing boundary first using [evidence.md](evidence.md). Correct
|
|
19
|
+
ordinary invalid tool arguments, component defects and legitimate guard failures
|
|
20
|
+
in their owner. Do not label every failed check as an ADS bug. A transport error
|
|
21
|
+
does not prove a network-interface cause, and a failed assertion may be a test
|
|
22
|
+
defect. Describe observations separately from `suspectedCause` or `proposal`.
|
|
23
|
+
|
|
24
|
+
## Submit compact, actionable observations
|
|
25
|
+
|
|
26
|
+
Bug reports require `title`, `expected`, `observed`, nonempty `steps` and
|
|
27
|
+
`frequency` (`always`, `intermittent`, `once` or `unknown`). A one-time failure can
|
|
28
|
+
be reported honestly; repeated reproduction is not required. `suspectedCause` is
|
|
29
|
+
optional. Feature requests require `title`, `workflow`, `capability` and `impact`;
|
|
30
|
+
`proposal` is optional.
|
|
31
|
+
|
|
32
|
+
Both accept optional `unit`, `scenario`, `reporter` and up to three `evidence`
|
|
33
|
+
selectors. Use discovered target IDs where possible. A new draft may not yet be
|
|
34
|
+
registered; naming it is a claim rather than registration or coverage credit.
|
|
35
|
+
Reporter names are agent-supplied metadata, not authenticated identity.
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
ads_report_bug({
|
|
39
|
+
title: "Consumer proof rejects a child reached through a local helper",
|
|
40
|
+
unit: "components/Example",
|
|
41
|
+
expected: "The real child and its props are recognized through the helper.",
|
|
42
|
+
observed: "The candidate is rejected by declarative-consumer.",
|
|
43
|
+
steps: ["Render the registered part through its parent.", "Dry-run its owner patch."],
|
|
44
|
+
frequency: "always",
|
|
45
|
+
evidence: [{resultId: "<returned execution ID>"}],
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
ads_request_feature({
|
|
49
|
+
title: "Select checks directly from a prepared draft",
|
|
50
|
+
workflow: "Investigate one registered behavior before validating a large draft.",
|
|
51
|
+
capability: "Run selected draft checks against an isolated candidate.",
|
|
52
|
+
impact: "Avoid repeating unrelated checks during investigation.",
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
An evidence selector is either `{resultId}` from `ads_verify`/guarded editing,
|
|
57
|
+
or the exact `{unit, check, runId}` from a check outcome. ADS verifies the selector
|
|
58
|
+
and saves a compact completion-time snapshot. Superseded or fabricated IDs fail;
|
|
59
|
+
do not attach another run's evidence. If the older slot is gone, omit the selector
|
|
60
|
+
and state what was observed rather than claiming it remains verified.
|
|
61
|
+
|
|
62
|
+
ADS also captures its version, configured framework, Node/platform, source and
|
|
63
|
+
configuration revisions, available build metadata and capture time. Missing
|
|
64
|
+
metadata is explicitly unobserved. Context capture does not rerun checks or
|
|
65
|
+
establish current passing behavior. A report can refer to a candidate while its
|
|
66
|
+
current-project context describes the live source; compare the labeled revisions.
|
|
67
|
+
|
|
68
|
+
Include a minimal reproduction, not whole component files, complete runner logs,
|
|
69
|
+
customer fixtures, credentials or request headers. The tools accept no file
|
|
70
|
+
attachment path and upload nothing. Artifact links may later become unavailable;
|
|
71
|
+
reports preserve compact text evidence, not image/trace bytes. Snapshot truncation
|
|
72
|
+
is explicit. A saved record is limited to 32 KiB; shorten oversized narrative.
|
|
73
|
+
Keep each report focused on one problem or capability rather than a session dump.
|
|
74
|
+
|
|
75
|
+
The reply is a compact receipt with `reportId`, `revision` and local `storagePath`. Equivalent submissions
|
|
76
|
+
for the same ADS version/framework reuse the ID and increment `submissionCount`.
|
|
77
|
+
This counts submissions, not independent reproductions. The latest submission,
|
|
78
|
+
context and evidence replace that report's details; there is no occurrence log.
|
|
79
|
+
|
|
80
|
+
## Storage and receipt
|
|
81
|
+
|
|
82
|
+
Both kinds are stored as ordinary JSON files at
|
|
83
|
+
`<projectRoot>/.ds/reports/<reportId>.json`. They are development metadata,
|
|
84
|
+
excluded from production code. Reports do not expire or get deleted by a count
|
|
85
|
+
limit. Archiving/deletion are deliberate maintenance actions; neither intake tool
|
|
86
|
+
performs them. This is project-local collection, not automatic delivery to ADS
|
|
87
|
+
maintainers or GitHub. Share selected reports explicitly when needed.
|
|
88
|
+
|
|
89
|
+
MCP intake is submission-only. There are no tools or resources for listing,
|
|
90
|
+
reading or subscribing to saved reports. The receipt acknowledges local storage;
|
|
91
|
+
it does not return the report body. Inspect or share the local JSON files through
|
|
92
|
+
normal project maintenance when needed. `ads_status.reports` identifies the two
|
|
93
|
+
submission tools, storage directory and this guidance, without listing reports.
|
|
94
|
+
|
|
95
|
+
## Continue without distorting the design
|
|
96
|
+
|
|
97
|
+
Preserve the draft and legitimate public API while reporting a tooling gap.
|
|
98
|
+
Do not privatize parts, add demo-only props, alter the reference baseline, weaken
|
|
99
|
+
guards or bypass a rejected MCP patch merely to proceed. Continue independent
|
|
100
|
+
work when possible. Tell the user the report ID, the exact blocked step and what
|
|
101
|
+
remains unverified; do not restate the entire stored report in conversation.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Node and Bun development runtimes
|
|
2
|
+
|
|
3
|
+
ADS supports Node 22.12+ and Bun 1.3.13+. A Bun project does not need Node or npm.
|
|
4
|
+
The launcher selects the interpreter; package manager and UI framework are
|
|
5
|
+
separate concerns. Preserve the target project's choices.
|
|
6
|
+
|
|
7
|
+
For a Node/npm project, run inside its package root:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx @reqvire-org/ads init --framework react
|
|
11
|
+
npm install
|
|
12
|
+
npm run build
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For Bun:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
bunx --bun @reqvire-org/ads init --framework react
|
|
19
|
+
bun install
|
|
20
|
+
bun --bun run build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Use `--framework preact` for native Preact. Init detects an existing package
|
|
24
|
+
manager or infers Bun from its launcher when no project choice exists. Use
|
|
25
|
+
`--package-manager bun` only for an explicit override; existing project metadata
|
|
26
|
+
and lockfiles take precedence over the launcher.
|
|
27
|
+
Use the installed/pinned ADS version. Never substitute an unrelated bare package.
|
|
28
|
+
|
|
29
|
+
`--bun` is essential to an explicit Bun runtime choice: many JavaScript tools
|
|
30
|
+
have a `#!/usr/bin/env node` shebang. Bun can otherwise launch Node when it is
|
|
31
|
+
available. Generated ADS scripts force Bun, including Oxlint and its JavaScript
|
|
32
|
+
plugins. Existing application scripts and lockfiles are preserved; translate
|
|
33
|
+
nested `npm` commands when intentionally converting an application to Bun.
|
|
34
|
+
Dependency packages and custom build commands must support the chosen runtime.
|
|
35
|
+
|
|
36
|
+
For ordinary `bun run build` commands to always select Bun, the project may
|
|
37
|
+
set its own `bunfig.toml`:
|
|
38
|
+
|
|
39
|
+
```toml
|
|
40
|
+
[run]
|
|
41
|
+
bun = true
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This is equivalent to passing `--bun` for script execution. ADS does not replace
|
|
45
|
+
an existing Bun configuration. Keep the explicit flag in MCP launch settings.
|
|
46
|
+
|
|
47
|
+
## MCP connection
|
|
48
|
+
|
|
49
|
+
For Bun, use these values in Claude's `.mcp.json` or Codex's MCP configuration:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"command": "bunx",
|
|
54
|
+
"args": ["--bun", "@reqvire-org/ads", "mcp"]
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Add `--mutations` to enable guarded source changes and `--port 4191` when the
|
|
59
|
+
project pins its showcase port. Append a project directory when the client
|
|
60
|
+
does not launch in the package root. For a local installed tool, use the
|
|
61
|
+
generated `ads-mcp` or `ads-read-mcp` package script. Keep stdout for JSON-RPC.
|
|
62
|
+
|
|
63
|
+
## Compiler and browser workers
|
|
64
|
+
|
|
65
|
+
Use the portable command in `ds.config.json`:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"mcp": {
|
|
70
|
+
"previewWatch": {
|
|
71
|
+
"command": "runtime",
|
|
72
|
+
"args": ["scripts/build-mcp-previews.mjs", "--watch"]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`runtime` means the interpreter that launched ADS, including its absolute
|
|
79
|
+
executable when available through an environment manager. It also works in
|
|
80
|
+
registered behavior profiles, with the project's installed runner entry file in
|
|
81
|
+
`args`. Explicit `node`, `bun` and custom executable commands retain their meaning;
|
|
82
|
+
ADS never silently substitutes another interpreter for them. Node-specific
|
|
83
|
+
commands still need Node, even in a Bun-managed package.
|
|
84
|
+
|
|
85
|
+
Mandatory architecture/Oxlint validation, ownership guards and screenshot workers
|
|
86
|
+
inherit ADS's interpreter. Browser tests remain project-owned Playwright specs;
|
|
87
|
+
Chromium/WebKit is a separate browser dependency, not a Node requirement. Runtime
|
|
88
|
+
identity participates in behavior evidence freshness.
|
|
89
|
+
|
|
90
|
+
For diagnosis, inspect `ads_status.project.runtime`: `name`, `version`,
|
|
91
|
+
`executable` and `binDir`. `project.commands` contains the discovered package
|
|
92
|
+
commands with the appropriate Bun flags. The MCP process and agent shell may
|
|
93
|
+
have different PATHs; use these reported values instead of scanning the machine
|
|
94
|
+
or installing another runtime without evidence.
|
|
95
|
+
|
|
96
|
+
Preview watching excludes standard output trees by default, including nested
|
|
97
|
+
Cargo `target/` directories, without allocating watches inside them. Explicit
|
|
98
|
+
`sourceDir` and `dsDir` take priority over those default output names. Register
|
|
99
|
+
custom outputs in `assets.generatedPaths`; do not copy the default list into a
|
|
100
|
+
new project's config. `ENOSPC` from `fs.watch` can mean the OS watch limit rather
|
|
101
|
+
than disk space: inspect the failing path and generated-tree traversal before
|
|
102
|
+
raising system limits or deleting files. Generated churn must not mark previews
|
|
103
|
+
stale; actual source changes must still rebuild.
|
|
104
|
+
|
|
105
|
+
Bundled binary renderers may load their forwarded `blob:` resources. ADS's
|
|
106
|
+
showcase/explorer permits WebAssembly compilation while keeping JavaScript eval
|
|
107
|
+
and undeclared network requests blocked. External MCP hosts control their CSP.
|
|
108
|
+
Test the actual renderer inside the App; a successful website build does not
|
|
109
|
+
establish binary-resource or WebAssembly support. Keep transport and resource
|
|
110
|
+
loading in explicit injected adapters or declared renderer dependencies.
|
|
@@ -4,8 +4,8 @@ Use this reference for `scenario-render`, `scenario-coverage`, `showcase-control
|
|
|
4
4
|
diagnostics. MCP serves the same guide as `ads://guides/scenarios`.
|
|
5
5
|
|
|
6
6
|
All preview kinds open at `?scenario=<discovered-id>`. Use the returned showcase
|
|
7
|
-
link instead of inferring a section from an ID's directory
|
|
8
|
-
|
|
7
|
+
link instead of inferring a section from an ID's directory. Token scenarios and
|
|
8
|
+
their fixtures belong in the configured shared token directory, with `kind: "tokens"`.
|
|
9
9
|
Legacy `?category=` links remain aliases. The `ads_show_tokens` tool retains its
|
|
10
10
|
`category` argument; both preview tools return canonical `?scenario=` links.
|
|
11
11
|
|
|
@@ -55,20 +55,14 @@ state effects. A working Next button is not evidence that form submission works.
|
|
|
55
55
|
Keep native action navigation separate from client-side submission behavior;
|
|
56
56
|
`allow-forms` does not grant host DOM access or top-level navigation.
|
|
57
57
|
|
|
58
|
-
##
|
|
58
|
+
## Independent shared token previews
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Do not render the runtime owner merely to retain its CSS or add unrelated sheets.
|
|
67
|
-
|
|
68
|
-
Open the exact token scenario in a fresh App and verify resolved values and sample
|
|
69
|
-
effects in both themes. A successful ordinary component preview does not prove
|
|
70
|
-
the independently bundled token preview loads the same definitions. Shared
|
|
71
|
-
foundation styling still follows the project's mount/build integration.
|
|
60
|
+
All token scenarios/fixtures belong under the shared token directory. They render
|
|
61
|
+
project-owned review UI with real sample bindings and probes. The project mount
|
|
62
|
+
adapter loads the shared foundation, so a token preview does not need to render a
|
|
63
|
+
runtime component merely to retain its CSS. There is no owner token-sheet injection.
|
|
64
|
+
Open each affected token scenario in a fresh App and verify sample effects in both
|
|
65
|
+
themes. A component preview alone does not establish token-preview correctness.
|
|
72
66
|
|
|
73
67
|
## Public children can share their parent's scenario
|
|
74
68
|
|
|
@@ -26,6 +26,15 @@ mounting, routing, CSS-entry, or scope integration problem.
|
|
|
26
26
|
|
|
27
27
|
## Select tests by observable risk
|
|
28
28
|
|
|
29
|
+
Judge the port against the destination contract as well as the source. Check
|
|
30
|
+
that it uses shared project roles, fits beside existing controls and remains
|
|
31
|
+
usable after typography/spacing substitutions. Exercise wrapping, focus rings,
|
|
32
|
+
disabled/error states, both themes and narrow containers where those adaptations
|
|
33
|
+
can change geometry or contrast. Record expected visual differences rather than
|
|
34
|
+
adding source-specific tokens to satisfy an exact-pixel assertion. Strict visual
|
|
35
|
+
parity is required only when it is part of the agreed brief; never edit the
|
|
36
|
+
reference to conceal an adaptation or a regression.
|
|
37
|
+
|
|
29
38
|
Use the cases relevant to the component, not a universal checklist:
|
|
30
39
|
|
|
31
40
|
| Area | Useful observations |
|
|
@@ -106,7 +115,8 @@ do not run Toast tests as a substitute. Once checks pass, rerun only when change
|
|
|
106
115
|
or unresolved observations justify it. Save browser artifacts in the repository's existing ignored location
|
|
107
116
|
(for example `output/playwright/`) or an isolated temporary directory.
|
|
108
117
|
|
|
109
|
-
Report
|
|
118
|
+
Report destination consistency and required behavioral matches separately from
|
|
119
|
+
intentional source-style differences, with evidence and the reference version. Distinguish
|
|
110
120
|
observed behavior, source inference, and untested cases. Give full native/reference
|
|
111
121
|
playground URLs when they exist. Do not report a static server as running without
|
|
112
122
|
checking it, or call screenshots proof of full animation/behavior parity.
|
package/dist/tokens.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { loadConfig, sourceFiles } from "./config.mjs";
|
|
|
6
6
|
import { foundationFiles, isSharedToken, tokenContract } from "./token-policy.mjs";
|
|
7
7
|
import { dimensionValue, numericCssUnit } from "./css-values.mjs";
|
|
8
8
|
import { checkComponentVariable } from "./boundaries.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { tokenOverlapAdvisories } from "./design-values.mjs";
|
|
10
10
|
|
|
11
11
|
export { tokenContract };
|
|
12
12
|
|
|
@@ -51,10 +51,7 @@ export function inspectTokens(directory, suppliedOptions) {
|
|
|
51
51
|
const { root, dsRoot, config } = options;
|
|
52
52
|
const definitions = new Map();
|
|
53
53
|
const diagnostics = [];
|
|
54
|
-
const scoped = scopedTokens(options);
|
|
55
|
-
diagnostics.push(...scoped.diagnostics);
|
|
56
54
|
const files = sourceFiles(path.join(dsRoot, config.tokenDir)).filter((file) => file.endsWith(".css"));
|
|
57
|
-
files.push(...scoped.definitions.map(entry => path.join(root, entry.file)));
|
|
58
55
|
files.sort((a, b) => foundationFiles.indexOf(path.basename(a)) - foundationFiles.indexOf(path.basename(b)) || a.localeCompare(b));
|
|
59
56
|
for (const file of files) {
|
|
60
57
|
let css;
|
|
@@ -73,7 +70,6 @@ export function inspectTokens(directory, suppliedOptions) {
|
|
|
73
70
|
column: decl.source.start.column,
|
|
74
71
|
scope: context(decl),
|
|
75
72
|
value: decl.value,
|
|
76
|
-
...(scoped.definitions.some(entry => entry.file === path.relative(root, file).replaceAll("\\", "/")) ? { owner:scoped.definitions.find(entry => entry.file === path.relative(root, file).replaceAll("\\", "/")).unit } : {}),
|
|
77
73
|
};
|
|
78
74
|
if (!definitions.has(decl.prop)) definitions.set(decl.prop, []);
|
|
79
75
|
definitions.get(decl.prop).push(definition);
|
|
@@ -113,8 +109,7 @@ export function inspectTokens(directory, suppliedOptions) {
|
|
|
113
109
|
}
|
|
114
110
|
const resolvedReferences = new Map();
|
|
115
111
|
for (const ref of references(entry.value)) {
|
|
116
|
-
|
|
117
|
-
if (local ? entry.owner !== local.unit : !isSharedToken(ref.name)) report("token-name", name, entry, `${name} references ${ref.name} outside its shared/owner token contract.`);
|
|
112
|
+
if (!isSharedToken(ref.name)) report("token-name", name, entry, `${name} references ${ref.name} outside the shared Data token contract.`);
|
|
118
113
|
if (!scope.has(ref.name) && !ref.fallback) report("token-reference", name, entry, `${name} references undefined ${ref.name}.`);
|
|
119
114
|
else if (scope.has(ref.name)) resolvedReferences.set(ref.name, resolveAlias(ref.name, [...chain, name]));
|
|
120
115
|
}
|
|
@@ -142,9 +137,11 @@ export function inspectTokens(directory, suppliedOptions) {
|
|
|
142
137
|
if (type && resolved !== undefined && !matchesType(resolved, type)) report("token-type", name, entry, `${name} expects ${type}; found ${resolved}.`);
|
|
143
138
|
}
|
|
144
139
|
}
|
|
140
|
+
const tokens = [...definitions].sort(([a], [b]) => a.localeCompare(b)).map(([name, entries]) => ({ name, ...tokenContract.tokens[name], owner:"tokens", definitions: entries }));
|
|
145
141
|
return options.tokenInventory = {
|
|
146
142
|
contractVersion: tokenContract.version,
|
|
147
|
-
tokens
|
|
143
|
+
tokens,
|
|
144
|
+
advisories: tokenOverlapAdvisories(tokens),
|
|
148
145
|
diagnostics,
|
|
149
146
|
};
|
|
150
147
|
}
|
package/dist/unit-contracts.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { realpathSync, statSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import ts from "typescript";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -17,7 +17,6 @@ const binding = z.object({ input: z.object({ api: ref, property: field }).strict
|
|
|
17
17
|
variable: z.string().regex(/^--[a-z][\w-]*\$\{key\}[\w-]*$/), scope: z.object({ api: ref, selector: z.string().min(1).max(200) }).strict(), checks }).strict();
|
|
18
18
|
const part = z.object({ api: ref, parent: ref, consumer: ref, checks }).strict();
|
|
19
19
|
const schema = z.object({ schemaVersion: z.literal(1),
|
|
20
|
-
tokens: z.object({ namespace: z.string(), stylesheet: z.string().min(1).max(256) }).strict().optional(),
|
|
21
20
|
paintInputs: z.array(paint).max(100).optional(), bindings: z.record(id, binding).optional(),
|
|
22
21
|
declarativeParts: z.array(part).max(100).optional(), behavior: z.record(z.string(), z.unknown()).optional(),
|
|
23
22
|
}).strict();
|
|
@@ -146,12 +145,6 @@ export function inspectUnitContracts(options) {
|
|
|
146
145
|
const absolute = path.resolve(options.root, reference.source);
|
|
147
146
|
if (!isInside(options.dsRoot, absolute) || inventory.owner(inventory.relative(reference.source)) !== unit || isDevelopmentFile(absolute, options)&&!isReviewFile(absolute,options)) report(`${fieldName} must reference runtime or review implementation inside ${unit}, not a contract, fixture or spec.`, fieldName);
|
|
148
147
|
}
|
|
149
|
-
if (data.tokens) {
|
|
150
|
-
if(!/^(?:components|patterns)\//.test(unit))report("Owner-local design token namespaces belong to components or patterns. Controllers remain headless; review uses the shared vocabulary and its own presentation state.","tokens");
|
|
151
|
-
const absolute = path.resolve(path.dirname(file), data.tokens.stylesheet);
|
|
152
|
-
if (!isInside(options.dsRoot, absolute) || inventory.owner(inventory.relative(slash(path.relative(options.root, absolute)))) !== unit || !absolute.endsWith(".css") || !existsSync(absolute)) report("Token stylesheet must be a real CSS file in this owner.", "tokens.stylesheet");
|
|
153
|
-
data.tokens.file = slash(path.relative(options.root, absolute));
|
|
154
|
-
}
|
|
155
148
|
for (const [index, input] of (data.paintInputs ?? []).entries()) {
|
|
156
149
|
if(data.paintInputs.slice(0,index).some(prior=>prior.api.identity===input.api.identity&&prior.property===input.property))report("Duplicate paint-input registration is ambiguous.",`paintInputs.${index}`);
|
|
157
150
|
input.apiName = apiName(input.api, `paintInputs.${index}.api`);
|