New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tokens-studio/sd-transforms

Package Overview
Dependencies
Maintainers
3
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tokens-studio/sd-transforms - npm Package Compare versions

Comparing version 0.8.1 to 0.8.2

dist/parsers/exclude-parent-keys.cjs

1

dist/index.d.ts
export { registerTransforms } from './registerTransforms.js';
export { expandComposites } from './parsers/expand-composites.js';
export { excludeParentKeys } from './parsers/exclude-parent-keys.js';
export { mapDescriptionToComment } from './mapDescriptionToComment.js';

@@ -4,0 +5,0 @@ export { checkAndEvaluateMath } from './checkAndEvaluateMath.js';

export { registerTransforms } from './registerTransforms.js';
export { expandComposites } from './parsers/expand-composites.js';
export { excludeParentKeys } from './parsers/exclude-parent-keys.js';
export { mapDescriptionToComment } from './mapDescriptionToComment.js';

@@ -4,0 +5,0 @@ export { checkAndEvaluateMath } from './checkAndEvaluateMath.js';

4

dist/registerTransforms.js

@@ -14,2 +14,3 @@ import { transformDimension } from './transformDimension.js';

import { expandComposites } from './parsers/expand-composites.js';
import { excludeParentKeys } from './parsers/exclude-parent-keys.js';
import { transformOpacity } from './transformOpacity.js';

@@ -39,3 +40,4 @@ const isBrowser = typeof window === 'object';

const obj = JSON.parse(contents);
const expanded = expandComposites(obj, filePath, transformOpts);
const excluded = excludeParentKeys(obj, transformOpts);
const expanded = expandComposites(excluded, filePath, transformOpts);
return expanded;

@@ -42,0 +44,0 @@ },

@@ -14,2 +14,3 @@ import { SingleBorderToken, SingleBoxShadowToken, SingleCompositionToken, SingleToken, SingleTypographyToken } from '@tokens-studio/types';

expand?: ExpandOptions | false;
excludeParentKeys?: boolean;
}
{
"name": "@tokens-studio/sd-transforms",
"version": "0.8.1",
"version": "0.8.2",
"description": "Custom transforms for Style-Dictionary, to work with Design Tokens that are exported from Tokens Studio",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -13,2 +13,3 @@ # Style Dictionary Transforms for Tokens Studio

- Expands composition tokens into multiple, optionally also does so for typography, border and shadow tokens -> parser
- Optionally excludes parent keys from your tokens file, e.g. when using single-file export from Tokens Studio Figma plugin -> parser
- Maps token descriptions to comments -> `ts/descriptionToComment`

@@ -109,2 +110,3 @@ - Check and evaluate Math expressions (transitive) -> `ts/resolveMath`

},
excludeParentKeys: true,
});

@@ -117,2 +119,3 @@ ```

| ------------------ | ------------------------ | -------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| excludeParentKeys | boolean | ❌ | `false` | Whether or not to exclude parent keys from your token files |
| expand | boolean \| ExpandOptions | ❌ | See props below | `false` to not register the parser at all. By default, expands composition tokens. Optionally, border, shadow and typography as well. |

@@ -123,2 +126,3 @@ | expand.composition | boolean \| ExpandFilter | ❌ | `true` | Whether or not to expand compositions. Also allows a filter callback function to conditionally expand per token/filePath |

| expand.border | boolean \| ExpandFilter | ❌ | `false` | Whether or not to expand borders. Also allows a filter callback function to conditionally expand per token/filePath |
| |

@@ -186,3 +190,3 @@ > Note: you can also import and use the `expandComposites` function to run the expansion on your token object manually.

> Note: make sure to choose either the full transformGroup, **OR** its separate transforms, so you can adjust or add your own.
> Note: make sure to choose either the full transformGroup, **OR** its separate transforms so you can adjust or add your own.
> [Combining a transformGroup with a transforms array can give unexpected results](https://github.com/amzn/style-dictionary/issues/813).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc