@adobe/spectrum-tokens 12.24.1 → 12.25.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @adobe/spectrum-tokens
2
2
 
3
+ ## 12.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`413ef5a`](https://github.com/adobe/spectrum-tokens/commit/413ef5adad9083b7e133cc867e0436a879004ec8) Thanks [@GarthDB](https://github.com/GarthDB)! - Added `private` metadata to global tokens.
8
+
3
9
  ## 12.24.1
4
10
 
5
11
  ### Patch Changes
package/index.js ADDED
@@ -0,0 +1,52 @@
1
+ /*
2
+ Copyright 2024 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 { glob } from "glob";
14
+
15
+ import { resolve } from "path";
16
+ import { readFile } from "fs/promises";
17
+ import * as url from "url";
18
+ import { writeFile } from "fs/promises";
19
+ import { format } from "prettier";
20
+
21
+ export const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
22
+
23
+ export const tokenFileNames = await glob(
24
+ `${resolve(__dirname, "./src")}/**/*.json`,
25
+ );
26
+
27
+ export const readJson = async (fileName) =>
28
+ JSON.parse(await readFile(fileName, "utf8"));
29
+
30
+ export const writeJson = async (fileName, jsonData) => {
31
+ await writeFile(
32
+ fileName,
33
+ await format(JSON.stringify(jsonData), { parser: "json-stringify" }),
34
+ );
35
+ };
36
+
37
+ export const getFileTokens = async (tokenFileName) =>
38
+ await readJson(resolve(__dirname, "src", tokenFileName));
39
+
40
+ export const getAllTokens = async () => {
41
+ return await Promise.all(tokenFileNames.map(getFileTokens)).then(
42
+ (tokenFileDataAr) => {
43
+ return tokenFileDataAr.reduce(
44
+ (tokenDataAcc, tokenFileData) => ({
45
+ ...tokenDataAcc,
46
+ ...tokenFileData,
47
+ }),
48
+ {},
49
+ );
50
+ },
51
+ );
52
+ };
package/moon.yml CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023 Adobe. All rights reserved.
1
+ # Copyright 2024 Adobe. All rights reserved.
2
2
  # This file is licensed to you under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License. You may obtain a copy
4
4
  # of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -7,6 +7,7 @@
7
7
  # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
8
8
  # OF ANY KIND, either express or implied. See the License for the specific language
9
9
  # governing permissions and limitations under the License.
10
+ $schema: "https://moonrepo.dev/schemas/project.json"
10
11
  type: library
11
12
  fileGroups:
12
13
  sources:
@@ -54,7 +55,7 @@ tasks:
54
55
  platform: node
55
56
  test:
56
57
  command:
57
- - npx
58
+ - pnpm
58
59
  - ava
59
60
  inputs:
60
61
  - "tasks/**/*"
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@adobe/spectrum-tokens",
3
- "version": "12.24.1",
3
+ "version": "12.25.0",
4
4
  "description": "Design tokens for Spectrum, Adobe's design system",
5
5
  "type": "module",
6
- "main": "tasks/buildSpectrumTokens.js",
6
+ "main": "index.js",
7
7
  "tokens": "dist/json/variables.json",
8
8
  "repository": {
9
9
  "type": "git",
@@ -23,12 +23,13 @@
23
23
  "homepage": "https://github.com/adobe/spectrum-tokens/tree/main/packages/tokens#readme",
24
24
  "devDependencies": {
25
25
  "ajv": "^8.12.0",
26
- "ajv-formats": "^2.1.1",
26
+ "ajv-formats": "^3.0.1",
27
27
  "deep-object-diff": "^1.1.9",
28
- "glob": "^10.3.3",
29
- "style-dictionary": "^3.8.0",
28
+ "find-duplicated-property-keys": "^1.2.9",
29
+ "glob": "^10.3.12",
30
+ "style-dictionary": "^3.9.2",
30
31
  "style-dictionary-sets": "^2.3.0",
31
- "tar": "^6.1.15",
32
+ "tar": "^7.0.1",
32
33
  "tmp-promise": "^3.0.3"
33
34
  },
34
35
  "scripts": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^\\{(\\w|-)*\\}$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -70,6 +70,7 @@
70
70
  ]
71
71
  },
72
72
  "component": {},
73
+ "private": {},
73
74
  "deprecated": {},
74
75
  "deprecated_comment": {},
75
76
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^rgba\\((([0-1]?[0-9]?[0-9]?|2[0-4][0-9]|25[0-5]),\\s?){3}(0|1|0?\\.\\d+)\\)|rgb\\(([0-1]?[0-9]?[0-9]?|2[0-4][0-9]|25[0-5]){1,3}(,\\s?\\d{1,3}%?){2}\\)$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^(?:-?((?:\\d+\\.?\\d*)|(?:\\.?\\d+))(px|rem|em|%))|0|\\d+dp$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^(?:\"?\\w+\"? ?,? ?)*\"?\\w+\"?$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^(?:-?((?:\\d+\\.?\\d*)|(?:\\.?\\d+))(px|rem|em))$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "enum": ["italic", "normal"]
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "enum": ["light", "regular", "medium", "bold", "extra-bold", "black"]
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^(?:\\d+\\.?\\d*)|(?:\\.?\\d+)$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^(?:\\d+(?:\\.\\d)+%)|(?:1|0)(?:\\.0)?|0?\\.\\d*$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -46,6 +46,7 @@
46
46
  "required": ["mobile", "desktop"]
47
47
  },
48
48
  "component": {},
49
+ "private": {},
49
50
  "deprecated": {},
50
51
  "deprecated_comment": {},
51
52
  "uuid": {}
@@ -74,6 +74,7 @@
74
74
  ]
75
75
  },
76
76
  "component": {},
77
+ "private": {},
77
78
  "deprecated": {},
78
79
  "deprecated_comment": {},
79
80
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "enum": ["uppercase", "lowercase", "capitalize", "none"]
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -11,8 +11,13 @@
11
11
  "component": {
12
12
  "type": "string"
13
13
  },
14
+ "private": {
15
+ "type": "boolean",
16
+ "default": false
17
+ },
14
18
  "deprecated": {
15
- "type": "boolean"
19
+ "type": "boolean",
20
+ "default": false
16
21
  },
17
22
  "deprecated_comment": {
18
23
  "type": "string"