Skip to content

Commit

Permalink
chore(release): 3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanksdesign committed Aug 19, 2021
1 parent 0cf6c52 commit a482a03
Show file tree
Hide file tree
Showing 25 changed files with 79 additions and 28 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

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.

### [3.0.2](https://github.com/amzn/style-dictionary/compare/v3.0.1...v3.0.2) (2021-08-19)


### Bug Fixes

* **format:** 'typescript/es6-declarations' return type ([#681](https://github.com/amzn/style-dictionary/issues/681)) ([0cf6c52](https://github.com/amzn/style-dictionary/commit/0cf6c52a3f85a91e5763dc31e0fb6efe2a531e25))
* **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)
* **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))
* **types:** format config expects formatter function ([#650](https://github.com/amzn/style-dictionary/issues/650)) ([b12c4b1](https://github.com/amzn/style-dictionary/commit/b12c4b1c6a94c62c757cd1675d216d9638f8d6e0))

### [3.0.1](https://github.com/amzn/style-dictionary/compare/v3.0.0...v3.0.1) (2021-06-07)


Expand Down
49 changes: 45 additions & 4 deletions docs/formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,17 @@ StyleDictionary.registerFormat({
// the `dictionary` object now has `usesReference()` and
// `getReferences()` methods. `usesReference()` will return true if
// the value has a reference in it. `getReferences()` will return
// an array of references to the whole tokens so that you can access its
// name or any other attributes.
// an array of references to the whole tokens so that you can access their
// names or any other attributes.
if (dictionary.usesReference(token.original.value)) {
// Note: make sure to use `token.original.value` because
// `token.value` is already resolved at this point.
const reference = dictionary.getReferences(token.original.value);
value = reference.name;
const refs = dictionary.getReferences(token.original.value);
refs.forEach(ref => {
value = value.replace(ref.value, function() {
return `${ref.name}`;
});
});
}
return `export const ${token.name} = ${value};`
}).join(`\n`)
Expand Down Expand Up @@ -480,6 +484,43 @@ StyleDictionary.registerFormat({
* * *
### getTypeScriptType
> formatHelpers.getTypeScriptType(value) ⇒ <code>String</code>
Given some value, returns a basic valid TypeScript type for that value.
Supports numbers, strings, booleans, and arrays of any of those types.
**Returns**: <code>String</code> - A valid name for a TypeScript type.
```
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>value</td><td><code>*</code></td><td><p>A value to check the type of.</p>
</td>
</tr> </tbody>
</table>

**Example**
```javascript
StyleDictionary.registerFormat({
name: 'myCustomFormat',
formatter: function({ dictionary, options }) {
return dictionary.allProperties.map(function(prop) {
var to_ret_prop = 'export const ' + prop.name + ' : ' + getTypeScriptType(prop.value) + ';';
if (prop.comment)
to_ret_prop = to_ret_prop.concat(' // ' + prop.comment);
return to_ret_prop;
}).join('\n');
}
});
* * *
### iconsWithPrefix
> formatHelpers.iconsWithPrefix(prefix, allTokens, options) ⇒ <code>String</code>
Expand Down
2 changes: 1 addition & 1 deletion docs/transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ EDIT scripts/handlebars/templates/api.hbs OR JSDOC COMMENT INSTEAD!
-->
# Transforms

Transforms are functions that modify a [token](tokens.md) so that it can be understood by a specific platform. It can modify the name, value, or attributes of a token - enabling each platform to use the design token in different ways. A simple example is changing pixel values to point values for iOS and dp or sp for Android. Transforms are isolated per platform; each platform begins with the same design token and makes the modifications it needs without affecting other platforms. The order you use transforms matters because transforms are performed sequentially. Transforms are used in your [configuration](config.md), and can be either [pre-defined transforms](transforms.md?id=pre-defined-transforms) supplied by Style Dictionary or [custom transforms](transforms.md?id=defining-custom-transforms).
Transforms are functions that modify a [token](tokens.md) so that it can be understood by a specific platform. It can modify the name, value, or attributes of a token - enabling each platform to use the design token in different ways. A simple example is changing pixel values to point values for iOS and dp or sp for Android. Transforms are isolated per platform; each platform begins with the same design token and makes the modifications it needs without affecting other platforms. The order you use transforms matters because transforms are performed sequentially. Transforms are used in your [configuration](config.md), and can be either [pre-defined transforms](transforms.md?id=defining-custom-transforms) supplied by Style Dictionary or [custom transforms](transforms.md?id=defining-custom-transforms).

## Using Transforms
You use transforms in your config file under platforms > [platform] > transforms
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/assets-base64-embed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/auto-rebuild-watcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"license": "Apache-2.0",
"devDependencies": {
"chokidar-cli": "^1.2.0",
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/component-cti/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
4 changes: 2 additions & 2 deletions examples/advanced/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"styled-components": "^5.3.0"
},
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
},
"resolutions": {
"immer": "8.0.1",
Expand All @@ -35,4 +35,4 @@
"not op_mini all"
],
"license": "Apache-2.0"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/create-react-native-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"babel-jest": "~25.2.6",
"jest": "~25.2.6",
"react-test-renderer": "~16.13.1",
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
},
"jest": {
"preset": "react-native"
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/custom-file-header/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"author": "",
"license": "ISC",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"handlebars": "^4.7.7",
"lodash": "^4.17.21",
"pug": "^3.0.2",
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/custom-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/custom-transforms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/format-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/matching-build-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"author": "Kelly Harrop <kn.harrop@gmail.com>",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/multi-brand-multi-platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"homepage": "https://github.com/dbanksdesign/style-dictionary-node#readme",
"devDependencies": {
"style-dictionary": "3.0.1",
"style-dictionary": "3.0.2",
"tinycolor2": "^1.4.1"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/npm-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/referencing_aliasing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"devDependencies": {
"aws-sdk": "^2.7.21",
"fs-extra": "^1.0.0",
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/tokens-deprecation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"license": "Apache-2.0",
"devDependencies": {
"lodash": "^4.17.11",
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/transitive-transforms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"license": "ISC",
"devDependencies": {
"chroma-js": "^2.1.0",
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/variables-in-outputs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"author": "",
"license": "MIT",
"devDependencies": {
"style-dictionary": "3.0.1"
"style-dictionary": "3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/yaml-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "3.0.1",
"style-dictionary": "3.0.2",
"yaml": "^1.10.0"
}
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "style-dictionary",
"version": "3.0.1",
"version": "3.0.2",
"description": "Style once, use everywhere. A build system for creating cross-platform styles.",
"keywords": [
"style dictionary",
Expand Down

0 comments on commit a482a03

Please sign in to comment.