From c202fa116ffab90d83e5769108f12d54e213b31f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:26:36 +0200 Subject: [PATCH] chore(deps): update dependency @tokens-studio/sd-transforms to v1 (#3332) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![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
tokens-studio/sd-transforms (@​tokens-studio/sd-transforms) ### [`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.
--- ### 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. --- - [ ] 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). --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Philipp Gfeller --- packages/tokens/build.js | 4 ++-- packages/tokens/package.json | 2 +- pnpm-lock.yaml | 39 ++++++++++++++++++------------------ 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/packages/tokens/build.js b/packages/tokens/build.js index c788960ace..3a92e894bc 100644 --- a/packages/tokens/build.js +++ b/packages/tokens/build.js @@ -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'; @@ -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() diff --git a/packages/tokens/package.json b/packages/tokens/package.json index 0d68849137..19f7ca005c 100644 --- a/packages/tokens/package.json +++ b/packages/tokens/package.json @@ -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" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f017adfc27..5769fd9beb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1221,8 +1221,8 @@ importers: packages/tokens: devDependencies: '@tokens-studio/sd-transforms': - specifier: 0.16.1 - version: 0.16.1(style-dictionary@4.0.1) + specifier: 1.2.0 + version: 1.2.0(style-dictionary@4.0.1) style-dictionary: specifier: 4.0.1 version: 4.0.1 @@ -2216,6 +2216,9 @@ packages: '@bundled-es-modules/memfs@4.9.4': resolution: {integrity: sha512-1XyYPUaIHwEOdF19wYVLBtHJRr42Do+3ctht17cZOHwHf67vkmRNPlYDGY2kJps4RgE5+c7nEZmEzxxvb1NZWA==} + '@bundled-es-modules/postcss-calc-ast-parser@0.1.6': + resolution: {integrity: sha512-y65TM5zF+uaxo9OeekJ3rxwTINlQvrkbZLogYvQYVoLtxm4xEiHfZ7e/MyiWbStYyWZVZkVqsaVU6F4SUK5XUA==} + '@changesets/apply-release-plan@7.0.4': resolution: {integrity: sha512-HLFwhKWayKinWAul0Vj+76jVx1Pc2v55MGPVjZ924Y/ROeSsBMFutv9heHmCUj48lJyRfOTJG5+ar+29FUky/A==} @@ -3726,14 +3729,14 @@ packages: peerDependencies: '@testing-library/dom': '>=7.21.4' - '@tokens-studio/sd-transforms@0.16.1': - resolution: {integrity: sha512-ODRGxDRoXwobdBKQr4Xn+Yiz8vLA1R/DzCN0zt66SH7fpImzcBMPDSmHKu8imWbonrwuBVyBh/Iv7MuNcI2e/g==} - engines: {node: '>=17.0.0'} + '@tokens-studio/sd-transforms@1.2.0': + resolution: {integrity: sha512-Ygj0nHiS0b/xMOcCovgrBylKk7EgDM9K3DiWEvdSGQZHAfOshAR7UCYQ5vEIH7NZaIVZqgqu2rB8FCIA9PDxbw==} + engines: {node: '>=18.0.0'} peerDependencies: - style-dictionary: ^4.0.0-prerelease.27 + style-dictionary: ^4.0.1 - '@tokens-studio/types@0.4.0': - resolution: {integrity: sha512-rp5t0NP3Kai+Z+euGfHRUMn3AvPQ0bd9Dd2qbtfgnTvujxM5QYVr4psx/mwrVwA3NS9829mE6cD3ln+PIaptBA==} + '@tokens-studio/types@0.5.1': + resolution: {integrity: sha512-LdCF9ZH5ej4Gb6n58x5fTkhstxjXDZc1SWteMWY6EiddLQJVONMIgYOrWrf1extlkSLjagX8WS0B63bAqeltnA==} '@tootallnate/once@2.0.0': resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} @@ -4982,9 +4985,6 @@ packages: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true - color2k@2.0.3: - resolution: {integrity: sha512-zW190nQTIoXcGCaU08DvVNFTmQhUpnJfVuAKfWqUQkflXKpaDdpaYoM0iluLS9lgJNHyBF58KKA2FBEwkD7wog==} - colord@2.9.3: resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} @@ -13150,6 +13150,10 @@ snapshots: stream: 0.0.3 util: 0.12.5 + '@bundled-es-modules/postcss-calc-ast-parser@0.1.6': + dependencies: + postcss-calc-ast-parser: 0.1.4 + '@changesets/apply-release-plan@7.0.4': dependencies: '@babel/runtime': 7.24.7 @@ -14911,18 +14915,17 @@ snapshots: dependencies: '@testing-library/dom': 9.3.1 - '@tokens-studio/sd-transforms@0.16.1(style-dictionary@4.0.1)': + '@tokens-studio/sd-transforms@1.2.0(style-dictionary@4.0.1)': dependencies: - '@tokens-studio/types': 0.4.0 - color2k: 2.0.3 + '@bundled-es-modules/deepmerge': 4.3.1 + '@bundled-es-modules/postcss-calc-ast-parser': 0.1.6 + '@tokens-studio/types': 0.5.1 colorjs.io: 0.4.5 - deepmerge: 4.3.1 expr-eval-fork: 2.0.2 is-mergeable-object: 1.1.1 - postcss-calc-ast-parser: 0.1.4 style-dictionary: 4.0.1 - '@tokens-studio/types@0.4.0': {} + '@tokens-studio/types@0.5.1': {} '@tootallnate/once@2.0.0': {} @@ -16408,8 +16411,6 @@ snapshots: color-support@1.1.3: {} - color2k@2.0.3: {} - colord@2.9.3: {} colorette@2.0.20: {}