Skip to content

Commit 098738b

Browse files
committed
fix(tokens): support style-dictionary build in windows env
1 parent 5c5c3f2 commit 098738b

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
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: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
default: "20"
2525
experimental:
2626
required: false
27-
default: false
27+
default: "false"
2828
ref:
2929
description: "The branch or tag to checkout"
3030
required: false
@@ -150,18 +150,11 @@ jobs:
150150
echo "Changes detected"
151151
git status
152152
git add .
153-
git diff > changes.diff
153+
git diff --staged > changes.diff
154154
exit 1
155155
fi
156156
157-
# If there are changes, capture the changes and upload them as an artifact
158-
- name: Capture changes
159-
if: ${{ failure() }}
160-
id: capture-changes
161-
run: |
162-
git diff
163-
git diff > changes.diff
164-
157+
# If there are changes, capture and upload them as an artifact
165158
- name: Upload changes
166159
if: ${{ failure() }}
167160
uses: actions/upload-artifact@v4

.github/workflows/development.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
# -------------------------------------------------------------
4343
# Validate build for various environments
4444
# -------------------------------------------------------------
45+
# todo: should we limit this to run before merging?
4546
verify_builds:
4647
name: Verify
4748
# Check that the PR is not in draft mode (or if it is, that it has the run_ci label to force a build)

tokens/project.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,17 @@
4646
},
4747
"style-dictionary": {
4848
"dependsOn": ["clean"],
49-
"executor": "@nxkit/style-dictionary:build",
49+
"executor": "nx:run-commands",
5050
"inputs": [
5151
"{projectRoot}/postcss.config.js",
5252
"{projectRoot}/style-dictionary.config.js",
5353
"{projectRoot}/utilities/style-dictionary.utils.js"
5454
],
5555
"options": {
56-
"deleteOutputPath": false,
57-
"outputPath": "./tokens",
58-
"platform": "CSS",
59-
"styleDictionaryConfig": "./tokens/style-dictionary.config.js",
60-
"tsConfig": "./tsconfig.json"
56+
"cwd": "{projectRoot}",
57+
"commands": [
58+
"style-dictionary build --config ./style-dictionary.config.js --platform CSS"
59+
]
6160
},
6261
"outputs": [
6362
"{projectRoot}/dist/global-vars.css",

tokens/style-dictionary.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
const path = require("path");
1515

16-
const generateFileConfig = require("./utilities/style-dictionary.utils.js");
16+
const generateFileConfig = require(path.join(__dirname, "utilities/style-dictionary.utils.js"));
1717

1818
const StyleDictionary = require("style-dictionary");
1919
const CSSSetsFormatter = require("style-dictionary-sets").CSSSetsFormatter;
@@ -38,10 +38,10 @@ const tokensDir = path.dirname(tokensPath);
3838
const setNames = ["desktop", "mobile", "light", "dark", "darkest"];
3939

4040
module.exports = {
41-
source: [`${tokensDir}/src/*.json`],
41+
source: [path.join(tokensDir, "src/*.json")],
4242
platforms: {
4343
CSS: {
44-
buildPath: "dist/css/",
44+
buildPath: path.join(__dirname, "dist/css/"),
4545
transforms: [
4646
AttributeSetsTransform.name,
4747
NameKebabTransfom.name,

0 commit comments

Comments
 (0)