@adobe/design-data-spec 4.8.0 → 4.8.1

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.
@@ -0,0 +1,50 @@
1
+ {
2
+ "tokens": [
3
+ {
4
+ "name": {
5
+ "component": "accordion",
6
+ "property": "gap",
7
+ "scale": "desktop"
8
+ },
9
+ "value": "8px",
10
+ "uuid": "aaaaaaaa-0072-4000-8000-000000000001"
11
+ },
12
+ {
13
+ "name": {
14
+ "component": "accordion",
15
+ "property": "gap",
16
+ "scale": "mobile"
17
+ },
18
+ "value": "10px",
19
+ "uuid": "aaaaaaaa-0072-4000-8000-000000000002"
20
+ }
21
+ ],
22
+ "relationships": [
23
+ {
24
+ "scope": {
25
+ "component": "accordion",
26
+ "property": "gap"
27
+ },
28
+ "context": "Spacing",
29
+ "$ref": "aaaaaaaa-0072-4000-8000-000000000001"
30
+ },
31
+ {
32
+ "scope": {
33
+ "component": "accordion",
34
+ "property": "gap"
35
+ },
36
+ "context": "Spacing",
37
+ "$ref": "aaaaaaaa-0072-4000-8000-000000000001"
38
+ }
39
+ ],
40
+ "components": [
41
+ {
42
+ "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/components/accordion.json",
43
+ "name": "accordion",
44
+ "displayName": "Accordion",
45
+ "meta": {
46
+ "category": "actions"
47
+ }
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "layer": 2,
3
+ "errors": [
4
+ {
5
+ "rule_id": "SPEC-072",
6
+ "severity": "warning",
7
+ "message_pattern": ".*twice.*mobile counterpart.*aaaaaaaa-0072-4000-8000-000000000002.*"
8
+ }
9
+ ]
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/design-data-spec",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "description": "Design Data Specification — prose, JSON Schemas, rule catalog, and conformance fixtures for the design data format",
5
5
  "type": "module",
6
6
  "repository": {
package/rules/rules.yaml CHANGED
@@ -724,3 +724,18 @@ rules:
724
724
  message: "Alias {token} sets {field}={ownValue} but its $ref chain resolves to a token with {field}={leafValue}"
725
725
  spec_ref: spec/cascade.md#alias-resolution
726
726
  introduced_in: "1.0.0-draft"
727
+ - id: SPEC-072
728
+ name: relationship-duplicate-ref-scale-counterpart
729
+ severity: warning
730
+ layer: 2
731
+ category: relationship
732
+ note: >
733
+ Typically a desktop and a mobile record where the second was copied without repointing it,
734
+ so the other scale's token is never reachable through the relationship. A repeated record
735
+ on a token with no scale counterpart is not reported.
736
+ assert: >
737
+ Two relationship records with the same scope, context and `$ref` SHOULD NOT both point at
738
+ a token that has a scale counterpart (the same name with another `scale` value).
739
+ message: "Relationship {scope} references {ref} twice, but the token has a {scale} counterpart ({counterpart}); point one record at it"
740
+ spec_ref: spec/relationship-format.md
741
+ introduced_in: "1.0.0-draft"
package/spec/manifest.md CHANGED
@@ -69,15 +69,16 @@ Each override object **MUST** include enough information to identify a target to
69
69
 
70
70
  **NORMATIVE:** Overrides **MUST NOT** change the resolved type of the token (aligns with [Cascade — type safety](cascade.md)).
71
71
 
72
- An override is applied as a new **platform-layer** record, not an in-place edit of the
73
- foundation record it targets — the original foundation record is left untouched.
74
- [Query](query.md) reports records across all cascade layers, so a query over an overridden
75
- token's selector returns both the untouched foundation record and the new platform-layer
76
- record (e.g. an override on a `state=disabled` token increases the matching count by one,
77
- rather than replacing an existing match). Only [`resolve` / `resolve_property`](cascade.md)
78
- apply `Foundation < Platform < Product` precedence to select a single winner. Tooling that
79
- counts "tokens a platform ships" from `query` output should resolve first, or it will
80
- double-count overridden tokens.
72
+ An override **replaces** the foundation record for that platform's graph: the replacement keeps the target's key and `uuid`, sits at the **platform** layer, and keeps every other field of the original record (`$schema`, `$valueType`, `lifecycle`, `description`, `conceptId`, and so on). Only `value` or `$ref` changes; an override that supplies `$ref` removes `value`, and one that supplies `value` removes `$ref`. The foundation package on disk is untouched. [Query](query.md) returns one record per token, and [`resolve` / `resolve_property`](cascade.md) still apply `Foundation < Platform < Product` precedence, so a platform override beats the foundation value and a product override beats both.
73
+
74
+ **Provenance.** A replaced record carries two in-memory markers so tooling can tell where it came from:
75
+
76
+ | Field | Value |
77
+ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
78
+ | `overriddenBy` | `{ "platform": "<manifest platform>" }` when the manifest sets `platform`; otherwise `{ "manifest": "manifest.json" }` (the literal file name; the manifest's real path is not recorded). |
79
+ | `overriddenFrom` | `{ "value": <foundation value> }` or `{ "$ref": <foundation $ref> }`. The first override's history is kept, so it is always the foundation value, even when a token is overridden more than once (the last override wins for the value). |
80
+
81
+ These markers exist only on the platform's in-memory records. They are not written to token files and are **not** serialized in legacy output.
81
82
 
82
83
  ### Identity fields
83
84