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

@cobalt-ui/plugin-json

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cobalt-ui/plugin-json - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

7

CHANGELOG.md
# @cobalt-ui/plugin-json
## 0.3.2
### Patch Changes
- 67d271e: Update README
- 8f5025d: Update package description
## 0.3.1

@@ -4,0 +11,0 @@

8

package.json
{
"name": "@cobalt-ui/plugin-json",
"description": "JSON builder for Cobalt UI design tokens",
"version": "0.3.1",
"description": "Generate JSON from your design tokens schema (requires @cobalt-ui/cli)",
"version": "0.3.2",
"author": {

@@ -21,3 +21,3 @@ "name": "Drew Powers",

"devDependencies": {
"@cobalt-ui/core": "^0.3.2"
"@cobalt-ui/core": "^0.3.3"
},

@@ -28,3 +28,3 @@ "scripts": {

},
"readme": "# @cobalt-ui/plugin-json\n\nGenerate JSON output from design tokens.\n\n```\nnpm i -D @cobalt-ui/plugin-json\n```\n\n```js\n// tokens.config.mjs\nimport json from '@cobalt-ui/plugin-json';\n\nexport default {\n plugins: [\n json({\n /** set the filename inside outDir */\n filename: './tokens.json',\n /** modify values */\n transformValue(value, token) {\n return value;\n },\n }),\n ],\n};\n```\n"
"readme": "# @cobalt-ui/plugin-json\n\nGenerate JSON output from design tokens.\n\n```\nnpm i -D @cobalt-ui/plugin-json\n```\n\n```js\n// tokens.config.mjs\nimport json from '@cobalt-ui/plugin-json';\n\nexport default {\n plugins: [\n json({\n /** set the filename inside outDir */\n filename: './tokens.json',\n }),\n ],\n};\n```\n\nIt’s worth noting that this JSON output differs from your source `tokens.json` in a number of ways:\n\n- It’s one flat array, making iterating over all your tokens easy without deep-crawling objects\n- All values are normalized, so you won’t get unexpected missing values\n- All shared properties are filled in, e.g. if a group has a default `type` it will be applied to all children tokens\n- All aliases are resolved, so you don’t have to recursively crawl `tokens.json` yourself\n- The original token value can be found in `_original`\n- Information about a token’s parent group can be found in `_group`\n\nSo if you have need for any of the above, this format can be much friendlier to iterate over than the original schema.\n"
}

@@ -18,6 +18,2 @@ # @cobalt-ui/plugin-json

filename: './tokens.json',
/** modify values */
transformValue(value, token) {
return value;
},
}),

@@ -27,1 +23,12 @@ ],

```
It’s worth noting that this JSON output differs from your source `tokens.json` in a number of ways:
- It’s one flat array, making iterating over all your tokens easy without deep-crawling objects
- All values are normalized, so you won’t get unexpected missing values
- All shared properties are filled in, e.g. if a group has a default `type` it will be applied to all children tokens
- All aliases are resolved, so you don’t have to recursively crawl `tokens.json` yourself
- The original token value can be found in `_original`
- Information about a token’s parent group can be found in `_group`
So if you have need for any of the above, this format can be much friendlier to iterate over than the original schema.
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