@razorwind/style-dictionary 0.0.29 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +12 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +2 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("@razorwind/core/plugin"),l=require("@razorwind/core/
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("@razorwind/core/plugin"),l=require("@razorwind/core/lib/tokens"),u=require("@razorwind/core/utils"),d=require("@stryke/type-checks/is-string"),f=require("node:path"),p=require("style-dictionary");p=s(p,1);function m(e){let t=e.files.map(e=>`- \`${e}\``).join(`
|
|
2
2
|
`),n=e.files[0]??`build/output.css`;return`# Installing Style Dictionary Output
|
|
3
3
|
|
|
4
4
|
Generated by \`@razorwind/style-dictionary\`.
|
|
@@ -30,4 +30,4 @@ SCSS example:
|
|
|
30
30
|
## Regenerate
|
|
31
31
|
|
|
32
32
|
Platform outputs are build artifacts — adjust tokens or Style Dictionary platform config in Razorwind, not hand-edit generated files.
|
|
33
|
-
`}function
|
|
33
|
+
`}function h(e){if((0,d.isString)(e))return e;if(typeof e==`object`&&e&&`toString`in e&&typeof e.toString==`function`){let t=e.toString();if(t!==`[object Object]`)return t}return JSON.stringify(e)}function g(e,t){if(e)return e.map(e=>(0,f.isAbsolute)(e)?e:(0,f.resolve)(t,e))}function _(e){return!e||typeof e!=`object`?{}:e}function v(e){let t=e[0];if(!t)return`INSTALL.md`;let n=(0,f.dirname)(t);return n===`.`?`INSTALL.md`:(0,f.join)(n,`INSTALL.md`)}async function y(e,t={},n=process.cwd()){let{source:r,include:i,usesDtcg:a,platforms:o,verbose:s,...c}=t;if(!o||Object.keys(o).length===0)return{};let d=await new p.default({...c,source:g(r,n),include:g(i,n),tokens:_(e.tokens),platforms:o,usesDtcg:a??!0},(0,l.styleDictionaryLogOptions)(s)).formatAllPlatforms(),f={};for(let[e,t]of Object.entries(d))for(let n of t){let t=n.destination??`${e}.output`;f[t]=(0,u.createDocument)(t,h(n.output),{name:e})}if(Object.keys(f).length>0){let e=Object.keys(f).sort(),n=t.installPath??v(e),r=t.installGuide??m({files:e});f[n]=(0,u.createDocument)(n,r,{name:`razorwind-style-dictionary`},`markdown`)}return f}var b=(0,c.definePlugin)(e=>({name:`style-dictionary`,generate:async(t,n)=>y(t,{...e,verbose:e?.verbose??n.verbose},n.cwd)}));exports.default=b,exports.generateStyleDictionary=y,exports.renderInstallMd=m;
|
package/dist/index.d.cts
CHANGED
|
@@ -25,6 +25,18 @@ import { Schema } from "@razorwind/core/schema";
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
type StyleDictionaryPluginOptions = Omit<Config, "tokens"> & {
|
|
28
|
+
/**
|
|
29
|
+
* When true, Style Dictionary runs with `log.verbosity: "verbose"`.
|
|
30
|
+
*
|
|
31
|
+
* Overrides `log.verbosity` on this config, matching the Style Dictionary
|
|
32
|
+
* CLI `--verbose` flag. When omitted or false, config `log.verbosity` (or
|
|
33
|
+
* Style Dictionary defaults) still apply.
|
|
34
|
+
*
|
|
35
|
+
* @see https://styledictionary.com/reference/logging/
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue false
|
|
38
|
+
*/
|
|
39
|
+
verbose?: boolean;
|
|
28
40
|
/**
|
|
29
41
|
* Override body for generated `INSTALL.md`. When omitted, platform output
|
|
30
42
|
* wiring steps are generated from emitted file paths.
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/install.ts","../src/generate.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;KA0CY,+BAA+B,KAAK;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/install.ts","../src/generate.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;KA0CY,+BAA+B,KAAK;;;;;;;;;;;;EAY9C;;;;;EAMA;;;;;;EAOA;;;;;;;;;iBC5Cc,gBAAgB;EAC9B;;;;;;;;;;iBCmEoB,wBACpB,MAAM,QACN,UAAS,8BACT,eACC,QAAQ,eAAe"}
|
package/dist/index.d.mts
CHANGED
|
@@ -25,6 +25,18 @@ import { Schema } from "@razorwind/core/schema";
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
type StyleDictionaryPluginOptions = Omit<Config, "tokens"> & {
|
|
28
|
+
/**
|
|
29
|
+
* When true, Style Dictionary runs with `log.verbosity: "verbose"`.
|
|
30
|
+
*
|
|
31
|
+
* Overrides `log.verbosity` on this config, matching the Style Dictionary
|
|
32
|
+
* CLI `--verbose` flag. When omitted or false, config `log.verbosity` (or
|
|
33
|
+
* Style Dictionary defaults) still apply.
|
|
34
|
+
*
|
|
35
|
+
* @see https://styledictionary.com/reference/logging/
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue false
|
|
38
|
+
*/
|
|
39
|
+
verbose?: boolean;
|
|
28
40
|
/**
|
|
29
41
|
* Override body for generated `INSTALL.md`. When omitted, platform output
|
|
30
42
|
* wiring steps are generated from emitted file paths.
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{definePlugin as e}from"@razorwind/core/plugin";import{
|
|
1
|
+
import{definePlugin as e}from"@razorwind/core/plugin";import{styleDictionaryLogOptions as t}from"@razorwind/core/lib/tokens";import{createDocument as n}from"@razorwind/core/utils";import{isString as r}from"@stryke/type-checks/is-string";import{dirname as i,isAbsolute as a,join as o,resolve as s}from"node:path";import c from"style-dictionary";function l(e){let t=e.files.map(e=>`- \`${e}\``).join(`
|
|
2
2
|
`),n=e.files[0]??`build/output.css`;return`# Installing Style Dictionary Output
|
|
3
3
|
|
|
4
4
|
Generated by \`@razorwind/style-dictionary\`.
|
|
@@ -30,5 +30,5 @@ SCSS example:
|
|
|
30
30
|
## Regenerate
|
|
31
31
|
|
|
32
32
|
Platform outputs are build artifacts — adjust tokens or Style Dictionary platform config in Razorwind, not hand-edit generated files.
|
|
33
|
-
`}function
|
|
33
|
+
`}function u(e){if(r(e))return e;if(typeof e==`object`&&e&&`toString`in e&&typeof e.toString==`function`){let t=e.toString();if(t!==`[object Object]`)return t}return JSON.stringify(e)}function d(e,t){if(e)return e.map(e=>a(e)?e:s(t,e))}function f(e){return!e||typeof e!=`object`?{}:e}function p(e){let t=e[0];if(!t)return`INSTALL.md`;let n=i(t);return n===`.`?`INSTALL.md`:o(n,`INSTALL.md`)}async function m(e,r={},i=process.cwd()){let{source:a,include:o,usesDtcg:s,platforms:m,verbose:h,...g}=r;if(!m||Object.keys(m).length===0)return{};let _=await new c({...g,source:d(a,i),include:d(o,i),tokens:f(e.tokens),platforms:m,usesDtcg:s??!0},t(h)).formatAllPlatforms(),v={};for(let[e,t]of Object.entries(_))for(let r of t){let t=r.destination??`${e}.output`;v[t]=n(t,u(r.output),{name:e})}if(Object.keys(v).length>0){let e=Object.keys(v).sort(),t=r.installPath??p(e),i=r.installGuide??l({files:e});v[t]=n(t,i,{name:`razorwind-style-dictionary`},`markdown`)}return v}var h=e(e=>({name:`style-dictionary`,generate:async(t,n)=>m(t,{...e,verbose:e?.verbose??n.verbose},n.cwd)}));export{h as default,m as generateStyleDictionary,l as renderInstallMd};
|
|
34
34
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razorwind/style-dictionary",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Razorwind plugin that uses Style Dictionary to generate code from Razorwind design tokens.",
|
|
6
6
|
"repository": {
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"typings": "dist/index.d.mts",
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"@power-plant/core": "^0.0.90",
|
|
87
|
-
"@razorwind/core": "0.0.
|
|
87
|
+
"@razorwind/core": "^0.0.45",
|
|
88
88
|
"@stryke/type-checks": "^0.6.41",
|
|
89
89
|
"style-dictionary": "^5.5.1"
|
|
90
90
|
},
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"typescript": "^6.0.3"
|
|
95
95
|
},
|
|
96
96
|
"publishConfig": { "access": "public" },
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "8646ac01928c5b68108e86adf33fb78941b35902"
|
|
98
98
|
}
|