@pixpilot/scaffoldfy 0.47.2 → 0.48.0

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.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const e=require(`./configurations-DJ1eNatp.cjs`);require(`./initial-config-CESipc-c.cjs`),require(`./tasks-BiruGt8T.cjs`);const t=require(`./validate-scaffoldfy-json-Bq2USY66.cjs`);require(`./scaffoldfy-config-validator-BvNnGMO1.cjs`);const n=require(`./src-BUTa4CXP.cjs`);let r=require(`node:fs`);r=e.I(r);let i=require(`node:path`);i=e.I(i);let a=require(`node:process`);a=e.I(a);let o=require(`commander`);o=e.I(o);const s=1;let c=0;const l={};function u(e=`Loading`){let t=[`|`,`/`,`-`,`\\`,`.`,`..`,`...`],n=0;c++;let r=c;return process.stdout.write(`${e} `),l[r]=setInterval(()=>{process.stdout.write(`\r${e} ${t[n%t.length]} `),n++},120),r}function d(e){l[e]&&(clearInterval(l[e]),delete l[e],process.stdout.write(`\r`),process.stdout.write(`${` `.repeat(30)}\r`))}const f=new o.Command,p=i.default.join(__dirname,`..`,`package.json`);let m=`0.0.0`;try{m=JSON.parse(r.default.readFileSync(p,`utf-8`)).version??`0.0.0`}catch{}f.name(`scaffoldfy`).description(`Automate project setup and configuration with customizable tasks`).version(m),f.option(`--dry-run`,`Run in dry mode without making any changes`).option(`--force`,`Force execution even if checks fail`).option(`--config <path>`,`Path to task configuration file (JSON or TypeScript)`,`./scaffoldfy.json`).option(`--no-validate`,`Skip schema validation of task configuration (validation is enabled by default)`).option(`--debug`,`Enable debug logging for verbose output`).action(async o=>{o.debug===!0&&e.O(!0);try{let s=[],c,l,f,p,m;if(o.config!=null&&o.config!==``){let n=i.default.resolve(a.default.cwd(),o.config);if(r.default.existsSync(n))if(m=n,n.endsWith(`.ts`)||n.endsWith(`.mts`)){e.D(`Loading tasks from TypeScript file: ${o.config}`,`info`);try{let t=await import(n);s=t.default??t.tasks??[],(!Array.isArray(s)||s.length===0)&&(e.D(`⚠️ No tasks found in TypeScript file or invalid format`,`warn`),e.D(`Expected default export or named export "tasks" with TaskDefinition[]`,`info`))}catch(t){e.D(`Failed to load TypeScript config file: ${o.config}`,`error`),t instanceof Error&&e.D(` Error: ${t.message}`,`error`),a.default.exit(1)}}else try{if(o.validate!==!1){e.w(`Validating task configuration against schema...`);let i=r.default.readFileSync(n,`utf-8`);t.r(JSON.parse(i),{silent:!1}).valid||(e.D(``,`error`),e.D(`💡 You can skip validation with --no-validate flag, but this is not recommended.`,`info`),a.default.exit(1)),e.D(`Configuration validated`,`success`)}let i=u(`Loading config`),m;try{m=await e.n(n,{sequential:!0})}finally{d(i)}if(m.configs!=null&&m.configs.length>0){let{runConfigurationSequentially:e}=await Promise.resolve().then(()=>require(`./run-configuration-sequentially-DxP6skRR.cjs`)),{createInitialConfig:t}=await Promise.resolve().then(()=>require(`./initial-config-CbzFPdT_.cjs`));await e(m.configs,{dryRun:o.dryRun??!1,force:o.force??!1,configFilePath:n},t()),a.default.exit(0)}s=m.tasks,c=m.variables,l=m.prompts,f=m.enabled,p=m.transformers,Array.isArray(s)||(e.D(`❌ Invalid config file format`,`error`),e.D(`Expected JSON with { "tasks": [...] } structure`,`info`),a.default.exit(1))}catch(t){e.D(`Failed to load JSON config file: ${o.config}`,`error`),t instanceof Error&&e.D(` Error: ${t.message}`,`error`),a.default.exit(1)}else e.D(`Config file not found: ${o.config}`,`warn`)}let h=l!=null&&l.length>0||c!=null&&c.length>0;s.length===0&&!h&&(e.D(`❌ No tasks defined`,`error`),e.D(`Please provide tasks using one of these methods:`,`info`),e.D(` 1. Create a template-tasks.json file in the current directory`,`info`),e.D(` 2. Create a template-tasks.ts file in the current directory`,`info`),e.D(` 3. Use --config option to specify a different config file`,`info`),e.D(`Example JSON structure:`,`info`),console.log(JSON.stringify({tasks:[{id:`update-package`,name:`Update package.json`,description:`Update package.json with repository information`,required:!0,enabled:!0,type:`update-json`,prompts:[{id:`projectName`,type:`input`,message:`What is your project name?`,default:`my-project`,required:!0},{id:`includeTests`,type:`confirm`,message:`Include test files?`,default:!0}],config:{file:`package.json`,updates:{name:`{{projectName}}`,author:`{{author}}`}}}]},null,2)),a.default.exit(1)),s.length===0?e.D(`Loaded template with 0 tasks (template may only provide prompts/variables for extending)`,`info`):e.D(`Loaded ${s.length} task(s)`,`success`),await n.t(s,{dryRun:o.dryRun,force:o.force,configFilePath:m,variables:c,prompts:l,configEnabled:f,transformers:p})}catch(t){if(e.D(`❌ CLI execution failed`,`error`),t instanceof Error){e.D(`Error: ${t.message}`,`error`);let n=a.default.env.DEBUG;n!=null&&n!==``&&console.error(t.stack)}else console.error(t);a.default.exit(1)}}),f.parse(a.default.argv);
2
+ const e=require(`./configurations-DJ1eNatp.cjs`);require(`./initial-config-CESipc-c.cjs`),require(`./tasks-BiruGt8T.cjs`);const t=require(`./validate-scaffoldfy-json-Bq2USY66.cjs`);require(`./scaffoldfy-config-validator-BvNnGMO1.cjs`);const n=require(`./src-BUTa4CXP.cjs`);let r=require(`node:fs`);r=e.I(r);let i=require(`node:path`);i=e.I(i);let a=require(`node:process`);a=e.I(a);let o=require(`commander`);o=e.I(o);const s=1;let c=0;const l={};function u(e=`Loading`){let t=[`|`,`/`,`-`,`\\`,`.`,`..`,`...`],n=0;c++;let r=c;return process.stdout.write(`${e} `),l[r]=setInterval(()=>{process.stdout.write(`\r${e} ${t[n%t.length]} `),n++},120),r}function d(e){l[e]&&(clearInterval(l[e]),delete l[e],process.stdout.write(`\r`),process.stdout.write(`${` `.repeat(30)}\r`))}const f=new o.Command,p=i.default.join(__dirname,`..`,`package.json`);let m=`0.0.0`;try{m=JSON.parse(r.default.readFileSync(p,`utf-8`)).version??`0.0.0`}catch{}f.name(`scaffoldfy`).description(`Automate project setup and configuration with customizable tasks`).version(m),f.option(`--dry-run`,`Run in dry mode without making any changes`).option(`--force`,`Force execution even if checks fail`).option(`--config <path>`,`Path to task configuration file (JSON or TypeScript)`,`./scaffoldfy.json`).option(`--no-validate`,`Skip schema validation of task configuration (validation is enabled by default)`).option(`--debug`,`Enable debug logging for verbose output`).action(async o=>{o.debug===!0&&e.O(!0);try{let s=[],c,l,f,p,m;if(o.config!=null&&o.config!==``){let n=i.default.resolve(a.default.cwd(),o.config);if(r.default.existsSync(n))if(m=n,n.endsWith(`.ts`)||n.endsWith(`.mts`)){e.D(`Loading tasks from TypeScript file: ${o.config}`,`info`);try{let t=await import(n);s=t.default??t.tasks??[],(!Array.isArray(s)||s.length===0)&&(e.D(`⚠️ No tasks found in TypeScript file or invalid format`,`warn`),e.D(`Expected default export or named export "tasks" with TaskDefinition[]`,`info`))}catch(t){e.D(`Failed to load TypeScript config file: ${o.config}`,`error`),t instanceof Error&&e.D(` Error: ${t.message}`,`error`),a.default.exit(1)}}else try{if(o.validate!==!1){e.w(`Validating task configuration against schema...`);let i=r.default.readFileSync(n,`utf-8`);t.r(JSON.parse(i),{silent:!1}).valid||(e.D(``,`error`),e.D(`💡 You can skip validation with --no-validate flag, but this is not recommended.`,`info`),a.default.exit(1)),e.D(`Configuration validated`,`success`)}let i=u(`Loading config`),m;try{m=await e.n(n,{sequential:!0})}finally{d(i)}if(m.configs!=null&&m.configs.length>0){let{runConfigurationSequentially:e}=await Promise.resolve().then(()=>require(`./run-configuration-sequentially-DKTi19-X.cjs`)),{createInitialConfig:t}=await Promise.resolve().then(()=>require(`./initial-config-CbzFPdT_.cjs`));await e(m.configs,{dryRun:o.dryRun??!1,force:o.force??!1,configFilePath:n},t()),a.default.exit(0)}s=m.tasks,c=m.variables,l=m.prompts,f=m.enabled,p=m.transformers,Array.isArray(s)||(e.D(`❌ Invalid config file format`,`error`),e.D(`Expected JSON with { "tasks": [...] } structure`,`info`),a.default.exit(1))}catch(t){e.D(`Failed to load JSON config file: ${o.config}`,`error`),t instanceof Error&&e.D(` Error: ${t.message}`,`error`),a.default.exit(1)}else e.D(`Config file not found: ${o.config}`,`warn`)}let h=l!=null&&l.length>0||c!=null&&c.length>0;s.length===0&&!h&&(e.D(`❌ No tasks defined`,`error`),e.D(`Please provide tasks using one of these methods:`,`info`),e.D(` 1. Create a template-tasks.json file in the current directory`,`info`),e.D(` 2. Create a template-tasks.ts file in the current directory`,`info`),e.D(` 3. Use --config option to specify a different config file`,`info`),e.D(`Example JSON structure:`,`info`),console.log(JSON.stringify({tasks:[{id:`update-package`,name:`Update package.json`,description:`Update package.json with repository information`,required:!0,enabled:!0,type:`update-json`,prompts:[{id:`projectName`,type:`input`,message:`What is your project name?`,default:`my-project`,required:!0},{id:`includeTests`,type:`confirm`,message:`Include test files?`,default:!0}],config:{file:`package.json`,updates:{name:`{{projectName}}`,author:`{{author}}`}}}]},null,2)),a.default.exit(1)),s.length===0?e.D(`Loaded template with 0 tasks (template may only provide prompts/variables for extending)`,`info`):e.D(`Loaded ${s.length} task(s)`,`success`),await n.t(s,{dryRun:o.dryRun,force:o.force,configFilePath:m,variables:c,prompts:l,configEnabled:f,transformers:p})}catch(t){if(e.D(`❌ CLI execution failed`,`error`),t instanceof Error){e.D(`Error: ${t.message}`,`error`);let n=a.default.env.DEBUG;n!=null&&n!==``&&console.error(t.stack)}else console.error(t);a.default.exit(1)}}),f.parse(a.default.argv);
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{D as e,O as t,n,w as r}from"./configurations-BFx3CItg.js";import"./initial-config-Dt0jw4Vs.js";import"./tasks-CMhsXaOx.js";import{r as i}from"./validate-scaffoldfy-json-gnb3COkM.js";import"./scaffoldfy-config-validator-D1iJBnRE.js";import{t as a}from"./src-uWkAarfL.js";import o from"node:path";import{fileURLToPath as s}from"node:url";import c from"node:fs";import l from"node:process";import{Command as u}from"commander";const d=()=>s(import.meta.url),f=(()=>o.dirname(d()))();let p=0;const m={};function h(e=`Loading`){let t=[`|`,`/`,`-`,`\\`,`.`,`..`,`...`],n=0;p++;let r=p;return process.stdout.write(`${e} `),m[r]=setInterval(()=>{process.stdout.write(`\r${e} ${t[n%t.length]} `),n++},120),r}function g(e){m[e]&&(clearInterval(m[e]),delete m[e],process.stdout.write(`\r`),process.stdout.write(`${` `.repeat(30)}\r`))}const _=new u,v=o.join(f,`..`,`package.json`);let y=`0.0.0`;try{y=JSON.parse(c.readFileSync(v,`utf-8`)).version??`0.0.0`}catch{}_.name(`scaffoldfy`).description(`Automate project setup and configuration with customizable tasks`).version(y),_.option(`--dry-run`,`Run in dry mode without making any changes`).option(`--force`,`Force execution even if checks fail`).option(`--config <path>`,`Path to task configuration file (JSON or TypeScript)`,`./scaffoldfy.json`).option(`--no-validate`,`Skip schema validation of task configuration (validation is enabled by default)`).option(`--debug`,`Enable debug logging for verbose output`).action(async s=>{s.debug===!0&&t(!0);try{let t=[],u,d,f,p,m;if(s.config!=null&&s.config!==``){let a=o.resolve(l.cwd(),s.config);if(c.existsSync(a))if(m=a,a.endsWith(`.ts`)||a.endsWith(`.mts`)){e(`Loading tasks from TypeScript file: ${s.config}`,`info`);try{let n=await import(a);t=n.default??n.tasks??[],(!Array.isArray(t)||t.length===0)&&(e(`⚠️ No tasks found in TypeScript file or invalid format`,`warn`),e(`Expected default export or named export "tasks" with TaskDefinition[]`,`info`))}catch(t){e(`Failed to load TypeScript config file: ${s.config}`,`error`),t instanceof Error&&e(` Error: ${t.message}`,`error`),l.exit(1)}}else try{if(s.validate!==!1){r(`Validating task configuration against schema...`);let t=c.readFileSync(a,`utf-8`);i(JSON.parse(t),{silent:!1}).valid||(e(``,`error`),e(`💡 You can skip validation with --no-validate flag, but this is not recommended.`,`info`),l.exit(1)),e(`Configuration validated`,`success`)}let o=h(`Loading config`),m;try{m=await n(a,{sequential:!0})}finally{g(o)}if(m.configs!=null&&m.configs.length>0){let{runConfigurationSequentially:e}=await import(`./run-configuration-sequentially-CEj-RPzZ.js`),{createInitialConfig:t}=await import(`./initial-config-V9mm6hls.js`);await e(m.configs,{dryRun:s.dryRun??!1,force:s.force??!1,configFilePath:a},t()),l.exit(0)}t=m.tasks,u=m.variables,d=m.prompts,f=m.enabled,p=m.transformers,Array.isArray(t)||(e(`❌ Invalid config file format`,`error`),e(`Expected JSON with { "tasks": [...] } structure`,`info`),l.exit(1))}catch(t){e(`Failed to load JSON config file: ${s.config}`,`error`),t instanceof Error&&e(` Error: ${t.message}`,`error`),l.exit(1)}else e(`Config file not found: ${s.config}`,`warn`)}let _=d!=null&&d.length>0||u!=null&&u.length>0;t.length===0&&!_&&(e(`❌ No tasks defined`,`error`),e(`Please provide tasks using one of these methods:`,`info`),e(` 1. Create a template-tasks.json file in the current directory`,`info`),e(` 2. Create a template-tasks.ts file in the current directory`,`info`),e(` 3. Use --config option to specify a different config file`,`info`),e(`Example JSON structure:`,`info`),console.log(JSON.stringify({tasks:[{id:`update-package`,name:`Update package.json`,description:`Update package.json with repository information`,required:!0,enabled:!0,type:`update-json`,prompts:[{id:`projectName`,type:`input`,message:`What is your project name?`,default:`my-project`,required:!0},{id:`includeTests`,type:`confirm`,message:`Include test files?`,default:!0}],config:{file:`package.json`,updates:{name:`{{projectName}}`,author:`{{author}}`}}}]},null,2)),l.exit(1)),t.length===0?e(`Loaded template with 0 tasks (template may only provide prompts/variables for extending)`,`info`):e(`Loaded ${t.length} task(s)`,`success`),await a(t,{dryRun:s.dryRun,force:s.force,configFilePath:m,variables:u,prompts:d,configEnabled:f,transformers:p})}catch(t){if(e(`❌ CLI execution failed`,`error`),t instanceof Error){e(`Error: ${t.message}`,`error`);let n=l.env.DEBUG;n!=null&&n!==``&&console.error(t.stack)}else console.error(t);l.exit(1)}}),_.parse(l.argv);export{};
2
+ import{D as e,O as t,n,w as r}from"./configurations-BFx3CItg.js";import"./initial-config-Dt0jw4Vs.js";import"./tasks-CMhsXaOx.js";import{r as i}from"./validate-scaffoldfy-json-gnb3COkM.js";import"./scaffoldfy-config-validator-D1iJBnRE.js";import{t as a}from"./src-uWkAarfL.js";import o from"node:path";import{fileURLToPath as s}from"node:url";import c from"node:fs";import l from"node:process";import{Command as u}from"commander";const d=()=>s(import.meta.url),f=(()=>o.dirname(d()))();let p=0;const m={};function h(e=`Loading`){let t=[`|`,`/`,`-`,`\\`,`.`,`..`,`...`],n=0;p++;let r=p;return process.stdout.write(`${e} `),m[r]=setInterval(()=>{process.stdout.write(`\r${e} ${t[n%t.length]} `),n++},120),r}function g(e){m[e]&&(clearInterval(m[e]),delete m[e],process.stdout.write(`\r`),process.stdout.write(`${` `.repeat(30)}\r`))}const _=new u,v=o.join(f,`..`,`package.json`);let y=`0.0.0`;try{y=JSON.parse(c.readFileSync(v,`utf-8`)).version??`0.0.0`}catch{}_.name(`scaffoldfy`).description(`Automate project setup and configuration with customizable tasks`).version(y),_.option(`--dry-run`,`Run in dry mode without making any changes`).option(`--force`,`Force execution even if checks fail`).option(`--config <path>`,`Path to task configuration file (JSON or TypeScript)`,`./scaffoldfy.json`).option(`--no-validate`,`Skip schema validation of task configuration (validation is enabled by default)`).option(`--debug`,`Enable debug logging for verbose output`).action(async s=>{s.debug===!0&&t(!0);try{let t=[],u,d,f,p,m;if(s.config!=null&&s.config!==``){let a=o.resolve(l.cwd(),s.config);if(c.existsSync(a))if(m=a,a.endsWith(`.ts`)||a.endsWith(`.mts`)){e(`Loading tasks from TypeScript file: ${s.config}`,`info`);try{let n=await import(a);t=n.default??n.tasks??[],(!Array.isArray(t)||t.length===0)&&(e(`⚠️ No tasks found in TypeScript file or invalid format`,`warn`),e(`Expected default export or named export "tasks" with TaskDefinition[]`,`info`))}catch(t){e(`Failed to load TypeScript config file: ${s.config}`,`error`),t instanceof Error&&e(` Error: ${t.message}`,`error`),l.exit(1)}}else try{if(s.validate!==!1){r(`Validating task configuration against schema...`);let t=c.readFileSync(a,`utf-8`);i(JSON.parse(t),{silent:!1}).valid||(e(``,`error`),e(`💡 You can skip validation with --no-validate flag, but this is not recommended.`,`info`),l.exit(1)),e(`Configuration validated`,`success`)}let o=h(`Loading config`),m;try{m=await n(a,{sequential:!0})}finally{g(o)}if(m.configs!=null&&m.configs.length>0){let{runConfigurationSequentially:e}=await import(`./run-configuration-sequentially-76FNB81E.js`),{createInitialConfig:t}=await import(`./initial-config-V9mm6hls.js`);await e(m.configs,{dryRun:s.dryRun??!1,force:s.force??!1,configFilePath:a},t()),l.exit(0)}t=m.tasks,u=m.variables,d=m.prompts,f=m.enabled,p=m.transformers,Array.isArray(t)||(e(`❌ Invalid config file format`,`error`),e(`Expected JSON with { "tasks": [...] } structure`,`info`),l.exit(1))}catch(t){e(`Failed to load JSON config file: ${s.config}`,`error`),t instanceof Error&&e(` Error: ${t.message}`,`error`),l.exit(1)}else e(`Config file not found: ${s.config}`,`warn`)}let _=d!=null&&d.length>0||u!=null&&u.length>0;t.length===0&&!_&&(e(`❌ No tasks defined`,`error`),e(`Please provide tasks using one of these methods:`,`info`),e(` 1. Create a template-tasks.json file in the current directory`,`info`),e(` 2. Create a template-tasks.ts file in the current directory`,`info`),e(` 3. Use --config option to specify a different config file`,`info`),e(`Example JSON structure:`,`info`),console.log(JSON.stringify({tasks:[{id:`update-package`,name:`Update package.json`,description:`Update package.json with repository information`,required:!0,enabled:!0,type:`update-json`,prompts:[{id:`projectName`,type:`input`,message:`What is your project name?`,default:`my-project`,required:!0},{id:`includeTests`,type:`confirm`,message:`Include test files?`,default:!0}],config:{file:`package.json`,updates:{name:`{{projectName}}`,author:`{{author}}`}}}]},null,2)),l.exit(1)),t.length===0?e(`Loaded template with 0 tasks (template may only provide prompts/variables for extending)`,`info`):e(`Loaded ${t.length} task(s)`,`success`),await a(t,{dryRun:s.dryRun,force:s.force,configFilePath:m,variables:u,prompts:d,configEnabled:f,transformers:p})}catch(t){if(e(`❌ CLI execution failed`,`error`),t instanceof Error){e(`Error: ${t.message}`,`error`);let n=l.env.DEBUG;n!=null&&n!==``&&console.error(t.stack)}else console.error(t);l.exit(1)}}),_.parse(l.argv);export{};
@@ -0,0 +1,4 @@
1
+ import{D as e,E as t,S as n,a as r,i,o as a,w as o}from"./configurations-BFx3CItg.js";import{S as s,a as c,c as l,l as u,n as d,o as f,r as p,u as m}from"./tasks-CMhsXaOx.js";import h from"node:process";async function g(e,t){let n=e.prompts??[];if(n.length>0){let e=l(n);e.length>0&&(console.error(`❌ Prompt validation errors:`),e.forEach(e=>console.error(` - ${e}`)),h.exit(1));let r=await m(n,await u(n,t),t);Object.assign(t,r)}}async function _(e,t){let n=e.variables??[];if(n.length>0){let o=i(n);o.length>0&&(console.error(`❌ Variable validation errors:`),o.forEach(e=>console.error(` - ${e}`)),h.exit(1));let s=await a(n,await r(n,t,{skipConditional:!0}),t);Object.assign(t,s),await v(e,t)}}async function v(e,t){let n=e.variables??[];if(n.length===0)return;let i=n.filter(e=>typeof e.value==`object`&&e.value!==null&&!Array.isArray(e.value)?e.value.type===`conditional`:!1);if(i.length>0){let e=await a(i,await r(i,t),t);Object.assign(t,e)}}async function y(e,r){return await n(e.enabled,r)?(await _(e,r),await g(e,r),await v(e,r),await n(e.enabled,r)?!0:(t(`⊘ Config "${e.name}" became disabled after variable/prompt resolution - skipping tasks`),!1)):(t(`⊘ Config "${e.name}" is disabled - skipping`),!1)}async function b(n,r,i={}){o(`Running configs with sequential variable/prompt resolution...`),o(`Total configs to process: ${n.length}`),o(`Registering built-in plugins...`),f();let a=[];console.log(``),t(`📋 Collecting input...`),console.log(``);for(let e=0;e<n.length;e++){let t=n[e];if(t==null)continue;let r=`=`.repeat(60);if(o(`\n${r}`),o(`Processing config ${e+1}/${n.length}: "${t.name}"`),o(r),o(`Current config keys: ${Object.keys(i).join(`, `)}`),await y(t,i)){let e=t.tasks??[];e.length>0&&(o(`Found ${e.length} task(s) in config "${t.name}" (will execute later)`),a.push(...e))}}if(o(`
2
+ 🔧 Validating and filtering all collected tasks...`),a.length===0){e(`No tasks found in any config`,`info`);return}console.log(``),e(`🛠️ Preparing tasks...`,`info`);let l=await p(a,i);if(console.log(``),e(`Found ${a.length} tasks (${l.length} enabled)`,`info`),e(`All tasks validated successfully`,`success`),l.length===0){e(`No enabled tasks to execute`,`info`);return}let u=d(l);if(r.dryRun){e(`
3
+ 🔍 Dry run - showing task changes...`,`info`),await s(u,i),e(`
4
+ 🔍 Dry run completed - no changes were made`,`info`),e(`Run without --dry-run to apply changes`,`info`);return}console.log(``),t(`⚙️ Executing tasks...`),console.log(``),await c(u,i,r)}export{b as runConfigurationSequentially};
@@ -0,0 +1,4 @@
1
+ const e=require(`./configurations-DJ1eNatp.cjs`),t=require(`./tasks-BiruGt8T.cjs`);let n=require(`node:process`);n=e.I(n);async function r(e,r){let i=e.prompts??[];if(i.length>0){let e=t.c(i);e.length>0&&(console.error(`❌ Prompt validation errors:`),e.forEach(e=>console.error(` - ${e}`)),n.default.exit(1));let a=await t.u(i,await t.l(i,r),r);Object.assign(r,a)}}async function i(t,r){let i=t.variables??[];if(i.length>0){let o=e.i(i);o.length>0&&(console.error(`❌ Variable validation errors:`),o.forEach(e=>console.error(` - ${e}`)),n.default.exit(1));let s=await e.o(i,await e.a(i,r,{skipConditional:!0}),r);Object.assign(r,s),await a(t,r)}}async function a(t,n){let r=t.variables??[];if(r.length===0)return;let i=r.filter(e=>typeof e.value==`object`&&e.value!==null&&!Array.isArray(e.value)?e.value.type===`conditional`:!1);if(i.length>0){let t=await e.o(i,await e.a(i,n),n);Object.assign(n,t)}}async function o(t,n){return await e.S(t.enabled,n)?(await i(t,n),await r(t,n),await a(t,n),await e.S(t.enabled,n)?!0:(e.E(`⊘ Config "${t.name}" became disabled after variable/prompt resolution - skipping tasks`),!1)):(e.E(`⊘ Config "${t.name}" is disabled - skipping`),!1)}async function s(n,r,i={}){e.w(`Running configs with sequential variable/prompt resolution...`),e.w(`Total configs to process: ${n.length}`),e.w(`Registering built-in plugins...`),t.o();let a=[];console.log(``),e.E(`📋 Collecting input...`),console.log(``);for(let t=0;t<n.length;t++){let r=n[t];if(r==null)continue;let s=`=`.repeat(60);if(e.w(`\n${s}`),e.w(`Processing config ${t+1}/${n.length}: "${r.name}"`),e.w(s),e.w(`Current config keys: ${Object.keys(i).join(`, `)}`),await o(r,i)){let t=r.tasks??[];t.length>0&&(e.w(`Found ${t.length} task(s) in config "${r.name}" (will execute later)`),a.push(...t))}}if(e.w(`
2
+ 🔧 Validating and filtering all collected tasks...`),a.length===0){e.D(`No tasks found in any config`,`info`);return}console.log(``),e.D(`🛠️ Preparing tasks...`,`info`);let s=await t.r(a,i);if(console.log(``),e.D(`Found ${a.length} tasks (${s.length} enabled)`,`info`),e.D(`All tasks validated successfully`,`success`),s.length===0){e.D(`No enabled tasks to execute`,`info`);return}let c=t.n(s);if(r.dryRun){e.D(`
3
+ 🔍 Dry run - showing task changes...`,`info`),await t.S(c,i),e.D(`
4
+ 🔍 Dry run completed - no changes were made`,`info`),e.D(`Run without --dry-run to apply changes`,`info`);return}console.log(``),e.E(`⚙️ Executing tasks...`),console.log(``),await t.a(c,i,r)}exports.runConfigurationSequentially=s;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/scaffoldfy",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.0",
5
5
  "author": "PixPilot <m.doaie@hotmail.com>",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -1,4 +0,0 @@
