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.1.0 to 0.2.0

dist/index.js.map

7

CHANGELOG.md
# @cobalt-ui/plugin-json
## 0.2.0
### Minor Changes
- 26bfb4c: Convert to JSON, follow design tokens spec
## 0.1.0
### Minor Changes
- 5748e72: Use JSON to align with the Design Tokens W3C spec

2

dist/index.d.ts

@@ -15,3 +15,3 @@ import type { Plugin, Token } from '@cobalt-ui/core';

/** output file (default: "./tokens/tokens.json") */
filename?: string;
fileName?: string;
/** modify values */

@@ -18,0 +18,0 @@ transformValue?: (token: Token, mode?: string) => any;

export default function json(options) {
let fileName = options?.filename || './tokens.json';
let fileName = options?.fileName || './tokens.json';
let transform = options?.transformValue;
return {
name: '@cobalt-ui/plugin-json',
async build({ schema }) {
async build({ tokens }) {
return [
{
fileName,
contents: JSON.stringify(schema, (_, token) => {
contents: JSON.stringify(tokens, (_, token) => {
// apply transformValue()

@@ -27,1 +27,2 @@ if (transform && typeof token.type == 'string') {

}
//# sourceMappingURL=index.js.map
{
"name": "@cobalt-ui/plugin-json",
"description": "JSON builder for Cobalt UI design tokens",
"version": "0.1.0",
"version": "0.2.0",
"author": {

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

"devDependencies": {
"@cobalt-ui/core": "^0.1.0"
"@cobalt-ui/core": "^0.2.0"
},

@@ -24,0 +24,0 @@ "scripts": {

@@ -20,3 +20,3 @@ import type { BuildResult, Plugin, Token } from '@cobalt-ui/core';

/** output file (default: "./tokens/tokens.json") */
filename?: string;
fileName?: string;
/** modify values */

@@ -27,3 +27,3 @@ transformValue?: (token: Token, mode?: string) => any;

export default function json(options?: Options): Plugin {
let fileName = options?.filename || './tokens.json';
let fileName = options?.fileName || './tokens.json';
let transform = options?.transformValue;

@@ -33,3 +33,3 @@

name: '@cobalt-ui/plugin-json',
async build({ schema }): Promise<BuildResult[]> {
async build({ tokens }): Promise<BuildResult[]> {
return [

@@ -39,3 +39,3 @@ {

contents: JSON.stringify(
schema,
tokens,
(_, token) => {

@@ -42,0 +42,0 @@ // apply transformValue()

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