diff --git a/.changeset/pre.json b/.changeset/pre.json index d99effdbd..5245a97de 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -8,12 +8,15 @@ "big-worms-collect-2", "big-worms-collect", "bright-timers-shout", + "eight-items-cheat", "fifty-dragons-heal", "gorgeous-lamps-chew", + "happy-numbers-grab", "honest-toes-wink", "light-games-occur", "nice-ears-shop", "old-ants-fix", + "sweet-toes-fly", "unlucky-cameras-draw" ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 0547d7c58..5b5870219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## 4.0.0-prerelease.4 + +### Minor Changes + +- 122c8f6: Expose a new utility called resolveReferences which takes a value containing references, the dictionary object, and resolves the value's references for you. + + ```js + import StyleDictionary from 'style-dictionary'; + import { resolveReferences } from 'style-dictionary/utils'; + + const sd = new StyleDictionary({ + tokens: { + foo: { value: 'foo' }, + bar: { value: '{foo}' }, + qux: { value: '{bar}' }, + }, + }); + + console.log(resolveReferences(sd.tokens.qux.value, sd.tokens)); // 'foo' + ``` + +- 122c8f6: BREAKING: expose getReferences and usesReference utilities as standalone utils rather than requiring them to be bound to dictionary object. This makes it easier to use. + +### Patch Changes + +- 044123c: Patch StyleDictionary main type file to export default instead of "export =" which does not work in ESM. + ## 4.0.0-prerelease.3 ### Patch Changes diff --git a/package.json b/package.json index 7e15cc3de..59a05c1d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "style-dictionary", - "version": "4.0.0-prerelease.3", + "version": "4.0.0-prerelease.4", "description": "Style once, use everywhere. A build system for creating cross-platform styles.", "keywords": [ "style dictionary",