Skip to content

Commit 348d54c

Browse files
Merge pull request #100 from tokens-studio/upgrade-sd-27
feat: upgrade to style-dictionary pre 27
2 parents 58fbfa5 + c764610 commit 348d54c

File tree

6 files changed

+19
-10
lines changed

6 files changed

+19
-10
lines changed

.changeset/silent-tables-pretend.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tokens-studio/configurator": patch
3+
---
4+
5+
Upgrade to Style Dictionary 4.0.0-prerelease.27

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"./utils": "./src/utils.js"
1818
},
1919
"scripts": {
20+
"start": "wds",
2021
"dev": "wds",
2122
"build": "rimraf dist && rollup -c rollup.config.js",
2223
"release": "npm run build && changeset publish"
@@ -36,7 +37,7 @@
3637
"magic-string": "^0.30.8",
3738
"path-unified": "^0.1.0",
3839
"prettier": "^3.2.5",
39-
"style-dictionary": "4.0.0-prerelease.26",
40+
"style-dictionary": "4.0.0-prerelease.27",
4041
"uuid": "^9.0.1"
4142
},
4243
"devDependencies": {

src/components/platforms/platforms-dialog.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class PlatformsDialog extends LitElement {
137137
>
138138
<sd-selection-display slot="selection-display"></sd-selection-display>
139139
${repeat(
140-
Object.keys(StyleDictionary.transformGroup)
140+
Object.keys(StyleDictionary.hooks.transformGroups)
141141
// put tokens-studio transformGroup first
142142
.sort((a, b) => {
143143
if (a === "tokens-studio") return -1;
@@ -155,7 +155,7 @@ class PlatformsDialog extends LitElement {
155155
`
156156
)}
157157
${repeat(
158-
Object.keys(StyleDictionary.transform)
158+
Object.keys(StyleDictionary.hooks.transforms)
159159
// put tokens-studio transforms first
160160
.sort((a, b) => {
161161
if (a.startsWith("ts/")) return -1;
@@ -189,7 +189,7 @@ class PlatformsDialog extends LitElement {
189189
>
190190
<sd-selection-display slot="selection-display"></sd-selection-display>
191191
${repeat(
192-
Object.keys(StyleDictionary.format),
192+
Object.keys(StyleDictionary.hooks.formats),
193193
(format) => format,
194194
(format) => html`
195195
<sd-option .checked=${false} .choiceValue="${format}"

src/components/platforms/token-platforms.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ class TokenPlatforms extends LitElement {
169169
<div class="transform">
170170
<h4>${platform.transformGroup}</h4>
171171
<div class="text-small">
172-
${StyleDictionary.transformGroup[platform.transformGroup]?.join(", ")}
172+
${StyleDictionary.hooks.transformGroups[
173+
platform.transformGroup
174+
]?.join(", ")}
173175
</div>
174176
</div>
175177
`;

src/style-dictionary.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ import { snackbar } from "./components/snackbar/SnackbarManager.js";
2020
const { promises } = fs;
2121

2222
StyleDictionary.registerParser({
23+
name: "js-tokens-parser",
2324
// matches js, mjs
2425
pattern: /\.(j|mj)s$/,
25-
parse: async ({ filePath }) => {
26+
parser: async ({ filePath }) => {
2627
const bundled = await bundle(filePath);
2728
const url = URL.createObjectURL(
2829
new Blob([bundled], { type: "text/javascript" })

0 commit comments

Comments
 (0)