Skip to content

Commit

Permalink
Version Packages (#284)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Jul 1, 2024
1 parent 67edf4b commit 57431ec
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 62 deletions.
5 changes: 0 additions & 5 deletions .changeset/four-shoes-peel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/giant-days-smash.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/good-ties-sell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/new-points-jam.md

This file was deleted.

14 changes: 0 additions & 14 deletions .changeset/odd-phones-fail.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/polite-cobras-arrive.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/twelve-icons-wait.md

This file was deleted.

15 changes: 0 additions & 15 deletions .changeset/yellow-nails-live.md

This file was deleted.

35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# @tokens-studio/sd-transforms

## 1.0.0

### Major Changes

- 67edf4b: 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.
- 67edf4b: BREAKING: Remove `expand` option, composite/object-value tokens must be expanded by using [Style Dictionary Expand](https://v4.styledictionary.com/reference/config/#expand).
- 67edf4b: BREAKING: remove CommonJS entrypoint and tools/scripts required to dual publish. Now that Style Dictionary v4 is ESM-only, this library will follow suit.
- 67edf4b: 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.

- 67edf4b: 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.

- 67edf4b: - 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`.

### Minor Changes

- 67edf4b: 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.
- 67edf4b: Add an adjust-types preprocessor utility that aligns the Tokens Studio types / object-value props with the DTCG ones.

## 0.16.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tokens-studio/sd-transforms",
"version": "0.16.1",
"version": "1.0.0",
"description": "Custom transforms for Style-Dictionary, to work with Design Tokens that are exported from Tokens Studio",
"license": "MIT",
"author": "Joren Broekema <joren.broekema@gmail.com>",
Expand Down

0 comments on commit 57431ec

Please sign in to comment.