diff --git a/.changeset/four-bulldogs-protect.md b/.changeset/four-bulldogs-protect.md deleted file mode 100644 index 7c92ea7..0000000 --- a/.changeset/four-bulldogs-protect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@divriots/style-dictionary-to-figma': patch ---- - -Fix clean-meta utility by using a proper isObject check which excludes arrays (values can be arrays). diff --git a/.changeset/spicy-sloths-rescue.md b/.changeset/spicy-sloths-rescue.md deleted file mode 100644 index 7f42589..0000000 --- a/.changeset/spicy-sloths-rescue.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -'@divriots/style-dictionary-to-figma': minor ---- - -BREAKING: if an upper token group does not have a tokenset property, it will get placed in a "global" tokenset by default. This means that no action is required by the user of the transformer to get a working JSON for Figma Tokens Plugin, but this change is potentially breaking because of how it changes the JSON output. - -### Before - -```json -{ - "core": { - "color": { - "primary": { - "base": { - "type": "color", - "value": "#14b8a6" - }, - "secondary": { - "type": "color", - "value": "#ff0000" - } - } - } - } -} -``` - -Nothing is changed in the output. However, if you have references, they might be broken because the plugin will interpret this as `"color"` being the upper property in a tokenset called `"core"`. - -### After - -```json -{ - "core": { - "color": { - "primary": { - "base": { - "type": "color", - "value": "#14b8a6" - }, - "secondary": { - "type": "color", - "value": "#ff0000" - } - } - } - } -} -``` - -turns into - -```json -{ - "global": { - "core": { - "color": { - "primary": { - "base": { - "type": "color", - "value": "#14b8a6" - }, - "secondary": { - "type": "color", - "value": "#ff0000" - } - } - } - } - } -} -``` - -Your reference, for example `{core.color.primary.base}` will now work properly because `"core"` is not interpreted as the tokenset, `"global"` is. diff --git a/CHANGELOG.md b/CHANGELOG.md index e81d98b..de3cc62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,84 @@ # @divriots/style-dictionary-to-figma +## 0.4.0 + +### Minor Changes + +- ab01a1e: BREAKING: if an upper token group does not have a tokenset property, it will get placed in a "global" tokenset by default. This means that no action is required by the user of the transformer to get a working JSON for Figma Tokens Plugin, but this change is potentially breaking because of how it changes the JSON output. + + ### Before + + ```json + { + "core": { + "color": { + "primary": { + "base": { + "type": "color", + "value": "#14b8a6" + }, + "secondary": { + "type": "color", + "value": "#ff0000" + } + } + } + } + } + ``` + + Nothing is changed in the output. However, if you have references, they might be broken because the plugin will interpret this as `"color"` being the upper property in a tokenset called `"core"`. + + ### After + + ```json + { + "core": { + "color": { + "primary": { + "base": { + "type": "color", + "value": "#14b8a6" + }, + "secondary": { + "type": "color", + "value": "#ff0000" + } + } + } + } + } + ``` + + turns into + + ```json + { + "global": { + "core": { + "color": { + "primary": { + "base": { + "type": "color", + "value": "#14b8a6" + }, + "secondary": { + "type": "color", + "value": "#ff0000" + } + } + } + } + } + } + ``` + + Your reference, for example `{core.color.primary.base}` will now work properly because `"core"` is not interpreted as the tokenset, `"global"` is. + +### Patch Changes + +- ab01a1e: Fix clean-meta utility by using a proper isObject check which excludes arrays (values can be arrays). + ## 0.3.3 ### Patch Changes diff --git a/package.json b/package.json index 93a836e..583885c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@divriots/style-dictionary-to-figma", - "version": "0.3.3", + "version": "0.4.0", "description": "A utility that transforms a style-dictionary object into something Figma Tokens plugin understands", "license": "MIT", "author": "divRiots ",