Skip to content

Commit

Permalink
fix: handle (deep) references for expandable composite tokens (#133)
Browse files Browse the repository at this point in the history
* fix: handle (deep) references for expandable composite tokens

* chore: simplify bundling

* chore: fix test coverage

* chore: adjust rollup config

* chore: clean up
  • Loading branch information
jorenbroekema committed Jun 2, 2023
1 parent b69b05b commit bd7fe6e
Show file tree
Hide file tree
Showing 20 changed files with 480 additions and 1,781 deletions.
5 changes: 5 additions & 0 deletions .changeset/long-crews-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/sd-transforms': patch
---

Handle references and deep references for tokens that can be expanded, like typography, border, shadow and composition.
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ npm-debug.log
## temp folders
/coverage/

index.cjs
src/postcss-calc-ast-parser.ts
src/deepmerge.ts
dist/
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ npm-debug.log
## temp folders
/coverage/

index.cjs
src/postcss-calc-ast-parser.ts
src/deepmerge.ts
dist/
3 changes: 0 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ npm-debug.log
## temp folders
/coverage/

index.cjs
src/postcss-calc-ast-parser.ts
src/deepmerge.ts
dist/
15 changes: 0 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@

Things to know before contributing:

## ESMify postcss-calc-ast-parser & deepmerge

We use postcss-calc-ast-parser to evaluate math expressions inside token values.
We use deepmerge to merge objects together.
These modules are CommonJS only, so it doesn't work in browser environments.

This is only a problem of the format, so it's easily fixed by using a bundler to format it to ESM.
Run:

```sh
npm run build
```

before doing things like linting, testing etc., or you will get errors.

## Tests

Unit tests should provide 100% coverage. Use:
Expand Down
241 changes: 228 additions & 13 deletions package-lock.json

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

0 comments on commit bd7fe6e

Please sign in to comment.