style-dictionary 5.1.3 → 5.1.4

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.
@@ -12,6 +12,6 @@
12
12
  "author": "",
13
13
  "license": "Apache-2.0",
14
14
  "devDependencies": {
15
- "style-dictionary": "^5.1.3"
15
+ "style-dictionary": "^5.1.4"
16
16
  }
17
17
  }
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "devDependencies": {
14
14
  "eslint-config-react-app": "^7.0.1",
15
- "style-dictionary": "^5.1.3"
15
+ "style-dictionary": "^5.1.4"
16
16
  },
17
17
  "resolutions": {
18
18
  "immer": "8.0.1",
@@ -29,7 +29,7 @@
29
29
  "eslint-config-react-app": "^7.0.1",
30
30
  "jest": "~25.2.6",
31
31
  "react-test-renderer": "~16.13.1",
32
- "style-dictionary": "^5.1.3"
32
+ "style-dictionary": "^5.1.4"
33
33
  },
34
34
  "jest": {
35
35
  "preset": "react-native"
@@ -10,6 +10,6 @@
10
10
  "author": "",
11
11
  "license": "Apache-2.0",
12
12
  "devDependencies": {
13
- "style-dictionary": "^5.1.3"
13
+ "style-dictionary": "^5.1.4"
14
14
  }
15
15
  }
@@ -16,6 +16,6 @@
16
16
  "author": "",
17
17
  "license": "Apache-2.0",
18
18
  "devDependencies": {
19
- "style-dictionary": "^5.1.3"
19
+ "style-dictionary": "^5.1.4"
20
20
  }
21
21
  }
@@ -9,6 +9,6 @@
9
9
  },
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
- "style-dictionary": "^5.1.3"
12
+ "style-dictionary": "^5.1.4"
13
13
  }
14
14
  }
@@ -10,6 +10,6 @@
10
10
  "author": "",
11
11
  "license": "Apache-2.0",
12
12
  "devDependencies": {
13
- "style-dictionary": "^5.1.3"
13
+ "style-dictionary": "^5.1.4"
14
14
  }
15
15
  }
@@ -17,6 +17,6 @@
17
17
  "author": "Kelly Harrop <kn.harrop@gmail.com>",
18
18
  "license": "Apache-2.0",
19
19
  "devDependencies": {
20
- "style-dictionary": "^5.1.3"
20
+ "style-dictionary": "^5.1.4"
21
21
  }
22
22
  }
@@ -16,6 +16,6 @@
16
16
  "author": "",
17
17
  "license": "Apache-2.0",
18
18
  "devDependencies": {
19
- "style-dictionary": "^5.1.3"
19
+ "style-dictionary": "^5.1.4"
20
20
  }
21
21
  }
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "homepage": "https://github.com/dbanksdesign/style-dictionary-node#readme",
22
22
  "devDependencies": {
23
- "style-dictionary": "^5.1.3",
23
+ "style-dictionary": "^5.1.4",
24
24
  "tinycolor2": "^1.4.1"
25
25
  }
26
26
  }
@@ -17,6 +17,6 @@
17
17
  "author": "",
18
18
  "license": "Apache-2.0",
19
19
  "devDependencies": {
20
- "style-dictionary": "^5.1.3"
20
+ "style-dictionary": "^5.1.4"
21
21
  }
22
22
  }
@@ -16,6 +16,6 @@
16
16
  "author": "",
17
17
  "license": "Apache-2.0",
18
18
  "devDependencies": {
19
- "style-dictionary": "^5.1.3"
19
+ "style-dictionary": "^5.1.4"
20
20
  }
21
21
  }
@@ -16,6 +16,6 @@
16
16
  "devDependencies": {
17
17
  "aws-sdk": "^2.7.21",
18
18
  "fs-extra": "^1.0.0",
19
- "style-dictionary": "^5.1.3"
19
+ "style-dictionary": "^5.1.4"
20
20
  }
