From d5d7a8e5e48341d16ad804950bbaba0204d9ad77 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:25:38 +0100 Subject: [PATCH] chore: release (prerelease) (#1108) Co-authored-by: github-actions[bot] --- .changeset/pre.json | 1 + CHANGELOG.md | 27 +++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 8ad9322dd..32e004398 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -27,6 +27,7 @@ "nice-ears-shop", "ninety-geckos-build", "old-ants-fix", + "pretty-clocks-guess", "rich-pianos-walk", "rotten-shirts-fail", "smooth-bulldogs-type", diff --git a/CHANGELOG.md b/CHANGELOG.md index e59c4ccaa..94b488d3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## 4.0.0-prerelease.15 + +### Major Changes + +- 502dbd1: BREAKING: All of our hooks, parsers, preprocessors, transforms, formats, actions, fileHeaders and filters, support async functions as well now. This means that the formatHelpers -> fileHeader helper method is now asynchronous, to support async fileheader functions. + + ```js + import StyleDictionary from 'style-dictionary'; + + const { fileHeader } = StyleDictionary.formatHelpers; + + StyleDictionary.registerFormat({ + name: 'custom/css', + // this can be async now, usually it is if you use fileHeader format helper, since that now always returns a Promise + formatter: async function ({ dictionary, file, options }) { + const { outputReferences } = options; + return ( + // this helper is now async! because the user-passed file.fileHeader might be an async function + (await fileHeader({ file })) + + ':root {\n' + + formattedVariables({ format: 'css', dictionary, outputReferences }) + + '\n}\n' + ); + }, + }); + ``` + ## 4.0.0-prerelease.14 ### Minor Changes diff --git a/package.json b/package.json index 61433f2e0..64f743f96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "style-dictionary", - "version": "4.0.0-prerelease.14", + "version": "4.0.0-prerelease.15", "description": "Style once, use everywhere. A build system for creating cross-platform styles.", "keywords": [ "style dictionary",