@adobe/design-data-spec 4.4.0 → 4.6.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/conformance/manifest-extensions/README.md +55 -31
- package/conformance/manifest-extensions/base/dataset.json +36 -3
- package/conformance/manifest-extensions/invalid/component-option-extension-missing-component/expected-errors.json +6 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-missing-component/extensions/platform-extensions/broken.json +4 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-missing-component/manifest.json +4 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-canonical-value/expected-errors.json +5 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-canonical-value/extensions/components/button.json +16 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-canonical-value/extensions/platform-extensions/broken.json +12 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-canonical-value/manifest.json +4 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-component/expected-errors.json +1 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-component/extensions/platform-extensions/broken.json +6 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-component/manifest.json +4 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-option/expected-errors.json +1 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-option/extensions/components/button.json +16 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-option/extensions/platform-extensions/broken.json +4 -0
- package/conformance/manifest-extensions/invalid/component-option-extension-unknown-option/manifest.json +4 -0
- package/conformance/manifest-extensions/invalid/implementations-remove-no-match/expected-errors.json +10 -0
- package/conformance/manifest-extensions/invalid/implementations-remove-no-match/extensions/implementations/button.json +9 -0
- package/conformance/manifest-extensions/invalid/implementations-remove-no-match/manifest.json +5 -0
- package/conformance/manifest-extensions/invalid/implementations-row-missing-reference/expected-errors.json +7 -0
- package/conformance/manifest-extensions/invalid/implementations-row-missing-reference/extensions/implementations/button.json +9 -0
- package/conformance/manifest-extensions/invalid/implementations-row-missing-reference/manifest.json +5 -0
- package/conformance/manifest-extensions/invalid/implementations-unknown-component/expected-errors.json +10 -0
- package/conformance/manifest-extensions/invalid/implementations-unknown-component/extensions/implementations/nope.json +12 -0
- package/conformance/manifest-extensions/invalid/implementations-unknown-component/manifest.json +5 -0
- package/conformance/manifest-extensions/invalid/implementations-unknown-op/expected-errors.json +7 -0
- package/conformance/manifest-extensions/invalid/implementations-unknown-op/extensions/implementations/button.json +9 -0
- package/conformance/manifest-extensions/invalid/implementations-unknown-op/manifest.json +5 -0
- package/conformance/manifest-extensions/valid/implementations-later-file-wins/expected.json +19 -0
- package/conformance/manifest-extensions/valid/implementations-later-file-wins/extensions/implementations/a-button.json +11 -0
- package/conformance/manifest-extensions/valid/implementations-later-file-wins/extensions/implementations/b-button.json +11 -0
- package/conformance/manifest-extensions/valid/implementations-later-file-wins/manifest.json +5 -0
- package/conformance/manifest-extensions/valid/implementations-other-owner-untouched/expected.json +26 -0
- package/conformance/manifest-extensions/valid/implementations-other-owner-untouched/extensions/implementations/button.json +18 -0
- package/conformance/manifest-extensions/valid/implementations-other-owner-untouched/manifest.json +5 -0
- package/conformance/manifest-extensions/valid/implementations-platform-local-component/expected.json +12 -0
- package/conformance/manifest-extensions/valid/implementations-platform-local-component/extensions/components/tab-bar-ios.json +9 -0
- package/conformance/manifest-extensions/valid/implementations-platform-local-component/extensions/implementations/tab-bar-ios.json +10 -0
- package/conformance/manifest-extensions/valid/implementations-platform-local-component/manifest.json +5 -0
- package/conformance/manifest-extensions/valid/implementations-remove-row/expected.json +11 -0
- package/conformance/manifest-extensions/valid/implementations-remove-row/extensions/implementations/button.json +10 -0
- package/conformance/manifest-extensions/valid/implementations-remove-row/manifest.json +5 -0
- package/conformance/manifest-extensions/valid/implementations-upsert-foundation-row/expected.json +19 -0
- package/conformance/manifest-extensions/valid/implementations-upsert-foundation-row/extensions/implementations/button.json +12 -0
- package/conformance/manifest-extensions/valid/implementations-upsert-foundation-row/manifest.json +5 -0
- package/conformance/manifest-extensions/valid/injects-component-option-extension/expected.json +18 -0
- package/conformance/manifest-extensions/valid/injects-component-option-extension/extensions/components/button.json +20 -0
- package/conformance/manifest-extensions/valid/injects-component-option-extension/extensions/platform-extensions/web-components-button.json +18 -0
- package/conformance/manifest-extensions/valid/injects-component-option-extension/manifest.json +4 -0
- package/llms.txt +29 -0
- package/package.json +3 -1
- package/schemas/component.schema.json +8 -3
- package/schemas/implementation-mapping.schema.json +69 -0
- package/schemas/platform-extension.json +73 -1
- package/spec/component-format.md +40 -19
- package/spec/manifest.md +71 -19
|
@@ -4,12 +4,14 @@ Exercises the Layer 2 platform manifest's `extensions/` **directory** loader
|
|
|
4
4
|
(`packages/design-data-spec/spec/manifest.md#extensions-directory`): a sibling
|
|
5
5
|
`extensions/` tree (or a custom name via the manifest's `extensionsDir` field)
|
|
6
6
|
whose category subdirectories (`tokens/`, `components/`, `fields/`,
|
|
7
|
-
`guidelines/`, `mode-sets/`, `platform-extensions/`, `relationships
|
|
7
|
+
`guidelines/`, `mode-sets/`, `platform-extensions/`, `relationships/`,
|
|
8
|
+
`implementations/`) are discovered,
|
|
8
9
|
glob+merged in sorted path order, per-fragment schema-validated, and spliced
|
|
9
10
|
into the manifest before it's applied to the graph.
|
|
10
11
|
|
|
11
12
|
* `base/dataset.json` — a shared minimal seed graph (three foundation tokens:
|
|
12
|
-
`btn-bg`, `btn-fg`, `chk-bg` on the `button`/`checkbox` components
|
|
13
|
+
`btn-bg`, `btn-fg`, `chk-bg` on the `button`/`checkbox` components, plus a
|
|
14
|
+
foundation `button` component with two default `implementations` rows), loaded
|
|
13
15
|
once per case before that case's `manifest.json` is applied via
|
|
14
16
|
`apply_configured`.
|
|
15
17
|
* `valid/<case>/` — `manifest.json` + an `extensions/` (or custom-named) tree
|
|
@@ -19,13 +21,18 @@ into the manifest before it's applied to the graph.
|
|
|
19
21
|
{
|
|
20
22
|
"relationships": {
|
|
21
23
|
"byUuid": { "<uuid>": { "count": 1, "value": "8px" } },
|
|
22
|
-
"absent": ["<uuid>"]
|
|
24
|
+
"absent": ["<uuid>"],
|
|
23
25
|
},
|
|
24
26
|
"components": { "present": ["tab-bar-ios"] },
|
|
25
27
|
"fields": { "present": ["hapticStyle"] },
|
|
26
28
|
"modeSets": { "present": ["interfaceLevel"] },
|
|
27
29
|
"guidelines": { "present": ["ios-haptics"] },
|
|
28
|
-
"tokens": { "orderByUuid": ["<uuid-1>", "<uuid-2>"] }
|
|
30
|
+
"tokens": { "orderByUuid": ["<uuid-1>", "<uuid-2>"] },
|
|
31
|
+
"implementations": {
|
|
32
|
+
"<component>": [
|
|
33
|
+
/* exact merged rows */
|
|
34
|
+
],
|
|
35
|
+
},
|
|
29
36
|
}
|
|
30
37
|
```
|
|
31
38
|
A case that only needs to prove "loads clean" uses `{}`.
|
|
@@ -36,31 +43,48 @@ into the manifest before it's applied to the graph.
|
|
|
36
43
|
Rust SDK drives these fixtures in `sdk/core/src/lib.rs` via the
|
|
37
44
|
`manifest_extensions_conformance` (pass/fail + error message matching) and
|
|
38
45
|
`manifest_extensions_behavior` (post-apply graph predicates) test modules.
|
|
46
|
+
The boolean option regression test derives an invalid case from
|
|
47
|
+
`valid/injects-component-option-extension` and checks that value aliases fail
|
|
48
|
+
with an error naming the option and component.
|
|
39
49
|
|
|
40
|
-
| Case
|
|
41
|
-
|
|
|
42
|
-
| `valid/injects-component`
|
|
43
|
-
| `valid/injects-platform-extension`
|
|
44
|
-
| `valid/injects-
|
|
45
|
-
| `valid/injects-
|
|
46
|
-
| `valid/injects-
|
|
47
|
-
| `valid/injects-
|
|
48
|
-
| `valid/
|
|
49
|
-
| `valid/
|
|
50
|
-
| `valid/
|
|
51
|
-
| `valid/
|
|
52
|
-
| `valid/
|
|
53
|
-
| `valid/
|
|
54
|
-
| `valid/
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `invalid/
|
|
62
|
-
| `invalid/
|
|
63
|
-
| `invalid/
|
|
64
|
-
| `invalid/
|
|
65
|
-
| `invalid/
|
|
66
|
-
| `invalid/
|
|
50
|
+
| Case | Intent |
|
|
51
|
+
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| `valid/injects-component` | A `components/` fragment is injected as a Platform-layer component. |
|
|
53
|
+
| `valid/injects-platform-extension` | A `platform-extensions/` fragment is injected. |
|
|
54
|
+
| `valid/injects-component-option-extension` | String value aliases and a boolean option name alias without `values` are injected via `componentOptions`. |
|
|
55
|
+
| `valid/injects-field` | A `fields/` fragment is injected. |
|
|
56
|
+
| `valid/injects-guideline` | A `guidelines/` fragment is injected. |
|
|
57
|
+
| `valid/injects-mode-set` | A `mode-sets/` fragment is injected (declare-or-replace by name). |
|
|
58
|
+
| `valid/injects-relationship` | A `relationships/` plain-add fragment is injected. |
|
|
59
|
+
| `valid/override-relationship-by-uuid` | An `op: "override"` entry replaces a plain add sharing its `uuid`, regardless of file sort order. |
|
|
60
|
+
| `valid/plain-add-uuid-collision-append` | Two plain adds sharing a `uuid` both append rather than one overwriting the other. |
|
|
61
|
+
| `valid/remove-relationship-by-uuid` | An `op: "remove"` entry deletes the matching relationship. |
|
|
62
|
+
| `valid/tokens-sorted-order` | Multiple `tokens/*.tokens.json` files concatenate in sorted path order. |
|
|
63
|
+
| `valid/later-file-wins` | Two `components/` fragments declaring the same component name dedupe to one, later file wins. |
|
|
64
|
+
| `valid/custom-extensions-dir` | The manifest's `extensionsDir` field is honored in place of the default `extensions/` name. |
|
|
65
|
+
| `valid/override-entry-skips-schema-validation` | An `op: "override"` relationship entry is not schema-validated against `relationship.schema.json` (only plain adds are). |
|
|
66
|
+
| `valid/implementations-upsert-foundation-row` | An `implementations/` row replaces the foundation default sharing its `importPath` and is stamped with the manifest `platform`. |
|
|
67
|
+
| `valid/implementations-later-file-wins` | Two fragments upserting the same stamped row dedupe by `implementation` id; the later file wins. |
|
|
68
|
+
| `valid/implementations-remove-row` | An `op: "remove"` selector deletes the matching foundation default. |
|
|
69
|
+
| `valid/implementations-platform-local-component` | A fragment may target a component added by the same manifest's `components/`. |
|
|
70
|
+
| `valid/implementations-other-owner-untouched` | A row stamped with a different `implementation` id is never matched by another owner's upsert. |
|
|
71
|
+
| `invalid/override-missing-uuid` | An `op: "override"` relationship entry missing `uuid` fails loudly. |
|
|
72
|
+
| `invalid/unknown-term-id` | A `platform-extensions/` fragment referencing a non-existent `termId` fails loudly. |
|
|
73
|
+
| `invalid/component-missing-name` | A `components/` fragment missing `name` fails Layer 1 fragment schema validation. |
|
|
74
|
+
| `invalid/field-invalid-kind` | A `fields/` fragment with an invalid `kind` enum value fails schema validation. |
|
|
75
|
+
| `invalid/guideline-invalid-category` | A `guidelines/` fragment with an invalid `category` enum value fails schema validation. |
|
|
76
|
+
| `invalid/mode-set-missing-default` | A `mode-sets/` fragment missing the required `default` field fails Layer 1 fragment schema validation. |
|
|
77
|
+
| `invalid/platform-extension-missing-extends` | A `platform-extensions/` fragment missing `extends` fails schema validation. |
|
|
78
|
+
| `invalid/component-option-extension-missing-component` | A `componentOptions[]` entry missing the required `component` field fails schema validation. |
|
|
79
|
+
| `invalid/component-option-extension-unknown-component` | A `componentOptions[]` entry referencing a component that doesn't exist fails loudly. |
|
|
80
|
+
| `invalid/component-option-extension-unknown-option` | A `componentOptions[]` entry referencing an option that doesn't exist on an existing component fails loudly. |
|
|
81
|
+
| `invalid/component-option-extension-unknown-canonical-value` | A `componentOptions[].values[]` entry must reference a value declared by the canonical component option. |
|
|
82
|
+
| `invalid/token-invalid-uuid` | A `tokens/*.tokens.json` fragment with a malformed `uuid` fails schema validation. |
|
|
83
|
+
| `invalid/relationship-missing-scope` | A `relationships/` plain-add fragment missing `scope` fails schema validation. |
|
|
84
|
+
| `invalid/extensions-dir-parent-traversal` | `extensionsDir` containing a `..` component is rejected. |
|
|
85
|
+
| `invalid/extensions-dir-absolute-path` | An absolute `extensionsDir` path is rejected. |
|
|
86
|
+
| `invalid/unknown-subdir-name` | An unrecognized subdirectory directly under `extensions/` (not one of the known categories) is rejected by name. |
|
|
87
|
+
| `invalid/implementations-unknown-component` | An `implementations/` fragment naming a component absent from the catalog fails loudly. |
|
|
88
|
+
| `invalid/implementations-remove-no-match` | An `op: "remove"` matching no owned row fails loudly. |
|
|
89
|
+
| `invalid/implementations-row-missing-reference` | A row with neither `package` nor `importPath` fails schema validation. |
|
|
90
|
+
| `invalid/implementations-unknown-op` | An `op` other than `"remove"` fails schema validation. |
|
|
@@ -2,21 +2,54 @@
|
|
|
2
2
|
"tokens": [
|
|
3
3
|
{
|
|
4
4
|
"key": "btn-bg",
|
|
5
|
-
"name": {
|
|
5
|
+
"name": {
|
|
6
|
+
"property": "background-color",
|
|
7
|
+
"component": "button"
|
|
8
|
+
},
|
|
6
9
|
"value": "#aaa",
|
|
7
10
|
"uuid": "u-btn-bg"
|
|
8
11
|
},
|
|
9
12
|
{
|
|
10
13
|
"key": "btn-fg",
|
|
11
|
-
"name": {
|
|
14
|
+
"name": {
|
|
15
|
+
"property": "color",
|
|
16
|
+
"component": "button"
|
|
17
|
+
},
|
|
12
18
|
"value": "#111",
|
|
13
19
|
"uuid": "u-btn-fg"
|
|
14
20
|
},
|
|
15
21
|
{
|
|
16
22
|
"key": "chk-bg",
|
|
17
|
-
"name": {
|
|
23
|
+
"name": {
|
|
24
|
+
"property": "background-color",
|
|
25
|
+
"component": "checkbox"
|
|
26
|
+
},
|
|
18
27
|
"value": "#bbb",
|
|
19
28
|
"uuid": "u-chk-bg"
|
|
20
29
|
}
|
|
30
|
+
],
|
|
31
|
+
"components": [
|
|
32
|
+
{
|
|
33
|
+
"$id": "https://example.com/components/button",
|
|
34
|
+
"name": "button",
|
|
35
|
+
"displayName": "Button",
|
|
36
|
+
"meta": {
|
|
37
|
+
"category": "actions",
|
|
38
|
+
"documentationUrl": "https://example.com"
|
|
39
|
+
},
|
|
40
|
+
"implementations": [
|
|
41
|
+
{
|
|
42
|
+
"platform": "web",
|
|
43
|
+
"componentName": "Button",
|
|
44
|
+
"package": "@react-spectrum/s2"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"platform": "web",
|
|
48
|
+
"componentName": "Button",
|
|
49
|
+
"importPath": "@adobe/spectrum-wc/components/button",
|
|
50
|
+
"notes": "Spectrum 2 web component custom element: swc-button."
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
21
54
|
]
|
|
22
55
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://example.com/components/button",
|
|
3
|
+
"name": "button",
|
|
4
|
+
"displayName": "Button",
|
|
5
|
+
"meta": {
|
|
6
|
+
"category": "actions",
|
|
7
|
+
"documentationUrl": "https://example.com"
|
|
8
|
+
},
|
|
9
|
+
"options": {
|
|
10
|
+
"style": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"default": "fill",
|
|
13
|
+
"values": [{ "value": "fill" }, { "value": "outline" }]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "errors": [{ "message_pattern": "not-a-real-component" }] }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "errors": [{ "message_pattern": "not-a-real-option" }] }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://example.com/components/button",
|
|
3
|
+
"name": "button",
|
|
4
|
+
"displayName": "Button",
|
|
5
|
+
"meta": {
|
|
6
|
+
"category": "actions",
|
|
7
|
+
"documentationUrl": "https://example.com"
|
|
8
|
+
},
|
|
9
|
+
"options": {
|
|
10
|
+
"style": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"default": "fill",
|
|
13
|
+
"values": [{ "value": "fill" }, { "value": "outline" }]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"implementations": {
|
|
3
|
+
"button": [
|
|
4
|
+
{
|
|
5
|
+
"platform": "web",
|
|
6
|
+
"componentName": "Button",
|
|
7
|
+
"package": "@react-spectrum/s2",
|
|
8
|
+
"notes": "second",
|
|
9
|
+
"implementation": "react-spectrum"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"platform": "web",
|
|
13
|
+
"componentName": "Button",
|
|
14
|
+
"importPath": "@adobe/spectrum-wc/components/button",
|
|
15
|
+
"notes": "Spectrum 2 web component custom element: swc-button."
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
package/conformance/manifest-extensions/valid/implementations-other-owner-untouched/expected.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"implementations": {
|
|
3
|
+
"button": [
|
|
4
|
+
{
|
|
5
|
+
"platform": "web",
|
|
6
|
+
"componentName": "Button",
|
|
7
|
+
"package": "@react-spectrum/s2",
|
|
8
|
+
"implementation": "react-spectrum",
|
|
9
|
+
"notes": "declared by another owner"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"platform": "web",
|
|
13
|
+
"componentName": "Button",
|
|
14
|
+
"importPath": "@adobe/spectrum-wc/components/button",
|
|
15
|
+
"notes": "Spectrum 2 web component custom element: swc-button."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"platform": "web",
|
|
19
|
+
"componentName": "Button",
|
|
20
|
+
"package": "@react-spectrum/s2",
|
|
21
|
+
"implementation": "web-components",
|
|
22
|
+
"notes": "web-components row with the same package"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "button",
|
|
3
|
+
"implementations": [
|
|
4
|
+
{
|
|
5
|
+
"platform": "web",
|
|
6
|
+
"componentName": "Button",
|
|
7
|
+
"package": "@react-spectrum/s2",
|
|
8
|
+
"implementation": "react-spectrum",
|
|
9
|
+
"notes": "declared by another owner"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"platform": "web",
|
|
13
|
+
"componentName": "Button",
|
|
14
|
+
"package": "@react-spectrum/s2",
|
|
15
|
+
"notes": "web-components row with the same package"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/conformance/manifest-extensions/valid/implementations-upsert-foundation-row/expected.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"implementations": {
|
|
3
|
+
"button": [
|
|
4
|
+
{
|
|
5
|
+
"platform": "web",
|
|
6
|
+
"componentName": "Button",
|
|
7
|
+
"package": "@react-spectrum/s2"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"platform": "web",
|
|
11
|
+
"componentName": "Button",
|
|
12
|
+
"package": "@adobe/spectrum-wc",
|
|
13
|
+
"importPath": "@adobe/spectrum-wc/components/button",
|
|
14
|
+
"notes": "Custom element: swc-button.",
|
|
15
|
+
"implementation": "web-components"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|