Skip to content

Commit dd0694c

Browse files
committed
fix(tokens): support style-dictionary build in windows env
1 parent 03653df commit dd0694c

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
@@ -61,18 +61,17 @@
6161
},
6262
"style-dictionary": {
6363
"dependsOn": ["clean"],
64-
"executor": "@nxkit/style-dictionary:build",
64+
"executor": "nx:run-commands",
6565
"inputs": [
6666
"{projectRoot}/postcss.config.js",
6767
"{projectRoot}/style-dictionary.config.js",
6868
"{projectRoot}/utilities/style-dictionary.utils.js"
6969
],
7070
"options": {
71-
"deleteOutputPath": false,
72-
"outputPath": "./tokens",
73-
"platform": "CSS",
74-
"styleDictionaryConfig": "./tokens/style-dictionary.config.js",
75-
"tsConfig": "./tsconfig.json"
71+
"cwd": "{projectRoot}",
72+
"commands": [
73+
"style-dictionary build --config ./style-dictionary.config.js --platform CSS"
74+
]
7675
},
7776
"outputs": [
7877
"{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)