style-dictionary 5.0.1 → 5.0.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/README.md +1 -1
- package/examples/advanced/assets-base64-embed/package.json +1 -1
- package/examples/advanced/create-react-app/package.json +2 -2
- package/examples/advanced/create-react-native-app/package.json +1 -1
- package/examples/advanced/custom-parser/package.json +1 -1
- package/examples/advanced/custom-transforms/package.json +1 -1
- package/examples/advanced/font-face-rules/package.json +1 -1
- package/examples/advanced/format-helpers/package.json +1 -1
- package/examples/advanced/matching-build-files/package.json +1 -1
- package/examples/advanced/multi-brand-multi-platform/package.json +1 -1
- package/examples/advanced/node-modules-as-config-and-properties/package.json +1 -1
- package/examples/advanced/npm-module/package.json +1 -1
- package/examples/advanced/referencing_aliasing/package.json +1 -1
- package/examples/advanced/s3/package.json +1 -1
- package/examples/advanced/tailwind-preset/package.json +1 -1
- package/examples/advanced/tokens-deprecation/package.json +1 -1
- package/examples/advanced/transitive-transforms/package.json +1 -1
- package/examples/advanced/variables-in-outputs/package.json +1 -1
- package/examples/advanced/yaml-tokens/package.json +1 -1
- package/lib/StyleDictionary.js +1 -1
- package/lib/cleanFile.d.ts +1 -1
- package/lib/cleanFile.js +3 -0
- package/lib/cleanFiles.d.ts +1 -1
- package/lib/utils/loadFile.js +6 -1
- package/package.json +10 -7
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<pre>
|
|
2
|
-
<a href="https://styledictionary.com/
|
|
2
|
+
<a href="https://styledictionary.com/versions/v4/migration/">What's new in Style Dictionary 4.0!</a>
|
|
3
3
|
</pre>
|
|
4
4
|
|
|
5
5
|
<img src="docs/src/assets/logo.png" alt="Style Dictionary logo and mascot" title=""Pascal"" width="100" align="right" />
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"version": "1.0.0",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"
|
|
7
|
+
"dart-sass": "^1.25.0",
|
|
8
8
|
"react": "^17.0.1",
|
|
9
9
|
"react-dom": "^17.0.1",
|
|
10
10
|
"react-scripts": "^5.0.1",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"eslint-config-react-app": "^7.0.1",
|
|
15
|
-
"style-dictionary": "^5.0.
|
|
15
|
+
"style-dictionary": "^5.0.3"
|
|
16
16
|
},
|
|
17
17
|
"resolutions": {
|
|
18
18
|
"immer": "8.0.1",
|
package/lib/StyleDictionary.js
CHANGED
|
@@ -80,7 +80,7 @@ export default class StyleDictionary extends Register {
|
|
|
80
80
|
// Placeholder is transformed on prepublish -> see scripts/inject-version.js
|
|
81
81
|
// Another option might be import pkg from './package.json' with { "type": "json" } which would work in both browser and node, but support is not there yet.
|
|
82
82
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility
|
|
83
|
-
static VERSION = '5.0.
|
|
83
|
+
static VERSION = '5.0.3';
|
|
84
84
|
|
|
85
85
|
/** @returns {Config} */
|
|
86
86
|
get options() {
|
package/lib/cleanFile.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param {PlatformConfig} [platform]
|
|
7
7
|
* @param {Volume} [vol]
|
|
8
8
|
*/
|
|
9
|
-
export default function cleanFile(file: File, platform?: PlatformConfig, vol?: Volume): Promise<string>;
|
|
9
|
+
export default function cleanFile(file: File, platform?: PlatformConfig, vol?: Volume): Promise<string | undefined>;
|
|
10
10
|
export type Volume = import("../types/Volume.d.ts").Volume;
|
|
11
11
|
export type File = import("../types/File.d.ts").File;
|
|
12
12
|
export type PlatformConfig = import("../types/Config.d.ts").PlatformConfig;
|
package/lib/cleanFile.js
CHANGED
|
@@ -48,6 +48,9 @@ export default async function cleanFile(file, platform = {}, vol = fs) {
|
|
|
48
48
|
let { destination } = file;
|
|
49
49
|
|
|
50
50
|
if (typeof destination !== 'string') throw new Error('Please enter a valid destination');
|
|
51
|
+
if (!destination) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
51
54
|
|
|
52
55
|
// if there is a clean path, prepend the destination with it
|
|
53
56
|
if (platform.buildPath) {
|
package/lib/cleanFiles.d.ts
CHANGED
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
* @param {PlatformConfig} platform
|
|
12
12
|
* @param {Volume} [vol]
|
|
13
13
|
*/
|
|
14
|
-
export default function cleanFiles(platform: PlatformConfig, vol?: Volume): Promise<string[] | undefined>;
|
|
14
|
+
export default function cleanFiles(platform: PlatformConfig, vol?: Volume): Promise<(string | undefined)[] | undefined>;
|
|
15
15
|
export type Volume = import("../types/Volume.d.ts").Volume;
|
|
16
16
|
export type PlatformConfig = import("../types/Config.d.ts").PlatformConfig;
|
package/lib/utils/loadFile.js
CHANGED
|
@@ -35,7 +35,11 @@ export async function loadFile(filePath, vol) {
|
|
|
35
35
|
try {
|
|
36
36
|
file_content = (await import(/* @vite-ignore */ /* webpackIgnore: true */ resolvedPath))
|
|
37
37
|
.default;
|
|
38
|
-
|
|
38
|
+
try {
|
|
39
|
+
file_content = structuredClone(file_content);
|
|
40
|
+
} catch (_e) {
|
|
41
|
+
// cloning may fail if the content is a config with dynamic not cloneable content e.g. Function
|
|
42
|
+
}
|
|
39
43
|
} catch (e) {
|
|
40
44
|
if (e instanceof Error) {
|
|
41
45
|
if ('.ts' === extname(filePath)) {
|
|
@@ -44,6 +48,7 @@ export async function loadFile(filePath, vol) {
|
|
|
44
48
|
|
|
45
49
|
Executing typescript files during runtime is only possible via
|
|
46
50
|
- NodeJS >= 22.6.0 with '--experimental-strip-types' flag
|
|
51
|
+
- NodeJS >= 22.18.0 where type stripping is enabled by default, no flag needed
|
|
47
52
|
- Deno
|
|
48
53
|
- Bun
|
|
49
54
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "style-dictionary",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "Style once, use everywhere. A build system for creating cross-platform styles.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"style dictionary",
|
|
@@ -65,8 +65,7 @@
|
|
|
65
65
|
"test:strip-types": "node --experimental-strip-types __tests__/strip-types-test.js",
|
|
66
66
|
"install-cli": "npm install -g $(npm pack)",
|
|
67
67
|
"release": "npm run build && changeset publish",
|
|
68
|
-
"prepare": "husky install",
|
|
69
|
-
"postinstall": "patch-package",
|
|
68
|
+
"prepare": "husky install && patch-package",
|
|
70
69
|
"version": "changeset version && npm install"
|
|
71
70
|
},
|
|
72
71
|
"lint-staged": {
|
|
@@ -113,18 +112,19 @@
|
|
|
113
112
|
"Joren Broekema <joren.broekema@gmail.com>"
|
|
114
113
|
],
|
|
115
114
|
"homepage": "https://github.com/amzn/style-dictionary",
|
|
115
|
+
"overrides": {
|
|
116
|
+
"tmp": "0.2.5"
|
|
117
|
+
},
|
|
116
118
|
"dependencies": {
|
|
117
119
|
"@bundled-es-modules/deepmerge": "^4.3.1",
|
|
118
|
-
"@bundled-es-modules/glob": "^
|
|
120
|
+
"@bundled-es-modules/glob": "^11.0.3",
|
|
119
121
|
"@bundled-es-modules/memfs": "^4.9.4",
|
|
120
|
-
"@types/node": "^22.10.5",
|
|
121
122
|
"@zip.js/zip.js": "^2.7.44",
|
|
122
123
|
"chalk": "^5.3.0",
|
|
123
124
|
"change-case": "^5.3.0",
|
|
124
125
|
"commander": "^12.1.0",
|
|
125
126
|
"is-plain-obj": "^4.1.0",
|
|
126
127
|
"json5": "^2.2.2",
|
|
127
|
-
"patch-package": "^8.0.0",
|
|
128
128
|
"path-unified": "^0.2.0",
|
|
129
129
|
"prettier": "^3.3.3",
|
|
130
130
|
"tinycolor2": "^1.6.0"
|
|
@@ -140,6 +140,7 @@
|
|
|
140
140
|
"@rollup/plugin-virtual": "^3.0.2",
|
|
141
141
|
"@shoelace-style/shoelace": "^2.15.0",
|
|
142
142
|
"@types/chai": "^4.3.9",
|
|
143
|
+
"@types/node": "^22.10.5",
|
|
143
144
|
"@types/tinycolor2": "^1.4.6",
|
|
144
145
|
"@types/uuid": "^9.0.8",
|
|
145
146
|
"@typescript-eslint/parser": "^8.22.0",
|
|
@@ -147,7 +148,7 @@
|
|
|
147
148
|
"@web/test-runner-commands": "^0.9.0",
|
|
148
149
|
"@web/test-runner-playwright": "^0.11.0",
|
|
149
150
|
"acorn": "^8.11.3",
|
|
150
|
-
"astro": "^5.2
|
|
151
|
+
"astro": "^5.13.2",
|
|
151
152
|
"chai": "^5.0.0-alpha.2",
|
|
152
153
|
"eslint": "^9.19.0",
|
|
153
154
|
"eslint-plugin-mocha": "^10.5.0",
|
|
@@ -167,7 +168,9 @@
|
|
|
167
168
|
"mocha": "^10.2.0",
|
|
168
169
|
"monaco-editor": "^0.47.0",
|
|
169
170
|
"npm-run-all": "^4.1.5",
|
|
171
|
+
"patch-package": "^8.0.0",
|
|
170
172
|
"sass": "^1.69.5",
|
|
173
|
+
"semver": "^7.6.3",
|
|
171
174
|
"sharp": "^0.32.5",
|
|
172
175
|
"starlight-links-validator": "^0.14.2",
|
|
173
176
|
"stylus": "^0.56.0",
|