Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare v1 release #283

Merged
merged 12 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/four-shoes-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/sd-transforms': minor
---

Adjust add-font-styles parser to also run on tokens of type fontWeight, to create a sibling token for the fontStyle if it is included in the fontWeight token.
5 changes: 5 additions & 0 deletions .changeset/giant-days-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/sd-transforms': major
---

BREAKING: `descriptionToComment` transform no longer removes newlines, just turns carriage returns into newlines. Style Dictionary now handles comments with newlines properly in its createPropertyFormatter utility.
5 changes: 5 additions & 0 deletions .changeset/good-ties-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/sd-transforms': major
---

BREAKING: Remove `expand` option, composite/object-value tokens must be expanded by using [Style Dictionary Expand](https://v4.styledictionary.com/reference/config/#expand).
5 changes: 5 additions & 0 deletions .changeset/new-points-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/sd-transforms': major
---

BREAKING: remove CommonJS entrypoint and tools/scripts required to dual publish. Now that Style Dictionary v4 is ESM-only, this library will follow suit.
14 changes: 14 additions & 0 deletions .changeset/odd-phones-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@tokens-studio/sd-transforms': major
---

BREAKING: `transformFontWeights` has been renamed to `transformFontWeight` for consistency.

Apply transforms to object-value (composite) token types:

- HEXRGBa transform applies to border and shadow colors
- Px dimension transform applies to border, typography and shadow dimensions
- Letterspacing, lineheights and fontweights transforms apply to these respective typography properties
- Resolve math transform applies to all properties of border, typography and shadow tokens

This also means that all transforms except for description to comment mapping are now transitive transforms, since the math resolve transform must be transitive and all other transforms must apply after the math one.
7 changes: 7 additions & 0 deletions .changeset/polite-cobras-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@tokens-studio/sd-transforms': major
---

BREAKING: remove CSS shorthand transforms for border, typography and shadow. Use the Style Dictionary transforms instead: https://styledictionary.com/reference/hooks/transforms/predefined/#bordercssshorthand.

Note that if you're not disabling the `withSDBuiltins` option, the `tokens-studio` transformGroup will include the ones in the `css` built-in transformGroup, so you might not notice the fact that they are moved.
5 changes: 5 additions & 0 deletions .changeset/twelve-icons-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/sd-transforms': minor
---

Add an adjust-types preprocessor utility that aligns the Tokens Studio types / object-value props with the DTCG ones.
15 changes: 15 additions & 0 deletions .changeset/yellow-nails-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@tokens-studio/sd-transforms': major
---

- BREAKING: Compatible with Style Dictionary >= v4.0.0. Not compatible with anything below that SD version.

- BREAKING: `registerTransforms` function has been renamed to `register`.

- BREAKING: `transforms` array has been refactored to `getTransforms()`, which is a function you should call. Optionally pass in the new platform option as parameter `{ platform: 'css' /* or 'compose' */}`

- BREAKING: By default, registered `tokens-studio` transformGroup will include the platform's Style Dictionary built-in transforms. E.g. if you're registering for platform `css` it will include the `css` transformGroup transforms from Style Dictionary, appended to the Tokens Studio specific transforms. This behavior can be disabled by passing `{ withSDBuiltins: false }`.

- Allow passing platform to the `register()` call: `register(SD, { platform: 'compose' })`. Default value is `'css'`. This means your `tokens-studio` group will be registered for that specific platform.

- Allow passing `name` to the `register()` call to configure the transformGroup name: `register(SD, { name: 'tokens-studio-css' })`. Default value is `tokens-studio`.
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: npm run lint

- name: Install chromium
run: npx playwright install-deps chromium
run: npx playwright install --with-deps chromium

- name: Unit tests
run: npm run test:unit
Expand Down
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Contributing Guidelines

Things to know before contributing:
Any contribution is greatly appreciated. If you feel like you lack knowledge/experience, even just creating a good issue with a minimal reproduction is already huge.
If you can create a PR with a failing test showing the bug you found, even better, don't worry about putting the test in the perfect location but as a rule of thumb, if your bug is only reproducible in combination with Style Dictionary, put it in the `test/integration`, if it's more isolated to sd-transforms you can put it in `test/spec` folder.

Is TypeScript not your strength and having issues? No problem, just do what you can and I'll help you fix whatever's broken in the PR.

## Tests

Expand All @@ -15,6 +18,9 @@ To run the tests and view the coverage report, to see which things are untested.

If some line of code really cannot be covered by a test or just doesn't make sense, [see here how to ignore them](https://modern-web.dev/docs/test-runner/writing-tests/code-coverage/#ignoring-uncovered-lines).

> 100% may seem a bit crazy, but just know that it's a lot easier to retain 100% than to get it for the first time ;)
> The biggest benefit to 100% is that it makes it very easy to identify redundant code; if it's redundant, it won't be covered.

## Linting

This checks code quality with ESLint, formatting with Prettier and types with TypeScript.
Expand Down
Loading
Loading