Skip to content

Commit

Permalink
feat: registers Tokens Studio transforms; build-tokens:watch NPM script
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz committed Sep 7, 2024
1 parent 029325a commit 5289111
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 144 deletions.
3 changes: 2 additions & 1 deletion lib/build-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ async function buildTokensCommand(commandArgs) {
source: tokensSource
? [`${tokensSource}/core/**/*.json`, `${tokensSource}/core/**/*.toml`]
: [],
preprocessors: ['tokens-studio'],
platforms: {
css: {
prefix: 'pgn',
transformGroup: 'paragon-css',
// NOTE: buildPath must end with a slash
buildPath: buildDir.slice(-1) === '/' ? buildDir : `${buildDir}/`,
options: {
Expand All @@ -82,7 +84,6 @@ async function buildTokensCommand(commandArgs) {
},
},
],
transforms: StyleDictionary.hooks.transformGroups.css.filter(item => item !== 'size/rem').concat('color/sass-color-functions', 'str-replace'),
},
},
log: {
Expand Down
64 changes: 64 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@
"playroom:build": "npm run playroom:build --workspace=www",
"prepare": "husky || true",
"build-tokens": "./bin/paragon-scripts.js build-tokens --build-dir ./styles/css",
"build-tokens:watch": "npx nodemon --ignore styles/css -x \"npm run build-tokens\"",
"replace-variables-usage-with-css": "./bin/paragon-scripts.js replace-variables -p src -t usage",
"replace-variables-definition-with-css": "./bin/paragon-scripts.js replace-variables -p src -t definition",
"cli:help": "./bin/paragon-scripts.js help"
},
"dependencies": {
"@popperjs/core": "^2.11.4",
"@tokens-studio/sd-transforms": "^1.2.4",
"axios": "^0.27.2",
"bootstrap": "^4.6.2",
"chalk": "^4.1.2",
Expand Down
Loading

0 comments on commit 5289111

Please sign in to comment.