@adobe/spectrum-tokens 14.13.0 → 14.13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # [**@adobe/spectrum-tokens**](https://github.com/adobe/spectrum-design-data)
2
2
 
3
+ ## 14.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+ - **packages/tokens/package.json**: re-add `./src/*` to `exports`; dropped when the
9
+ strict allowlist landed in #740, only `./dist/*` was restored in #747, breaking
10
+ `@adobe/spectrum-tokens/src/*.json` imports for raw-source-JSON consumers.
11
+
3
12
  ## 14.13.0
4
13
 
5
14
  ### Minor Changes
@@ -20,7 +29,6 @@
20
29
  **New Branch:** `f84bce21`
21
30
 
22
31
  <details open><summary><strong>Added (9)</strong></summary>
23
-
24
32
  - `group-gap-extra-large-spacious`
25
33
  - `group-gap-extra-small-spacious`
26
34
  - `group-gap-large-spacious`
@@ -35,7 +43,6 @@
35
43
  ### Updated (15)
36
44
 
37
45
  <details open><summary><strong>Added Properties (5)</strong></summary>
38
-
39
46
  - `base-padding-horizontal-2x-large`
40
47
  - `desktop.schema`: `dimension.json`
41
48
  - `desktop.value`: `18px`
package/moon.yml CHANGED
@@ -24,7 +24,7 @@ tasks:
24
24
  - ./schemas
25
25
  - --exceptions-path
26
26
  - ./naming-exceptions.json
27
- platform: system
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
- platform: system
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
- local: true
85
- platform: system
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
- platform: system
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
- platform: system
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
- local: true
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.0",
3
+ "version": "14.13.1",
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": {
@@ -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) => {