@adobe/spectrum-tokens 14.2.2 → 14.2.3

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,11 @@
1
1
  # [**@adobe/spectrum-tokens**](https://github.com/adobe/spectrum-design-data)
2
2
 
3
+ ## 14.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#747](https://github.com/adobe/spectrum-design-data/pull/747) [`80b1637`](https://github.com/adobe/spectrum-design-data/commit/80b163712ae7ac42b9892b0fd4001b1bb27ba1ac) Thanks [@GarthDB](https://github.com/GarthDB)! - fix(tokens): restore ./dist/\* subpath export for backward compatibility
8
+
3
9
  ## 14.2.2
4
10
 
5
11
  ### Patch Changes
package/moon.yml CHANGED
@@ -16,14 +16,8 @@ fileGroups:
16
16
  - "test/**/*"
17
17
  tasks:
18
18
  validateDesignData:
19
- command: cargo
19
+ command: ../../sdk/target/debug/design-data
20
20
  args:
21
- - run
22
- - --manifest-path
23
- - ../../sdk/Cargo.toml
24
- - --bin
25
- - design-data
26
- - --
27
21
  - validate
28
22
  - ./src
29
23
  - --schema-path
@@ -31,20 +25,16 @@ tasks:
31
25
  - --exceptions-path
32
26
  - ./naming-exceptions.json
33
27
  platform: system
28
+ deps:
29
+ - sdk:build
34
30
  inputs:
35
31
  - "@globs(sources)"
36
32
  - "schemas/**/*.json"
37
33
  - "snapshots/**/*.json"
38
34
  - "naming-exceptions.json"
39
35
  verifyDesignDataSnapshot:
40
- command: cargo
36
+ command: ../../sdk/target/debug/design-data
41
37
  args:
42
- - run
43
- - --manifest-path
44
- - ../../sdk/Cargo.toml
45
- - --bin
46
- - design-data
47
- - --
48
38
  - migrate
49
39
  - verify
50
40
  - ./src
@@ -55,6 +45,8 @@ tasks:
55
45
  - --exceptions-path
56
46
  - ./naming-exceptions.json
57
47
  platform: system
48
+ deps:
49
+ - sdk:build
58
50
  inputs:
59
51
  - "@globs(sources)"
60
52
  - "schemas/**/*.json"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spectrum-tokens",
3
- "version": "14.2.2",
3
+ "version": "14.2.3",
4
4
  "description": "Design tokens for Spectrum, Adobe's design system",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -23,7 +23,8 @@
23
23
  "homepage": "https://github.com/adobe/spectrum-design-data/tree/main/packages/tokens#readme",
24
24
  "exports": {
25
25
  ".": "./index.js",
26
- "./schemas/token-file.json": "./schemas/token-file.json"
26
+ "./schemas/token-file.json": "./schemas/token-file.json",
27
+ "./dist/*": "./dist/*"
27
28
  },
28
29
  "devDependencies": {
29
30
  "ajv": "^8.17.1",
@@ -0,0 +1,72 @@
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
+ import test from "ava";
14
+ import { access, readFile } from "fs/promises";
15
+ import { fileURLToPath } from "url";
16
+ import path from "path";
17
+
18
+ const packageJsonPath = fileURLToPath(
19
+ new URL("../package.json", import.meta.url),
20
+ );
21
+ const pkgDir = path.dirname(packageJsonPath);
22
+
23
+ /**
24
+ * Resolve a subpath like ./dist/json/variables.json against the
25
+ * "./dist/*" -> "./dist/*" export pattern (Node replaces * with the suffix).
26
+ */
27
+ function resolveDistStarSubpath(request) {
28
+ if (!request.startsWith("./dist/")) {
29
+ return null;
30
+ }
31
+ const suffix = request.slice("./dist/".length);
32
+ return `./dist/${suffix}`;
33
+ }
34
+
35
+ test("package.json exports preserve backward-compatible entry points", async (t) => {
36
+ const pkg = JSON.parse(await readFile(packageJsonPath, { encoding: "utf8" }));
37
+ const { exports } = pkg;
38
+
39
+ t.truthy(exports, "exports field must be defined");
40
+ t.is(exports["."], "./index.js", "main entry export");
41
+ t.is(
42
+ exports["./schemas/token-file.json"],
43
+ "./schemas/token-file.json",
44
+ "token-file schema export",
45
+ );
46
+ t.is(
47
+ exports["./dist/*"],
48
+ "./dist/*",
49
+ "dist wildcard export required for @adobe/spectrum-tokens/dist/json/variables.json",
50
+ );
51
+ });
52
+
53
+ test("dist/json/variables.json maps through ./dist/* export and exists after build", async (t) => {
54
+ const pkg = JSON.parse(await readFile(packageJsonPath, { encoding: "utf8" }));
55
+ const { exports } = pkg;
56
+
57
+ t.is(exports["./dist/*"], "./dist/*");
58
+
59
+ const consumerSubpath = "./dist/json/variables.json";
60
+ const resolvedTarget = resolveDistStarSubpath(consumerSubpath);
61
+ t.is(
62
+ resolvedTarget,
63
+ "./dist/json/variables.json",
64
+ "subpath should map to dist/json/variables.json under ./dist/* pattern",
65
+ );
66
+
67
+ const absolutePath = path.join(pkgDir, "dist/json/variables.json");
68
+ await t.notThrowsAsync(
69
+ async () => access(absolutePath),
70
+ "dist/json/variables.json must exist (buildTokens runs before test)",
71
+ );
72
+ });