21
21
  }
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "license": "Apache-2.0",
12
12
  "devDependencies": {
13
- "style-dictionary": "^5.1.3",
13
+ "style-dictionary": "^5.1.4",
14
14
  "tailwindcss": "^3.4.15",
15
15
  "mocha": "^10.2.0",
16
16
  "chai": "^5.1.1"
@@ -16,6 +16,6 @@
16
16
  "author": "",
17
17
  "license": "Apache-2.0",
18
18
  "devDependencies": {
19
- "style-dictionary": "^5.1.3"
19
+ "style-dictionary": "^5.1.4"
20
20
  }
21
21
  }
@@ -12,6 +12,6 @@
12
12
  "license": "ISC",
13
13
  "devDependencies": {
14
14
  "colorjs.io": "^0.5.2",
15
- "style-dictionary": "^5.1.3"
15
+ "style-dictionary": "^5.1.4"
16
16
  }
17
17
  }
@@ -11,6 +11,6 @@
11
11
  "author": "",
12
12
  "license": "MIT",
13
13
  "devDependencies": {
14
- "style-dictionary": "^5.1.3"
14
+ "style-dictionary": "^5.1.4"
15
15
  }
16
16
  }
@@ -10,7 +10,7 @@
10
10
  "author": "",
11
11
  "license": "Apache-2.0",
12
12
  "devDependencies": {
13
- "style-dictionary": "^5.1.3",
13
+ "style-dictionary": "^5.1.4",
14
14
  "yaml": "^1.10.0"
15
15
  }
16
16
  }
@@ -67,7 +67,7 @@ export default class StyleDictionary extends Register {
67
67
  // Placeholder is transformed on prepublish -> see scripts/inject-version.js
68
68
  // 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.
69
69
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility
70
- static VERSION = '5.1.3';
70
+ static VERSION = '5.1.4';
71
71
 
72
72
  /** @returns {Config} */
73
73
  get options() {
@@ -105,7 +105,9 @@ function wrapValueWithDoubleQuote(token, options) {
105
105
  * @returns {string}
106
106
  */
107
107
  function throwSizeError(name, value, unitType) {
108
- throw `Invalid Number: '${name}: ${value}' is not a valid number, cannot transform to '${unitType}' \n`;
108
+ throw new Error(
109
+ `Invalid Number: '${name}: ${value}' is not a valid number, cannot transform to '${unitType}' \n`,
110
+ );
109
111
  }
110
112
 
111
113
  /**
@@ -46,20 +46,24 @@ async function _transformTokenWrapper(transform, token, config, options, vol) {
46
46
  try {
47
47
  to_ret = await transform.transform(token, config, options, vol);
48
48
  } catch (e) {
49
- if (e instanceof Error) {
50
- const transformError = createErrorMessage(token, e, transform.name, !!options?.usesDtcg);
51
- // collect the errors so we can warn the user at the end of the run
52
- GroupMessages.add(TRANSFORM_ERRORS, transformError);
49
+ const message = e instanceof Error ? e.message : String(e);
50
+ const transformError = createErrorMessage(
51
+ token,
52
+ e instanceof Error ? e : new Error(message),
53
+ transform.name,
54
+ !!options?.usesDtcg,
55
+ );
56
+ // collect the errors so we can warn the user at the end of the run
57
+ GroupMessages.add(TRANSFORM_ERRORS, transformError);
53
58
 
54
- // Return a sensible fallback value
55
- switch (transform.type) {
56
- case 'attribute':
57
- return token.attributes;
58
- case 'name':
59
- return token.name;
60
- case 'value':
61
- return options.usesDtcg ? token.$value : token.value;
62
- }
59
+ // Return a sensible fallback value
60
+ switch (transform.type) {
61
+ case 'attribute':
62
+ return token.attributes;
63
+ case 'name':
64
+ return token.name;
65
+ case 'value':
66
+ return options.usesDtcg ? token.$value : token.value;
63
67
  }
64
68
  }
65
69
  return to_ret;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "style-dictionary",
3
- "version": "5.1.3",
3
+ "version": "5.1.4",
4
4
  "description": "Style once, use everywhere. A build system for creating cross-platform styles.",
5
5
  "keywords": [
6
6
  "style dictionary",