derived-cli 0.0.42 → 0.0.43
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/bundle.js +2 -2
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -95,7 +95,7 @@ To resolve this, please restart the command with one of these flags:
|
|
|
95
95
|
|
|
96
96
|
Example:
|
|
97
97
|
derived-cli add ${r} --overwrite
|
|
98
|
-
`;x(l),process.exit(1)}let a=await qe({message:"Some files already exist. How would you like to proceed?",options:[{value:"overwrite-all",label:"Overwrite all"},{value:"select",label:"Select files to overwrite"},{value:"skip-all",label:"Skip all"}]});if(N(a)&&(x("Operation cancelled."),process.exit(0)),a==="overwrite-all")D=!0;else if(a==="select"){let l=await Rt({message:"Select files to overwrite",options:u.map(p=>({value:p.resolvedPath,label:p.resolvedPath}))});N(l)&&(x("Operation cancelled."),process.exit(0)),o=l}s.start("Generating files...")}let h=Lt(n.result.files,o,D);if(h.errors?.length&&console.log(h.errors,"errors"),s.stop(`${h.addResults.length} files added, ${h.modifyResults.length} files modified, ${h.errors.length} errors`),h.addResults.length>0||h.modifyResults.length>0){if(Qt(r),i?.setupCommands&&i.setupCommands.trim()){let a=i.setupCommands.split(",").map(p=>p.trim()),l=I();for(let p of a)if(p){l.start(`Running setup command: ${p}`);try{(0,G.execSync)(p,{stdio:"inherit",cwd:process.cwd()}),l.stop(`Completed: ${p}`)}catch(F){l.stop(`Warning: Setup command failed: ${p}`),console.warn(` ${F.message}`)}}}i?.aiInstruction&&console.log("Instructions to be followed after file generation:",i.aiInstruction)}}async function au(r,e,t,i=!1){Le(`Add block: ${r}`);let s=!1,n=!1,u=I();u.start("Fetching block...");let o=await le.fetchBlock(r);if(o?.result?.id)u.stop(`Block Found '${o.result.name}' ${o.result.input?"with input":""}`);else{u.stop("Block Not Found");return}if(o.result.dependsOn?.length)for(let h of o.result.dependsOn)Ye(h.code)||(U(`Resolving dependency: ${h.code}`),await au(h.code,void 0,null,i));let D=t||o.result.input;for(t&&(Ze(r,t,i,o.result),s=!0)
|
|
98
|
+
`;x(l),process.exit(1)}let a=await qe({message:"Some files already exist. How would you like to proceed?",options:[{value:"overwrite-all",label:"Overwrite all"},{value:"select",label:"Select files to overwrite"},{value:"skip-all",label:"Skip all"}]});if(N(a)&&(x("Operation cancelled."),process.exit(0)),a==="overwrite-all")D=!0;else if(a==="select"){let l=await Rt({message:"Select files to overwrite",options:u.map(p=>({value:p.resolvedPath,label:p.resolvedPath}))});N(l)&&(x("Operation cancelled."),process.exit(0)),o=l}s.start("Generating files...")}let h=Lt(n.result.files,o,D);if(h.errors?.length&&console.log(h.errors,"errors"),s.stop(`${h.addResults.length} files added, ${h.modifyResults.length} files modified, ${h.errors.length} errors`),h.addResults.length>0||h.modifyResults.length>0){if(Qt(r),i?.setupCommands&&i.setupCommands.trim()){let a=i.setupCommands.split(",").map(p=>p.trim()),l=I();for(let p of a)if(p){l.start(`Running setup command: ${p}`);try{(0,G.execSync)(p,{stdio:"inherit",cwd:process.cwd()}),l.stop(`Completed: ${p}`)}catch(F){l.stop(`Warning: Setup command failed: ${p}`),console.warn(` ${F.message}`)}}}i?.aiInstruction&&console.log("Instructions to be followed after file generation:",i.aiInstruction)}}async function au(r,e,t,i=!1){Le(`Add block: ${r}`);let s=!1,n=!1,u=I();u.start("Fetching block...");let o=await le.fetchBlock(r);if(o?.result?.id)u.stop(`Block Found '${o.result.name}' ${o.result.input?"with input":""}`);else{u.stop("Block Not Found");return}if(o.result.dependsOn?.length)for(let h of o.result.dependsOn)Ye(h.code)||(U(`Resolving dependency: ${h.code}`),await au(h.code,void 0,null,i));let D=t||o.result.input;for(t&&(await Ze(r,t,i,o.result),s=!0),!D&&!s&&(await Ze(r,{},i,o.result),s=!0),D&&e&&!t&&(D=await uu(D,e),n=!0);!s&&D&&!e;){if(nu(D),ru()){let l=`This block requires input configuration, but user selection is not available.
|
|
99
99
|
|
|
100
100
|
To resolve this, please restart the command with below flag:
|
|
101
101
|
|
|
@@ -107,7 +107,7 @@ To resolve this, please restart the command with below flag:
|
|
|
107
107
|
Follow this JSON structure for block input:
|
|
108
108
|
|
|
109
109
|
${JSON.stringify(D,null,2)}
|
|
110
|
-
`;x(l),process.exit(1)}let a=await qe({message:"What would you like to do?",options:[{value:"refine",label:"Edit (AI)"},{value:"edit",label:"Edit (Editor)"},{value:"showFiles",label:"Show files to be created"},{value:"done",label:"Insert Files
|
|
110
|
+
`;x(l),process.exit(1)}let a=await qe({message:"What would you like to do?",options:[{value:"refine",label:"Edit (AI)"},{value:"edit",label:"Edit (Editor)"},{value:"showFiles",label:"Show files to be created"},{value:"done",label:"Insert Files"}]});if(N(a)&&(x("Operation cancelled."),process.exit(0)),a==="refine"){let l=await Gt({message:"Describe what to refine:"});D=await uu(D,l),n=!0}a==="edit"&&(D=await Vi(D)),a==="done"&&(await Ze(r,D,i,o.result),s=!0),a==="showFiles"&&Du(r,D)}}ae.command("help").description("List all commands and usage").action(()=>{console.log(`
|
|
111
111
|
Available commands:
|
|
112
112
|
|
|
113
113
|
add <block-id>
|