Skip to content

Commit f817f73

Browse files
authored
fix(tokens): support style-dictionary build in windows env (#2500)
1 parent 048399e commit f817f73

39 files changed

+2300
-1459
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* text=auto eol=lf
12
README.md merge=ours
23

34
# Treat yarn assets as binaries for diffing

.github/workflows/build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,15 @@ jobs:
150150
echo "Changes detected"
151151
git status
152152
git add .
153-
git diff > changes.diff
154153
exit 1
155154
fi
156155
156+
# If there are changes, capture the changes and upload them as an artifact
157+
- name: Capture changes
158+
if: ${{ failure() }}
159+
id: capture-changes
160+
run: git diff --staged > changes.diff
161+
157162
- name: Upload changes
158163
if: ${{ failure() }}
159164
uses: actions/upload-artifact@v4

.github/workflows/development.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,15 @@ jobs:
5252
system:
5353
- macos-latest
5454
- ubuntu-latest
55-
# - windows-latest # todo: debug token style-dictionary failures on windows
5655
node-version:
5756
- 20
57+
# experimental:
58+
# - false
59+
# include:
60+
# - system: windows-latest
61+
# experimental: true
62+
# - system: windows-latest
63+
# experimental: true
5864
uses: ./.github/workflows/build.yml
5965
with:
6066
system: ${{ matrix.system }}
@@ -190,7 +196,7 @@ jobs:
190196
# -------------------------------------------------------------
191197
vrt:
192198
name: Testing
193-
if: contains(github.event.pull_request.labels.*.name, 'run_vrt') || ((github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'run_ci')) && github.event.pull_request.mergeable == true)
199+
if: ${{ contains(github.event.pull_request.labels.*.name, 'run_vrt') || ((github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'run_ci')) && github.event.pull_request.mergeable == true) }}
194200
uses: ./.github/workflows/vrt.yml
195201
with:
196202
skip: ${{ github.base_ref == 'spectrum-two' || contains(github.event.pull_request.labels.*.name, 'skip_vrt') }}

.storybook/blocks/utilities.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function fetchToken(key, fallback = undefined, presets = {}) {
9393
// Check if the spectrum data is available
9494
if (!tokens || typeof tokens !== "object") return fallback;
9595

96-
return parseData(tokens[key], { color, platform }) ?? fallback;
96+
return parseData(tokens?.[key], { color, platform }) ?? fallback;
9797
}
9898

