@razorwind/core 0.0.21 → 0.0.22
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/{config-CtutEZxn.d.cts → config-CBGz3vxV.d.cts} +2 -2
- package/dist/{config-CtutEZxn.d.cts.map → config-CBGz3vxV.d.cts.map} +1 -1
- package/dist/{config-K7NDOu8X.d.mts → config-CaaK20wo.d.mts} +2 -2
- package/dist/config-CaaK20wo.d.mts.map +1 -0
- package/dist/{index-CTxcRgsQ.d.mts → index-BhVvIILv.d.mts} +1 -1
- package/dist/{index-B8QkH27E.d.mts → index-BlIc4ofi.d.mts} +4 -4
- package/dist/{index-B8QkH27E.d.mts.map → index-BlIc4ofi.d.mts.map} +1 -1
- package/dist/{index-CLKZ9zwR.d.cts → index-CKJ5fZxo.d.cts} +4 -4
- package/dist/{index-CLKZ9zwR.d.cts.map → index-CKJ5fZxo.d.cts.map} +1 -1
- package/dist/{index-DVzJiV8M.d.cts → index-DW51mcvl.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -9
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +7 -9
- package/dist/index.mjs +1 -1
- package/dist/lib/tokens/index.d.cts +1 -1
- package/dist/lib/tokens/index.d.mts +1 -1
- package/dist/{plugin-BCE3VBBe.d.cts → plugin-C_nK-znA.d.cts} +2 -2
- package/dist/{plugin-BCE3VBBe.d.cts.map → plugin-C_nK-znA.d.cts.map} +1 -1
- package/dist/{plugin-NRz4uyoM.d.mts → plugin-Cbx7QH4X.d.mts} +2 -2
- package/dist/plugin-Cbx7QH4X.d.mts.map +1 -0
- package/dist/plugin.d.cts +2 -2
- package/dist/plugin.d.mts +2 -2
- package/dist/schema/index.cjs +1 -1
- package/dist/schema/index.d.cts +2 -2
- package/dist/schema/index.d.mts +2 -2
- package/dist/schema/index.mjs +1 -1
- package/dist/{schema-_bi4ZPQH.d.cts → schema-C6-umW1r.d.cts} +6 -6
- package/dist/{schema-_bi4ZPQH.d.cts.map → schema-C6-umW1r.d.cts.map} +1 -1
- package/dist/{schema-_bi4ZPQH.d.mts → schema-C6-umW1r.d.mts} +6 -6
- package/dist/schema-C6-umW1r.d.mts.map +1 -0
- package/dist/{schema-C7BulI9p.mjs → schema-CzpHs4s7.mjs} +2 -2
- package/dist/schema-CzpHs4s7.mjs.map +1 -0
- package/dist/{schema-C5pGZiV3.cjs → schema-DWEhLYz4.cjs} +1 -1
- package/package.json +2 -2
- package/dist/config-K7NDOu8X.d.mts.map +0 -1
- package/dist/plugin-NRz4uyoM.d.mts.map +0 -1
- package/dist/schema-C7BulI9p.mjs.map +0 -1
- package/dist/schema-_bi4ZPQH.d.mts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Components, t as Schema } from "./schema-
|
|
1
|
+
import { a as Components, t as Schema } from "./schema-C6-umW1r.cjs";
|
|
2
2
|
import { PreprocessedTokens } from "style-dictionary";
|
|
3
3
|
import { Tokens } from "@power-plant/dtcg-schema";
|
|
4
4
|
import { EnvPaths } from "@stryke/env";
|
|
@@ -166,4 +166,4 @@ type Config = RequiredKeys<UserConfig, "componentsPath" | "plugins"> & {
|
|
|
166
166
|
};
|
|
167
167
|
//#endregion
|
|
168
168
|
export { UserConfigFn as a, UserConfigParams as c, TokensPreprocessor as d, UserConfigExport as i, Plugin as l, Options as n, UserConfigFnObject as o, UserConfig as r, UserConfigFnPromise as s, Config as t, TokensParser as u };
|
|
169
|
-
//# sourceMappingURL=config-
|
|
169
|
+
//# sourceMappingURL=config-CBGz3vxV.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
1
|
+
{"version":3,"file":"config-CBGz3vxV.d.cts","names":[],"sources":["../src/types/plugin.ts","../src/types/config.ts"],"mappings":";;;;;;;;;;;;;;;UAgCiB;EACf;EACA,SAAS;EACT,SAAS,qBAAqB;;;;;;;;;KAUpB;EAEN;EACA,eAAe,YAAY,uBAAuB;MAElD,YAAY,uBAAuB;;;;;;;;;UAUxB;;;;;;;EAOf;;;;;;EAOA,UAAU;;;;;;EAOV,gBAAgB;;;;;;;;EAShB,WAAW,MAAM,QAAQ,QAAQ,WAAW,aAAa;;;;;;;;EASzD,YACE,MAAM,QACN,QAAQ,WACL,aAAa,eAAe;;;;;;;;EASjC,YAAY,MAAM,QAAQ,QAAQ,WAAW;;;;UCvF9B;;;;;;EAMf;;;;EAKA;;;;;;;;EASA;;;;;;EAOA;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA;;UAGe,mBAAmB;EAClC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,SAAS,eAAe;EACjC,aAAa;EACb,UAAU;;UAGK;EACf;EACA;;KAGU,sBAAsB,QAAQ,eAAe;KAC7C,uBACV,QAAQ,qBACL,QAAQ,aAAa;KACd,gBACV,QAAQ,qBACL,aAAa,eAAe,QAAQ,aAAa;KAC1C,mBACR,aACA,eACA,QAAQ,aAAa,gBACrB,qBACA,sBACA;KAEQ,SAAS,aAAa;EAChC;EACA,UAAU;IACR"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Components, t as Schema } from "./schema-
|
|
1
|
+
import { a as Components, t as Schema } from "./schema-C6-umW1r.mjs";
|
|
2
2
|
import { GeneratedDocument } from "@power-plant/core";
|
|
3
3
|
import { PreprocessedTokens } from "style-dictionary";
|
|
4
4
|
import { EnvPaths } from "@stryke/env";
|
|
@@ -166,4 +166,4 @@ type Config = RequiredKeys<UserConfig, "componentsPath" | "plugins"> & {
|
|
|
166
166
|
};
|
|
167
167
|
//#endregion
|
|
168
168
|
export { UserConfigFn as a, UserConfigParams as c, TokensPreprocessor as d, UserConfigExport as i, Plugin as l, Options as n, UserConfigFnObject as o, UserConfig as r, UserConfigFnPromise as s, Config as t, TokensParser as u };
|
|
169
|
-
//# sourceMappingURL=config-
|
|
169
|
+
//# sourceMappingURL=config-CaaK20wo.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-CaaK20wo.d.mts","names":[],"sources":["../src/types/plugin.ts","../src/types/config.ts"],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as Schema } from "./schema-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { l as Plugin, t as Config } from "./config-
|
|
1
|
+
import { t as Schema } from "./schema-C6-umW1r.mjs";
|
|
2
|
+
import "./index-BhVvIILv.mjs";
|
|
3
|
+
import { l as Plugin, t as Config } from "./config-CaaK20wo.mjs";
|
|
4
4
|
import { ExecutionContext } from "@power-plant/core";
|
|
5
5
|
import { Tokens } from "@power-plant/dtcg-schema";
|
|
6
6
|
import { Hooks, Parser, PreprocessedTokens } from "style-dictionary/types";
|
|
@@ -166,4 +166,4 @@ declare function registerRazorwindHooks(plugins?: Plugin[], target?: StyleDictio
|
|
|
166
166
|
declare const registerRazorwindParsers: typeof registerRazorwindHooks;
|
|
167
167
|
//#endregion
|
|
168
168
|
export { RazorwindParserName as C, TOKEN_PARSER_NAMES as D, TOKEN_FILE_EXTENSIONS as E, TYPE_PATH_HINTS as O, DEFAULT_TOKEN_PATH_CANDIDATES as S, TOKEN_DIRECTORY_GLOB as T, inferTypeFromPath as _, razorwindInferPreprocessor as a, normalizeTokenTree as b, LoadTokensOptions as c, loadTokensOrThrow as d, ResolveTokensPathOptions as f, InferredTokenType as g, themeKeyFromPath as h, getRazorwindPreprocessorHooks as i, LoadedTokens as l, resolveTokensSource as m, StyleDictionaryRegisterTarget as n, registerRazorwindHooks as o, ResolvedTokensSource as p, getRazorwindParserHooks as r, registerRazorwindParsers as s, RAZORWIND_INFER_PREPROCESSOR as t, loadTokens as u, inferValue as v, THEME_BASENAME_PATTERN as w, parseCssCustomProperties as x, nestFlatTokens as y };
|
|
169
|
-
//# sourceMappingURL=index-
|
|
169
|
+
//# sourceMappingURL=index-BlIc4ofi.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-BlIc4ofi.d.mts","names":[],"sources":["../src/lib/tokens/constants.ts","../src/lib/tokens/css.ts","../src/lib/tokens/infer.ts","../src/lib/tokens/resolve-path.ts","../src/lib/tokens/load.ts","../src/lib/tokens/parsers.ts"],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as Schema } from "./schema-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { l as Plugin, t as Config } from "./config-
|
|
1
|
+
import { t as Schema } from "./schema-C6-umW1r.cjs";
|
|
2
|
+
import "./index-DW51mcvl.cjs";
|
|
3
|
+
import { l as Plugin, t as Config } from "./config-CBGz3vxV.cjs";
|
|
4
4
|
import { Tokens } from "@power-plant/dtcg-schema";
|
|
5
5
|
import { ExecutionContext } from "@power-plant/core";
|
|
6
6
|
import { Hooks, Parser, PreprocessedTokens } from "style-dictionary/types";
|
|
@@ -166,4 +166,4 @@ declare function registerRazorwindHooks(plugins?: Plugin[], target?: StyleDictio
|
|
|
166
166
|
declare const registerRazorwindParsers: typeof registerRazorwindHooks;
|
|
167
167
|
//#endregion
|
|
168
168
|
export { RazorwindParserName as C, TOKEN_PARSER_NAMES as D, TOKEN_FILE_EXTENSIONS as E, TYPE_PATH_HINTS as O, DEFAULT_TOKEN_PATH_CANDIDATES as S, TOKEN_DIRECTORY_GLOB as T, inferTypeFromPath as _, razorwindInferPreprocessor as a, normalizeTokenTree as b, LoadTokensOptions as c, loadTokensOrThrow as d, ResolveTokensPathOptions as f, InferredTokenType as g, themeKeyFromPath as h, getRazorwindPreprocessorHooks as i, LoadedTokens as l, resolveTokensSource as m, StyleDictionaryRegisterTarget as n, registerRazorwindHooks as o, ResolvedTokensSource as p, getRazorwindParserHooks as r, registerRazorwindParsers as s, RAZORWIND_INFER_PREPROCESSOR as t, loadTokens as u, inferValue as v, THEME_BASENAME_PATTERN as w, parseCssCustomProperties as x, nestFlatTokens as y };
|
|
169
|
-
//# sourceMappingURL=index-
|
|
169
|
+
//# sourceMappingURL=index-CKJ5fZxo.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-CKJ5fZxo.d.cts","names":[],"sources":["../src/lib/tokens/constants.ts","../src/lib/tokens/css.ts","../src/lib/tokens/infer.ts","../src/lib/tokens/resolve-path.ts","../src/lib/tokens/load.ts","../src/lib/tokens/parsers.ts"],"mappings":";;;;;;;;cAmBa;KAOD,8BAA8B;;cAG7B;;;;;cAsBA;;cAyBA;;cAGA,wBAAsB;;cAItB,iBAAiB;;;;;;;iBCvDd,yBACd,mBACC;;;KCgCS;;;;iBAmEI,kBACd,iBACC;;;;iBAiBa,WACd,cACA;EACG;EAAgB,OAAO;;;;;iBAsPZ,mBACd,gBACA;;;;;;;;iBA2Cc,eACd,MAAM,0BACL;;;UC9Zc;;;;EAIf;;;;EAKA;;;;EAKA,gBAAgB;;UAGD;;;;;;;EAOf;;;;EAKA;;;;EAKA;;;;;;;;;iBAyFc,oBACd,SAAS,2BACR;;;;iBAqFa,iBAAiB;;;UCzMhB,0BAA0B;;;;;;EAMzC;;KAGU,eAAe,SAAS,eAAe;;;;;;;;;iBA2I7B,WACpB,SAAS,iBAAiB,QAAQ,gBACjC,QAAQ;;;;;;;;;;iBAsCW,kBACpB,SAAS,iBAAiB,QAAQ,gBACjC,QAAQ;;;;cClME;;UAGI;EACf,iBAAiB,QAAQ;EACzB,uBAAuB;IACrB;IACA,qBAAqB;;;;iBAyET,2BAA2B,YAAY;;;;;iBAavC,2BACd,YAAY,qBACX;;iBAKa,iCAAiC,YAC/C;;;;;;;;;;iBAgBc,uBACd,UAAS,UACT,SAAQ;;;;cA6CG,iCAAwB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./schema-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./schema-DWEhLYz4.cjs"),n=require("./tokens-IRvI2l2K.cjs"),r=require("./plugin.cjs");let i=require("@power-plant/core"),a=require("@stryke/type-checks/is-empty-object"),o=require("defu"),s=require("style-dictionary");s=e.t(s,1);let c=require("@stryke/fs/exists"),l=require("@stryke/fs/is-file"),u=require("@stryke/fs/json"),d=require("@stryke/fs/list-files"),f=require("@stryke/path/append"),p=require("@stryke/path/file-path-fns"),m=require("@stryke/path/join"),h=require("@stryke/string-format/title-case"),g=require("@stryke/type-checks/is-set-object"),_=require("@stryke/type-checks/is-set-string"),v=require("node:fs/promises"),y=require("node:path"),b=require("@stryke/env"),x=require("@stryke/path/find"),S=require("@stryke/path/replace"),C=require("@stryke/type-checks/is-function"),w=require("c12"),T=require("jiti"),E=require("node:fs"),D=require("node:os");D=e.t(D,1);var O=`0.0.22`;const k=t.r.partial(),A=(0,o.createDefu)((e,t,n)=>Array.isArray(n)?(e[t]=n,!0):!1);function j(e,t){return(0,y.isAbsolute)(t)?t:(0,y.resolve)(e,t)}function M(e){return Array.isArray(e)?e.filter(_.isSetString):(0,_.isSetString)(e)?[e]:[]}function N(e){if((0,_.isSetString)(e))return e;if((0,g.isSetObject)(e)&&`url`in e&&(0,_.isSetString)(e.url))return e.url}function P(e){if(!e)return;let n=t.n.safeParse(e);if(n.success)return[n.data];if(!Array.isArray(e))return;let r=[];for(let n of e){let e=t.n.safeParse(n);e.success&&r.push(e.data)}return r.length>0?r:void 0}function F(e){if(!(0,g.isSetObject)(e))return;let t=k.safeParse(e);if(t.success)return Object.keys(t.data).length>0?t.data:void 0}function I(e){return(0,g.isSetObject)(e)&&`path`in e}async function L(e){let t=(0,m.joinPaths)(e,`package.json`);if(!(0,c.existsSync)(t))return;let n;try{n=await(0,u.readJsonFile)(t)}catch{return}let r={};(0,_.isSetString)(n.name)&&(r.name=n.name,r.title=n.name),(0,_.isSetString)(n.description)&&(r.description=n.description),(0,_.isSetString)(n.version)&&(r.version=n.version),(0,_.isSetString)(n.homepage)&&(r.homepage=n.homepage);let i=N(n.repository);if(i&&(r.repository=i),(0,g.isSetObject)(n.dependencies)&&(r.dependencies=n.dependencies),(0,g.isSetObject)(n.devDependencies)&&(r.devDependencies=n.devDependencies),Array.isArray(n.keywords)){let e=n.keywords.filter(_.isSetString);e.length>0&&(r.tags=e)}let a=n.razorwind,o,s;I(a)?s=P(a):(0,g.isSetObject)(a)&&(o=F(a),`files`in a&&(s=P(a.files)));let l=A(o??{},r);return s?.length&&(l.files=s),Object.keys(l).length>0?l:void 0}async function R(e){let t=(0,m.joinPaths)(e,`component.json`);if(!(0,c.existsSync)(t))return;let n;try{n=await(0,u.readJsonFile)(t)}catch{return}if(I(n)||Array.isArray(n)){let e=P(n);if(e)return{files:e}}return F(n)}async function z(e){let n=await L(e),r=await R(e);if(!n&&!r)return;let i=A(r??{},n??{}),a=(0,_.isSetString)(i.name)?i.name:(0,p.findFolderName)(e),o=(0,_.isSetString)(i.title)?i.title:(0,h.titleCase)(a),s=t.r.safeParse({...i,name:a,title:o});if(s.success)return{...s.data,files:await Promise.all((s.data.files??(await(0,d.listFiles)(e)).filter(e=>(0,p.findFileName)(e,{withExtension:!1})===`index`))?.filter(Boolean)?.map(async t=>typeof t==`string`?{type:/[tj]sx$/.test((0,p.findFileExtensionSafe)(t))?`component`:`file`,path:t,content:await(0,v.readFile)((0,f.appendPath)(t,e),`utf8`)}:{type:/[tj]sx$/.test((0,p.findFileExtensionSafe)(t.path))?`component`:`file`,...t,content:t.content?t.content:t.path?await(0,v.readFile)((0,f.appendPath)(t.path,e),`utf8`):void 0,path:(0,f.appendPath)(t.path,e)}))}}async function B(e){let t={},n=M(e.options.componentsPath);for(let r of n){let n=j(e.cwd,r);if(!(!(0,c.existsSync)(n)||!(0,l.isDirectory)(n)))try{let e=await(0,v.readdir)(n,{withFileTypes:!0});for(let r of e){if(!r.isDirectory()||r.name.startsWith(`.`))continue;let e=await z((0,m.joinPaths)(n,r.name));e&&(t[e.name]=e)}}catch{continue}}return t}const V=D.default.homedir();async function H(e,t){let n=t.configFile&&(0,E.existsSync)((0,S.replacePath)(t.configFile,e))?(0,S.replacePath)(t.configFile,e):t.configFile&&(0,E.existsSync)(t.configFile)?t.configFile:(0,E.existsSync)((0,m.joinPaths)(e,`razorwind.${t.mode}.config.ts`))?(0,m.joinPaths)(e,`razorwind.${t.mode}.config.ts`):(0,E.existsSync)((0,m.joinPaths)(e,`razorwind.${t.mode}.config.js`))?(0,m.joinPaths)(e,`razorwind.${t.mode}.config.js`):(0,E.existsSync)((0,m.joinPaths)(e,`razorwind.${t.mode}.config.mts`))?(0,m.joinPaths)(e,`razorwind.${t.mode}.config.mts`):(0,E.existsSync)((0,m.joinPaths)(e,`razorwind.${t.mode}.config.mjs`))?(0,m.joinPaths)(e,`razorwind.${t.mode}.config.mjs`):(0,E.existsSync)((0,m.joinPaths)(e,`razorwind.config.ts`))?(0,m.joinPaths)(e,`razorwind.config.ts`):(0,E.existsSync)((0,m.joinPaths)(e,`razorwind.config.js`))?(0,m.joinPaths)(e,`razorwind.config.js`):(0,E.existsSync)((0,m.joinPaths)(e,`razorwind.config.mts`))?(0,m.joinPaths)(e,`razorwind.config.mts`):(0,E.existsSync)((0,m.joinPaths)(e,`razorwind.config.mjs`))?(0,m.joinPaths)(e,`razorwind.config.mjs`):void 0,r=(0,b.getEnvPaths)({orgId:`storm-software`,appId:`razorwind`,workspaceRoot:e}),i={fsCache:r.cache},a=(0,T.createJiti)(e,i),s={};if(n){let r=await a.import(a.esmResolve(n));if(r?.default){let i={};(0,C.isFunction)(r.default)?i=await Promise.resolve(r.default({cwd:e,mode:t.mode??`development`})):((0,g.isSetObject)(r.default)||Array.isArray(r.default))&&(i=r.default),((0,g.isSetObject)(i)||Array.isArray(i))&&(s={...i,configFile:n})}}let[c,l,u]=await Promise.all([(0,w.loadConfig)({cwd:e,name:`razorwind`,envName:t.mode,globalRc:!0,packageJson:`razorwind`,dotenv:!0,jitiOptions:i}),(0,w.loadConfig)({cwd:r.config,name:`razorwind`,envName:t.mode,dotenv:!0,jitiOptions:i}),(0,w.loadConfig)({cwd:V,name:`razorwind`,envName:t.mode,dotenv:!0,jitiOptions:i})]),d=(0,o.defu)({cwd:e,envPaths:{...r,home:V}},t,s,(0,g.isSetObject)(c?.config)?{...c.config}:{},(0,g.isSetObject)(l?.config)?{...l.config}:{},(0,g.isSetObject)(u?.config)?{...u.config}:{},{componentsPath:e,plugins:[]});if(Array.isArray(d.componentsPath)){let t=d.componentsPath.filter(_.isSetString).map(e=>(0,x.findFilePath)(e));d.componentsPath=t.length>0?t:e}else d.componentsPath=(0,_.isSetString)(d.componentsPath)?(0,x.findFilePath)(d.componentsPath):e;return Array.isArray(d.plugins)||(d.plugins=[]),d}function U(e){return e}const W=(0,i.defineGenerator)({meta:{name:`razorwind`,title:`Razorwind`,description:`A generator that uses Razorwind to generate design system code from design tokens and components.`,version:O,tags:[`razorwind`,`dtcg`]},schema:(0,i.defineSchema)({schema:t.t}),input:async e=>{let t=(0,i.useExecution)();if(t.options=await H(t.cwd,e),t.options.plugins.length===0)throw Error(`Razorwind will not generate any code - no plugins configured. Please add at least one plugin to the configuration.`);n.l(t.options.plugins,s.default);let r=t.options.tokens;(!r||(0,a.isEmptyObject)(r))&&(r=await n.t(t));let c={tokens:r??{},components:(0,o.defu)(t.options.components??{},await B(t)??{})};for(let e of t.options.plugins.filter(e=>e.extract))c=await e.extract(c,t.options);if(!c.tokens||(0,a.isEmptyObject)(c.tokens))throw Error(`Unable to load design tokens for the current workspace. Please ensure that Razorwind is configured correctly and that the tokens are available.`);for(let e of t.options.plugins.filter(e=>e.validate))await e.validate(c,t.options);return c},generator:async e=>{let t=(0,i.useExecution)(),n={};for(let r of t.options.plugins.filter(e=>e.generate)){let i=await r.generate(e,t.options);n=(0,o.defu)(i,n)}return n}});exports.DEFAULT_TOKEN_PATH_CANDIDATES=n.g,exports.RAZORWIND_INFER_PREPROCESSOR=n.a,exports.THEME_BASENAME_PATTERN=n._,exports.TOKEN_DIRECTORY_GLOB=n.v,exports.TOKEN_FILE_EXTENSIONS=n.y,exports.TYPE_PATH_HINTS=n.x,exports.WINDIE_PARSERS=n.b,exports.razorwindParsers=n.b,exports.defineConfig=U,exports.definePlugin=r.definePlugin,exports.generator=W,exports.getRazorwindParserHooks=n.o,exports.getRazorwindPreprocessorHooks=n.s,exports.inferTypeFromPath=n.f,exports.inferValue=n.p,exports.loadComponents=B,exports.loadTokens=n.t,exports.loadTokensOrThrow=n.n,exports.nestFlatTokens=n.m,exports.normalizeTokenTree=n.h,exports.parseCssCustomProperties=n.d,exports.razorwindInferPreprocessor=n.c,exports.registerRazorwindHooks=n.l,exports.registerRazorwindParsers=n.u,exports.resolveConfig=H,exports.resolveTokensSource=n.r,exports.themeKeyFromPath=n.i;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as Components, t as Schema } from "./schema-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { a as UserConfigFn, c as UserConfigParams, d as TokensPreprocessor, i as UserConfigExport, l as Plugin, n as Options, o as UserConfigFnObject, r as UserConfig, s as UserConfigFnPromise, t as Config, u as TokensParser } from "./config-
|
|
4
|
-
import { t as definePlugin } from "./plugin-
|
|
5
|
-
import { C as RazorwindParserName, D as TOKEN_PARSER_NAMES, E as TOKEN_FILE_EXTENSIONS, O as TYPE_PATH_HINTS, S as DEFAULT_TOKEN_PATH_CANDIDATES, T as TOKEN_DIRECTORY_GLOB, _ as inferTypeFromPath, a as razorwindInferPreprocessor, b as normalizeTokenTree, c as LoadTokensOptions, d as loadTokensOrThrow, f as ResolveTokensPathOptions, g as InferredTokenType, h as themeKeyFromPath, i as getRazorwindPreprocessorHooks, l as LoadedTokens, m as resolveTokensSource, n as StyleDictionaryRegisterTarget, o as registerRazorwindHooks, p as ResolvedTokensSource, r as getRazorwindParserHooks, s as registerRazorwindParsers, t as RAZORWIND_INFER_PREPROCESSOR, u as loadTokens, v as inferValue, w as THEME_BASENAME_PATTERN, x as parseCssCustomProperties, y as nestFlatTokens } from "./index-
|
|
1
|
+
import { a as Components, t as Schema } from "./schema-C6-umW1r.cjs";
|
|
2
|
+
import "./index-DW51mcvl.cjs";
|
|
3
|
+
import { a as UserConfigFn, c as UserConfigParams, d as TokensPreprocessor, i as UserConfigExport, l as Plugin, n as Options, o as UserConfigFnObject, r as UserConfig, s as UserConfigFnPromise, t as Config, u as TokensParser } from "./config-CBGz3vxV.cjs";
|
|
4
|
+
import { t as definePlugin } from "./plugin-C_nK-znA.cjs";
|
|
5
|
+
import { C as RazorwindParserName, D as TOKEN_PARSER_NAMES, E as TOKEN_FILE_EXTENSIONS, O as TYPE_PATH_HINTS, S as DEFAULT_TOKEN_PATH_CANDIDATES, T as TOKEN_DIRECTORY_GLOB, _ as inferTypeFromPath, a as razorwindInferPreprocessor, b as normalizeTokenTree, c as LoadTokensOptions, d as loadTokensOrThrow, f as ResolveTokensPathOptions, g as InferredTokenType, h as themeKeyFromPath, i as getRazorwindPreprocessorHooks, l as LoadedTokens, m as resolveTokensSource, n as StyleDictionaryRegisterTarget, o as registerRazorwindHooks, p as ResolvedTokensSource, r as getRazorwindParserHooks, s as registerRazorwindParsers, t as RAZORWIND_INFER_PREPROCESSOR, u as loadTokens, v as inferValue, w as THEME_BASENAME_PATTERN, x as parseCssCustomProperties, y as nestFlatTokens } from "./index-CKJ5fZxo.cjs";
|
|
6
6
|
import StyleDictionary from "style-dictionary";
|
|
7
7
|
import { ExecutionContext, GeneratorConfig } from "@power-plant/core";
|
|
8
8
|
//#region src/lib/resolve-config.d.ts
|
|
@@ -49,10 +49,8 @@ declare function defineConfig(config: UserConfigExport): UserConfigExport;
|
|
|
49
49
|
/**
|
|
50
50
|
* Load components from `componentsPath` directories.
|
|
51
51
|
*
|
|
52
|
-
* For each configured path that is a directory, every direct child directory
|
|
53
|
-
*
|
|
54
|
-
* 1. `package.json` — npm fields and/or a `razorwind` object (including
|
|
55
|
-
* `componentFileSchema` file entries)
|
|
52
|
+
* For each configured path that is a directory, every direct child directory is inspected for:
|
|
53
|
+
* 1. `package.json` — npm fields and/or a `razorwind` object (including `componentFileSchema` file entries)
|
|
56
54
|
* 2. `component.json` — component metadata or `componentFileSchema` values
|
|
57
55
|
*
|
|
58
56
|
* When both resolve values, `component.json` overlays `package.json`.
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/lib/resolve-config.ts","../src/config.ts","../src/lib/components/load.ts","../src/types/base.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;;;iBA8CsB,cACpB,aACA,SAAS,UACR,QAAQ;;;;;;;;;;;;;;;;;;;;;;;iBCEK,aAAa,QAAQ,aAAa;iBAClC,aAAa,QAAQ,eAAe;iBACpC,aAAa,QAAQ,QAAQ,cAAc,QAAQ;iBACnD,aACd,QAAQ,QAAQ,gBACf,QAAQ;iBACK,aAAa,QAAQ,qBAAqB;iBAC1C,aAAa,QAAQ,sBAAsB;iBAC3C,aAAa,QAAQ,eAAe;iBACpC,aAAa,QAAQ,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/lib/resolve-config.ts","../src/config.ts","../src/lib/components/load.ts","../src/types/base.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;;;iBA8CsB,cACpB,aACA,SAAS,UACR,QAAQ;;;;;;;;;;;;;;;;;;;;;;;iBCEK,aAAa,QAAQ,aAAa;iBAClC,aAAa,QAAQ,eAAe;iBACpC,aAAa,QAAQ,QAAQ,cAAc,QAAQ;iBACnD,aACd,QAAQ,QAAQ,gBACf,QAAQ;iBACK,aAAa,QAAQ,qBAAqB;iBAC1C,aAAa,QAAQ,sBAAsB;iBAC3C,aAAa,QAAQ,eAAe;iBACpC,aAAa,QAAQ,mBAAmB;;;;;;;;;;;;iBC0PlC,eACpB,SAAS,iBAAiB,QAAQ,gBACjC,QAAQ;;;KCnSC,UAAU,oCAAoC,gBACxD,QACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;YCGU;IACR,IAAI;;;;;;;;;cAcK,uCAAS,sBAAA,QAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as Components, t as Schema } from "./schema-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { a as UserConfigFn, c as UserConfigParams, d as TokensPreprocessor, i as UserConfigExport, l as Plugin, n as Options, o as UserConfigFnObject, r as UserConfig, s as UserConfigFnPromise, t as Config, u as TokensParser } from "./config-
|
|
4
|
-
import { t as definePlugin } from "./plugin-
|
|
5
|
-
import { C as RazorwindParserName, D as TOKEN_PARSER_NAMES, E as TOKEN_FILE_EXTENSIONS, O as TYPE_PATH_HINTS, S as DEFAULT_TOKEN_PATH_CANDIDATES, T as TOKEN_DIRECTORY_GLOB, _ as inferTypeFromPath, a as razorwindInferPreprocessor, b as normalizeTokenTree, c as LoadTokensOptions, d as loadTokensOrThrow, f as ResolveTokensPathOptions, g as InferredTokenType, h as themeKeyFromPath, i as getRazorwindPreprocessorHooks, l as LoadedTokens, m as resolveTokensSource, n as StyleDictionaryRegisterTarget, o as registerRazorwindHooks, p as ResolvedTokensSource, r as getRazorwindParserHooks, s as registerRazorwindParsers, t as RAZORWIND_INFER_PREPROCESSOR, u as loadTokens, v as inferValue, w as THEME_BASENAME_PATTERN, x as parseCssCustomProperties, y as nestFlatTokens } from "./index-
|
|
1
|
+
import { a as Components, t as Schema } from "./schema-C6-umW1r.mjs";
|
|
2
|
+
import "./index-BhVvIILv.mjs";
|
|
3
|
+
import { a as UserConfigFn, c as UserConfigParams, d as TokensPreprocessor, i as UserConfigExport, l as Plugin, n as Options, o as UserConfigFnObject, r as UserConfig, s as UserConfigFnPromise, t as Config, u as TokensParser } from "./config-CaaK20wo.mjs";
|
|
4
|
+
import { t as definePlugin } from "./plugin-Cbx7QH4X.mjs";
|
|
5
|
+
import { C as RazorwindParserName, D as TOKEN_PARSER_NAMES, E as TOKEN_FILE_EXTENSIONS, O as TYPE_PATH_HINTS, S as DEFAULT_TOKEN_PATH_CANDIDATES, T as TOKEN_DIRECTORY_GLOB, _ as inferTypeFromPath, a as razorwindInferPreprocessor, b as normalizeTokenTree, c as LoadTokensOptions, d as loadTokensOrThrow, f as ResolveTokensPathOptions, g as InferredTokenType, h as themeKeyFromPath, i as getRazorwindPreprocessorHooks, l as LoadedTokens, m as resolveTokensSource, n as StyleDictionaryRegisterTarget, o as registerRazorwindHooks, p as ResolvedTokensSource, r as getRazorwindParserHooks, s as registerRazorwindParsers, t as RAZORWIND_INFER_PREPROCESSOR, u as loadTokens, v as inferValue, w as THEME_BASENAME_PATTERN, x as parseCssCustomProperties, y as nestFlatTokens } from "./index-BlIc4ofi.mjs";
|
|
6
6
|
import { ExecutionContext, GeneratorConfig } from "@power-plant/core";
|
|
7
7
|
import StyleDictionary from "style-dictionary";
|
|
8
8
|
//#region src/lib/resolve-config.d.ts
|
|
@@ -49,10 +49,8 @@ declare function defineConfig(config: UserConfigExport): UserConfigExport;
|
|
|
49
49
|
/**
|
|
50
50
|
* Load components from `componentsPath` directories.
|
|
51
51
|
*
|
|
52
|
-
* For each configured path that is a directory, every direct child directory
|
|
53
|
-
*
|
|
54
|
-
* 1. `package.json` — npm fields and/or a `razorwind` object (including
|
|
55
|
-
* `componentFileSchema` file entries)
|
|
52
|
+
* For each configured path that is a directory, every direct child directory is inspected for:
|
|
53
|
+
* 1. `package.json` — npm fields and/or a `razorwind` object (including `componentFileSchema` file entries)
|
|
56
54
|
* 2. `component.json` — component metadata or `componentFileSchema` values
|
|
57
55
|
*
|
|
58
56
|
* When both resolve values, `component.json` overlays `package.json`.
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,r as n}from"./schema-
|
|
1
|
+
import{a as e,i as t,r as n}from"./schema-CzpHs4s7.mjs";import{_ as r,a as i,b as a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as ee,n as p,o as te,p as ne,r as re,s as m,t as h,u as g,v as _,x as v,y}from"./tokens-lbmSdrlF.mjs";import{definePlugin as b}from"./plugin.mjs";import{defineGenerator as x,defineSchema as S,useExecution as C}from"@power-plant/core";import{isEmptyObject as w}from"@stryke/type-checks/is-empty-object";import{createDefu as ie,defu as T}from"defu";import ae from"style-dictionary";import{existsSync as E}from"@stryke/fs/exists";import{isDirectory as oe}from"@stryke/fs/is-file";import{readJsonFile as D}from"@stryke/fs/json";import{listFiles as se}from"@stryke/fs/list-files";import{appendPath as O}from"@stryke/path/append";import{findFileExtensionSafe as k,findFileName as A,findFolderName as j}from"@stryke/path/file-path-fns";import{joinPaths as M}from"@stryke/path/join";import{titleCase as N}from"@stryke/string-format/title-case";import{isSetObject as P}from"@stryke/type-checks/is-set-object";import{isSetString as F}from"@stryke/type-checks/is-set-string";import{readFile as I,readdir as L}from"node:fs/promises";import{isAbsolute as R,resolve as z}from"node:path";import{getEnvPaths as B}from"@stryke/env";import{findFilePath as V}from"@stryke/path/find";import{replacePath as H}from"@stryke/path/replace";import{isFunction as U}from"@stryke/type-checks/is-function";import{loadConfig as W}from"c12";import{createJiti as G}from"jiti";import{existsSync as K}from"node:fs";import ce from"node:os";var le=`0.0.22`;const ue=e.partial(),q=ie((e,t,n)=>Array.isArray(n)?(e[t]=n,!0):!1);function de(e,t){return R(t)?t:z(e,t)}function fe(e){return Array.isArray(e)?e.filter(F):F(e)?[e]:[]}function pe(e){if(F(e))return e;if(P(e)&&`url`in e&&F(e.url))return e.url}function J(e){if(!e)return;let n=t.safeParse(e);if(n.success)return[n.data];if(!Array.isArray(e))return;let r=[];for(let n of e){let e=t.safeParse(n);e.success&&r.push(e.data)}return r.length>0?r:void 0}function Y(e){if(!P(e))return;let t=ue.safeParse(e);if(t.success)return Object.keys(t.data).length>0?t.data:void 0}function X(e){return P(e)&&`path`in e}async function me(e){let t=M(e,`package.json`);if(!E(t))return;let n;try{n=await D(t)}catch{return}let r={};F(n.name)&&(r.name=n.name,r.title=n.name),F(n.description)&&(r.description=n.description),F(n.version)&&(r.version=n.version),F(n.homepage)&&(r.homepage=n.homepage);let i=pe(n.repository);if(i&&(r.repository=i),P(n.dependencies)&&(r.dependencies=n.dependencies),P(n.devDependencies)&&(r.devDependencies=n.devDependencies),Array.isArray(n.keywords)){let e=n.keywords.filter(F);e.length>0&&(r.tags=e)}let a=n.razorwind,o,s;X(a)?s=J(a):P(a)&&(o=Y(a),`files`in a&&(s=J(a.files)));let c=q(o??{},r);return s?.length&&(c.files=s),Object.keys(c).length>0?c:void 0}async function he(e){let t=M(e,`component.json`);if(!E(t))return;let n;try{n=await D(t)}catch{return}if(X(n)||Array.isArray(n)){let e=J(n);if(e)return{files:e}}return Y(n)}async function ge(t){let n=await me(t),r=await he(t);if(!n&&!r)return;let i=q(r??{},n??{}),a=F(i.name)?i.name:j(t),o=F(i.title)?i.title:N(a),s=e.safeParse({...i,name:a,title:o});if(s.success)return{...s.data,files:await Promise.all((s.data.files??(await se(t)).filter(e=>A(e,{withExtension:!1})===`index`))?.filter(Boolean)?.map(async e=>typeof e==`string`?{type:/[tj]sx$/.test(k(e))?`component`:`file`,path:e,content:await I(O(e,t),`utf8`)}:{type:/[tj]sx$/.test(k(e.path))?`component`:`file`,...e,content:e.content?e.content:e.path?await I(O(e.path,t),`utf8`):void 0,path:O(e.path,t)}))}}async function Z(e){let t={},n=fe(e.options.componentsPath);for(let r of n){let n=de(e.cwd,r);if(!(!E(n)||!oe(n)))try{let e=await L(n,{withFileTypes:!0});for(let r of e){if(!r.isDirectory()||r.name.startsWith(`.`))continue;let e=await ge(M(n,r.name));e&&(t[e.name]=e)}}catch{continue}}return t}const Q=ce.homedir();async function $(e,t){let n=t.configFile&&K(H(t.configFile,e))?H(t.configFile,e):t.configFile&&K(t.configFile)?t.configFile:K(M(e,`razorwind.${t.mode}.config.ts`))?M(e,`razorwind.${t.mode}.config.ts`):K(M(e,`razorwind.${t.mode}.config.js`))?M(e,`razorwind.${t.mode}.config.js`):K(M(e,`razorwind.${t.mode}.config.mts`))?M(e,`razorwind.${t.mode}.config.mts`):K(M(e,`razorwind.${t.mode}.config.mjs`))?M(e,`razorwind.${t.mode}.config.mjs`):K(M(e,`razorwind.config.ts`))?M(e,`razorwind.config.ts`):K(M(e,`razorwind.config.js`))?M(e,`razorwind.config.js`):K(M(e,`razorwind.config.mts`))?M(e,`razorwind.config.mts`):K(M(e,`razorwind.config.mjs`))?M(e,`razorwind.config.mjs`):void 0,r=B({orgId:`storm-software`,appId:`razorwind`,workspaceRoot:e}),i={fsCache:r.cache},a=G(e,i),o={};if(n){let r=await a.import(a.esmResolve(n));if(r?.default){let i={};U(r.default)?i=await Promise.resolve(r.default({cwd:e,mode:t.mode??`development`})):(P(r.default)||Array.isArray(r.default))&&(i=r.default),(P(i)||Array.isArray(i))&&(o={...i,configFile:n})}}let[s,c,l]=await Promise.all([W({cwd:e,name:`razorwind`,envName:t.mode,globalRc:!0,packageJson:`razorwind`,dotenv:!0,jitiOptions:i}),W({cwd:r.config,name:`razorwind`,envName:t.mode,dotenv:!0,jitiOptions:i}),W({cwd:Q,name:`razorwind`,envName:t.mode,dotenv:!0,jitiOptions:i})]),u=T({cwd:e,envPaths:{...r,home:Q}},t,o,P(s?.config)?{...s.config}:{},P(c?.config)?{...c.config}:{},P(l?.config)?{...l.config}:{},{componentsPath:e,plugins:[]});if(Array.isArray(u.componentsPath)){let t=u.componentsPath.filter(F).map(e=>V(e));u.componentsPath=t.length>0?t:e}else u.componentsPath=F(u.componentsPath)?V(u.componentsPath):e;return Array.isArray(u.plugins)||(u.plugins=[]),u}function _e(e){return e}const ve=x({meta:{name:`razorwind`,title:`Razorwind`,description:`A generator that uses Razorwind to generate design system code from design tokens and components.`,version:le,tags:[`razorwind`,`dtcg`]},schema:S({schema:n}),input:async e=>{let t=C();if(t.options=await $(t.cwd,e),t.options.plugins.length===0)throw Error(`Razorwind will not generate any code - no plugins configured. Please add at least one plugin to the configuration.`);f(t.options.plugins,ae);let n=t.options.tokens;(!n||w(n))&&(n=await h(t));let r={tokens:n??{},components:T(t.options.components??{},await Z(t)??{})};for(let e of t.options.plugins.filter(e=>e.extract))r=await e.extract(r,t.options);if(!r.tokens||w(r.tokens))throw Error(`Unable to load design tokens for the current workspace. Please ensure that Razorwind is configured correctly and that the tokens are available.`);for(let e of t.options.plugins.filter(e=>e.validate))await e.validate(r,t.options);return r},generator:async e=>{let t=C(),n={};for(let r of t.options.plugins.filter(e=>e.generate)){let i=await r.generate(e,t.options);n=T(i,n)}return n}});export{l as DEFAULT_TOKEN_PATH_CANDIDATES,i as RAZORWIND_INFER_PREPROCESSOR,r as THEME_BASENAME_PATTERN,_ as TOKEN_DIRECTORY_GLOB,y as TOKEN_FILE_EXTENSIONS,v as TYPE_PATH_HINTS,a as WINDIE_PARSERS,a as razorwindParsers,_e as defineConfig,b as definePlugin,ve as generator,te as getRazorwindParserHooks,m as getRazorwindPreprocessorHooks,c as inferTypeFromPath,ne as inferValue,Z as loadComponents,h as loadTokens,p as loadTokensOrThrow,ee as nestFlatTokens,u as normalizeTokenTree,s as parseCssCustomProperties,o as razorwindInferPreprocessor,f as registerRazorwindHooks,g as registerRazorwindParsers,$ as resolveConfig,re as resolveTokensSource,d as themeKeyFromPath};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as RazorwindParserName, D as TOKEN_PARSER_NAMES, E as TOKEN_FILE_EXTENSIONS, O as TYPE_PATH_HINTS, S as DEFAULT_TOKEN_PATH_CANDIDATES, T as TOKEN_DIRECTORY_GLOB, _ as inferTypeFromPath, a as razorwindInferPreprocessor, b as normalizeTokenTree, c as LoadTokensOptions, d as loadTokensOrThrow, f as ResolveTokensPathOptions, g as InferredTokenType, h as themeKeyFromPath, i as getRazorwindPreprocessorHooks, l as LoadedTokens, m as resolveTokensSource, n as StyleDictionaryRegisterTarget, o as registerRazorwindHooks, p as ResolvedTokensSource, r as getRazorwindParserHooks, s as registerRazorwindParsers, t as RAZORWIND_INFER_PREPROCESSOR, u as loadTokens, v as inferValue, w as THEME_BASENAME_PATTERN, x as parseCssCustomProperties, y as nestFlatTokens } from "../../index-
|
|
1
|
+
import { C as RazorwindParserName, D as TOKEN_PARSER_NAMES, E as TOKEN_FILE_EXTENSIONS, O as TYPE_PATH_HINTS, S as DEFAULT_TOKEN_PATH_CANDIDATES, T as TOKEN_DIRECTORY_GLOB, _ as inferTypeFromPath, a as razorwindInferPreprocessor, b as normalizeTokenTree, c as LoadTokensOptions, d as loadTokensOrThrow, f as ResolveTokensPathOptions, g as InferredTokenType, h as themeKeyFromPath, i as getRazorwindPreprocessorHooks, l as LoadedTokens, m as resolveTokensSource, n as StyleDictionaryRegisterTarget, o as registerRazorwindHooks, p as ResolvedTokensSource, r as getRazorwindParserHooks, s as registerRazorwindParsers, t as RAZORWIND_INFER_PREPROCESSOR, u as loadTokens, v as inferValue, w as THEME_BASENAME_PATTERN, x as parseCssCustomProperties, y as nestFlatTokens } from "../../index-CKJ5fZxo.cjs";
|
|
2
2
|
export { DEFAULT_TOKEN_PATH_CANDIDATES, type InferredTokenType, type LoadTokensOptions, type LoadedTokens, RAZORWIND_INFER_PREPROCESSOR, type RazorwindParserName, type ResolveTokensPathOptions, type ResolvedTokensSource, type StyleDictionaryRegisterTarget, THEME_BASENAME_PATTERN, TOKEN_DIRECTORY_GLOB, TOKEN_FILE_EXTENSIONS, TYPE_PATH_HINTS, TOKEN_PARSER_NAMES as WINDIE_PARSERS, TOKEN_PARSER_NAMES as razorwindParsers, getRazorwindParserHooks, getRazorwindPreprocessorHooks, inferTypeFromPath, inferValue, loadTokens, loadTokensOrThrow, nestFlatTokens, normalizeTokenTree, parseCssCustomProperties, razorwindInferPreprocessor, registerRazorwindHooks, registerRazorwindParsers, resolveTokensSource, themeKeyFromPath };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as RazorwindParserName, D as TOKEN_PARSER_NAMES, E as TOKEN_FILE_EXTENSIONS, O as TYPE_PATH_HINTS, S as DEFAULT_TOKEN_PATH_CANDIDATES, T as TOKEN_DIRECTORY_GLOB, _ as inferTypeFromPath, a as razorwindInferPreprocessor, b as normalizeTokenTree, c as LoadTokensOptions, d as loadTokensOrThrow, f as ResolveTokensPathOptions, g as InferredTokenType, h as themeKeyFromPath, i as getRazorwindPreprocessorHooks, l as LoadedTokens, m as resolveTokensSource, n as StyleDictionaryRegisterTarget, o as registerRazorwindHooks, p as ResolvedTokensSource, r as getRazorwindParserHooks, s as registerRazorwindParsers, t as RAZORWIND_INFER_PREPROCESSOR, u as loadTokens, v as inferValue, w as THEME_BASENAME_PATTERN, x as parseCssCustomProperties, y as nestFlatTokens } from "../../index-
|
|
1
|
+
import { C as RazorwindParserName, D as TOKEN_PARSER_NAMES, E as TOKEN_FILE_EXTENSIONS, O as TYPE_PATH_HINTS, S as DEFAULT_TOKEN_PATH_CANDIDATES, T as TOKEN_DIRECTORY_GLOB, _ as inferTypeFromPath, a as razorwindInferPreprocessor, b as normalizeTokenTree, c as LoadTokensOptions, d as loadTokensOrThrow, f as ResolveTokensPathOptions, g as InferredTokenType, h as themeKeyFromPath, i as getRazorwindPreprocessorHooks, l as LoadedTokens, m as resolveTokensSource, n as StyleDictionaryRegisterTarget, o as registerRazorwindHooks, p as ResolvedTokensSource, r as getRazorwindParserHooks, s as registerRazorwindParsers, t as RAZORWIND_INFER_PREPROCESSOR, u as loadTokens, v as inferValue, w as THEME_BASENAME_PATTERN, x as parseCssCustomProperties, y as nestFlatTokens } from "../../index-BlIc4ofi.mjs";
|
|
2
2
|
export { DEFAULT_TOKEN_PATH_CANDIDATES, type InferredTokenType, type LoadTokensOptions, type LoadedTokens, RAZORWIND_INFER_PREPROCESSOR, type RazorwindParserName, type ResolveTokensPathOptions, type ResolvedTokensSource, type StyleDictionaryRegisterTarget, THEME_BASENAME_PATTERN, TOKEN_DIRECTORY_GLOB, TOKEN_FILE_EXTENSIONS, TYPE_PATH_HINTS, TOKEN_PARSER_NAMES as WINDIE_PARSERS, TOKEN_PARSER_NAMES as razorwindParsers, getRazorwindParserHooks, getRazorwindPreprocessorHooks, inferTypeFromPath, inferValue, loadTokens, loadTokensOrThrow, nestFlatTokens, normalizeTokenTree, parseCssCustomProperties, razorwindInferPreprocessor, registerRazorwindHooks, registerRazorwindParsers, resolveTokensSource, themeKeyFromPath };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as Plugin } from "./config-
|
|
1
|
+
import { l as Plugin } from "./config-CBGz3vxV.cjs";
|
|
2
2
|
//#region src/plugin.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Type helper for Razorwind plugins (`parsers` / `preprocessors` + `extract` / `validate` / `generate`).
|
|
@@ -46,4 +46,4 @@ declare function definePlugin<TOptions>(factory: (options: TOptions) => Plugin,
|
|
|
46
46
|
declare function definePlugin(plugin: Plugin, overrides?: Partial<Plugin>): Plugin;
|
|
47
47
|
//#endregion
|
|
48
48
|
export { definePlugin as t };
|
|
49
|
-
//# sourceMappingURL=plugin-
|
|
49
|
+
//# sourceMappingURL=plugin-C_nK-znA.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-
|
|
1
|
+
{"version":3,"file":"plugin-C_nK-znA.d.cts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiEgB,aAAa,UAC3B,UAAU,SAAS,aAAa,QAChC,YAAY,QAAQ,WAClB,UAAU,aAAa;iBACX,aACd,QAAQ,QACR,YAAY,QAAQ,UACnB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as Plugin } from "./config-
|
|
1
|
+
import { l as Plugin } from "./config-CaaK20wo.mjs";
|
|
2
2
|
//#region src/plugin.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Type helper for Razorwind plugins (`parsers` / `preprocessors` + `extract` / `validate` / `generate`).
|
|
@@ -46,4 +46,4 @@ declare function definePlugin<TOptions>(factory: (options: TOptions) => Plugin,
|
|
|
46
46
|
declare function definePlugin(plugin: Plugin, overrides?: Partial<Plugin>): Plugin;
|
|
47
47
|
//#endregion
|
|
48
48
|
export { definePlugin as t };
|
|
49
|
-
//# sourceMappingURL=plugin-
|
|
49
|
+
//# sourceMappingURL=plugin-Cbx7QH4X.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-Cbx7QH4X.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":""}
|
package/dist/plugin.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { d as TokensPreprocessor, l as Plugin, u as TokensParser } from "./config-
|
|
2
|
-
import { t as definePlugin } from "./plugin-
|
|
1
|
+
import { d as TokensPreprocessor, l as Plugin, u as TokensParser } from "./config-CBGz3vxV.cjs";
|
|
2
|
+
import { t as definePlugin } from "./plugin-C_nK-znA.cjs";
|
|
3
3
|
export { type Plugin, type TokensParser, type TokensPreprocessor, definePlugin };
|
package/dist/plugin.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { d as TokensPreprocessor, l as Plugin, u as TokensParser } from "./config-
|
|
2
|
-
import { t as definePlugin } from "./plugin-
|
|
1
|
+
import { d as TokensPreprocessor, l as Plugin, u as TokensParser } from "./config-CaaK20wo.mjs";
|
|
2
|
+
import { t as definePlugin } from "./plugin-Cbx7QH4X.mjs";
|
|
3
3
|
export { type Plugin, type TokensParser, type TokensPreprocessor, definePlugin };
|
package/dist/schema/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../schema-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../schema-DWEhLYz4.cjs");let t=require("@power-plant/dtcg-schema");exports.componentFileSchema=e.n,exports.componentSchema=e.r,exports.componentsSchema=e.i,exports.schema=e.t,Object.defineProperty(exports,"tokenSchema",{enumerable:!0,get:function(){return t.tokenSchema}}),Object.defineProperty(exports,"tokensSchema",{enumerable:!0,get:function(){return t.tokensSchema}});
|
package/dist/schema/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as Components, c as componentsSchema, i as ComponentFile, n as schema, o as componentFileSchema, r as Component, s as componentSchema, t as Schema } from "../schema-
|
|
2
|
-
import { i as tokensSchema, n as Tokens, r as tokenSchema, t as Token } from "../index-
|
|
1
|
+
import { a as Components, c as componentsSchema, i as ComponentFile, n as schema, o as componentFileSchema, r as Component, s as componentSchema, t as Schema } from "../schema-C6-umW1r.cjs";
|
|
2
|
+
import { i as tokensSchema, n as Tokens, r as tokenSchema, t as Token } from "../index-DW51mcvl.cjs";
|
|
3
3
|
export { type Component, type ComponentFile, type Components, type Schema, type Token, type Tokens, componentFileSchema, componentSchema, componentsSchema, schema, tokenSchema, tokensSchema };
|
package/dist/schema/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as Components, c as componentsSchema, i as ComponentFile, n as schema, o as componentFileSchema, r as Component, s as componentSchema, t as Schema } from "../schema-
|
|
2
|
-
import { i as tokensSchema, n as Tokens, r as tokenSchema, t as Token } from "../index-
|
|
1
|
+
import { a as Components, c as componentsSchema, i as ComponentFile, n as schema, o as componentFileSchema, r as Component, s as componentSchema, t as Schema } from "../schema-C6-umW1r.mjs";
|
|
2
|
+
import { i as tokensSchema, n as Tokens, r as tokenSchema, t as Token } from "../index-BhVvIILv.mjs";
|
|
3
3
|
export { type Component, type ComponentFile, type Components, type Schema, type Token, type Tokens, componentFileSchema, componentSchema, componentsSchema, schema, tokenSchema, tokensSchema };
|
package/dist/schema/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,t as a}from"../schema-
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,t as a}from"../schema-CzpHs4s7.mjs";export{t as componentFileSchema,e as componentSchema,r as componentsSchema,i as schema,a as tokenSchema,n as tokensSchema};
|
|
@@ -3,7 +3,7 @@ import { Tokens } from "@power-plant/dtcg-schema";
|
|
|
3
3
|
//#region src/schema/components.d.ts
|
|
4
4
|
declare const componentFileSchema: z$1.ZodObject<{
|
|
5
5
|
path: z$1.ZodString;
|
|
6
|
-
type: z$1.
|
|
6
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
7
7
|
block: "block";
|
|
8
8
|
component: "component";
|
|
9
9
|
ui: "ui";
|
|
@@ -24,7 +24,7 @@ type ComponentFile = z$1.infer<typeof componentFileSchema>;
|
|
|
24
24
|
declare const componentSchema: z$1.ZodObject<{
|
|
25
25
|
name: z$1.ZodString;
|
|
26
26
|
title: z$1.ZodString;
|
|
27
|
-
type: z$1.
|
|
27
|
+
type: z$1.ZodDefault<z$1.ZodEnum<{
|
|
28
28
|
block: "block";
|
|
29
29
|
component: "component";
|
|
30
30
|
ui: "ui";
|
|
@@ -43,7 +43,7 @@ declare const componentSchema: z$1.ZodObject<{
|
|
|
43
43
|
registryDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
44
44
|
files: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
45
45
|
path: z$1.ZodString;
|
|
46
|
-
type: z$1.
|
|
46
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
47
47
|
block: "block";
|
|
48
48
|
component: "component";
|
|
49
49
|
ui: "ui";
|
|
@@ -65,7 +65,7 @@ type Component = z$1.infer<typeof componentSchema>;
|
|
|
65
65
|
declare const componentsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
66
66
|
name: z$1.ZodString;
|
|
67
67
|
title: z$1.ZodString;
|
|
68
|
-
type: z$1.
|
|
68
|
+
type: z$1.ZodDefault<z$1.ZodEnum<{
|
|
69
69
|
block: "block";
|
|
70
70
|
component: "component";
|
|
71
71
|
ui: "ui";
|
|
@@ -84,7 +84,7 @@ declare const componentsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
|
84
84
|
registryDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
85
85
|
files: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
86
86
|
path: z$1.ZodString;
|
|
87
|
-
type: z$1.
|
|
87
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
88
88
|
block: "block";
|
|
89
89
|
component: "component";
|
|
90
90
|
ui: "ui";
|
|
@@ -112,4 +112,4 @@ interface Schema {
|
|
|
112
112
|
declare const schema: z.ZodType<Schema>;
|
|
113
113
|
//#endregion
|
|
114
114
|
export { Components as a, componentsSchema as c, ComponentFile as i, schema as n, componentFileSchema as o, Component as r, componentSchema as s, Schema as t };
|
|
115
|
-
//# sourceMappingURL=schema-
|
|
115
|
+
//# sourceMappingURL=schema-C6-umW1r.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-
|
|
1
|
+
{"version":3,"file":"schema-C6-umW1r.d.cts","names":[],"sources":["../src/schema/components.ts","../src/schema/schema.ts"],"mappings":";;;cAoBa,qBAAmB,IAAA;;;;;;;;;;;;;;;;;;GAyB9B,IAAA,KAAA;KAEU,gBAAgB,IAAE,aAAa;cAE9B,iBAAe,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgB1B,IAAA,KAAA;KAEU,YAAY,IAAE,aAAa;cAE1B,kBAAgB,IAAA,UAAA,IAAA,WAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAwC,IAAA,KAAA;KAEzD,aAAa,IAAE,aAAa;;;UC1CvB;EACf,YAAY;EACZ,QAAQ,SAAS,eAAe;;cAGrB,QAAQ,EAAE,QAAQ"}
|
|
@@ -3,7 +3,7 @@ import { Tokens } from "@power-plant/dtcg-schema";
|
|
|
3
3
|
//#region src/schema/components.d.ts
|
|
4
4
|
declare const componentFileSchema: z$1.ZodObject<{
|
|
5
5
|
path: z$1.ZodString;
|
|
6
|
-
type: z$1.
|
|
6
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
7
7
|
block: "block";
|
|
8
8
|
component: "component";
|
|
9
9
|
ui: "ui";
|
|
@@ -24,7 +24,7 @@ type ComponentFile = z$1.infer<typeof componentFileSchema>;
|
|
|
24
24
|
declare const componentSchema: z$1.ZodObject<{
|
|
25
25
|
name: z$1.ZodString;
|
|
26
26
|
title: z$1.ZodString;
|
|
27
|
-
type: z$1.
|
|
27
|
+
type: z$1.ZodDefault<z$1.ZodEnum<{
|
|
28
28
|
block: "block";
|
|
29
29
|
component: "component";
|
|
30
30
|
ui: "ui";
|
|
@@ -43,7 +43,7 @@ declare const componentSchema: z$1.ZodObject<{
|
|
|
43
43
|
registryDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
44
44
|
files: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
45
45
|
path: z$1.ZodString;
|
|
46
|
-
type: z$1.
|
|
46
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
47
47
|
block: "block";
|
|
48
48
|
component: "component";
|
|
49
49
|
ui: "ui";
|
|
@@ -65,7 +65,7 @@ type Component = z$1.infer<typeof componentSchema>;
|
|
|
65
65
|
declare const componentsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
66
66
|
name: z$1.ZodString;
|
|
67
67
|
title: z$1.ZodString;
|
|
68
|
-
type: z$1.
|
|
68
|
+
type: z$1.ZodDefault<z$1.ZodEnum<{
|
|
69
69
|
block: "block";
|
|
70
70
|
component: "component";
|
|
71
71
|
ui: "ui";
|
|
@@ -84,7 +84,7 @@ declare const componentsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
|
84
84
|
registryDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
85
85
|
files: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
86
86
|
path: z$1.ZodString;
|
|
87
|
-
type: z$1.
|
|
87
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
88
88
|
block: "block";
|
|
89
89
|
component: "component";
|
|
90
90
|
ui: "ui";
|
|
@@ -112,4 +112,4 @@ interface Schema {
|
|
|
112
112
|
declare const schema: z.ZodType<Schema>;
|
|
113
113
|
//#endregion
|
|
114
114
|
export { Components as a, componentsSchema as c, ComponentFile as i, schema as n, componentFileSchema as o, Component as r, componentSchema as s, Schema as t };
|
|
115
|
-
//# sourceMappingURL=schema-
|
|
115
|
+
//# sourceMappingURL=schema-C6-umW1r.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-C6-umW1r.d.mts","names":[],"sources":["../src/schema/components.ts","../src/schema/schema.ts"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{z as t}from"zod";import{tokenSchema as n,tokensSchema as r,tokensSchema as i}from"@power-plant/dtcg-schema";const a=t.object({path:t.string(),type:t.enum([`lib`,`block`,`component`,`ui`,`hook`,`theme`,`page`,`file`,`style`,`base`,`font`,`item`]).
|
|
2
|
-
//# sourceMappingURL=schema-
|
|
1
|
+
import e,{z as t}from"zod";import{tokenSchema as n,tokensSchema as r,tokensSchema as i}from"@power-plant/dtcg-schema";const a=t.object({path:t.string(),type:t.enum([`lib`,`block`,`component`,`ui`,`hook`,`theme`,`page`,`file`,`style`,`base`,`font`,`item`]).optional(),content:t.string().optional(),target:t.string().optional().describe(`The target path of the file. This is the path to the file in the project. Supports registry target placeholders @components/, @ui/, @lib/, and @hooks/, which resolve to the corresponding aliases configured in components.json. These placeholders are independent of the project's import prefix.`)}),o=t.object({name:t.string(),title:t.string(),type:t.enum([`block`,`component`,`ui`,`page`]).default(`component`),category:t.string().optional(),description:t.string().optional(),tags:t.array(t.string()).optional(),related:t.array(t.string()).optional(),since:t.string().optional(),version:t.string().optional(),repository:t.string().optional(),homepage:t.string().optional(),dependencies:t.record(t.string(),t.string()).optional(),devDependencies:t.record(t.string(),t.string()).optional(),registryDependencies:t.record(t.string(),t.string()).optional(),files:t.array(a).optional()}),s=t.record(t.string(),o),c=e.union([r,e.record(e.string(),r)]),l=e.object({tokens:c,components:s});export{o as a,a as i,i as n,s as o,l as r,n as t};
|
|
2
|
+
//# sourceMappingURL=schema-CzpHs4s7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-CzpHs4s7.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BocRIvOZ.cjs");let t=require("zod");t=e.t(t,1);let n=require("@power-plant/dtcg-schema");const r=t.z.object({path:t.z.string(),type:t.z.enum([`lib`,`block`,`component`,`ui`,`hook`,`theme`,`page`,`file`,`style`,`base`,`font`,`item`]).
|
|
1
|
+
const e=require("./rolldown-runtime-BocRIvOZ.cjs");let t=require("zod");t=e.t(t,1);let n=require("@power-plant/dtcg-schema");const r=t.z.object({path:t.z.string(),type:t.z.enum([`lib`,`block`,`component`,`ui`,`hook`,`theme`,`page`,`file`,`style`,`base`,`font`,`item`]).optional(),content:t.z.string().optional(),target:t.z.string().optional().describe(`The target path of the file. This is the path to the file in the project. Supports registry target placeholders @components/, @ui/, @lib/, and @hooks/, which resolve to the corresponding aliases configured in components.json. These placeholders are independent of the project's import prefix.`)}),i=t.z.object({name:t.z.string(),title:t.z.string(),type:t.z.enum([`block`,`component`,`ui`,`page`]).default(`component`),category:t.z.string().optional(),description:t.z.string().optional(),tags:t.z.array(t.z.string()).optional(),related:t.z.array(t.z.string()).optional(),since:t.z.string().optional(),version:t.z.string().optional(),repository:t.z.string().optional(),homepage:t.z.string().optional(),dependencies:t.z.record(t.z.string(),t.z.string()).optional(),devDependencies:t.z.record(t.z.string(),t.z.string()).optional(),registryDependencies:t.z.record(t.z.string(),t.z.string()).optional(),files:t.z.array(r).optional()}),a=t.z.record(t.z.string(),i),o=t.default.union([n.tokensSchema,t.default.record(t.default.string(),n.tokensSchema)]),s=t.default.object({tokens:o,components:a});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razorwind/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "💨 Razorwind is a unified set of tools that make creating design systems a breeze.",
|
|
6
6
|
"keywords": ["razorwind", "storm-software"],
|
|
@@ -145,5 +145,5 @@
|
|
|
145
145
|
"typescript": "^6.0.3"
|
|
146
146
|
},
|
|
147
147
|
"publishConfig": { "access": "public" },
|
|
148
|
-
"gitHead": "
|
|
148
|
+
"gitHead": "924975280684f987be67006f3d8055dfb713da8c"
|
|
149
149
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-K7NDOu8X.d.mts","names":[],"sources":["../src/types/plugin.ts","../src/types/config.ts"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-NRz4uyoM.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-C7BulI9p.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-_bi4ZPQH.d.mts","names":[],"sources":["../src/schema/components.ts","../src/schema/schema.ts"],"mappings":""}
|