@40q/40q-cli 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/165.index.js +1 -0
- package/dist/216.index.js +1 -0
- package/dist/284.index.js +1 -0
- package/dist/350.index.js +1 -0
- package/dist/522.index.js +1 -0
- package/dist/62.index.js +2 -0
- package/dist/62.index.js.LICENSE.txt +9 -0
- package/dist/758.index.js +1 -0
- package/dist/index.js.LICENSE.txt +14 -0
- package/dist/resources/scripts/editor/blocks/default/default.block.js +39 -0
- package/dist/resources/scripts/editor/blocks/hello-today/hello-today.block.js +39 -0
- package/dist/resources/scripts/editor/blocks/here-we-go-again/here-we-go-again.block.js +39 -0
- package/dist/resources/scripts/editor/blocks/section-header/section-header.block.js +39 -0
- package/dist/src/commands/Codegen/Generators/GeneratorStrategy.factory.js +11 -0
- package/dist/src/commands/Codegen/Generators/GeneratorStrategy.js +2 -0
- package/dist/src/commands/Codegen/Generators/strategies/BlockGenerator.strategy.js +88 -0
- package/dist/src/commands/Codegen/Prompts/PromptStrategy.factory.js +10 -12
- package/dist/src/commands/Codegen/Prompts/PromptStrategy.js +2 -0
- package/dist/src/commands/Codegen/Prompts/strategies/BlockPrompt.strategy.js +43 -0
- package/dist/src/commands/Codegen/StrategyFactory.js +63 -0
- package/package.json +7 -1
- package/templates/blocks/default/tsx.txt +16 -2
@@ -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""}}}}};
|