9999
/**
@@ -110,7 +110,7 @@ export function fetchTokenSet(key, presets = {}) {
110110
}
111111

112112
// Fetch the theme if it exists; this data exists if wrapped in a ThemeProvider
113-
const { color, platform, tokens } = fetchTheme(presets);
113+
const { color, platform, tokens = {} } = fetchTheme(presets);
114114

115115
// Check the token data for a set of tokens matching the provided regex
116116
const tokenSet = Object.keys(tokens)

.storybook/package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@
4949
"@babel/core": "^7.26.0",
5050
"@chromatic-com/storybook": "^3.2.3",
5151
"@etchteam/storybook-addon-status": "^5.0.0",
52-
"@storybook/addon-a11y": "^8.4.7",
53-
"@storybook/addon-actions": "^8.4.7",
54-
"@storybook/addon-designs": "^8.0.4",
55-
"@storybook/addon-docs": "^8.4.7",
56-
"@storybook/addon-essentials": "^8.4.7",
57-
"@storybook/addon-interactions": "^8.4.7",
58-
"@storybook/blocks": "^8.4.7",
59-
"@storybook/builder-vite": "^8.4.7",
60-
"@storybook/components": "^8.4.7",
61-
"@storybook/core-events": "^8.4.7",
62-
"@storybook/manager-api": "^8.4.7",
63-
"@storybook/preview-api": "^8.4.7",
64-
"@storybook/test-runner": "^0.21.0",
65-
"@storybook/theming": "^8.4.7",
66-
"@storybook/web-components-vite": "^8.4.7",
52+
"@storybook/addon-a11y": "8.4.7",
53+
"@storybook/addon-actions": "8.4.7",
54+
"@storybook/addon-designs": "^8.2.1",
55+
"@storybook/addon-docs": "8.4.7",
56+
"@storybook/addon-essentials": "8.4.7",
57+
"@storybook/addon-interactions": "8.4.7",
58+
"@storybook/blocks": "8.4.7",
59+
"@storybook/builder-vite": "8.4.7",
60+
"@storybook/components": "8.4.7",
61+
"@storybook/core-events": "8.4.7",
62+
"@storybook/manager-api": "8.4.7",
63+
"@storybook/preview-api": "8.4.7",
64+
"@storybook/test-runner": "^0.22.0",
65+
"@storybook/theming": "8.4.7",
66+
"@storybook/web-components-vite": "8.4.7",
6767
"@whitespace/storybook-addon-html": "^6.1.1",
6868
"chromatic": "^11.22.2",
6969
"lit": "^3.2.1",
@@ -76,7 +76,7 @@
7676
"react-syntax-highlighter": "^15.6.1",
7777
"remark-gfm": "^4.0.0",
7878
"rollup-plugin-postcss-lit": "^2.1.0",
79-
"storybook": "^8.4.7",
79+
"storybook": "8.4.7",
8080
"vite": "^5.4.11"
8181
},
8282
"keywords": [

nx.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,20 @@
8989
"cross-env NODE_OPTIONS=\"--no-warnings\" node -e 'require(\"./tasks/component-builder.js\").default()'"
9090
]
9191
},
92-
"outputs": ["{projectRoot}/dist/*.css", "{projectRoot}/dist/*.map"]
92+
"outputs": ["{projectRoot}/dist/*.css*", "{projectRoot}/dist/**/*.css*"]
9393
},
9494
"clean": {
9595
"cache": true,
9696
"executor": "nx:run-commands",
97-
"inputs": ["{projectRoot}/dist/*.css", "{projectRoot}/dist/*.map", { "externalDependencies": ["rimraf"] }],
97+
"inputs": ["{projectRoot}/dist/*.css*", "{projectRoot}/dist/**/*.css*", { "externalDependencies": ["rimraf"] }],
9898
"options": {
99-
"commands": ["rimraf {projectRoot}/dist/*.css {projectRoot}/dist/*.map"]
99+
"commands": ["rimraf {projectRoot}/dist/*.css* {projectRoot}/dist/**/"]
100100
},
101101
"outputs": ["{projectRoot}/dist"]
102102
},
103103
"compare": {
104104
"cache": true,
105-
"dependsOn": [{ "projects": "bundle", "target": "build" }],
105+
"dependsOn": ["build", { "projects": ["bundle"], "target": "build" }],
106106
"executor": "nx:run-commands",
107107
"inputs": [
108108
"{workspaceRoot}/tasks/compare-compiled-output.js",
@@ -217,6 +217,7 @@
217217
}
218218
},
219219
"validate": {
220+
"cache": true,
220221
"executor": "nx:run-commands",
221222
"inputs": [
222223
"{workspaceRoot}/schemas/metadata.schema.json",

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"clean:env": "rm -rf .env .storybook/chromatic.config.json",
2828
"clean:preview": "nx clean storybook --skip-nx-cache",
2929
"cleaner": "nx run-many --target clean --projects",
30-
"compare": "cross-env NODE_ENV=production node --no-warnings ./tasks/compare-compiled-output.js",
30+
"compare": "cross-env NODE_ENV=production yarn bundle && yarn component:compare",
3131
"component:build": "node --no-warnings ./tasks/component-builder.js",
3232
"component:compare": "node --no-warnings ./tasks/component-compare.js",
3333
"component:report": "node --no-warnings ./tasks/component-reporter.js",
@@ -70,7 +70,6 @@
7070
"@changesets/cli": "^2.27.11",
7171
"@commitlint/cli": "^19.6.1",
7272
"@commitlint/config-conventional": "^19.6.0",
73-
"@csstools/postcss-bundler": "^2.0.6",
7473
"@nx/devkit": "^19.8.2",
7574
"@spectrum-tools/postcss-add-theming-layer": "1.0.2",
7675
"@spectrum-tools/postcss-property-rollup": "0.0.1",
@@ -117,9 +116,9 @@
117116
"prettier": "^3.5.3",
118117
"rimraf": "^6.0.1",
119118
"semver": "^7.7.1",
120-
"stylelint": "^16.15.0",
121-
"stylelint-config-standard": "^36.0.1",
122-
"stylelint-header": "^2.1.0",
119+
"stylelint": "^16.18.0",
120+
"stylelint-config-standard": "^38.0.0",
121+
"stylelint-header": "^3.0.0",
123122
"stylelint-high-performance-animation": "^1.11.0",
124123
"stylelint-order": "^6.0.4",
125124
"stylelint-selector-bem-pattern": "^4.0.1",

plugins/postcss-add-theming-layer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const {
1717
extractFallbackValue,
1818
getVariableName,
1919
checkForReplacement
20-
} = require("./utilities");
20+
} = require("./utilities.js");
2121

2222
/**
2323
* @typedef Options

plugins/stylelint-no-missing-var/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"devDependencies": {
3636
"ava": "^6.2.0",
3737
"c8": "^10.1.3",
38-
"stylelint": "^16.15.0"
38+
"stylelint": "^16.18.0"
3939
},
4040
"keywords": [
4141
"css",

plugins/stylelint-no-unknown-custom-properties/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"devDependencies": {
3939
"ava": "^6.2.0",
4040
"c8": "^10.1.3",
41-
"stylelint": "^16.15.0"
41+
"stylelint": "^16.18.0"
4242
},
4343
"keywords": [
4444
"css",

0 commit comments

Comments
 (0)