@40q/40q-cli 1.0.11 → 1.0.12

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.
@@ -0,0 +1 @@
1
+ "use strict";exports.id=165,exports.ids=[165],exports.modules={41165:(s,e,r)=>{r.r(e)}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=216,exports.ids=[216,522],exports.modules={32522:(e,t,s)=>{s.r(t),s.d(t,{BlockGenerator:()=>l});var r=s(57147),a=s(71017),i=s.n(a),c=s(32081);class l{constructor(e){this.template="",this.name="",this.title="",this.camelCaseName="",console.log(e),this.template=""===e.template?"default":e.template,this.name=e.name||"default",this.camelCaseName=this.toCamelCase(this.name),this.title=this.parseName(this.name)}run(){this.createBlockFolder(),this.createBlockFiles()}createBlockFolder(){(0,c.execSync)(`mkdir -p resources/scripts/editor/blocks/${this.name}`)}createBlockFiles(){r.writeFileSync(i().join(process.cwd(),`resources/scripts/editor/blocks/${this.name}/${this.name}.block.tsx`),this.getTemplate("tsx").replace(/{{name}}/g,this.name??"").replace(/{{title}}/g,this.title)),r.writeFileSync(i().join(process.cwd(),`resources/views/blocks/${this.name}.blade.php`),this.getTemplate("blade")),r.writeFileSync(i().join(process.cwd(),`app/Blocks/${this.camelCaseName}.php`),this.getTemplate("php").replace(/{{name}}/g,this.name??"").replace(/{{camelCaseName}}/g,this.camelCaseName))}parseName(e){return e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}toCamelCase(e){return e.split("-").reduce(((e,t)=>e+t.charAt(0).toUpperCase()+t.slice(1)),"")??""}getTemplate(e){try{const t=function(e){let t=__dirname;for(;t!==a.parse(t).root;){if(r.existsSync(a.join(t,".cliroot")))return t;t=a.dirname(t)}throw new Error("CLI root directory with .cliroot marker not found.")}(),s=`templates/blocks/${this.template}`;return r.readFileSync(i().join(t,`${s}/${e}.txt`),"utf8")}catch(e){return""}}}},34216:(e,t,s)=>{s.r(t),s.d(t,{BlockGenerator:()=>r.BlockGenerator});var r=s(32522)}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=284,exports.ids=[284,350],exports.modules={63350:(e,t,a)=>{a.r(t),a.d(t,{BlockPromptStrategy:()=>o});var m=a(96062),r=a.n(m),s=a(78913);class o{async prompt(){const e=await r().prompt([{type:"list",name:"template",message:"Please select a template:",choices:s.v.templateChoices.block,default:""}]),t=e?.template||"",a=await r().prompt([{type:"input",name:"name",message:"Please enter a name for the block:",default:t||"block-name"}]);return{name:a?.name||"",template:t}}}},79284:(e,t,a)=>{a.r(t),a.d(t,{BlockPromptStrategy:()=>m.BlockPromptStrategy});var m=a(63350)}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=350,exports.ids=[350],exports.modules={63350:(e,t,a)=>{a.r(t),a.d(t,{BlockPromptStrategy:()=>l});var s=a(96062),m=a.n(s),p=a(78913);class l{async prompt(){const e=await m().prompt([{type:"list",name:"template",message:"Please select a template:",choices:p.v.templateChoices.block,default:""}]),t=e?.template||"",a=await m().prompt([{type:"input",name:"name",message:"Please enter a name for the block:",default:t||"block-name"}]);return{name:a?.name||"",template:t}}}}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=522,exports.ids=[522],exports.modules={32522:(e,t,s)=>{s.r(t),s.d(t,{BlockGenerator:()=>l});var a=s(57147),r=s(71017),i=s.n(r),c=s(32081);class l{constructor(e){this.template="",this.name="",this.title="",this.camelCaseName="",console.log(e),this.template=""===e.template?"default":e.template,this.name=e.name||"default",this.camelCaseName=this.toCamelCase(this.name),this.title=this.parseName(this.name)}run(){this.createBlockFolder(),this.createBlockFiles()}createBlockFolder(){(0,c.execSync)(`mkdir -p resources/scripts/editor/blocks/${this.name}`)}createBlockFiles(){a.writeFileSync(i().join(process.cwd(),`resources/scripts/editor/blocks/${this.name}/${this.name}.block.tsx`),this.getTemplate("tsx").replace(/{{name}}/g,this.name??"").replace(/{{title}}/g,this.title)),a.writeFileSync(i().join(process.cwd(),`resources/views/blocks/${this.name}.blade.php`),this.getTemplate("blade")),a.writeFileSync(i().join(process.cwd(),`app/Blocks/${this.camelCaseName}.php`),this.getTemplate("php").replace(/{{name}}/g,this.name??"").replace(/{{camelCaseName}}/g,this.camelCaseName))}parseName(e){return e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}toCamelCase(e){return e.split("-").reduce(((e,t)=>e+t.charAt(0).toUpperCase()+t.slice(1)),"")??""}getTemplate(e){try{const t=function(e){let t=__dirname;for(;t!==r.parse(t).root;){if(a.existsSync(r.join(t,".cliroot")))return t;t=r.dirname(t)}throw new Error("CLI root directory with .cliroot marker not found.")}(),s=`templates/blocks/${this.template}`;return a.readFileSync(i().join(t,`${s}/${e}.txt`),"utf8")}catch(e){return""}}}}};