Skip to content

Commit

Permalink
chore(deps): update dependency @tokens-studio/sd-transforms to v1 (#3332
Browse files Browse the repository at this point in the history
)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[@tokens-studio/sd-transforms](https://togithub.com/tokens-studio/sd-transforms)
| [`0.16.1` ->
`1.2.0`](https://renovatebot.com/diffs/npm/@tokens-studio%2fsd-transforms/0.16.1/1.2.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@tokens-studio%2fsd-transforms/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@tokens-studio%2fsd-transforms/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@tokens-studio%2fsd-transforms/0.16.1/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@tokens-studio%2fsd-transforms/0.16.1/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>tokens-studio/sd-transforms
(@&#8203;tokens-studio/sd-transforms)</summary>

###
[`v1.2.0`](https://togithub.com/tokens-studio/sd-transforms/blob/HEAD/CHANGELOG.md#120)

[Compare
Source](https://togithub.com/tokens-studio/sd-transforms/compare/v1.1.0...v1.2.0)

##### Minor Changes

-
[`ff31df8`](https://togithub.com/tokens-studio/sd-transforms/commit/ff31df8):
Add lineHeight and fontWeight types to the expandTypesMap. Even though
DTCG spec does not yet recognize them, they really are special types and
marking them as such enables transforms to target them specifically.
-
[`ff31df8`](https://togithub.com/tokens-studio/sd-transforms/commit/ff31df8):
Properly split fontWeight tokens that contain fontStyle into the parent
group. For typography tokens this was correct but for fontWeight tokens,
collision could occur between the token and its sibling tokens.

###
[`v1.1.0`](https://togithub.com/tokens-studio/sd-transforms/blob/HEAD/CHANGELOG.md#110)

[Compare
Source](https://togithub.com/tokens-studio/sd-transforms/compare/v1.0.1...v1.1.0)

##### Minor Changes

-
[`c687817`](https://togithub.com/tokens-studio/sd-transforms/commit/c687817):
Add the `originalType` property to `$extensions.['studio.tokens']` to
store the original Tokens Studio token type, when the type is aligned to
DTCG types. LetterSpacing transform is the transform in this package
that actually needs to use this, because it doesn't want to match all
dimension tokens, but it does want to match letterSpacing tokens.
-
[`ed10715`](https://togithub.com/tokens-studio/sd-transforms/commit/ed10715):
Allow changing the resolve math transform amount of decimals to round
for using platform options `mathFractionDigits`, change default value
from 3 to 4.

##### Patch Changes

-
[`c687817`](https://togithub.com/tokens-studio/sd-transforms/commit/c687817):
Fix alignTypes to also include `borderWidth`, `letterSpacing`,
`paragraphSpacing` and `paragraphIndent` and align them to `dimension`.
-
[`9c02741`](https://togithub.com/tokens-studio/sd-transforms/commit/9c02741):
Fix bug where usesDtcg flag was not passed to resolveReference utility.

###
[`v1.0.1`](https://togithub.com/tokens-studio/sd-transforms/blob/HEAD/CHANGELOG.md#101)

[Compare
Source](https://togithub.com/tokens-studio/sd-transforms/compare/v1.0.0...v1.0.1)

##### Patch Changes

-
[`6c7b2ff`](https://togithub.com/tokens-studio/sd-transforms/commit/6c7b2ff):
Fix tsconfig to exclude test files and ensure dist folder structure is
correct.

###
[`v1.0.0`](https://togithub.com/tokens-studio/sd-transforms/blob/HEAD/CHANGELOG.md#100)

[Compare
Source](https://togithub.com/tokens-studio/sd-transforms/compare/v0.16.1...v1.0.0)

##### Major Changes

-
[`67edf4b`](https://togithub.com/tokens-studio/sd-transforms/commit/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`](https://togithub.com/tokens-studio/sd-transforms/commit/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`](https://togithub.com/tokens-studio/sd-transforms/commit/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`](https://togithub.com/tokens-studio/sd-transforms/commit/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`](https://togithub.com/tokens-studio/sd-transforms/commit/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`](https://togithub.com/tokens-studio/sd-transforms/commit/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`](https://togithub.com/tokens-studio/sd-transforms/commit/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`](https://togithub.com/tokens-studio/sd-transforms/commit/67edf4b):
Add an adjust-types preprocessor utility that aligns the Tokens Studio
types / object-value props with the DTCG ones.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on the first day of the
month" in timezone Europe/Zurich, Automerge - At any time (no schedule
defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/swisspost/design-system).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyLwn5OmIHRva2VucyJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Philipp Gfeller <[email protected]>
  • Loading branch information
renovate[bot] and gfellerph authored Jul 24, 2024
1 parent cb15f35 commit c202fa1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions packages/tokens/build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { registerTransforms } from '@tokens-studio/sd-transforms';
import { register } from '@tokens-studio/sd-transforms';
import StyleDictionary from 'style-dictionary';
import { usesReferences } from 'style-dictionary/utils';
import { promises } from 'fs';
Expand All @@ -9,7 +9,7 @@ const FILE_HEADER =
'// Do not edit manually!\n// This file was generated on:\n// {date} by the @swisspost/design-system-tokens package build command\n\n';
const GLOBAL_TOKEN_NAMESPACES = ['post'];

registerTransforms(StyleDictionary);
register(StyleDictionary);

/**
* @function StyleDictionary.registerFilter()
Expand Down
2 changes: 1 addition & 1 deletion packages/tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"linkDirectory": true
},
"devDependencies": {
"@tokens-studio/sd-transforms": "0.16.1",
"@tokens-studio/sd-transforms": "1.2.0",
"style-dictionary": "4.0.1"
}
}
39 changes: 20 additions & 19 deletions pnpm-lock.yaml

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

0 comments on commit c202fa1

Please sign in to comment.