@xaendar/cli 0.4.9 → 0.4.11

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.
Files changed (2) hide show
  1. package/dist/cli.js +1 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -159,4 +159,4 @@ export default defineConfig({
159
159
  "style": "${t}"
160
160
  }
161
161
  }
162
- }`}function Zt(){try{let r=JSON.parse(Yt(zt(import.meta.filename,"..","./package.json"),"utf8"));if(!r.version)throw new Error("Unable to determine Xaendar CLI version.");return r.version}catch(r){console.error("Error reading Xaendar CLI version:",r),process.exit(1)}}function gt(r){let t=Zt(),e=r.name,i=`${e}-root`;return[{type:"file",name:"package.json",content:ct(e,t)},{type:"file",name:"xaendar.json",content:ft(e,r.style)},{type:"file",name:"vite.config.ts",content:dt()},{type:"file",name:"tsconfig.json",content:mt()},{type:"directory",name:"src",children:[{type:"file",name:"index.html",content:ut(i)},{type:"file",name:"signals.ts",content:pt()},{type:"file",name:"main.ts",content:ht(i)},{type:"generateComponent",name:i}]}]}import{execSync as ie}from"child_process";function Ct(){return new $("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((r,t)=>{let e=ne(t.style),i=t.path||process.cwd(),n=R(i,r);se(n),Ot(gt({name:r,style:e}),n,e),ie("npm i",{stdio:"inherit",cwd:n})})}function ne(r){let t=["css","scss","less","styl"];return r?(t.includes(r)||(console.error(`\u2716 Invalid style option: ${r}`),process.exit(1)),r):"css"}function se(r){let t=Qt(r);t&&te(r).length&&(console.error(`\u2716 Cannot create project: target directory is not empty: ${r}`),process.exit(1)),t||_t(r)}function Ot(r,t,e){r.forEach(i=>{switch(i.type){case"file":case void 0:let n=i.content;ee(R(t,i.name),n,"utf8");break;case"directory":let s=R(t,i.name);_t(s),i.children&&Ot(i.children,s,e);break;case"generateComponent":v(i.name,t,!1,e);break}})}var ae=JSON.parse(re(oe(import.meta.filename,"..","package.json"),"utf-8")).version;y.name("xd").description("Xaendar CLI").version(ae);y.addCommand(lt());y.addCommand(Ct());y.parse();
162
+ }`}function Zt(){try{let r=JSON.parse(Yt(zt(import.meta.filename,"..","../package.json"),"utf8"));if(!r.version)throw new Error("Unable to determine Xaendar CLI version.");return r.version}catch(r){console.error("Error reading Xaendar CLI version:",r),process.exit(1)}}function gt(r){let t=Zt(),e=r.name,i=`${e}-root`;return[{type:"file",name:"package.json",content:ct(e,t)},{type:"file",name:"xaendar.json",content:ft(e,r.style)},{type:"file",name:"vite.config.ts",content:dt()},{type:"file",name:"tsconfig.json",content:mt()},{type:"directory",name:"src",children:[{type:"file",name:"index.html",content:ut(i)},{type:"file",name:"signals.ts",content:pt()},{type:"file",name:"main.ts",content:ht(i)},{type:"generateComponent",name:i}]}]}import{execSync as ie}from"child_process";function Ct(){return new $("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((r,t)=>{let e=ne(t.style),i=t.path||process.cwd(),n=R(i,r);se(n),Ot(gt({name:r,style:e}),n,e),ie("npm i",{stdio:"inherit",cwd:n})})}function ne(r){let t=["css","scss","less","styl"];return r?(t.includes(r)||(console.error(`\u2716 Invalid style option: ${r}`),process.exit(1)),r):"css"}function se(r){let t=Qt(r);t&&te(r).length&&(console.error(`\u2716 Cannot create project: target directory is not empty: ${r}`),process.exit(1)),t||_t(r)}function Ot(r,t,e){r.forEach(i=>{switch(i.type){case"file":case void 0:let n=i.content;ee(R(t,i.name),n,"utf8");break;case"directory":let s=R(t,i.name);_t(s),i.children&&Ot(i.children,s,e);break;case"generateComponent":v(i.name,t,!1,e);break}})}var ae=JSON.parse(re(oe(import.meta.filename,"..","../package.json"),"utf-8")).version;y.name("xd").description("Xaendar CLI").version(ae);y.addCommand(lt());y.addCommand(Ct());y.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaendar/cli",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "description": "Cli tool for Xaendar framework",
5
5
  "author": "Kaitenjo",
6
6
  "license": "MIT",