style-dictionary 3.0.3 → 3.1.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/README.md +3 -0
- package/bin/style-dictionary +2 -2
- package/examples/advanced/assets-base64-embed/package.json +1 -1
- package/examples/advanced/auto-rebuild-watcher/package.json +2 -2
- package/examples/advanced/component-cti/package.json +1 -1
- package/examples/advanced/create-react-app/package.json +1 -1
- package/examples/advanced/create-react-native-app/package.json +1 -1
- package/examples/advanced/custom-file-header/package.json +1 -1
- package/examples/advanced/custom-formats-with-templates/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/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/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/common/formatHelpers/createPropertyFormatter.js +5 -3
- package/lib/common/formatHelpers/fileHeader.js +1 -1
- package/lib/common/formatHelpers/formattedVariables.js +4 -3
- package/lib/common/formatHelpers/getTypeScriptType.js +42 -18
- package/lib/common/formats.js +16 -5
- package/lib/common/templates/scss/map-deep.template +1 -15
- package/lib/common/transforms.js +23 -0
- package/lib/extend.js +1 -0
- package/lib/utils/combineJSON.js +1 -0
- package/lib/utils/es6_.js +6 -1
- package/lib/utils/jsonc.js +14 -0
- package/lib/utils/resolveObject.js +11 -0
- package/package.json +3 -1
- package/types/Format.d.ts +1 -1
- package/types/FormatHelpers.d.ts +1 -1
- package/types/TransformGroup.d.ts +1 -2
- package/types/index.d.ts +23 -3
- package/CHANGELOG.md +0 -280
package/README.md
CHANGED
|
@@ -22,6 +22,9 @@ For detailed usage head to https://amzn.github.io/style-dictionary
|
|
|
22
22
|
## Watch the Demo on Youtube
|
|
23
23
|
[](http://youtu.be/1HREvonfqhY)
|
|
24
24
|
|
|
25
|
+
## Experiment in the playground
|
|
26
|
+
Try the browser-based Style Dictionary playground: [https://www.style-dictionary-play.dev/](https://www.style-dictionary-play.dev/), built by the folks at [\<div\>RIOTS](https://divriots.com/).
|
|
27
|
+
|
|
25
28
|
## Contents
|
|
26
29
|
* [Installation](#installation)
|
|
27
30
|
* [Usage](#usage)
|
package/bin/style-dictionary
CHANGED
|
@@ -29,7 +29,7 @@ function getConfigPath(options) {
|
|
|
29
29
|
process.exit(1);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
return configPath;
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -72,7 +72,7 @@ program
|
|
|
72
72
|
|
|
73
73
|
// error on unknown commands
|
|
74
74
|
program.on('command:*', function () {
|
|
75
|
-
console.error('Invalid command: %s\nSee --help for a list of available commands.',
|
|
75
|
+
console.error('Invalid command: %s\nSee --help for a list of available commands.', process.argv.slice(2).join(' '));
|
|
76
76
|
process.exit(1);
|
|
77
77
|
});
|
|
78
78
|
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "node_modules/.bin/style-dictionary build",
|
|
12
12
|
"clean": "rm -rf build",
|
|
13
|
-
"watch": "npm run build && chokidar \"
|
|
13
|
+
"watch": "npm run build && chokidar \"tokens/**/*.json\" -c \"npm run build\"",
|
|
14
14
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
15
15
|
},
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"chokidar-cli": "^1.2.0",
|
|
20
|
-
"style-dictionary": "3.0
|
|
20
|
+
"style-dictionary": "3.1.0"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -45,9 +45,10 @@ const defaultFormatting = {
|
|
|
45
45
|
* @param {Dictionary} options.dictionary - The dictionary object sent to the formatter function
|
|
46
46
|
* @param {String} options.format - Available formats are: 'css', 'sass', 'less', and 'stylus'. If you want to customize the format and can't use one of those predefined formats, use the `formatting` option
|
|
47
47
|
* @param {Object} options.formatting - Custom formatting properties that define parts of a declaration line in code. The configurable strings are: prefix, indentation, separator, suffix, and commentStyle. Those are used to generate a line like this: `${indentation}${prefix}${prop.name}${separator} ${prop.value}${suffix}`
|
|
48
|
+
* @param {Boolean} options.themeable [false] - Whether tokens should default to being themeable.
|
|
48
49
|
* @returns {Function}
|
|
49
50
|
*/
|
|
50
|
-
function createPropertyFormatter({outputReferences, dictionary, format, formatting={}}) {
|
|
51
|
+
function createPropertyFormatter({ outputReferences, dictionary, format, formatting = {}, themeable = false }) {
|
|
51
52
|
let {prefix, commentStyle, indentation, separator, suffix} = Object.assign({}, defaultFormatting, formatting);
|
|
52
53
|
|
|
53
54
|
switch(format) {
|
|
@@ -117,7 +118,8 @@ function createPropertyFormatter({outputReferences, dictionary, format, formatti
|
|
|
117
118
|
|
|
118
119
|
to_ret_prop += prop.attributes.category === 'asset' ? `"${value}"` : value;
|
|
119
120
|
|
|
120
|
-
|
|
121
|
+
const themeable_prop = typeof prop.themeable === 'boolean' ? prop.themeable : themeable;
|
|
122
|
+
if (format === 'sass' && themeable_prop) {
|
|
121
123
|
to_ret_prop += ' !default';
|
|
122
124
|
}
|
|
123
125
|
|
|
@@ -135,4 +137,4 @@ function createPropertyFormatter({outputReferences, dictionary, format, formatti
|
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
139
|
|
|
138
|
-
module.exports = createPropertyFormatter;
|
|
140
|
+
module.exports = createPropertyFormatter;
|
|
@@ -38,7 +38,7 @@ const defaultFormatting = {
|
|
|
38
38
|
* StyleDictionary.registerFormat({
|
|
39
39
|
* name: 'myCustomFormat',
|
|
40
40
|
* formatter: function({ dictionary, file }) {
|
|
41
|
-
* return fileHeader({file, 'short') +
|
|
41
|
+
* return fileHeader({file, commentStyle: 'short'}) +
|
|
42
42
|
* dictionary.allTokens.map(token => `${token.name} = ${token.value}`)
|
|
43
43
|
* .join('\n');
|
|
44
44
|
* }
|
|
@@ -27,6 +27,7 @@ const defaultFormatting = {
|
|
|
27
27
|
* @param {Object} options.dictionary - The dictionary object that gets passed to the formatter method.
|
|
28
28
|
* @param {Boolean} options.outputReferences - Whether or not to output references
|
|
29
29
|
* @param {Object} options.formatting - Custom formatting properties that define parts of a declaration line in code. This will get passed to `formatHelpers.createPropertyFormatter` and used for the `lineSeparator` between lines of code.
|
|
30
|
+
* @param {Boolean} options.themeable [false] - Whether tokens should default to being themeable.
|
|
30
31
|
* @returns {String}
|
|
31
32
|
* @example
|
|
32
33
|
* ```js
|
|
@@ -38,7 +39,7 @@ const defaultFormatting = {
|
|
|
38
39
|
* });
|
|
39
40
|
* ```
|
|
40
41
|
*/
|
|
41
|
-
function formattedVariables({format, dictionary, outputReferences=false, formatting={}}) {
|
|
42
|
+
function formattedVariables({ format, dictionary, outputReferences = false, formatting = {}, themeable = false}) {
|
|
42
43
|
let {allTokens} = dictionary;
|
|
43
44
|
|
|
44
45
|
let {lineSeparator} = Object.assign({}, defaultFormatting, formatting);
|
|
@@ -56,9 +57,9 @@ function formattedVariables({format, dictionary, outputReferences=false, formatt
|
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
return allTokens
|
|
59
|
-
.map(createPropertyFormatter({ outputReferences, dictionary, format, formatting }))
|
|
60
|
+
.map(createPropertyFormatter({ outputReferences, dictionary, format, formatting, themeable }))
|
|
60
61
|
.filter(function(strVal) { return !!strVal })
|
|
61
62
|
.join(lineSeparator);
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
module.exports = formattedVariables;
|
|
65
|
+
module.exports = formattedVariables;
|
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
11
|
* and limitations under the License.
|
|
12
12
|
*/
|
|
13
|
+
const { unique } = require('../../utils/es6_');
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Given some value, returns a basic valid TypeScript type for that value.
|
|
16
|
-
* Supports numbers, strings, booleans, and
|
|
17
|
-
*
|
|
17
|
+
* Supports numbers, strings, booleans, arrays and objects of any of those types.
|
|
18
|
+
*
|
|
18
19
|
* @memberof module:formatHelpers
|
|
19
20
|
* @example
|
|
20
21
|
* ```javascript
|
|
@@ -29,25 +30,48 @@
|
|
|
29
30
|
* }).join('\n');
|
|
30
31
|
* }
|
|
31
32
|
* });
|
|
32
|
-
*
|
|
33
|
+
*
|
|
33
34
|
* @param {*} value A value to check the type of.
|
|
34
35
|
* @return {String} A valid name for a TypeScript type.
|
|
35
36
|
* ```
|
|
36
37
|
*/
|
|
37
|
-
function getTypeScriptType(value)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
function getTypeScriptType(value) {
|
|
39
|
+
if (Array.isArray(value)) return getArrayType(value)
|
|
40
|
+
if (typeof value === 'object') return getObjectType(value)
|
|
41
|
+
if (['string', 'number', 'boolean'].includes(typeof value)) return typeof value
|
|
42
|
+
|
|
43
|
+
return 'any'
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @param {Object} value An object with uknown type properties
|
|
48
|
+
* @returns {String} A representation of the type model for the passed object
|
|
49
|
+
*/
|
|
50
|
+
function getObjectType(value) {
|
|
51
|
+
const entries = Object.entries(value)
|
|
52
|
+
return `{ ${entries.map(([key, property], index) => {
|
|
53
|
+
const isLast = entries.length === index + 1
|
|
54
|
+
return `${key}: ${getTypeScriptType(property)}${!isLast ? ', ' : ''}`
|
|
55
|
+
}).join('')} }`
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @param {Array} value An array to check each property of
|
|
60
|
+
* @returns {String} A valid type for the passed array and it's items
|
|
61
|
+
*/
|
|
62
|
+
function getArrayType(passedArray) {
|
|
63
|
+
if (passedArray.length > 0) {
|
|
64
|
+
const firstValueType = getTypeScriptType(passedArray[0]);
|
|
65
|
+
if (passedArray.every((v) => getTypeScriptType(v) === firstValueType)) {
|
|
66
|
+
return firstValueType + '[]';
|
|
67
|
+
} else {
|
|
68
|
+
return `(${unique(passedArray.map((item, index) => {
|
|
69
|
+
const isLast = passedArray.length === index + 1;
|
|
70
|
+
return `${getTypeScriptType(item)}${!isLast ? ' | ' : ''}`
|
|
71
|
+
})).join('')})[]`
|
|
46
72
|
}
|
|
47
|
-
|
|
48
|
-
const type = typeof value;
|
|
49
|
-
if (['string', 'number', 'boolean'].includes(type)) return type;
|
|
50
|
-
return 'any';
|
|
51
73
|
}
|
|
52
|
-
|
|
53
|
-
|
|
74
|
+
return 'any[]';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = getTypeScriptType;
|
package/lib/common/formats.js
CHANGED
|
@@ -84,6 +84,9 @@ module.exports = {
|
|
|
84
84
|
*
|
|
85
85
|
* @memberof Formats
|
|
86
86
|
* @kind member
|
|
87
|
+
* @param {Object} options
|
|
88
|
+
* @param {Boolean} [options.outputReferences=false] - Whether or not to keep [references](/#/formats?id=references-in-output-files) (a -> b -> c) in the output.
|
|
89
|
+
* @param {Boolean} [options.themeable=true] - Whether or not tokens should default to being themeable, if not otherwise specified per token.
|
|
87
90
|
* @example
|
|
88
91
|
* ```scss
|
|
89
92
|
* $color-background-base: #f0f0f0 !default;
|
|
@@ -100,8 +103,15 @@ module.exports = {
|
|
|
100
103
|
* ```
|
|
101
104
|
*/
|
|
102
105
|
'scss/map-deep': function({dictionary, options, file}) {
|
|
103
|
-
const
|
|
104
|
-
|
|
106
|
+
const mapTemplate = _template(fs.readFileSync(__dirname + '/templates/scss/map-deep.template'));
|
|
107
|
+
|
|
108
|
+
// Default the "themeable" option to true for backward compatibility.
|
|
109
|
+
const { outputReferences, themeable = true } = options;
|
|
110
|
+
return '\n' +
|
|
111
|
+
fileHeader({ file, commentStyle: 'long' }) +
|
|
112
|
+
formattedVariables({ format: 'sass', dictionary, outputReferences, themeable })
|
|
113
|
+
+ '\n' +
|
|
114
|
+
mapTemplate({dictionary, file});
|
|
105
115
|
},
|
|
106
116
|
|
|
107
117
|
// This will soon be removed, is left here only for backwards compatibility
|
|
@@ -120,6 +130,7 @@ module.exports = {
|
|
|
120
130
|
* @param {Object} options
|
|
121
131
|
* @param {Boolean} [options.showFileHeader=true] - Whether or not to include a comment that has the build date
|
|
122
132
|
* @param {Boolean} [options.outputReferences=false] - Whether or not to keep [references](/#/formats?id=references-in-output-files) (a -> b -> c) in the output.
|
|
133
|
+
* @param {Boolean} [options.themeable=false] - Whether or not tokens should default to being themeable, if not otherwise specified per token.
|
|
123
134
|
* @example
|
|
124
135
|
* ```scss
|
|
125
136
|
* $color-background-base: #f0f0f0;
|
|
@@ -127,9 +138,9 @@ module.exports = {
|
|
|
127
138
|
* ```
|
|
128
139
|
*/
|
|
129
140
|
'scss/variables': function({dictionary, options, file}) {
|
|
130
|
-
const { outputReferences } = options;
|
|
141
|
+
const { outputReferences, themeable = false } = options;
|
|
131
142
|
return fileHeader({file, commentStyle: 'short'}) +
|
|
132
|
-
formattedVariables({format: 'sass', dictionary, outputReferences});
|
|
143
|
+
formattedVariables({format: 'sass', dictionary, outputReferences, themeable});
|
|
133
144
|
},
|
|
134
145
|
|
|
135
146
|
/**
|
|
@@ -1165,4 +1176,4 @@ declare const ${moduleName}: ${JSON.stringify(treeWalker(dictionary.tokens), nul
|
|
|
1165
1176
|
// Mark which formats are nested
|
|
1166
1177
|
module.exports['json/nested'].nested = true;
|
|
1167
1178
|
module.exports['javascript/module'].nested = true;
|
|
1168
|
-
module.exports['javascript/object'].nested = true;
|
|
1179
|
+
module.exports['javascript/object'].nested = true;
|
|
@@ -13,21 +13,7 @@
|
|
|
13
13
|
// express or implied. See the License for the specific language governing
|
|
14
14
|
// permissions and limitations under the License.
|
|
15
15
|
%>
|
|
16
|
-
|
|
17
|
-
// output the list of tokens as Sass variables
|
|
18
|
-
//
|
|
19
|
-
dictionary.allTokens.forEach(function(prop) {
|
|
20
|
-
var output = '';
|
|
21
|
-
output += '$' + prop.name + ': ' + (prop.attributes.category==='asset' ? '"'+prop.value+'"' : prop.value) + ' !default;'
|
|
22
|
-
if(prop.comment) {
|
|
23
|
-
output += ' // ' + prop.comment;
|
|
24
|
-
}
|
|
25
|
-
output += '\n';
|
|
26
|
-
print(output);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
print('\n');
|
|
30
|
-
|
|
16
|
+
<%
|
|
31
17
|
// output the list of tokens as a Sass nested map
|
|
32
18
|
// (the values are pointing to the variables)
|
|
33
19
|
//
|
package/lib/common/transforms.js
CHANGED
|
@@ -474,6 +474,29 @@ module.exports = {
|
|
|
474
474
|
}
|
|
475
475
|
},
|
|
476
476
|
|
|
477
|
+
/**
|
|
478
|
+
* Transforms the value into an UIColor swift class for iOS
|
|
479
|
+
*
|
|
480
|
+
* ```swift
|
|
481
|
+
* // Matches: token.attributes.category === 'color'
|
|
482
|
+
* // Returns:
|
|
483
|
+
* Color(red: 0.667, green: 0.667, blue: 0.667, opacity: 0.6)
|
|
484
|
+
* ```
|
|
485
|
+
*
|
|
486
|
+
* @memberof Transforms
|
|
487
|
+
*/
|
|
488
|
+
'color/ColorSwiftUI': {
|
|
489
|
+
type: 'value',
|
|
490
|
+
matcher: isColor,
|
|
491
|
+
transformer: function (token) {
|
|
492
|
+
const { r, g, b, a } = Color(token.value).toRgb();
|
|
493
|
+
const rFixed = (r / 255.0).toFixed(3);
|
|
494
|
+
const gFixed = (g / 255.0).toFixed(3);
|
|
495
|
+
const bFixed = (b / 255.0).toFixed(3);
|
|
496
|
+
return `Color(red: ${rFixed}, green: ${gFixed}, blue: ${bFixed}, opacity: ${a})`;
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
|
|
477
500
|
/**
|
|
478
501
|
* Transforms the value into a hex or rgb string depending on if it has transparency
|
|
479
502
|
*
|
package/lib/extend.js
CHANGED
package/lib/utils/combineJSON.js
CHANGED
package/lib/utils/es6_.js
CHANGED
|
@@ -101,7 +101,7 @@ const assign = function () {
|
|
|
101
101
|
|
|
102
102
|
/* global Set */
|
|
103
103
|
const pull = function (arr, ...removeList){
|
|
104
|
-
var removeSet = new Set(removeList)
|
|
104
|
+
var removeSet = new Set(removeList)
|
|
105
105
|
for (let i=arr.length-1;i>=0;i--) {
|
|
106
106
|
if (removeSet.has(arr[i])) {
|
|
107
107
|
arr.splice(i, 1)
|
|
@@ -109,6 +109,10 @@ const pull = function (arr, ...removeList){
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
const unique = function (arr){
|
|
113
|
+
return [...new Set(arr)]
|
|
114
|
+
}
|
|
115
|
+
|
|
112
116
|
const upperFirst = function (str) {
|
|
113
117
|
return str ? str[0].toUpperCase() + str.substr(1) : ''
|
|
114
118
|
}
|
|
@@ -157,4 +161,5 @@ module.exports = {
|
|
|
157
161
|
kebabCase: ChangeCase.paramCase,
|
|
158
162
|
pull: pull,
|
|
159
163
|
matches: matches,
|
|
164
|
+
unique: unique,
|
|
160
165
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const jsonc = require("jsonc-parser");
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
register(module, filename) {
|
|
6
|
+
const content = fs.readFileSync(filename, "utf8");
|
|
7
|
+
try {
|
|
8
|
+
module.exports = jsonc.parse(content);
|
|
9
|
+
} catch (err) {
|
|
10
|
+
err.message = filename + ": " + err.message;
|
|
11
|
+
throw err;
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -94,8 +94,19 @@ function compile_value(value, stack) {
|
|
|
94
94
|
// Find what the value is referencing
|
|
95
95
|
const pathName = getPath(variable, options);
|
|
96
96
|
const context = getName(current_context, options);
|
|
97
|
+
const refHasValue = pathName[pathName.length-1] === 'value';
|
|
97
98
|
ref = resolveReference(pathName, updated_object);
|
|
98
99
|
|
|
100
|
+
// If the reference doesn't end in 'value'
|
|
101
|
+
// and
|
|
102
|
+
// the reference points to someplace that has a `value` attribute
|
|
103
|
+
// we should take the '.value' of the reference
|
|
104
|
+
// per the W3C draft spec where references do not have .value
|
|
105
|
+
// https://design-tokens.github.io/community-group/format/#aliases-references
|
|
106
|
+
if (!refHasValue && ref && ref.hasOwnProperty('value')) {
|
|
107
|
+
ref = ref.value;
|
|
108
|
+
}
|
|
109
|
+
|
|
99
110
|
if (typeof ref !== 'undefined') {
|
|
100
111
|
if (typeof ref === 'string') {
|
|
101
112
|
to_ret = value.replace(match, ref);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "style-dictionary",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Style once, use everywhere. A build system for creating cross-platform styles.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"style dictionary",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
],
|
|
80
80
|
"transform": {
|
|
81
81
|
"^.+\\.json5$": "json5-jest",
|
|
82
|
+
"^.+\\.jsonc$": "json5-jest",
|
|
82
83
|
"^.+\\.jsx?$": "babel-jest"
|
|
83
84
|
}
|
|
84
85
|
},
|
|
@@ -141,6 +142,7 @@
|
|
|
141
142
|
"jsdoc-escape-at": "^1.0.1",
|
|
142
143
|
"jsdoc-to-markdown": "^7.0.1",
|
|
143
144
|
"json5-jest": "^1.0.1",
|
|
145
|
+
"jsonc-parser": "^3.0.0",
|
|
144
146
|
"less": "^3.11.2",
|
|
145
147
|
"lint-staged": "^10.2.7",
|
|
146
148
|
"node-sass": "^6.0.1",
|
package/types/Format.d.ts
CHANGED
package/types/FormatHelpers.d.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ declare namespace StyleDictionary {
|
|
|
62
62
|
options: Config;
|
|
63
63
|
|
|
64
64
|
transform: Record<string, Transform>;
|
|
65
|
-
transformGroup: Record<string, TransformGroup>;
|
|
65
|
+
transformGroup: Record<string, TransformGroup['transforms']>;
|
|
66
66
|
format: Record<string, Format>;
|
|
67
67
|
action: Record<string, Action>;
|
|
68
68
|
filter: Record<string, Filter>;
|
|
@@ -163,10 +163,30 @@ declare namespace StyleDictionary {
|
|
|
163
163
|
*/
|
|
164
164
|
registerFilter(filter: Named<Filter>): this;
|
|
165
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Add a custom file header to Style Dictionary. File headers are used to write a
|
|
168
|
+
* custom messasge on top of the generated files.
|
|
169
|
+
* @param {String} fileHeader.name The name of the file header to be added
|
|
170
|
+
* @param {Function} fileHeader.fileHeader The file header function
|
|
171
|
+
* @example
|
|
172
|
+
* ```js
|
|
173
|
+
* StyleDictionary.registerFileHeader({
|
|
174
|
+
* name: 'custmoHeader',
|
|
175
|
+
* fileHeader: function(defaultMessage) {
|
|
176
|
+
* return return [
|
|
177
|
+
* `hello`,
|
|
178
|
+
* ...defaultMessage
|
|
179
|
+
* ]
|
|
180
|
+
* }
|
|
181
|
+
* })
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
registerFileHeader(fileHeader: Named<{ fileHeader: FileHeader }>): this;
|
|
185
|
+
|
|
166
186
|
/**
|
|
167
187
|
* Adds a custom parser to parse style dictionary files. This allows you to modify
|
|
168
188
|
* the design token data before it gets to Style Dictionary or write your
|
|
169
|
-
* token files in a language other than JSON, JSON5, or CommonJS modules.
|
|
189
|
+
* token files in a language other than JSON, JSONC, JSON5, or CommonJS modules.
|
|
170
190
|
*
|
|
171
191
|
* @param {Regex} parser.pattern - A file path regular expression to match which files this parser should be be used on. This is similar to how webpack loaders work. `/\.json$/` will match any file ending in '.json', for example.
|
|
172
192
|
* @param {Function} parser.parse - Function to parse the file contents. Takes 1 argument, which is an object with 2 attributes: contents which is the string of the file contents and filePath. The function should return a plain Javascript object.
|
|
@@ -306,4 +326,4 @@ declare namespace StyleDictionary {
|
|
|
306
326
|
}
|
|
307
327
|
|
|
308
328
|
declare var StyleDictionary: StyleDictionary.Core;
|
|
309
|
-
export = StyleDictionary;
|
|
329
|
+
export = StyleDictionary;
|
package/CHANGELOG.md
DELETED
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
-
|
|
5
|
-
### [3.0.3](https://github.com/amzn/style-dictionary/compare/v3.0.2...v3.0.3) (2021-10-15)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
* **types:** `className` optional parameter ([#683](https://github.com/amzn/style-dictionary/issues/683)) ([639d7da](https://github.com/amzn/style-dictionary/commit/639d7daa49fccdf569ec39a14953e366df1d7908)), closes [/github.com/amzn/style-dictionary/blob/main/examples/basic/config.json#L100](https://github.com/amzn//github.com/amzn/style-dictionary/blob/main/examples/basic/config.json/issues/L100)
|
|
11
|
-
* **types:** added `name` to format, and export `Named` ([#714](https://github.com/amzn/style-dictionary/issues/714)) ([9ca0f6f](https://github.com/amzn/style-dictionary/commit/9ca0f6fc5d01706bf6864a2ea0fababb191f30f4))
|
|
12
|
-
|
|
13
|
-
### [3.0.2](https://github.com/amzn/style-dictionary/compare/v3.0.1...v3.0.2) (2021-08-19)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
### Bug Fixes
|
|
17
|
-
|
|
18
|
-
* **format:** 'typescript/es6-declarations' return type ([#681](https://github.com/amzn/style-dictionary/issues/681)) ([0cf6c52](https://github.com/amzn/style-dictionary/commit/0cf6c52a3f85a91e5763dc31e0fb6efe2a531e25))
|
|
19
|
-
* **lib:** fix `createFormatArgs` positional args ([#655](https://github.com/amzn/style-dictionary/issues/655)) ([29e511d](https://github.com/amzn/style-dictionary/commit/29e511d07e7991430f6f892879aeb0ade0c6a289)), closes [#652](https://github.com/amzn/style-dictionary/issues/652)
|
|
20
|
-
* **references:** check if object value is a string before replacement ([#682](https://github.com/amzn/style-dictionary/issues/682)) ([bfc204c](https://github.com/amzn/style-dictionary/commit/bfc204c50e7addde2b98dc5703b9be31b5b44823))
|
|
21
|
-
* **types:** format config expects formatter function ([#650](https://github.com/amzn/style-dictionary/issues/650)) ([b12c4b1](https://github.com/amzn/style-dictionary/commit/b12c4b1c6a94c62c757cd1675d216d9638f8d6e0))
|
|
22
|
-
|
|
23
|
-
### [3.0.1](https://github.com/amzn/style-dictionary/compare/v3.0.0...v3.0.1) (2021-06-07)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
### Bug Fixes
|
|
27
|
-
|
|
28
|
-
* **swift:** add missing space after UIColor's alpha property ([#648](https://github.com/amzn/style-dictionary/issues/648)) ([7c65733](https://github.com/amzn/style-dictionary/commit/7c65733c05a82b99960e6dca25124fce91fbda32))
|
|
29
|
-
* **types:** directly export Named type to avoid ambiguity with TS --isolatedModules option ([8295b0d](https://github.com/amzn/style-dictionary/commit/8295b0dffc28a5dda934fb32a26f32ffcc241ffb))
|
|
30
|
-
* **types:** directly export Named type to avoid ambiguity with TS --isolatedModules option ([3ed31be](https://github.com/amzn/style-dictionary/commit/3ed31be5b09312df88c66e9274672303a8609acc))
|
|
31
|
-
|
|
32
|
-
## [3.0.0](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.10...v3.0.0) (2021-05-25)
|
|
33
|
-
|
|
34
|
-
## [3.0.0-rc.10](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.9...v3.0.0-rc.10) (2021-05-24)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
### Features
|
|
38
|
-
|
|
39
|
-
* **formats:** add typescript declarations formats ([#557](https://github.com/amzn/style-dictionary/issues/557)) ([f517bcf](https://github.com/amzn/style-dictionary/commit/f517bcfa219bddc5a10b5443ccb85c4869711064)), closes [#425](https://github.com/amzn/style-dictionary/issues/425)
|
|
40
|
-
* **types:** cleaning up our type definitions ([#632](https://github.com/amzn/style-dictionary/issues/632)) ([db6269b](https://github.com/amzn/style-dictionary/commit/db6269b636264cc0849f595c0f15a34c977c1398))
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
### Bug Fixes
|
|
44
|
-
|
|
45
|
-
* **references:** value object references now work ([#623](https://github.com/amzn/style-dictionary/issues/623)) ([23de306](https://github.com/amzn/style-dictionary/commit/23de3062c464a70d9e6492a380e1052e9500ea2d)), closes [#615](https://github.com/amzn/style-dictionary/issues/615)
|
|
46
|
-
* **template:** remove blank lines in scss/map-deep and scss/map-flat templates ([#588](https://github.com/amzn/style-dictionary/issues/588)) ([a88e622](https://github.com/amzn/style-dictionary/commit/a88e622bcc06a98972dddb2b11903828ba3dab2b))
|
|
47
|
-
|
|
48
|
-
### [2.10.3](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.5...v2.10.3) (2021-03-09)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### Bug Fixes
|
|
52
|
-
|
|
53
|
-
* **extend:** remove prototype pollution ([#560](https://github.com/amzn/style-dictionary/issues/560)) ([89ee39a](https://github.com/amzn/style-dictionary/commit/89ee39a7953c1825ea4578d43f129e23b4ed5da8))
|
|
54
|
-
|
|
55
|
-
## [3.0.0-rc.9](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.8...v3.0.0-rc.9) (2021-05-04)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
### Features
|
|
59
|
-
|
|
60
|
-
* **compose:** Add Jetpack Compose format ([#599](https://github.com/amzn/style-dictionary/issues/599)) ([8a53858](https://github.com/amzn/style-dictionary/commit/8a53858dc35f4b4565abe9a6500c78814e3e6eae)), closes [#478](https://github.com/amzn/style-dictionary/issues/478)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
### Bug Fixes
|
|
64
|
-
|
|
65
|
-
* **formats:** bringing mapName back to scss formats ([#611](https://github.com/amzn/style-dictionary/issues/611)) ([7a28f40](https://github.com/amzn/style-dictionary/commit/7a28f40b7f44b37e565b1360683b60268d044e9e))
|
|
66
|
-
* **formats:** fixing formatting options in fileHeader ([#614](https://github.com/amzn/style-dictionary/issues/614)) ([3f7fe96](https://github.com/amzn/style-dictionary/commit/3f7fe9674c0cb1f228e0415ce468d18a48e4a7f0)), closes [#612](https://github.com/amzn/style-dictionary/issues/612)
|
|
67
|
-
* **references:** fixing circular reference errors ([#607](https://github.com/amzn/style-dictionary/issues/607)) ([9af17f4](https://github.com/amzn/style-dictionary/commit/9af17f420c2a11c64f77041f5c2439c093f9c035)), closes [#608](https://github.com/amzn/style-dictionary/issues/608)
|
|
68
|
-
* **references:** flushing the filtered reference warnings ([#598](https://github.com/amzn/style-dictionary/issues/598)) ([d3b5135](https://github.com/amzn/style-dictionary/commit/d3b51352f33cb15765cb152605acd3c44e6fbf69))
|
|
69
|
-
|
|
70
|
-
## [3.0.0-rc.8](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.7...v3.0.0-rc.8) (2021-04-05)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
### Features
|
|
74
|
-
|
|
75
|
-
* **formats:** add an optional selector to css/variables format ([#582](https://github.com/amzn/style-dictionary/issues/582)) ([34922a8](https://github.com/amzn/style-dictionary/commit/34922a8572b7cefc6ca579cca9f73b16bfc4efc0))
|
|
76
|
-
* **formats:** output references handles interpoloated references ([#590](https://github.com/amzn/style-dictionary/issues/590)) ([cc595ca](https://github.com/amzn/style-dictionary/commit/cc595ca0683cc757dfae562a8688eb0b8d121cbe)), closes [#589](https://github.com/amzn/style-dictionary/issues/589)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
### Bug Fixes
|
|
80
|
-
|
|
81
|
-
* **combine:** filePath was missing for falsey values ([#583](https://github.com/amzn/style-dictionary/issues/583)) ([8c405e6](https://github.com/amzn/style-dictionary/commit/8c405e6765367aff7eb94fda1a0a235f1c422c9c))
|
|
82
|
-
* **formats:** update output references in formats to handle nested references ([#587](https://github.com/amzn/style-dictionary/issues/587)) ([9ce0311](https://github.com/amzn/style-dictionary/commit/9ce031108979493c7f5d0df34e3546322694feb6))
|
|
83
|
-
|
|
84
|
-
## [3.0.0-rc.7](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.6...v3.0.0-rc.7) (2021-03-24)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### Features
|
|
88
|
-
|
|
89
|
-
* **formats:** adding custom file headers ([#572](https://github.com/amzn/style-dictionary/issues/572)) ([2a29502](https://github.com/amzn/style-dictionary/commit/2a29502f762c8694dd541dc9c0a0e0aa32e4dec9)), closes [#566](https://github.com/amzn/style-dictionary/issues/566)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
### Bug Fixes
|
|
93
|
-
|
|
94
|
-
* **references:** use unfiltered dictionary for reference resolution in formats ([#553](https://github.com/amzn/style-dictionary/issues/553)) ([62c8fb8](https://github.com/amzn/style-dictionary/commit/62c8fb8ddaccb94dc2eee3b4504f38c264689b77))
|
|
95
|
-
|
|
96
|
-
## [3.0.0-rc.6](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.5...v3.0.0-rc.6) (2021-03-09)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
### Bug Fixes
|
|
100
|
-
|
|
101
|
-
* **extend:** remove prototype pollution ([#554](https://github.com/amzn/style-dictionary/issues/554)) ([b99710a](https://github.com/amzn/style-dictionary/commit/b99710a23abf7d49be28f4ce33dbe99a8af5923f))
|
|
102
|
-
|
|
103
|
-
## [3.0.0-rc.5](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2021-02-27)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
### Bug Fixes
|
|
107
|
-
|
|
108
|
-
* **types:** introduce parser, update config, optional transform options ([#546](https://github.com/amzn/style-dictionary/issues/546)) ([0042354](https://github.com/amzn/style-dictionary/commit/0042354b4ccb43ef26ddb13adab82b73f25dbf4f)), closes [#545](https://github.com/amzn/style-dictionary/issues/545)
|
|
109
|
-
|
|
110
|
-
## [3.0.0-rc.4](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-02-16)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
### Features
|
|
114
|
-
|
|
115
|
-
* **formats:** add stylus/variables format ([#527](https://github.com/amzn/style-dictionary/issues/527)) ([8c56752](https://github.com/amzn/style-dictionary/commit/8c56752d43616884fe6b1f4f7a77994396ce2c3f)), closes [#526](https://github.com/amzn/style-dictionary/issues/526)
|
|
116
|
-
|
|
117
|
-
## [3.0.0-rc.3](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-02-06)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
### Features
|
|
121
|
-
|
|
122
|
-
* **build-file:** do not generate file if properties is empty ([#494](https://github.com/amzn/style-dictionary/issues/494)) ([8945c46](https://github.com/amzn/style-dictionary/commit/8945c46f26a08ff6ffac3a5aa0e84a0f330efdb4))
|
|
123
|
-
* **format:** output references ([#504](https://github.com/amzn/style-dictionary/issues/504)) ([7e7889a](https://github.com/amzn/style-dictionary/commit/7e7889a41c79c58a04297762a31550c9bd7c2ee0))
|
|
124
|
-
* **format:** use named parameters in formatter functions ([#533](https://github.com/amzn/style-dictionary/issues/533)) ([32bd40d](https://github.com/amzn/style-dictionary/commit/32bd40d3a94dd3be49ea795e3dbcc70e149bd6eb))
|
|
125
|
-
* react-native support ([#512](https://github.com/amzn/style-dictionary/issues/512)) ([bd61cd2](https://github.com/amzn/style-dictionary/commit/bd61cd294afccd5299a7103fd2ea6177203e9994))
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
### Bug Fixes
|
|
129
|
-
|
|
130
|
-
* **examples:** little typo ([#518](https://github.com/amzn/style-dictionary/issues/518)) ([33271b6](https://github.com/amzn/style-dictionary/commit/33271b62b2a0c100a2be8c08f7cd89815e287327))
|
|
131
|
-
* **export platform:** fixing infinite loop when there are reference errors ([#531](https://github.com/amzn/style-dictionary/issues/531)) ([6078c80](https://github.com/amzn/style-dictionary/commit/6078c8041286589eef7515945f771240bf73c8ef))
|
|
132
|
-
* **property setup:** original property being mutated if the value is an object ([#534](https://github.com/amzn/style-dictionary/issues/534)) ([0b13ae2](https://github.com/amzn/style-dictionary/commit/0b13ae212023ba003ab71cc30eadb20ad10ebc0c))
|
|
133
|
-
* **types:** add transitive to value transform type ([#536](https://github.com/amzn/style-dictionary/issues/536)) ([695eed6](https://github.com/amzn/style-dictionary/commit/695eed60f9f56c30542bbec8d0c1622a6a6959df))
|
|
134
|
-
* **types:** Change transforms to transform in Core ([#530](https://github.com/amzn/style-dictionary/issues/530)) ([40a2601](https://github.com/amzn/style-dictionary/commit/40a2601724ed947aa141ff53e874c14c317992df))
|
|
135
|
-
|
|
136
|
-
## [3.0.0-rc.2](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.1...v3.0.0-rc.2) (2021-01-12)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
### Features
|
|
140
|
-
|
|
141
|
-
* **format:** adding android/resources format ([e43aafd](https://github.com/amzn/style-dictionary/commit/e43aafd0e4c5f34158ea0cdc222833b79b35ab16))
|
|
142
|
-
* **transforms:** add 'px to rem' transform ([#491](https://github.com/amzn/style-dictionary/issues/491)) ([75f0ba3](https://github.com/amzn/style-dictionary/commit/75f0ba36e1211edf955c7b6bd6c58cbd9fc6524c))
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
### Bug Fixes
|
|
146
|
-
|
|
147
|
-
* **extend:** use given file path for token data ([#499](https://github.com/amzn/style-dictionary/issues/499)) ([0b23c9d](https://github.com/amzn/style-dictionary/commit/0b23c9d77e367b2080e4b624fcb294773b2aefcb))
|
|
148
|
-
* **parsers:** fixed an error where parsers weren't running ([#511](https://github.com/amzn/style-dictionary/issues/511)) ([b0077c3](https://github.com/amzn/style-dictionary/commit/b0077c3d06caf5b7fcacd7378aab7827cdaa3961))
|
|
149
|
-
* **types:** fix transform options type [#502](https://github.com/amzn/style-dictionary/issues/502) ([32787f8](https://github.com/amzn/style-dictionary/commit/32787f8a133a61f6132cef4bb88922f72951b804))
|
|
150
|
-
|
|
151
|
-
## [3.0.0-rc.1](https://github.com/amzn/style-dictionary/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2020-12-04)
|
|
152
|
-
|
|
153
|
-
## [3.0.0-rc.0](https://github.com/amzn/style-dictionary/compare/v2.10.2...v3.0.0-rc.0) (2020-12-03)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
### Features
|
|
157
|
-
|
|
158
|
-
* **examples:** add custom filters example ([c9bfcbc](https://github.com/amzn/style-dictionary/commit/c9bfcbcb07fec4435f2368c66d0db793d676a06e))
|
|
159
|
-
* **examples:** add custom filters example ([f95c420](https://github.com/amzn/style-dictionary/commit/f95c4202e93dcc00b47e595c4910f435a57d1987))
|
|
160
|
-
* **examples:** add matching build files example ([#481](https://github.com/amzn/style-dictionary/issues/481)) ([5a80ef6](https://github.com/amzn/style-dictionary/commit/5a80ef626bacb6b487f2543793e7ed6451e81498)), closes [#251](https://github.com/amzn/style-dictionary/issues/251)
|
|
161
|
-
* add support for !default in SCSS variables format ([#359](https://github.com/amzn/style-dictionary/issues/359)) ([fa82002](https://github.com/amzn/style-dictionary/commit/fa8200221477a7bf0d9fcb031a54dc61ba2e3f72)), closes [#307](https://github.com/amzn/style-dictionary/issues/307)
|
|
162
|
-
* add TypeScript typings ([#410](https://github.com/amzn/style-dictionary/issues/410)) ([a8bb832](https://github.com/amzn/style-dictionary/commit/a8bb83278fa5bf7b1796d7f466f21a7beef0da84))
|
|
163
|
-
* **core:** add new entries on property object ([#356](https://github.com/amzn/style-dictionary/issues/356)) ([fd254a5](https://github.com/amzn/style-dictionary/commit/fd254a5e9f78b9888cf59770e61800357421d934))
|
|
164
|
-
* **formats:** add file object to formatter method ([#439](https://github.com/amzn/style-dictionary/issues/439)) ([1481c46](https://github.com/amzn/style-dictionary/commit/1481c46647808d95dc26ff6c08a0906df09d0316))
|
|
165
|
-
* **formats:** javascript/module-flat format ([#457](https://github.com/amzn/style-dictionary/issues/457)) ([37b06e8](https://github.com/amzn/style-dictionary/commit/37b06e86ba77576fb0619372fd73e16673c6440d))
|
|
166
|
-
* **parser:** adding custom parser support ([#429](https://github.com/amzn/style-dictionary/issues/429)) ([887a837](https://github.com/amzn/style-dictionary/commit/887a837a72f15cb4e2550f883e6d4479e1fa9d42))
|
|
167
|
-
* **transforms:** Make transitive transforms & resolves possible ([#371](https://github.com/amzn/style-dictionary/issues/371)) ([3edbb17](https://github.com/amzn/style-dictionary/commit/3edbb178d53f9e5af2328b7c26271fe436af86d3)), closes [#208](https://github.com/amzn/style-dictionary/issues/208)
|
|
168
|
-
|
|
169
|
-
### Bug Fixes
|
|
170
|
-
|
|
171
|
-
* **cli:** update clean config path logic ([#454](https://github.com/amzn/style-dictionary/issues/454)) ([dc3cfa5](https://github.com/amzn/style-dictionary/commit/dc3cfa58aa7cc78a6359a8bb269e6f32ba50b110))
|
|
172
|
-
* **formats:** fix max call stack issue on json/nested format ([#465](https://github.com/amzn/style-dictionary/issues/465)) ([67fb361](https://github.com/amzn/style-dictionary/commit/67fb361fb2448f9b91a1a125ee61d6bbe2f77732))
|
|
173
|
-
* **transforms:** fix transitive transforms ([#476](https://github.com/amzn/style-dictionary/issues/476)) ([ac0c515](https://github.com/amzn/style-dictionary/commit/ac0c515c8b4593b91eb352b1f744895796e3ab49))
|
|
174
|
-
|
|
175
|
-
### [2.10.3](https://github.com/amzn/style-dictionary/compare/v2.10.2...v2.10.3) (2021-03-09)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
### Bug Fixes
|
|
179
|
-
|
|
180
|
-
* **extend:** remove prototype pollution ([#560](https://github.com/amzn/style-dictionary/issues/560)) ([89ee39a](https://github.com/amzn/style-dictionary/commit/89ee39a7953c1825ea4578d43f129e23b4ed5da8))
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
### [2.10.2](https://github.com/amzn/style-dictionary/compare/v2.10.1...v2.10.2) (2020-10-08)
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
### Bug Fixes
|
|
187
|
-
|
|
188
|
-
* **cli:** update clean config path logic ([#454](https://github.com/amzn/style-dictionary/issues/454)) ([3cc3d4e](https://github.com/amzn/style-dictionary/commit/3cc3d4e04f2ee4d0ac8b1f90b725e80f6b53beb4))
|
|
189
|
-
* **formats:** fix max call stack issue on json/nested format ([#465](https://github.com/amzn/style-dictionary/issues/465)) ([4064e6a](https://github.com/amzn/style-dictionary/commit/4064e6add00ca3380d9a2c9ef9862f73ef051de9))
|
|
190
|
-
|
|
191
|
-
### [2.10.1](https://github.com/amzn/style-dictionary/compare/v2.10.0...v2.10.1) (2020-07-09)
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
### Bug Fixes
|
|
195
|
-
|
|
196
|
-
* **filter:** fix conditional to ensure we catch properties with a falsy value ([#423](https://github.com/amzn/style-dictionary/issues/423)) ([1ec4e74](https://github.com/amzn/style-dictionary/commit/1ec4e74b9b717208f7d64aa33d43774ae8023a23)), closes [#406](https://github.com/amzn/style-dictionary/issues/406)
|
|
197
|
-
* **formats:** align scss/map-* with scss/variables on asset category ([9d867ef](https://github.com/amzn/style-dictionary/commit/9d867ef3ad72cf68557434ce1a28ba996a5ac467))
|
|
198
|
-
|
|
199
|
-
## [2.10.0](https://github.com/amzn/style-dictionary/compare/v2.9.0...v2.10.0) (2020-05-05)
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
### Features
|
|
203
|
-
|
|
204
|
-
* adding color/hsl and color/hsl-4 transforms ([#383](https://github.com/amzn/style-dictionary/issues/383)) ([b777cfb](https://github.com/amzn/style-dictionary/commit/b777cfb11e5edc32e61df2dd33909c37a7efe2e5))
|
|
205
|
-
* flutter support ([#320](https://github.com/amzn/style-dictionary/issues/320)) ([8a5f645](https://github.com/amzn/style-dictionary/commit/8a5f645cc9e73fea9bbb8b6b38c5baa1d23149c8)), closes [#255](https://github.com/amzn/style-dictionary/issues/255) [#288](https://github.com/amzn/style-dictionary/issues/288)
|
|
206
|
-
|
|
207
|
-
<a name="2.9.0"></a>
|
|
208
|
-
# [2.9.0](https://github.com/amzn/style-dictionary/compare/v2.8.3...v2.9.0) (2020-04-21)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
### Bug Fixes
|
|
212
|
-
|
|
213
|
-
* **transforms:** add NaN check to all size transforms ([#413](https://github.com/amzn/style-dictionary/issues/413)) ([d353795](https://github.com/amzn/style-dictionary/commit/d353795))
|
|
214
|
-
* **transforms:** add specificity so color for hex values is correct ([#412](https://github.com/amzn/style-dictionary/issues/412)) ([01cc11c](https://github.com/amzn/style-dictionary/commit/01cc11c)), closes [#407](https://github.com/amzn/style-dictionary/issues/407)
|
|
215
|
-
* clean require cache before loading file content ([#405](https://github.com/amzn/style-dictionary/issues/405)) ([18a50d0](https://github.com/amzn/style-dictionary/commit/18a50d0)), closes [#404](https://github.com/amzn/style-dictionary/issues/404)
|
|
216
|
-
* parseFloat() has only one argument ([#417](https://github.com/amzn/style-dictionary/issues/417)) ([16c3040](https://github.com/amzn/style-dictionary/commit/16c3040)), closes [#416](https://github.com/amzn/style-dictionary/issues/416)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
### Features
|
|
220
|
-
|
|
221
|
-
* **attribute/cti:** attribute/cti should respect manually set attributes ([#415](https://github.com/amzn/style-dictionary/issues/415)) ([fb3e393](https://github.com/amzn/style-dictionary/commit/fb3e393)), closes [#414](https://github.com/amzn/style-dictionary/issues/414)
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
<a name="2.8.3"></a>
|
|
226
|
-
## [2.8.3](https://github.com/amzn/style-dictionary/compare/v2.8.2...v2.8.3) (2019-10-30)
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
### Bug Fixes
|
|
230
|
-
|
|
231
|
-
* **format:** minor css format output fix ([#323](https://github.com/amzn/style-dictionary/issues/323)) ([adb94e1](https://github.com/amzn/style-dictionary/commit/adb94e1)), closes [#322](https://github.com/amzn/style-dictionary/issues/322)
|
|
232
|
-
* **utils:** handle 0 values ([#325](https://github.com/amzn/style-dictionary/issues/325)) ([189d61b](https://github.com/amzn/style-dictionary/commit/189d61b)), closes [#324](https://github.com/amzn/style-dictionary/issues/324)
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
<a name="2.8.2"></a>
|
|
237
|
-
## [2.8.2](https://github.com/amzn/style-dictionary/compare/v2.8.1...v2.8.2) (2019-09-04)
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
### Bug Fixes
|
|
241
|
-
|
|
242
|
-
* **format:** issue [#295](https://github.com/amzn/style-dictionary/issues/295) ([c654648](https://github.com/amzn/style-dictionary/commit/c654648))
|
|
243
|
-
* **format:** issue [#295](https://github.com/amzn/style-dictionary/issues/295) ([#316](https://github.com/amzn/style-dictionary/issues/316)) ([030175e](https://github.com/amzn/style-dictionary/commit/030175e))
|
|
244
|
-
* **formats:** change less and scss comments to short version ([#306](https://github.com/amzn/style-dictionary/issues/306)) ([4f13f57](https://github.com/amzn/style-dictionary/commit/4f13f57)), closes [#305](https://github.com/amzn/style-dictionary/issues/305)
|
|
245
|
-
* **transform:** increase uicolor to 3 decimals to retain 8bit precision ([#314](https://github.com/amzn/style-dictionary/issues/314)) ([a3bde96](https://github.com/amzn/style-dictionary/commit/a3bde96))
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
<a name="2.8.1"></a>
|
|
250
|
-
## [2.8.1](https://github.com/amzn/style-dictionary/compare/v2.8.0...v2.8.1) (2019-07-02)
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
### Bug Fixes
|
|
254
|
-
|
|
255
|
-
* **format:** adding configurable name to sass map name ([#291](https://github.com/amzn/style-dictionary/issues/291)) ([cfa2422](https://github.com/amzn/style-dictionary/commit/cfa2422)), closes [#290](https://github.com/amzn/style-dictionary/issues/290)
|
|
256
|
-
* **sketch:** fix sketch palette format to use new filters ([#287](https://github.com/amzn/style-dictionary/issues/287)) ([374012c](https://github.com/amzn/style-dictionary/commit/374012c)), closes [#285](https://github.com/amzn/style-dictionary/issues/285)
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
<a name="2.8.0"></a>
|
|
261
|
-
# [2.8.0](https://github.com/amzn/style-dictionary/compare/v2.7.0...v2.8.0) (2019-05-28)
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
### Bug Fixes
|
|
265
|
-
|
|
266
|
-
* **cleanfile:** add file check and log for non-existent file ([#277](https://github.com/amzn/style-dictionary/issues/277)) ([6375133](https://github.com/amzn/style-dictionary/commit/6375133))
|
|
267
|
-
* **docs/examples:** 404 errors and typos ([#269](https://github.com/amzn/style-dictionary/issues/269)) ([da369da](https://github.com/amzn/style-dictionary/commit/da369da))
|
|
268
|
-
* **error-messaging:** add better error messaging when a transform or transformGroup does not exist ([#264](https://github.com/amzn/style-dictionary/issues/264)) ([d5c0583](https://github.com/amzn/style-dictionary/commit/d5c0583))
|
|
269
|
-
* **extend:** multiple extensions properly deep merge ([#276](https://github.com/amzn/style-dictionary/issues/276)) ([f1d6bb0](https://github.com/amzn/style-dictionary/commit/f1d6bb0)), closes [#274](https://github.com/amzn/style-dictionary/issues/274)
|
|
270
|
-
* accidentally generating test output in root directory ([4994553](https://github.com/amzn/style-dictionary/commit/4994553))
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
### Features
|
|
274
|
-
|
|
275
|
-
* **config:** use config.js if config.json is not found ([#249](https://github.com/amzn/style-dictionary/issues/249)) ([09fc43f](https://github.com/amzn/style-dictionary/commit/09fc43f)), closes [#238](https://github.com/amzn/style-dictionary/issues/238) [#238](https://github.com/amzn/style-dictionary/issues/238) [#247](https://github.com/amzn/style-dictionary/issues/247)
|
|
276
|
-
* add automatic changelog generation ([#225](https://github.com/amzn/style-dictionary/issues/225)) ([b062008](https://github.com/amzn/style-dictionary/commit/b062008))
|
|
277
|
-
* **docs:** adding PR and download badges; fixing code coverage badge ([#270](https://github.com/amzn/style-dictionary/issues/270)) ([2307a44](https://github.com/amzn/style-dictionary/commit/2307a44)), closes [#265](https://github.com/amzn/style-dictionary/issues/265)
|
|
278
|
-
* **ios-swift:** adding common transforms for Swift in iOS ([#255](https://github.com/amzn/style-dictionary/issues/255)) ([749db69](https://github.com/amzn/style-dictionary/commit/749db69)), closes [#161](https://github.com/amzn/style-dictionary/issues/161)
|
|
279
|
-
* **transforms:** Add UIColor transform for swift ([#250](https://github.com/amzn/style-dictionary/issues/250)) ([a62d880](https://github.com/amzn/style-dictionary/commit/a62d880)), closes [#161](https://github.com/amzn/style-dictionary/issues/161)
|
|
280
|
-
* **warning:** catch property name collisions during file output ([#273](https://github.com/amzn/style-dictionary/issues/273)) ([9a40407](https://github.com/amzn/style-dictionary/commit/9a40407))
|