@xaendar/cli 0.6.14 → 0.6.15
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/cli.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -169,4 +169,4 @@ export default defineConfig({
|
|
|
169
169
|
"style": "${t}"
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
}`}function pt(){try{let o=JSON.parse(ht(ct(import.meta.filename,"..","../
|
|
172
|
+
}`}function pt(){try{let o=JSON.parse(ht(ct(import.meta.filename,"..","../package.json"),"utf8"));if(!o.version)throw new Error("Unable to determine Xaendar CLI version.");return o.version}catch(o){console.error("Error reading Xaendar CLI version:",o),process.exit(1)}}function B(o){let t=pt(),e=o.name,i=`${e}-root`;return[{type:"file",name:"package.json",content:M(e,t)},{type:"file",name:"xaendar.json",content:R(e,o.style)},{type:"file",name:"vite.config.ts",content:q()},{type:"file",name:"tsconfig.json",content:U()},{type:"directory",name:"src",children:[{type:"file",name:"index.html",content:I(i)},{type:"file",name:"signals.ts",content:L()},{type:"file",name:"main.ts",content:j(i)},{type:"generateComponent",name:i}]}]}import{execSync as gt}from"child_process";function K(){return new g("new").description("Scaffold a new Xaendar project").argument("<name>","Name of the project to create").option("-p, --path <path>","Custom path for the generated project (default: current directory)").option("-s, --style <style>","CSS preprocessor to use (css, scss, less, styl)","css").action((o,t)=>{let e=_t(t.style),i=t.path||process.cwd(),n=k(i,o);Ct(n),X(B({name:o,style:e}),n,e),gt("npm i",{stdio:"inherit",cwd:n})})}function _t(o){let t=["css","scss","less","styl"];return o?(t.includes(o)||(console.error(`\u2716 Invalid style option: ${o}`),process.exit(1)),o):"css"}function Ct(o){let t=mt(o);t&&dt(o).length&&(console.error(`\u2716 Cannot create project: target directory is not empty: ${o}`),process.exit(1)),t||J(o)}function X(o,t,e){o.forEach(i=>{switch(i.type){case"file":case void 0:let n=i.content;ft(k(t,i.name),n,"utf8");break;case"directory":let s=k(t,i.name);J(s),i.children&&X(i.children,s,e);break;case"generateComponent":S(i.name,t,!1,e);break}})}var xt=JSON.parse(Ot(bt(import.meta.filename,"..","../package.json"),"utf-8")).version;A.name("xd").description("Xaendar CLI").version(xt);A.addCommand(N());A.addCommand(K());A.parse();
|