From 342189f48695853ab67d7c2dbf17fd64536b8c22 Mon Sep 17 00:00:00 2001 From: jorenbroekema Date: Tue, 14 May 2024 13:56:58 +0200 Subject: [PATCH] feat: tokens-studio preprocessor in default config --- .changeset/rare-trainers-guess.md | 5 +++++ src/style-dictionary.js | 2 +- src/utils/file-tree.js | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/rare-trainers-guess.md diff --git a/.changeset/rare-trainers-guess.md b/.changeset/rare-trainers-guess.md new file mode 100644 index 0000000..7fe5995 --- /dev/null +++ b/.changeset/rare-trainers-guess.md @@ -0,0 +1,5 @@ +--- +"@tokens-studio/configurator": patch +--- + +Add preprocessors tokens-studio in default config, since SD prerelease 27 this must be explicit in the config. diff --git a/src/style-dictionary.js b/src/style-dictionary.js index 2741d9d..1dcd48a 100644 --- a/src/style-dictionary.js +++ b/src/style-dictionary.js @@ -20,7 +20,7 @@ import { snackbar } from "./components/snackbar/SnackbarManager.js"; const { promises } = fs; StyleDictionary.registerParser({ - name: "js-tokens-parser", + name: "tokens-studio/parser-js", // matches js, mjs pattern: /\.(j|mj)s$/, parser: async ({ filePath }) => { diff --git a/src/utils/file-tree.js b/src/utils/file-tree.js index 9c10487..2b91522 100644 --- a/src/utils/file-tree.js +++ b/src/utils/file-tree.js @@ -102,6 +102,7 @@ export async function createConfig() { JSON.stringify( { source: ["**/*.json"], + preprocessors: ["tokens-studio"], platforms: { css: { transformGroup: "tokens-studio",