1
- import{D as e,E as t,S as n,a as r,i,o as a,w as o}from"./configurations-BFx3CItg.js";import{S as s,a as c,c as l,l as u,n as d,o as f,r as p,u as m}from"./tasks-CMhsXaOx.js";import h from"node:process";async function g(e,t){let n=e.prompts??[];if(n.length>0){let e=l(n);e.length>0&&(console.error(`❌ Prompt validation errors:`),e.forEach(e=>console.error(` - ${e}`)),h.exit(1));let r=await m(n,await u(n,t),t);Object.assign(t,r)}}async function _(e,t){let n=e.variables??[];if(n.length>0){let e=i(n);e.length>0&&(console.error(`❌ Variable validation errors:`),e.forEach(e=>console.error(` - ${e}`)),h.exit(1));let o=await a(n,await r(n,t,{skipConditional:!0}),t);Object.assign(t,o);let s=n.filter(e=>typeof e.value==`object`&&e.value!==null&&!Array.isArray(e.value)?e.value.type===`conditional`:!1);if(s.length>0){let e=await a(s,await r(s,t),t);Object.assign(t,e)}}}async function v(e,r){return await n(e.enabled,r)?(await _(e,r),await g(e,r),await n(e.enabled,r)?!0:(t(`⊘ Config "${e.name}" became disabled after variable/prompt resolution - skipping tasks`),!1)):(t(`⊘ Config "${e.name}" is disabled - skipping`),!1)}async function y(n,r,i={}){o(`Running configs with sequential variable/prompt resolution...`),o(`Total configs to process: ${n.length}`),o(`Registering built-in plugins...`),f();let a=[];console.log(``),t(`📋 Collecting input...`),console.log(``);for(let e=0;e<n.length;e++){let t=n[e];if(t==null)continue;let r=`=`.repeat(60);if(o(`\n${r}`),o(`Processing config ${e+1}/${n.length}: "${t.name}"`),o(r),o(`Current config keys: ${Object.keys(i).join(`, `)}`),await v(t,i)){let e=t.tasks??[];e.length>0&&(o(`Found ${e.length} task(s) in config "${t.name}" (will execute later)`),a.push(...e))}}if(o(`
2
- 🔧 Validating and filtering all collected tasks...`),a.length===0){e(`No tasks found in any config`,`info`);return}console.log(``),e(`🛠️ Preparing tasks...`,`info`);let l=await p(a,i);if(console.log(``),e(`Found ${a.length} tasks (${l.length} enabled)`,`info`),e(`All tasks validated successfully`,`success`),l.length===0){e(`No enabled tasks to execute`,`info`);return}let u=d(l);if(r.dryRun){e(`
3
- 🔍 Dry run - showing task changes...`,`info`),await s(u,i),e(`
4
- 🔍 Dry run completed - no changes were made`,`info`),e(`Run without --dry-run to apply changes`,`info`);return}console.log(``),t(`⚙️ Executing tasks...`),console.log(``),await c(u,i,r)}export{y as runConfigurationSequentially};
@@ -1,4 +0,0 @@
1
- const e=require(`./configurations-DJ1eNatp.cjs`),t=require(`./tasks-BiruGt8T.cjs`);let n=require(`node:process`);n=e.I(n);async function r(e,r){let i=e.prompts??[];if(i.length>0){let e=t.c(i);e.length>0&&(console.error(`❌ Prompt validation errors:`),e.forEach(e=>console.error(` - ${e}`)),n.default.exit(1));let a=await t.u(i,await t.l(i,r),r);Object.assign(r,a)}}async function i(t,r){let i=t.variables??[];if(i.length>0){let t=e.i(i);t.length>0&&(console.error(`❌ Variable validation errors:`),t.forEach(e=>console.error(` - ${e}`)),n.default.exit(1));let a=await e.o(i,await e.a(i,r,{skipConditional:!0}),r);Object.assign(r,a);let o=i.filter(e=>typeof e.value==`object`&&e.value!==null&&!Array.isArray(e.value)?e.value.type===`conditional`:!1);if(o.length>0){let t=await e.o(o,await e.a(o,r),r);Object.assign(r,t)}}}async function a(t,n){return await e.S(t.enabled,n)?(await i(t,n),await r(t,n),await e.S(t.enabled,n)?!0:(e.E(`⊘ Config "${t.name}" became disabled after variable/prompt resolution - skipping tasks`),!1)):(e.E(`⊘ Config "${t.name}" is disabled - skipping`),!1)}async function o(n,r,i={}){e.w(`Running configs with sequential variable/prompt resolution...`),e.w(`Total configs to process: ${n.length}`),e.w(`Registering built-in plugins...`),t.o();let o=[];console.log(``),e.E(`📋 Collecting input...`),console.log(``);for(let t=0;t<n.length;t++){let r=n[t];if(r==null)continue;let s=`=`.repeat(60);if(e.w(`\n${s}`),e.w(`Processing config ${t+1}/${n.length}: "${r.name}"`),e.w(s),e.w(`Current config keys: ${Object.keys(i).join(`, `)}`),await a(r,i)){let t=r.tasks??[];t.length>0&&(e.w(`Found ${t.length} task(s) in config "${r.name}" (will execute later)`),o.push(...t))}}if(e.w(`
2
- 🔧 Validating and filtering all collected tasks...`),o.length===0){e.D(`No tasks found in any config`,`info`);return}console.log(``),e.D(`🛠️ Preparing tasks...`,`info`);let s=await t.r(o,i);if(console.log(``),e.D(`Found ${o.length} tasks (${s.length} enabled)`,`info`),e.D(`All tasks validated successfully`,`success`),s.length===0){e.D(`No enabled tasks to execute`,`info`);return}let c=t.n(s);if(r.dryRun){e.D(`
3
- 🔍 Dry run - showing task changes...`,`info`),await t.S(c,i),e.D(`
4
- 🔍 Dry run completed - no changes were made`,`info`),e.D(`Run without --dry-run to apply changes`,`info`);return}console.log(``),e.E(`⚙️ Executing tasks...`),console.log(``),await t.a(c,i,r)}exports.runConfigurationSequentially=o;