{"_id":"@dawiidio/quarksy","_rev":"2-47fe0019d71304af55790145a1b8f2d3","name":"@dawiidio/quarksy","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.4":{"name":"@dawiidio/quarksy","version":"0.0.4","description":"Compact design tokens parser","main":"dist/index.js","type":"commonjs","bin":{"quarksy":"dist/cli.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/dawiidio/quarksy.git"},"scripts":{"test":"echo \"Error: no test specified\"","build":"tsc & tsc-alias","build:watch":"(concurrently \"tsc -w\" \"tsc-alias -w\")"},"publishConfig":{"access":"public"},"devDependencies":{"@types/commander":"^2.12.2","@types/dotenv":"^8.2.0","@types/node":"^20.11.13","concurrently":"^8.2.2","tsc-alias":"^1.8.8","typescript":"^5.3.3"},"keywords":["design","design-tokens","figma"],"author":{"name":"Dawid Wojda","email":"dawid@dawiid.io","url":"https://dawiid.io/"},"private":false,"license":"ISC","dependencies":{"commander":"^11.1.0"},"_id":"@dawiidio/quarksy@0.0.4","gitHead":"ddd8c6e976fc7255b16e0e3a1835043ab65775d4","bugs":{"url":"https://github.com/dawiidio/quarksy/issues"},"homepage":"https://github.com/dawiidio/quarksy#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-uGuJ0QbiKbYYnQkUBRb4tmzG9FCKHEZ8ttKfp1/tr/makTDNhhTHPiHSik4gaUvf38irYGOVJuOyOOA5zMj5VA==","shasum":"5cbbcd250acffc6809589c86caf2a5fd328a6c80","tarball":"https://registry.npmjs.org/@dawiidio/quarksy/-/quarksy-0.0.4.tgz","fileCount":2,"unpackedSize":4372,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dawiidio%2fquarksy@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDGEA2LlWVBAJCmWdOtnb9jSJOp9JkJI7kU+UpeFBt7dAiEAtcXBUjWBZx3Kh6kBWyHXyhkr8fBup1BGgA40+9apYfw="}]},"_npmUser":{"name":"dawiidio","email":"dawiidio@gmail.com"},"directories":{},"maintainers":[{"name":"dawiidio","email":"dawiidio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quarksy_0.0.4_1707008096314_0.20768952054878786"},"_hasShrinkwrap":false},"0.0.5":{"name":"@dawiidio/quarksy","version":"0.0.5","description":"Compact design tokens parser","main":"dist/index.js","type":"commonjs","bin":{"quarksy":"dist/cli.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/dawiidio/quarksy.git"},"scripts":{"test":"echo \"Error: no test specified\"","build":"tsc & tsc-alias","build:watch":"(concurrently \"tsc -w\" \"tsc-alias -w\")"},"publishConfig":{"access":"public"},"devDependencies":{"@types/commander":"^2.12.2","@types/dotenv":"^8.2.0","@types/node":"^20.11.13","concurrently":"^8.2.2","tsc-alias":"^1.8.8","typescript":"^5.3.3"},"keywords":["design","design-tokens","figma"],"author":{"name":"Dawid Wojda","email":"dawid@dawiid.io","url":"https://dawiid.io/"},"private":false,"license":"ISC","dependencies":{"commander":"^11.1.0"},"_id":"@dawiidio/quarksy@0.0.5","gitHead":"fd802c2e411c22dc933b9a981efb0470aa95e55e","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/dawiidio/quarksy/issues"},"homepage":"https://github.com/dawiidio/quarksy#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-liTjg9ttgYMh8BK1wWIwD9BiWFhnvrNEFsQvDva/0TzsqsxDwR53dCk+WEim8cGqai5KbW5YHgrQEKYQZiwCMQ==","shasum":"41732ca7c010d827e4c3a12e05d93a0ff76f5c9a","tarball":"https://registry.npmjs.org/@dawiidio/quarksy/-/quarksy-0.0.5.tgz","fileCount":20,"unpackedSize":25059,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dawiidio%2fquarksy@0.0.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZQuUzPaIvpZWNyFJE4THO+pGOxfWObcXsFucQ3UvkUwIgTO3etmztWzVWDuJGq8HjRnInboo2hR57HuyECfOpbII="}]},"_npmUser":{"name":"dawiidio","email":"dawiidio@gmail.com"},"directories":{},"maintainers":[{"name":"dawiidio","email":"dawiidio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quarksy_0.0.5_1707008577811_0.47544472115177494"},"_hasShrinkwrap":false},"0.0.6":{"name":"@dawiidio/quarksy","version":"0.0.6","description":"Compact design tokens parser","main":"dist/index.js","type":"commonjs","bin":{"quarksy":"dist/cli.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/dawiidio/quarksy.git"},"scripts":{"test":"echo \"Error: no test specified\"","build":"tsc && tsc-alias","build:watch":"(concurrently \"tsc -w\" \"tsc-alias -w\")"},"publishConfig":{"access":"public"},"devDependencies":{"@types/commander":"^2.12.2","@types/dotenv":"^8.2.0","@types/node":"^20.11.13","concurrently":"^8.2.2","tsc-alias":"^1.8.8","typescript":"^5.3.3"},"keywords":["design","design-tokens","figma"],"author":{"name":"Dawid Wojda","email":"dawid@dawiid.io","url":"https://dawiid.io/"},"private":false,"license":"ISC","dependencies":{"commander":"^11.1.0"},"_id":"@dawiidio/quarksy@0.0.6","gitHead":"7e3205a3b7651ab27d0e8de8f73cb858d02af76c","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/dawiidio/quarksy/issues"},"homepage":"https://github.com/dawiidio/quarksy#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-o7wgKQv8st60uwuvz781bgqj+3yUokEDAtwZrfnG/GMNINdPX+94eW5sE/IgWHIm6TcwuH2BY+nxbCvNFh86pg==","shasum":"6ff5deaee79a033bae8d5412c4e1a5d934f1ccd9","tarball":"https://registry.npmjs.org/@dawiidio/quarksy/-/quarksy-0.0.6.tgz","fileCount":20,"unpackedSize":25065,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dawiidio%2fquarksy@0.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH6qCV1dm49wXEj9Q15oCOmCOKHfYTnNUxeHXekjCFgVAiEAvIW6FEfZ2JET5HJnebT45dvnElt0TWWBAU3CPptJ3OU="}]},"_npmUser":{"name":"dawiidio","email":"dawiidio@gmail.com"},"directories":{},"maintainers":[{"name":"dawiidio","email":"dawiidio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quarksy_0.0.6_1707008880965_0.008819076379295465"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-04T00:54:56.229Z","0.0.4":"2024-02-04T00:54:56.470Z","modified":"2024-02-04T01:08:01.553Z","0.0.5":"2024-02-04T01:02:58.097Z","0.0.6":"2024-02-04T01:08:01.119Z"},"maintainers":[{"name":"dawiidio","email":"dawiidio@gmail.com"}],"description":"Compact design tokens parser","homepage":"https://github.com/dawiidio/quarksy#readme","keywords":["design","design-tokens","figma"],"repository":{"type":"git","url":"git+ssh://git@github.com/dawiidio/quarksy.git"},"author":{"name":"Dawid Wojda","email":"dawid@dawiid.io","url":"https://dawiid.io/"},"bugs":{"url":"https://github.com/dawiidio/quarksy/issues"},"license":"ISC","readme":"# @dawiidio/quarksy\n\nThis is a small, 0-dependency design-tokens parser. What are design tokens? \nFor example, you may check out figma and their Tokens Studio to learn more.\nIn one sentence: tokens are single source of truth for both designers and \ndevelopers saved in json file which you can export from e.g. Figma tool.\n\nFor example, it can generate css output for tokens like the below example:\n\n```css\n:root {\n    --sizing-base: 2px;\n    --sizing-xs: 4px;\n    --sizing-s: 8px;\n    --sizing-m: 24px;\n    --sizing-l: 24px;\n    --sizing-xl: 32px;\n    --colors-primary-100: #c7fadb;\n    --colors-primary-500: #05eb62;\n    --colors-primary-900: #066d2f;\n    --colors-secondary-100: #e9d5f8;\n    --colors-secondary-500: #941bf0;\n    --colors-secondary-900: #3e046a;\n    --font-size-s: 14px;\n    --font-size-m: 16px;\n    --font-size-l: 24px;\n    --font-size-xl: 36px;\n    --border-radius-m: 6px;\n    --font-family-primary: Ubuntu;\n    --font-family-secondary: Nunito;\n    --font-weight-bold: 800;\n    --font-weight-thin: 300;\n    --font-weight-normal: 500;\n    --spacing-s: 4px;\n    --spacing-m: 8px;\n    --spacing-l: 24px;\n}\n\n.typography-H3 { \n   font-family: Nunito;\n   font-weight: 500;\n   font-size: 36px; \n}\n\n.typography-Body1 { \n   font-family: Ubuntu;\n   font-weight: 300;\n   font-size: 16px; \n}\n```\n\nit will resolve all token aliases like the below ones\n\n```json\n{\n  \"typography\": {\n    \"H3\": {\n      \"value\": {\n        \"fontFamily\": \"{fontFamily.secondary}\",\n        \"fontWeight\": \"{fontWeight.normal}\",\n        \"fontSize\": \"{fontSize.xl}\"\n      },\n      \"type\": \"typography\"\n    }\n  }\n}\n```\n\nto these values:\n\n```css\n.typography-H3 { \n   font-family: Nunito;\n   font-weight: 500;\n   font-size: 36px; \n}\n```\n\n## Installation\n\n```shell\nnpm i @dawiidio/quarksy\n\n// or\n\nyarn add @dawiidio/quarksy\n```\n\n## Cli usage\n\n```text\nUsage: quarksy [options] [inputFile]\n\nTransforms design tokens to code\n\nArguments:\n  inputFile                    tokens file to be transformed (default: \"tokens.json\")\n\nOptions:\n  -V, --version                output the version number\n  -p, --platform <string...>   for which platforms you want to transform your tokens (default: [\"css\"])\n  --token-prefix <string>      prefix for token variable names\n  --token-set-prefix <string>  prefix for token sets variable names, eg. typography which may be build of many\n                               properties\n  -o, --output-dir <string>    output directory\n  -h, --help                   display help for command\n```\n\n## Programmatic usage\n\nBelow you can see simple example, for implementation hints see `src/platforms/CssPlatform.ts`\n\n```ts\nimport {\n    TokensObjectParser,\n    writePlatformOutputToFileSystem,\n    Platform\n} from '@dawiidio/quarksy';\n\nasync function main() {\n    const myDesignTokensObject = {\n        // json export from eg. Figma tokens\n    };\n\n    const tokensObjectParser = new TokensObjectParser(myDesignTokensObject);\n\n    class MyPlatform extends Platform {\n        run(tokensObject: TokensObjectParser): [string, string][] {\n            // do something to transform tokensObject to platform specific code\n            return []\n        }\n    }\n\n    const myPlatform = new MyPlatform();\n    \n    await writePlatformOutputToFileSystem(myPlatform.run(tokensObjectParser));\n}\n```\n\n## Supported platforms\n\nFor now only CSS, soon will be more :)","readmeFilename":"README.md"}