@adobe/spectrum-tokens 14.13.0 → 14.13.2
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/CHANGELOG.md +49 -3
- package/dist/json/drover.json +6 -6
- package/dist/json/variables.json +6 -6
- package/moon.yml +8 -11
- package/package.json +2 -1
- package/src/layout.json +13 -13
- package/test/packageContents.test.js +146 -0
- package/test/packageExports.test.js +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# [**@adobe/spectrum-tokens**](https://github.com/adobe/spectrum-design-data)
|
|
2
2
|
|
|
3
|
+
## 14.13.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1186](https://github.com/adobe/spectrum-design-data/pull/1186) [`dcf0832`](https://github.com/adobe/spectrum-design-data/commit/dcf083214d56989817db192801638e3ec20e2306) Thanks [@mrcjhicks](https://github.com/mrcjhicks)! - ## Token sync from Spectrum Tokens Studio
|
|
8
|
+
|
|
9
|
+
**Original implementer:** @NateBaldwinDesign
|
|
10
|
+
|
|
11
|
+
### Design motivation
|
|
12
|
+
|
|
13
|
+
Web Design / Figma Arch teams agree to revert recent updates to component heights for small and extra small sizes back to their original height values in S2 (prior to layout token refactor)
|
|
14
|
+
|
|
15
|
+
| Size | Current | Update (this PR) |
|
|
16
|
+
| ----------- | ------- | ---------------- |
|
|
17
|
+
| Small | 26px | 24px |
|
|
18
|
+
| Extra small | 22px | 20px |
|
|
19
|
+
|
|
20
|
+
### Token changes
|
|
21
|
+
|
|
22
|
+
## Tokens Changed (4)
|
|
23
|
+
|
|
24
|
+
**Original Branch:** `main`
|
|
25
|
+
**New Branch:** `tokens-sync/patch-spectrum2-from-main`
|
|
26
|
+
|
|
27
|
+
### Updated (4)
|
|
28
|
+
|
|
29
|
+
<details open><summary><strong>Updated Properties (4)</strong></summary>
|
|
30
|
+
- `accessory-gap-extra-small`
|
|
31
|
+
- `value`: `4px` -> `3px`
|
|
32
|
+
- `accessory-gap-small`
|
|
33
|
+
- `value`: `5px` -> `4px`
|
|
34
|
+
- `base-padding-vertical-extra-small`
|
|
35
|
+
- `value`: `4px` -> `3px`
|
|
36
|
+
- `base-padding-vertical-small` - `value`: `5px` -> `4px`
|
|
37
|
+
</details>
|
|
38
|
+
|
|
39
|
+
### References
|
|
40
|
+
- Tokens Studio PR: https://github.com/adobe/spectrum-tokens-studio-data/pull/312
|
|
41
|
+
- Spectrum Tokens PR: https://github.com/adobe/spectrum-design-data/pull/1186
|
|
42
|
+
|
|
43
|
+
## 14.13.1
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- [#1185](https://github.com/adobe/spectrum-design-data/pull/1185) [`eac1cb3`](https://github.com/adobe/spectrum-design-data/commit/eac1cb3121eda40c929e333f1375c75895244882) Thanks [@GarthDB](https://github.com/GarthDB)! - Restore the `./src/*` subpath export for @adobe/spectrum-tokens.
|
|
48
|
+
- **packages/tokens/package.json**: re-add `./src/*` to `exports`; dropped when the
|
|
49
|
+
strict allowlist landed in #740, only `./dist/*` was restored in #747, breaking
|
|
50
|
+
`@adobe/spectrum-tokens/src/*.json` imports for raw-source-JSON consumers.
|
|
51
|
+
|
|
3
52
|
## 14.13.0
|
|
4
53
|
|
|
5
54
|
### Minor Changes
|
|
@@ -20,7 +69,6 @@
|
|
|
20
69
|
**New Branch:** `f84bce21`
|
|
21
70
|
|
|
22
71
|
<details open><summary><strong>Added (9)</strong></summary>
|
|
23
|
-
|
|
24
72
|
- `group-gap-extra-large-spacious`
|
|
25
73
|
- `group-gap-extra-small-spacious`
|
|
26
74
|
- `group-gap-large-spacious`
|
|
@@ -35,7 +83,6 @@
|
|
|
35
83
|
### Updated (15)
|
|
36
84
|
|
|
37
85
|
<details open><summary><strong>Added Properties (5)</strong></summary>
|
|
38
|
-
|
|
39
86
|
- `base-padding-horizontal-2x-large`
|
|
40
87
|
- `desktop.schema`: `dimension.json`
|
|
41
88
|
- `desktop.value`: `18px`
|
|
@@ -67,7 +114,6 @@
|
|
|
67
114
|
- `base-padding-horizontal-small` - `desktop.schema`: `dimension.json` - `desktop.value`: `10px` - `desktop.uuid`: `ba072414-2cdd-4773-86a5-11ca47c08e23` - `mobile.schema`: `dimension.json` - `mobile.value`: `8px` - `mobile.uuid`: `6b43633d-8f29-4c24-b26e-687d6f161bce`
|
|
68
115
|
</details>
|
|
69
116
|
<details open><summary><strong>Deleted Properties (5)</strong></summary>
|
|
70
|
-
|
|
71
117
|
- `base-padding-horizontal-2x-large`
|
|
72
118
|
- `value`: -> `14px`
|
|
73
119
|
- `base-padding-horizontal-extra-large`
|
package/dist/json/drover.json
CHANGED
|
@@ -1638,10 +1638,10 @@
|
|
|
1638
1638
|
"accessory-gap-affixed-medium": "4px",
|
|
1639
1639
|
"accessory-gap-affixed-small": "3px",
|
|
1640
1640
|
"accessory-gap-extra-large": "8px",
|
|
1641
|
-
"accessory-gap-extra-small": "
|
|
1641
|
+
"accessory-gap-extra-small": "3px",
|
|
1642
1642
|
"accessory-gap-large": "7px",
|
|
1643
1643
|
"accessory-gap-medium": "6px",
|
|
1644
|
-
"accessory-gap-small": "
|
|
1644
|
+
"accessory-gap-small": "4px",
|
|
1645
1645
|
"accessory-item-padding-2x-small": "2px",
|
|
1646
1646
|
"accessory-item-padding-extra-large": "9px",
|
|
1647
1647
|
"accessory-item-padding-extra-small": "3px",
|
|
@@ -1808,18 +1808,18 @@
|
|
|
1808
1808
|
"base-padding-horizontal-uniform-2x-large": "15px",
|
|
1809
1809
|
"base-padding-horizontal-uniform-2x-small": "2px",
|
|
1810
1810
|
"base-padding-horizontal-uniform-extra-large": "13px",
|
|
1811
|
-
"base-padding-horizontal-uniform-extra-small": "
|
|
1811
|
+
"base-padding-horizontal-uniform-extra-small": "3px",
|
|
1812
1812
|
"base-padding-horizontal-uniform-large": "10px",
|
|
1813
1813
|
"base-padding-horizontal-uniform-medium": "7px",
|
|
1814
|
-
"base-padding-horizontal-uniform-small": "
|
|
1814
|
+
"base-padding-horizontal-uniform-small": "4px",
|
|
1815
1815
|
"base-padding-vertical-2x-large": "15px",
|
|
1816
1816
|
"base-padding-vertical-2x-small": "2px",
|
|
1817
1817
|
"base-padding-vertical-3x-large": "19px",
|
|
1818
1818
|
"base-padding-vertical-extra-large": "13px",
|
|
1819
|
-
"base-padding-vertical-extra-small": "
|
|
1819
|
+
"base-padding-vertical-extra-small": "3px",
|
|
1820
1820
|
"base-padding-vertical-large": "10px",
|
|
1821
1821
|
"base-padding-vertical-medium": "7px",
|
|
1822
|
-
"base-padding-vertical-small": "
|
|
1822
|
+
"base-padding-vertical-small": "4px",
|
|
1823
1823
|
"body-cjk-line-height": 1.7,
|
|
1824
1824
|
"body-cjk-size-l": "16px",
|
|
1825
1825
|
"body-cjk-size-m": "14px",
|
package/dist/json/variables.json
CHANGED
|
@@ -28153,7 +28153,7 @@
|
|
|
28153
28153
|
"uuid": "ae4398f5-6ead-4928-adf9-f39c0cfcec11"
|
|
28154
28154
|
},
|
|
28155
28155
|
"accessory-gap-extra-small": {
|
|
28156
|
-
"value": "
|
|
28156
|
+
"value": "3px",
|
|
28157
28157
|
"uuid": "c4071c28-33df-4461-a05c-2a1b1c295d5e"
|
|
28158
28158
|
},
|
|
28159
28159
|
"accessory-gap-large": {
|
|
@@ -28165,7 +28165,7 @@
|
|
|
28165
28165
|
"uuid": "627d972a-4164-4ec6-8c64-0ee97c23fc43"
|
|
28166
28166
|
},
|
|
28167
28167
|
"accessory-gap-small": {
|
|
28168
|
-
"value": "
|
|
28168
|
+
"value": "4px",
|
|
28169
28169
|
"uuid": "843d1518-7aa6-4d60-968e-b71ebbfcd88e"
|
|
28170
28170
|
},
|
|
28171
28171
|
"accessory-item-padding-2x-small": {
|
|
@@ -28334,7 +28334,7 @@
|
|
|
28334
28334
|
},
|
|
28335
28335
|
"base-padding-horizontal-uniform-extra-small": {
|
|
28336
28336
|
"ref": "{base-padding-vertical-extra-small}",
|
|
28337
|
-
"value": "
|
|
28337
|
+
"value": "3px",
|
|
28338
28338
|
"uuid": "337ce5da-d735-4930-a9c8-9fecf4dcb9b0"
|
|
28339
28339
|
},
|
|
28340
28340
|
"base-padding-horizontal-uniform-large": {
|
|
@@ -28349,7 +28349,7 @@
|
|
|
28349
28349
|
},
|
|
28350
28350
|
"base-padding-horizontal-uniform-small": {
|
|
28351
28351
|
"ref": "{base-padding-vertical-small}",
|
|
28352
|
-
"value": "
|
|
28352
|
+
"value": "4px",
|
|
28353
28353
|
"uuid": "3c42cb65-d84e-4cfd-bf17-e9f21ce17b7e"
|
|
28354
28354
|
},
|
|
28355
28355
|
"base-padding-vertical-2x-large": {
|
|
@@ -28369,7 +28369,7 @@
|
|
|
28369
28369
|
"uuid": "62ea5f0e-3cb5-4535-8cd1-a7f30ba932fc"
|
|
28370
28370
|
},
|
|
28371
28371
|
"base-padding-vertical-extra-small": {
|
|
28372
|
-
"value": "
|
|
28372
|
+
"value": "3px",
|
|
28373
28373
|
"uuid": "e4437bc9-3acf-4bb5-9dab-39157a0d5e47"
|
|
28374
28374
|
},
|
|
28375
28375
|
"base-padding-vertical-large": {
|
|
@@ -28381,7 +28381,7 @@
|
|
|
28381
28381
|
"uuid": "5741f832-f012-45bc-9e87-6e07ab2cb87f"
|
|
28382
28382
|
},
|
|
28383
28383
|
"base-padding-vertical-small": {
|
|
28384
|
-
"value": "
|
|
28384
|
+
"value": "4px",
|
|
28385
28385
|
"uuid": "80b4ea6a-2f97-4d23-9256-61e30ed07f4d"
|
|
28386
28386
|
},
|
|
28387
28387
|
"border-width-100": {
|
package/moon.yml
CHANGED
|
@@ -24,7 +24,7 @@ tasks:
|
|
|
24
24
|
- ./schemas
|
|
25
25
|
- --exceptions-path
|
|
26
26
|
- ./naming-exceptions.json
|
|
27
|
-
|
|
27
|
+
toolchain: "system"
|
|
28
28
|
deps:
|
|
29
29
|
- sdk:build
|
|
30
30
|
inputs:
|
|
@@ -44,7 +44,7 @@ tasks:
|
|
|
44
44
|
- ./schemas
|
|
45
45
|
- --exceptions-path
|
|
46
46
|
- ./naming-exceptions.json
|
|
47
|
-
|
|
47
|
+
toolchain: "system"
|
|
48
48
|
deps:
|
|
49
49
|
- sdk:build
|
|
50
50
|
inputs:
|
|
@@ -60,7 +60,6 @@ tasks:
|
|
|
60
60
|
command:
|
|
61
61
|
- node
|
|
62
62
|
- tasks/buildSpectrumTokens.js
|
|
63
|
-
platform: node
|
|
64
63
|
inputs:
|
|
65
64
|
- "tasks/buildSpectrumTokens.js"
|
|
66
65
|
- "@globs(sources)"
|
|
@@ -70,7 +69,6 @@ tasks:
|
|
|
70
69
|
command:
|
|
71
70
|
- node
|
|
72
71
|
- tasks/buildManifest.js
|
|
73
|
-
platform: node
|
|
74
72
|
inputs:
|
|
75
73
|
- "tasks/buildManifest.js"
|
|
76
74
|
- "@globs(sources)"
|
|
@@ -81,15 +79,16 @@ tasks:
|
|
|
81
79
|
- rm
|
|
82
80
|
- -rf
|
|
83
81
|
- dist
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
toolchain: "system"
|
|
83
|
+
options:
|
|
84
|
+
runInCI: false
|
|
86
85
|
verifyLegacyRoundtrip:
|
|
87
86
|
command: ../../sdk/target/debug/design-data
|
|
88
87
|
args:
|
|
89
88
|
- migrate
|
|
90
89
|
- roundtrip-verify
|
|
91
90
|
- ./src
|
|
92
|
-
|
|
91
|
+
toolchain: "system"
|
|
93
92
|
deps:
|
|
94
93
|
- sdk:build
|
|
95
94
|
inputs:
|
|
@@ -102,7 +101,7 @@ tasks:
|
|
|
102
101
|
- ../design-data/tokens
|
|
103
102
|
- --reference
|
|
104
103
|
- ./src
|
|
105
|
-
|
|
104
|
+
toolchain: "system"
|
|
106
105
|
deps:
|
|
107
106
|
- sdk:build
|
|
108
107
|
inputs:
|
|
@@ -122,10 +121,8 @@ tasks:
|
|
|
122
121
|
- ~:verifyDesignDataSnapshot
|
|
123
122
|
- ~:verifyLegacyRoundtrip
|
|
124
123
|
- ~:verifyLegacyOutput
|
|
125
|
-
platform: node
|
|
126
124
|
test-watch:
|
|
127
125
|
command:
|
|
128
126
|
- ava
|
|
129
127
|
- --watch
|
|
130
|
-
|
|
131
|
-
platform: node
|
|
128
|
+
preset: "server"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spectrum-tokens",
|
|
3
|
-
"version": "14.13.
|
|
3
|
+
"version": "14.13.2",
|
|
4
4
|
"description": "Design tokens for Spectrum, Adobe's design system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"exports": {
|
|
25
25
|
".": "./index.js",
|
|
26
26
|
"./schemas/token-file.json": "./schemas/token-file.json",
|
|
27
|
+
"./src/*": "./src/*",
|
|
27
28
|
"./dist/*": "./dist/*"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
package/src/layout.json
CHANGED
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
},
|
|
50
50
|
"accessory-gap-extra-small": {
|
|
51
51
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/dimension.json",
|
|
52
|
-
"value": "
|
|
53
|
-
"
|
|
54
|
-
"
|
|
52
|
+
"value": "3px",
|
|
53
|
+
"description": "Spacing between child elements for accessory elements at extra-small size",
|
|
54
|
+
"uuid": "c4071c28-33df-4461-a05c-2a1b1c295d5e"
|
|
55
55
|
},
|
|
56
56
|
"accessory-gap-large": {
|
|
57
57
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/dimension.json",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
},
|
|
68
68
|
"accessory-gap-small": {
|
|
69
69
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/dimension.json",
|
|
70
|
-
"value": "
|
|
71
|
-
"
|
|
72
|
-
"
|
|
70
|
+
"value": "4px",
|
|
71
|
+
"description": "Spacing between child elements for accessory elements at small size",
|
|
72
|
+
"uuid": "843d1518-7aa6-4d60-968e-b71ebbfcd88e"
|
|
73
73
|
},
|
|
74
74
|
"accessory-item-padding-2x-small": {
|
|
75
75
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/dimension.json",
|
|
@@ -349,9 +349,9 @@
|
|
|
349
349
|
},
|
|
350
350
|
"base-padding-vertical-extra-small": {
|
|
351
351
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/dimension.json",
|
|
352
|
-
"value": "
|
|
353
|
-
"
|
|
354
|
-
"
|
|
352
|
+
"value": "3px",
|
|
353
|
+
"description": "Vertical internal spacing for base UI elements at extra-small size",
|
|
354
|
+
"uuid": "e4437bc9-3acf-4bb5-9dab-39157a0d5e47"
|
|
355
355
|
},
|
|
356
356
|
"base-padding-vertical-large": {
|
|
357
357
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/dimension.json",
|
|
@@ -367,9 +367,9 @@
|
|
|
367
367
|
},
|
|
368
368
|
"base-padding-vertical-small": {
|
|
369
369
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/dimension.json",
|
|
370
|
-
"value": "
|
|
371
|
-
"
|
|
372
|
-
"
|
|
370
|
+
"value": "4px",
|
|
371
|
+
"description": "Vertical internal spacing for base UI elements at small size",
|
|
372
|
+
"uuid": "80b4ea6a-2f97-4d23-9256-61e30ed07f4d"
|
|
373
373
|
},
|
|
374
374
|
"border-width-100": {
|
|
375
375
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/dimension.json",
|
|
@@ -4067,4 +4067,4 @@
|
|
|
4067
4067
|
}
|
|
4068
4068
|
}
|
|
4069
4069
|
}
|
|
4070
|
-
}
|
|
4070
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2026 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Asserts that the pnpm-published tarball for @adobe/spectrum-tokens contains every
|
|
15
|
+
* file that consumers depend on. Uses `pnpm pack --json` rather than plain
|
|
16
|
+
* filesystem checks so the test honours `files`, `.npmignore`, and npm defaults —
|
|
17
|
+
* the same rules that govern what actually gets published.
|
|
18
|
+
*
|
|
19
|
+
* pnpm is used (not npm) per the project's pnpm-only mandate. pnpm 10 supports
|
|
20
|
+
* --json on pack and produces the same file-list structure. Note: pnpm has no
|
|
21
|
+
* --dry-run flag but does write a tarball to disk; the tarball is cleaned up after.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import test from "ava";
|
|
25
|
+
import { execFileSync } from "child_process";
|
|
26
|
+
import { readFile, rm } from "fs/promises";
|
|
27
|
+
import { fileURLToPath } from "url";
|
|
28
|
+
import path from "path";
|
|
29
|
+
|
|
30
|
+
const pkgDir = path.dirname(
|
|
31
|
+
fileURLToPath(new URL("../package.json", import.meta.url)),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Run `pnpm pack --json` and return the Set of packed file paths.
|
|
36
|
+
* Cleans up the written tarball afterward. Result is shared across all tests
|
|
37
|
+
* in this module via a module-level Promise.
|
|
38
|
+
*/
|
|
39
|
+
const packedFilesPromise = (async () => {
|
|
40
|
+
const raw = execFileSync("pnpm", ["pack", "--json"], {
|
|
41
|
+
cwd: pkgDir,
|
|
42
|
+
encoding: "utf8",
|
|
43
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
44
|
+
});
|
|
45
|
+
const result = JSON.parse(raw);
|
|
46
|
+
// Clean up the tarball pnpm wrote to disk.
|
|
47
|
+
if (result.filename) {
|
|
48
|
+
await rm(path.join(pkgDir, result.filename), { force: true });
|
|
49
|
+
}
|
|
50
|
+
const files = result.files.map((f) => f.path);
|
|
51
|
+
return new Set(files);
|
|
52
|
+
})();
|
|
53
|
+
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
// Explicit required files
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
const requiredFiles = [
|
|
59
|
+
"index.js",
|
|
60
|
+
"package.json",
|
|
61
|
+
"manifest.json",
|
|
62
|
+
"dist/json/variables.json",
|
|
63
|
+
"schemas/token-file.json",
|
|
64
|
+
"README.md",
|
|
65
|
+
"LICENSE",
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
test("packed tarball includes all explicitly required files", async (t) => {
|
|
69
|
+
const packed = await packedFilesPromise;
|
|
70
|
+
const missing = requiredFiles.filter((f) => !packed.has(f));
|
|
71
|
+
t.deepEqual(
|
|
72
|
+
missing,
|
|
73
|
+
[],
|
|
74
|
+
`Missing from published tarball: ${missing.join(", ")}`,
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
// All src/ token files (derived from manifest.json, not hardcoded)
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
test("packed tarball includes every src/ token file listed in manifest.json", async (t) => {
|
|
83
|
+
const [packed, manifest] = await Promise.all([
|
|
84
|
+
packedFilesPromise,
|
|
85
|
+
readFile(path.join(pkgDir, "manifest.json"), "utf8").then(JSON.parse),
|
|
86
|
+
]);
|
|
87
|
+
|
|
88
|
+
// manifest.json entries look like "src/color-palette.json"
|
|
89
|
+
const missing = manifest.filter((f) => !packed.has(f));
|
|
90
|
+
t.deepEqual(
|
|
91
|
+
missing,
|
|
92
|
+
[],
|
|
93
|
+
`src/ files in manifest.json missing from tarball: ${missing.join(", ")}`,
|
|
94
|
+
);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
// Self-maintaining: every exports / main / tokens target must be packed
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
|
|
101
|
+
test("packed tarball satisfies every exports, main, and tokens target in package.json", async (t) => {
|
|
102
|
+
const [packed, pkg] = await Promise.all([
|
|
103
|
+
packedFilesPromise,
|
|
104
|
+
readFile(path.join(pkgDir, "package.json"), "utf8").then(JSON.parse),
|
|
105
|
+
]);
|
|
106
|
+
|
|
107
|
+
const failures = [];
|
|
108
|
+
|
|
109
|
+
// Strip leading "./" and check or prefix-match against packed paths.
|
|
110
|
+
const toRelative = (target) => target.replace(/^\.\//, "");
|
|
111
|
+
|
|
112
|
+
const checkTarget = (fieldName, target) => {
|
|
113
|
+
const rel = toRelative(target);
|
|
114
|
+
if (rel.endsWith("*")) {
|
|
115
|
+
// Wildcard: at least one packed file must share the prefix.
|
|
116
|
+
const prefix = rel.slice(0, -1); // e.g. "src/" or "dist/"
|
|
117
|
+
if (![...packed].some((p) => p.startsWith(prefix))) {
|
|
118
|
+
failures.push(`${fieldName}: no packed files match prefix "${prefix}"`);
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
if (!packed.has(rel)) {
|
|
122
|
+
failures.push(`${fieldName}: "${rel}" not in packed tarball`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// exports map
|
|
128
|
+
if (pkg.exports) {
|
|
129
|
+
for (const [subpath, target] of Object.entries(pkg.exports)) {
|
|
130
|
+
checkTarget(`exports["${subpath}"]`, target);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// main (e.g. "./index.js")
|
|
135
|
+
if (pkg.main) {
|
|
136
|
+
checkTarget("main", pkg.main);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// tokens (e.g. "dist/json/variables.json")
|
|
140
|
+
if (pkg.tokens) {
|
|
141
|
+
const target = pkg.tokens.startsWith("./") ? pkg.tokens : `./${pkg.tokens}`;
|
|
142
|
+
checkTarget("tokens", target);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
t.deepEqual(failures, [], failures.join("\n"));
|
|
146
|
+
});
|
|
@@ -48,6 +48,19 @@ test("package.json exports preserve backward-compatible entry points", async (t)
|
|
|
48
48
|
"./dist/*",
|
|
49
49
|
"dist wildcard export required for @adobe/spectrum-tokens/dist/json/variables.json",
|
|
50
50
|
);
|
|
51
|
+
t.is(
|
|
52
|
+
exports["./src/*"],
|
|
53
|
+
"./src/*",
|
|
54
|
+
"src wildcard export required for @adobe/spectrum-tokens/src/*.json",
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("src/color-palette.json maps through ./src/* export and exists", async (t) => {
|
|
59
|
+
const absolutePath = path.join(pkgDir, "src/color-palette.json");
|
|
60
|
+
await t.notThrowsAsync(
|
|
61
|
+
async () => access(absolutePath),
|
|
62
|
+
"src/color-palette.json must exist in the package",
|
|
63
|
+
);
|
|
51
64
|
});
|
|
52
65
|
|
|
53
66
|
test("dist/json/variables.json maps through ./dist/* export and exists after build", async (t) => {
|