@crossdelta/platform-sdk 0.3.8 → 0.3.10

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 (3) hide show
  1. package/README.md +2 -1
  2. package/bin/cli.js +3 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -166,10 +166,11 @@ my-platform/
166
166
 
167
167
  | Command | Description |
168
168
  |---------|-------------|
169
+ | `pf new` | Interactive mode - choose project type and options |
169
170
  | `pf new workspace <name>` | Scaffold a complete platform workspace |
170
171
  | `pf new hono-micro <path>` | Generate a lightweight Hono microservice |
171
172
  | `pf new nest-micro <path>` | Generate a NestJS microservice |
172
- | `pf new hono-micro <path> --ai` | Generate with AI assistance |
173
+ | `pf new hono-micro <path> --ai -d "..."` | Generate with AI assistance |
173
174
  | `pf setup --ai` | Configure AI provider (OpenAI/Anthropic) |
174
175
  | `pf dev` | Start dev environment with watch mode |
175
176
  | `pf dev --no-watch` | Start without file watching |
package/bin/cli.js CHANGED
@@ -292,17 +292,17 @@ export default config
292
292
  `}var Eie=4001,Cie=4e3;function wie(t){let e=[],r=t.match(/containerPort\s*:\s*(\d+)/);r&&e.push(Number(r[1]));let n=t.match(/internalPorts\s*:\s*\[([^\]]+)\]/);if(n){let o=n[1].match(/\d+/g);o&&e.push(...o.map(Number))}let i=t.match(/httpPort\s*:\s*(\d+)/);i&&e.push(Number(i[1]));let s=t.matchAll(/const\s+\w*[pP]ort\w*\s*=\s*(\d+)/g);for(let o of s)e.push(Number(o[1]));return e}function Sie(t,e){let r=e?Eie:Cie,n=new Set;if(!(0,gn.existsSync)(t))return r;let i=(0,gn.readdirSync)(t).filter(o=>o.endsWith(".ts"));for(let o of i){let a=(0,Ra.join)(t,o);try{let u=(0,gn.readFileSync)(a,"utf-8"),c=wie(u);for(let l of c)n.add(l)}catch{}}let s=r;for(;n.has(s);)s++;return s}function vie(t){return(0,Ra.basename)(t)}var hd={title:"Creating infrastructure service config",task:async(t,e)=>{let r=vie(t.projectName),n=Kc(),i=(0,Ra.join)(n,"infra","services");if(!(0,gn.existsSync)(i)){e.title="Skipping infra config (no infra/services directory found)";return}let s=(0,Ra.join)(i,`${r}.ts`);if((0,gn.existsSync)(s)){e.title=`Service config already exists: infra/services/${r}.ts`;return}let o=Sie(i,!0);t.assignedPort=o;let a=t.serviceType==="hono"?eP(r,o):tP(r,o);(0,gn.writeFileSync)(s,a),e.title=`Created infra/services/${r}.ts (port: ${o})`}};var rl=require("node:child_process"),rP=require("node:fs"),nP=require("node:path"),_ie=()=>{try{return(0,rl.execSync)("git --version",{stdio:"ignore"}),!0}catch{return!1}},Aie=t=>(0,rP.existsSync)((0,nP.join)(t,".git")),iP={title:"Initializing git repository",enabled:()=>_ie(),skip:t=>Aie(t.cwd)?"Already a git repository":!1,task:async(t,e)=>{try{(0,rl.execSync)("git init",{cwd:t.cwd,stdio:"ignore"}),(0,rl.execSync)("git add -A",{cwd:t.cwd,stdio:"ignore"}),(0,rl.execSync)('git commit -m "chore: initial commit"',{cwd:t.cwd,stdio:"ignore",env:{...process.env,GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"Platform SDK",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"platform-sdk@localhost",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"Platform SDK",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"platform-sdk@localhost"}}),e.title="Git repository initialized with initial commit"}catch{e.title="Git initialization skipped (git error)"}}};var Ia={title:"Installing Bun",enabled:t=>!!t.shouldInstallBun&&!gy(),task:async(t,e)=>mt(e,async r=>{await Bk(e),t.elapsedTime+=r(),e.title=`Bun installed successfully. (${t.elapsedTime}s)`})},Ma={enabled:t=>!gy()&&!t.shouldInstallBun&&!t.packageManager,task:async(t,e)=>{t.shouldInstallBun=await e.prompt(Ie).run({type:"Toggle",message:"Would you like to use Bun? (recommended)",initial:!0,footer:["",`${E.magenta.bold("Bun")} is a fast JavaScript runtime, package manager, bundler, and test runner: ${E.underline("https://bun.sh")}`,Tk(),kk()].join(`
293
293
  `)}),t.shouldInstallBun&&(t.packageManager="bun")}};var dd={title:"Install integrations",enabled:t=>t.selectedIntegrations.length>0,task:async(t,e)=>mt(e,async r=>{let{selectedIntegrations:n,cwd:i,packageManager:s}=t;await rO({selectedIntegrations:n,packageManager:s,cwd:i,task:e}),t.elapsedTime+=r()}),rendererOptions:{outputBar:1e3}},pd={title:"Select integrations",enabled:t=>t.selectedIntegrations.length===0,task:async(t,e)=>{t.selectedIntegrations=await e.prompt(Ie).run({type:"MultiSelect",hint:`
294
294
  Press <space> to select/deselect, <enter> to confirm, <i> to invert selection`,message:"Which integrations would you like to include?",initial:Ta().map((r,n)=>n),choices:t.availableIntegrations.map(({name:r,description:n})=>({name:r,message:[E.bold(r),n].join(" - "),value:r}))}),!t.selectedIntegrations||t.selectedIntegrations.length===0?e.title="No integrations selected.":e.title=["Selected integrations:",...t.selectedIntegrations.map(r=>E.bold(`\u2022 ${r}`))].join(`
295
- `)}};var sP={title:"Install Nest CLI",task:async(t,e)=>mt(e,async r=>{await Nk({packages:["@nestjs/cli"],task:e,cwd:t.cwd}),t.elapsedTime+=r()}),rendererOptions:{outputBar:1e3}};var md={title:"Install dependencies",task:async(t,e)=>mt(e,async r=>{await Fa({cwd:t.cwd,task:e,packageManager:t.packageManager}),t.elapsedTime+=r()})};var La={enabled:t=>!t.removeDir&&!dk(t.cwd),task:async(t,e)=>{if(t.removeDir=await e.prompt(Ie).run({type:"Toggle",message:E.bold("\u26A0\uFE0F Overwrite existing directory?"),initial:!1}),!t.removeDir)throw new Error("Project creation was canceled by the user.")}},Na={enabled:t=>!!t.removeDir,task:async t=>Dk(t.cwd)};var Dd={title:"Run integration commands",enabled:t=>t.selectedIntegrations.length>0,task:async(t,e)=>mt(e,async r=>{let{selectedIntegrations:n,cwd:i}=t;await nO({selectedIntegrations:n,cwd:i,task:e,packageManager:t.packageManager}),t.elapsedTime+=r()}),rendererOptions:{outputBar:1}};var $a={task:async(t,e)=>{t.projectName=await e.prompt(Ie).run({type:"Input",initial:t.projectName,message:"Enter project name",validate:r=>r?!0:"Project name is required."}),t.cwd&&(t.cwd=pt(t.projectName))}};var ja={title:"Select Package manager",task:async(t,e)=>{if(t.packageManager){e.title=`Using ${E.bold(t.packageManager)} as package manager.`;return}t.packageManager=await e.prompt(Ie).run({type:"Select",message:"Which package manager would you like to use?",initial:Dt(),choices:Lk}),e.title=`Using ${E.bold(t.packageManager)} as package manager.`}};var oP={title:"GitHub repository owner",task:async(t,e)=>{if(t.githubOwner){e.title=`GitHub owner: ${E.bold(t.githubOwner)}`;return}t.githubOwner=await e.prompt(Ie).run({type:"Input",message:"Enter GitHub organization or username",initial:"my-org",validate:r=>r?.trim()?!0:"GitHub owner is required."}),e.title=`GitHub owner: ${E.bold(t.githubOwner)}`}},aP={title:"Include GitHub CI/CD",task:async(t,e)=>{if(t.includeGitHubCI!==void 0){e.title=t.includeGitHubCI?"Including GitHub CI/CD workflows":"Skipping GitHub CI/CD";return}t.includeGitHubCI=await e.prompt(Ie).run({type:"Toggle",message:"Include GitHub Actions workflows and CI/CD?",initial:!0,enabled:"Yes",disabled:"No"}),e.title=t.includeGitHubCI?"Including GitHub CI/CD workflows":"Skipping GitHub CI/CD"}};var uP={title:"Pulumi stack name",task:async(t,e)=>{if(t.pulumiStackBase){e.title=`Pulumi stack: ${E.bold(t.pulumiStackBase)}`;return}let r=t.githubOwner||"myorg",n=t.projectName?.replace(/[^a-zA-Z0-9-]/g,"-")||"myproject",i=`${r}/${n}`;t.pulumiStackBase=await e.prompt(Ie).run({type:"Input",message:"Enter Pulumi stack base name (org/project)",initial:i,validate:s=>s?.trim()?s.includes("/")?!0:"Format should be org/project (e.g., myorg/myproject)":"Pulumi stack name is required."}),e.title=`Pulumi stack: ${E.bold(t.pulumiStackBase)}`}};var rp=require("node:fs"),Za=require("node:path");var tp=require("node:fs"),ep=require("node:path"),QR=P(Qd()),bae=t=>t.toUpperCase().replace(/-/g,"_"),Fae=()=>{let t=[(0,ep.join)(__dirname,"templates","hono-microservice"),(0,ep.join)(__dirname,"..","hono-microservice","templates")];for(let e of t)if((0,tp.existsSync)(e))return e;throw new Error(`Hono templates directory not found. Searched in: ${t.join(", ")}`)},wb=(t,e)=>{let r=Fae(),n=(0,ep.join)(r,t),i=(0,tp.readFileSync)(n,"utf-8");return QR.default.compile(i)(e)};function eI(t){return wb("src/index.ts.hbs",{serviceName:t,envKey:bae(t)})}function tI(){return wb("tsconfig.json.hbs",{})}function rI(t="1.2.23"){return wb("Dockerfile.hbs",{bunVersion:t})}var nI={title:"Create Hono app structure",rendererOptions:{outputBar:1e3},task:async(t,e)=>mt(e,async r=>{await Bi("create-hono@latest",[t.projectName,"--pm",t.packageManager,"--template bun","--install"],{task:e});let n=(0,Za.basename)(t.projectName),i="bun run --hot src/index.ts",s=Ok();ya("scripts.start:dev",i,t.projectName),ya("name",`${s}/${n}`,t.projectName);let o=(0,Za.join)(pt(t.projectName),"src","index.ts");(0,rp.writeFileSync)(o,eI(n));let a=(0,Za.join)(pt(t.projectName),"tsconfig.json");(0,rp.writeFileSync)(a,tI());let u=(0,Za.join)(pt(t.projectName),"Dockerfile");(0,rp.writeFileSync)(u,rI()),t.elapsedTime+=r()})};async function Eae(t,e){let{valid:r,config:n,error:i}=Da();(!r||!n)&&(console.log(i),process.exit(1));let s=(e.servicePath||t||"services/my-hono-service").trim(),o=await V0(e.description);K0(s,n,o);try{await z0({servicePath:s,description:o,serviceType:"hono"},n)&&(console.log(E.green.bold(`
295
+ `)}};var sP={title:"Install Nest CLI",task:async(t,e)=>mt(e,async r=>{await Nk({packages:["@nestjs/cli"],task:e,cwd:t.cwd}),t.elapsedTime+=r()}),rendererOptions:{outputBar:1e3}};var md={title:"Install dependencies",task:async(t,e)=>mt(e,async r=>{await Fa({cwd:t.cwd,task:e,packageManager:t.packageManager}),t.elapsedTime+=r()})};var La={enabled:t=>!t.removeDir&&!dk(t.cwd),task:async(t,e)=>{if(t.removeDir=await e.prompt(Ie).run({type:"Toggle",message:E.bold("\u26A0\uFE0F Overwrite existing directory?"),initial:!1}),!t.removeDir)throw new Error("Project creation was canceled by the user.")}},Na={enabled:t=>!!t.removeDir,task:async t=>Dk(t.cwd)};var Dd={title:"Run integration commands",enabled:t=>t.selectedIntegrations.length>0,task:async(t,e)=>mt(e,async r=>{let{selectedIntegrations:n,cwd:i}=t;await nO({selectedIntegrations:n,cwd:i,task:e,packageManager:t.packageManager}),t.elapsedTime+=r()}),rendererOptions:{outputBar:1}};var $a={task:async(t,e)=>{t.projectName=await e.prompt(Ie).run({type:"Input",initial:t.projectName,message:"Enter project name",validate:r=>r?!0:"Project name is required."}),t.cwd&&(t.cwd=pt(t.projectName))}};var ja={title:"Select Package manager",task:async(t,e)=>{if(t.packageManager){e.title=`Using ${E.bold(t.packageManager)} as package manager.`;return}t.packageManager=await e.prompt(Ie).run({type:"Select",message:"Which package manager would you like to use?",initial:Dt(),choices:Lk}),e.title=`Using ${E.bold(t.packageManager)} as package manager.`}};var oP={title:"GitHub repository owner",task:async(t,e)=>{if(t.githubOwner){e.title=`GitHub owner: ${E.bold(t.githubOwner)}`;return}t.githubOwner=await e.prompt(Ie).run({type:"Input",message:"Enter GitHub organization or username",initial:"my-org",validate:r=>r?.trim()?!0:"GitHub owner is required."}),e.title=`GitHub owner: ${E.bold(t.githubOwner)}`}},aP={title:"Include GitHub CI/CD",task:async(t,e)=>{if(t.includeGitHubCI!==void 0){e.title=t.includeGitHubCI?"Including GitHub CI/CD workflows":"Skipping GitHub CI/CD";return}t.includeGitHubCI=await e.prompt(Ie).run({type:"Toggle",message:"Include GitHub Actions workflows and CI/CD?",initial:!0,enabled:"Yes",disabled:"No"}),e.title=t.includeGitHubCI?"Including GitHub CI/CD workflows":"Skipping GitHub CI/CD"}};var uP={title:"Pulumi stack name",task:async(t,e)=>{if(t.pulumiStackBase){e.title=`Pulumi stack: ${E.bold(t.pulumiStackBase)}`;return}let r=t.githubOwner||"myorg",n=t.projectName?.replace(/[^a-zA-Z0-9-]/g,"-")||"myproject",i=`${r}/${n}`;t.pulumiStackBase=await e.prompt(Ie).run({type:"Input",message:"Enter Pulumi stack base name (org/project)",initial:i,validate:s=>s?.trim()?s.includes("/")?!0:"Format should be org/project (e.g., myorg/myproject)":"Pulumi stack name is required."}),e.title=`Pulumi stack: ${E.bold(t.pulumiStackBase)}`}};var rp=require("node:fs"),Za=require("node:path");var tp=require("node:fs"),ep=require("node:path"),QR=P(Qd()),bae=t=>t.toUpperCase().replace(/-/g,"_"),Fae=()=>{let t=[(0,ep.join)(__dirname,"templates","hono-microservice"),(0,ep.join)(__dirname,"..","hono-microservice","templates")];for(let e of t)if((0,tp.existsSync)(e))return e;throw new Error(`Hono templates directory not found. Searched in: ${t.join(", ")}`)},wb=(t,e)=>{let r=Fae(),n=(0,ep.join)(r,t),i=(0,tp.readFileSync)(n,"utf-8");return QR.default.compile(i)(e)};function eI(t){return wb("src/index.ts.hbs",{serviceName:t,envKey:bae(t)})}function tI(){return wb("tsconfig.json.hbs",{})}function rI(t="1.2.23"){return wb("Dockerfile.hbs",{bunVersion:t})}var nI={title:"Create Hono app structure",rendererOptions:{outputBar:1e3},task:async(t,e)=>mt(e,async r=>{await Bi("create-hono@latest",[t.projectName,"--pm",t.packageManager,"--template bun","--install"],{task:e});let n=(0,Za.basename)(t.projectName),i="bun run --hot src/index.ts",s=Ok();ya("scripts.start:dev",i,t.projectName),ya("name",`${s}/${n}`,t.projectName);let o=(0,Za.join)(pt(t.projectName),"src","index.ts");(0,rp.writeFileSync)(o,eI(n));let a=(0,Za.join)(pt(t.projectName),"tsconfig.json");(0,rp.writeFileSync)(a,tI());let u=(0,Za.join)(pt(t.projectName),"Dockerfile");(0,rp.writeFileSync)(u,rI()),t.elapsedTime+=r()})};async function Eae(t,e){let{valid:r,config:n,error:i}=Da();(!r||!n)&&(console.log(i),process.exit(1));let s=(t||"services/my-hono-service").trim(),o=await V0(e.description);K0(s,n,o);try{await z0({servicePath:s,description:o,serviceType:"hono"},n)&&(console.log(E.green.bold(`
296
296
  \u2705 Service generated successfully!
297
297
  `)),console.log(E.dim("Next steps:")),console.log(E.dim(` 1. ${E.cyan(`cd ${s}`)}`)),console.log(E.dim(` 2. ${E.cyan("bun install")}`)),console.log(E.dim(` 3. ${E.cyan("bun dev")}`)),console.log())}catch(a){console.log(E.red.bold(`
298
298
  \u274C Error: ${a.message}
299
299
  `)),process.exit(1)}}var sI=mi({name:"hono-micro",description:"Create a new Hono microservice with the Crossdelta setup. Use --ai for AI-powered generation.",arguments:[["[name]","Name or path of the service"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["--install","Allow create-hono to install dependencies during scaffolding"],["-y, --yes","Skip all prompts and use default values"],["--ai","Use AI to generate service code based on a description"],["-d, --description <description>","Service description for AI generation (requires --ai)"]],exampleUsage:'platform new hono-micro my-service --ai -d "Payment processing service"',buildContext:(t,e)=>{let r=(t.name??"services/my-hono-service").trim(),n=pt(r),i=e.packageManager??(e.yes&&Dt()),s=Er(),o=e.yes?Ta():[],a=e.packageManager==="bun";return{cwd:n,projectName:r,packageManager:i,shouldInstallBun:a,availableIntegrations:s,selectedIntegrations:o,serviceType:"hono",elapsedTime:0,userConfirmed:!!e.yes,removeDir:!!e.yes}},shouldSkipWorkflow:(t,e)=>!!e.ai,onSkipWorkflow:(t,e)=>Eae(t.name,e),prompts:[$a,La,Ma,ja,pd,Pa],actions:[Na,Ia,nI,hd,dd,Dd],onComplete:({projectName:t,packageManager:e,selectedIntegrations:r,assignedPort:n})=>{H.breakLine().log(E.bold.green("Hono Microservice created successfully!")),id(r),sd((0,iI.basename)(t),n??8080);let i=e??Dt();H.breakLine().log(`To start the project, run:
300
- ${E.bold(`cd ${t} && ${i} run dev`)}`).breakLine().log("Happy shipping with Hono! \u26A1\uFE0F").breakLine()}});var mI=require("node:path");var lI=require("node:fs"),fI=require("node:path");var ip=require("node:fs"),np=require("node:path"),oI=P(Qd()),Cae=t=>t.toUpperCase().replace(/-/g,"_"),wae=t=>t.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),Sae=()=>{let t=[(0,np.join)(__dirname,"templates","nest-microservice"),(0,np.join)(__dirname,"..","nest-microservice","templates")];for(let e of t)if((0,ip.existsSync)(e))return e;throw new Error(`NestJS templates directory not found. Searched in: ${t.join(", ")}`)},aI=(t,e)=>{let r=Sae(),n=(0,np.join)(r,t),i=(0,ip.readFileSync)(n,"utf-8");return oI.default.compile(i)(e)};function uI(t,e=3e3){return aI("src/main.ts.hbs",{serviceName:t,envKey:Cae(t),displayName:wae(t),defaultPort:e})}function cI(t="24",e="1.2.23"){return aI("Dockerfile.hbs",{nodeVersion:t,bunVersion:e})}var hI={title:"Create NestJS app structure",rendererOptions:{outputBar:1e3},task:async(t,e)=>mt(e,async r=>{await Bi("@nestjs/cli",["new",t.projectName,"--skip-install","--package-manager",t.packageManager],{task:e});let n=(0,fI.join)(pt(t.projectName),"Dockerfile");(0,lI.writeFileSync)(n,cI()),t.elapsedTime+=r()})};var dI=require("node:fs"),sp=require("node:path");var pI={title:"Patch main.ts with PORT pattern",task:async(t,e)=>mt(e,async r=>{let n=(0,sp.basename)(t.projectName),i=t.assignedPort??3e3,s=(0,sp.join)(pt(t.projectName),"src","main.ts");(0,dI.writeFileSync)(s,uI(n,i)),e.title=`Patched main.ts with PORT || ${n.toUpperCase().replace(/-/g,"_")}_PORT`,t.elapsedTime+=r()})};async function vae(t,e){let{valid:r,config:n,error:i}=Da();(!r||!n)&&(console.log(i),process.exit(1));let s=(e.servicePath||t||"services/my-nest-service").trim(),o=await V0(e.description);K0(s,n,o);try{await z0({servicePath:s,description:o,serviceType:"nest"},n)&&(console.log(E.green.bold(`
300
+ ${E.bold(`cd ${t} && ${i} run dev`)}`).breakLine().log("Happy shipping with Hono! \u26A1\uFE0F").breakLine()}});var mI=require("node:path");var lI=require("node:fs"),fI=require("node:path");var ip=require("node:fs"),np=require("node:path"),oI=P(Qd()),Cae=t=>t.toUpperCase().replace(/-/g,"_"),wae=t=>t.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),Sae=()=>{let t=[(0,np.join)(__dirname,"templates","nest-microservice"),(0,np.join)(__dirname,"..","nest-microservice","templates")];for(let e of t)if((0,ip.existsSync)(e))return e;throw new Error(`NestJS templates directory not found. Searched in: ${t.join(", ")}`)},aI=(t,e)=>{let r=Sae(),n=(0,np.join)(r,t),i=(0,ip.readFileSync)(n,"utf-8");return oI.default.compile(i)(e)};function uI(t,e=3e3){return aI("src/main.ts.hbs",{serviceName:t,envKey:Cae(t),displayName:wae(t),defaultPort:e})}function cI(t="24",e="1.2.23"){return aI("Dockerfile.hbs",{nodeVersion:t,bunVersion:e})}var hI={title:"Create NestJS app structure",rendererOptions:{outputBar:1e3},task:async(t,e)=>mt(e,async r=>{await Bi("@nestjs/cli",["new",t.projectName,"--skip-install","--package-manager",t.packageManager],{task:e});let n=(0,fI.join)(pt(t.projectName),"Dockerfile");(0,lI.writeFileSync)(n,cI()),t.elapsedTime+=r()})};var dI=require("node:fs"),sp=require("node:path");var pI={title:"Patch main.ts with PORT pattern",task:async(t,e)=>mt(e,async r=>{let n=(0,sp.basename)(t.projectName),i=t.assignedPort??3e3,s=(0,sp.join)(pt(t.projectName),"src","main.ts");(0,dI.writeFileSync)(s,uI(n,i)),e.title=`Patched main.ts with PORT || ${n.toUpperCase().replace(/-/g,"_")}_PORT`,t.elapsedTime+=r()})};async function vae(t,e){let{valid:r,config:n,error:i}=Da();(!r||!n)&&(console.log(i),process.exit(1));let s=(t||"services/my-nest-service").trim(),o=await V0(e.description);K0(s,n,o);try{await z0({servicePath:s,description:o,serviceType:"nest"},n)&&(console.log(E.green.bold(`
301
301
  \u2705 Service generated successfully!
302
302
  `)),console.log(E.dim("Next steps:")),console.log(E.dim(` 1. ${E.cyan(`cd ${s}`)}`)),console.log(E.dim(` 2. ${E.cyan("bun install")}`)),console.log(E.dim(` 3. ${E.cyan("bun run start:dev")}`)),console.log())}catch(a){console.log(E.red.bold(`
303
303
  \u274C Error: ${a.message}
304
304
  `)),process.exit(1)}}var DI=mi({name:"nest-micro",description:"Create a new NestJS microservice with the Crossdelta setup. Use --ai for AI-powered generation.",arguments:[["[name]","Name or path of the service"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["--ai","Use AI to generate service code based on a description"],["-d, --description <description>","Service description for AI generation (requires --ai)"]],exampleUsage:'platform new nest-micro my-service --ai -d "User authentication service"',buildContext:(t,e)=>{let r=(t.name??"services/my-nest-service").trim(),n=pt(r),i=e.packageManager??(e.yes&&Dt()),s=e.packageManager==="bun",o=Er(),a=e.yes?Ta():[];return{cwd:n,projectName:r,shouldInstallBun:s,packageManager:i,availableIntegrations:o,selectedIntegrations:a,serviceType:"nest",elapsedTime:0,userConfirmed:!!e.yes,removeDir:!!e.yes}},shouldSkipWorkflow:(t,e)=>!!e.ai,onSkipWorkflow:(t,e)=>vae(t.name,e),prompts:[$a,La,Ma,ja,pd,Pa],actions:[Na,Ia,hI,hd,pI,md,sP,dd,Dd],onComplete:({projectName:t,packageManager:e,selectedIntegrations:r,assignedPort:n})=>{H.breakLine().log(E.bold.green("NestJS Microservice created successfully!")),id(r),sd((0,mI.basename)(t),n??3e3),H.breakLine().log(`To start the project, run:
305
- ${E.bold(`cd ${t} && ${e} run start:dev`)}`).breakLine().log("Happy coding! \u{1F389}").breakLine()}});var qt=require("node:fs"),Mi=require("node:path"),gI=P(Qd()),_ae=()=>{let t=[(0,Mi.join)(__dirname,"templates","workspace"),(0,Mi.join)(__dirname,"..","workspace","templates")];for(let e of t)if((0,qt.existsSync)(e))return e;throw new Error(`Workspace templates directory not found. Searched in: ${t.join(", ")}`)},Aae=(t,e)=>{let r=(0,qt.readFileSync)(t,"utf-8");return gI.default.compile(r)(e)},Bae=[{template:"package.json.hbs",output:"package.json"},{template:"biome.json.hbs",output:"biome.json"},{template:"turbo.json.hbs",output:"turbo.json"},{template:"bunfig.toml.hbs",output:"bunfig.toml"},{template:"gitignore.hbs",output:".gitignore"},{template:"editorconfig.hbs",output:".editorconfig"},{template:"npmrc.hbs",output:".npmrc"},{template:"infra/package.json.hbs",output:"infra/package.json"},{template:"infra/index.ts.hbs",output:"infra/index.ts"},{template:"infra/tsconfig.json.hbs",output:"infra/tsconfig.json"},{template:"infra/Pulumi.yaml.hbs",output:"infra/Pulumi.yaml"},{template:"infra/Pulumi.dev.yaml.hbs",output:"infra/Pulumi.dev.yaml"},{template:"infra/services/example.ts.hbs",output:"infra/services/example.ts"},{template:"apps/.gitkeep",output:"apps/.gitkeep",isStatic:!0},{template:"services/.gitkeep",output:"services/.gitkeep",isStatic:!0},{template:"packages/.gitkeep",output:"packages/.gitkeep",isStatic:!0},{template:"docs/.gitkeep",output:"docs/.gitkeep",isStatic:!0},{template:".github/copilot-instructions.md.hbs",output:".github/copilot-instructions.md"},{template:".github/README.md",output:".github/README.md",isStatic:!0,isGitHubCI:!0},{template:".github/dependabot.yml",output:".github/dependabot.yml",isStatic:!0,isGitHubCI:!0},{template:".github/workflows/lint-and-tests.yml.hbs",output:".github/workflows/lint-and-tests.yml",isGitHubCI:!0},{template:".github/workflows/build-and-deploy.yml.hbs",output:".github/workflows/build-and-deploy.yml",isGitHubCI:!0},{template:".github/workflows/publish-packages.yml",output:".github/workflows/publish-packages.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/setup-bun-install/action.yml.hbs",output:".github/actions/setup-bun-install/action.yml",isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/action.yml",output:".github/actions/check-image-tag-exists/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/index.js",output:".github/actions/check-image-tag-exists/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/action.yml",output:".github/actions/check-path-changes/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/index.js",output:".github/actions/check-path-changes/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/detect-skipped-services/action.yml",output:".github/actions/detect-skipped-services/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/action.yml",output:".github/actions/generate-scope-matrix/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/index.js",output:".github/actions/generate-scope-matrix/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/prepare-build-context/action.yml",output:".github/actions/prepare-build-context/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/action.yml",output:".github/actions/resolve-scope-tags/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/index.js",output:".github/actions/resolve-scope-tags/index.js",isStatic:!0,isGitHubCI:!0}],xI={title:"Creating workspace structure",task:async(t,e)=>{if((0,qt.existsSync)(t.cwd)){e.title="Workspace directory already exists, skipping...";return}let r=_ae(),n=t.includeGitHubCI??!0,i={projectName:t.projectName,githubOwner:t.githubOwner||"",pulumiStackBase:t.pulumiStackBase||t.projectName},s=Bae.filter(o=>!(o.isGitHubCI&&!n));for(let o of s){let a=(0,Mi.join)(t.cwd,o.output),u=(0,Mi.dirname)(a);if((0,qt.existsSync)(u)||(0,qt.mkdirSync)(u,{recursive:!0}),o.isStatic){let c=(0,Mi.join)(r,o.template);(0,qt.existsSync)(c)?(0,qt.writeFileSync)(a,(0,qt.readFileSync)(c)):(0,qt.writeFileSync)(a,"")}else{let c=(0,Mi.join)(r,o.template),l=Aae(c,i);(0,qt.writeFileSync)(a,l)}}e.title="Workspace structure created"}};var yI=mi({name:"workspace",description:"Create a new workspace with infrastructure setup",arguments:[["[name]","Name or path of the workspace"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["-o, --github-owner <owner>","GitHub organization or username"],["-s, --pulumi-stack <name>","Pulumi stack base name (org/project)"],["--no-github","Skip GitHub CI/CD workflows"]],exampleUsage:"pf new workspace my-platform -o my-org",buildContext:(t,e)=>{let r=(t.name??"my-platform").trim(),n=pt(r),i=e.packageManager??(e.yes?Dt():void 0),s=e.packageManager==="bun",o=!!e.yes,a=e.githubOwner??(o?"my-org":void 0),u=e.pulumiStack??(o?`${a}/${r}`:void 0),c=e.github!==void 0?e.github:o?!0:void 0;return{cwd:n,projectName:r,shouldInstallBun:s,packageManager:i,elapsedTime:0,userConfirmed:o,removeDir:o,githubOwner:a,pulumiStackBase:u,includeGitHubCI:c}},prompts:[$a,La,oP,aP,uP,Ma,ja,Pa],actions:[Na,Ia,xI,md,iP],onComplete:({projectName:t,includeGitHubCI:e})=>{H.breakLine().log(E.bold.green("Workspace created successfully!")),H.breakLine().log(E.bold("Next steps:")).log(` 1. ${E.cyan(`cd ${t}`)}`).log(` 2. ${E.cyan("bun pulumi login")}`).log(` 3. ${E.cyan("bun pulumi up --stack dev")}`),e&&H.breakLine().log(E.bold("GitHub Setup:")).log(" Configure these secrets in your GitHub repository:").log(` \u2022 ${E.yellow("PULUMI_ACCESS_TOKEN")} - Pulumi Cloud access token`).log(` \u2022 ${E.yellow("DIGITALOCEAN_TOKEN")} - DigitalOcean API token`).log(` \u2022 ${E.yellow("NPM_TOKEN")} - (optional) NPM token for private packages`),H.breakLine().log(E.bold("Structure created:")).log(" apps/ # Frontend applications").log(" services/ # Backend microservices").log(" packages/ # Shared libraries").log(" infra/").log(" \u251C\u2500\u2500 index.ts # Pulumi entry point").log(" \u251C\u2500\u2500 services/ # Service configs").log(" \u251C\u2500\u2500 Pulumi.yaml # Pulumi project config").log(" \u2514\u2500\u2500 Pulumi.dev.yaml # Dev stack config"),e&&H.log(" .github/").log(" \u251C\u2500\u2500 workflows/ # CI/CD workflows").log(" \u2514\u2500\u2500 actions/ # Custom actions"),H.breakLine().log("Happy coding! \u{1F389}").breakLine()}});var Dl=[{name:"Hono Microservice",value:"hono-micro",command:sI,supportsAi:!0},{name:"Nest Microservice",value:"nest-micro",command:DI,supportsAi:!0},{name:"Workspace (Infrastructure)",value:"workspace",command:yI,supportsAi:!1}],bI=()=>{let t=mi({name:"new",description:"Create a new project",arguments:[["[type]","Type of the project (e.g., nest-micro, shopware-plugin)"]],exampleUsage:"platform new nest-micro test-project",buildContext:e=>({projectType:e.type??"",useAi:!1,aiDescription:"",elapsedTime:0,cwd:process.cwd()}),prompts:[{enabled:e=>!e.projectType,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"select",message:"Select Project type",choices:Dl});e.projectType=Dl.find(i=>i.name===n)?.value||"",r.title=`Using ${E.bold(n)}`}},{enabled:e=>!!Dl.find(n=>n.value===e.projectType)?.supportsAi&&Da().valid,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"toggle",message:"Use AI to generate service code?",enabled:"Yes",disabled:"No",initial:!1});e.useAi=n,r.title=n?E.cyan("\u{1F916} AI-powered generation"):"Standard scaffolding"}},{enabled:e=>e.useAi,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"input",message:"\u{1F4E6} Service path (e.g., services/my-service):",initial:"services/my-hono-service"});e.servicePath=n.trim(),r.title=`Path: ${E.dim(n)}`}},{enabled:e=>e.useAi,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"input",message:"Describe what this service should do:"});e.aiDescription=n,r.title=`Description: ${E.dim(n.slice(0,50))}${n.length>50?"...":""}`}}],actions:[],onComplete:async e=>{Dl.find(i=>i.value===e.projectType)||t.error(E.red(`Project type ${e.projectType} is not supported.`));let r=t.commands.find(i=>i.name()===e.projectType),n={};e.useAi&&(n.ai=!0,n.description=e.aiDescription,n.servicePath=e.servicePath),await QO(r,e,n)}});for(let e of Dl)t.addCommand(e.command);return t};var bn=require("node:fs"),op=require("node:path");var CI=300,Tae=1e3,FI=["infra/services"],EI=["services","apps"],gl=null,xl=!1,Li=t=>{process.stdout.write(`${t}
305
+ ${E.bold(`cd ${t} && ${e} run start:dev`)}`).breakLine().log("Happy coding! \u{1F389}").breakLine()}});var qt=require("node:fs"),Mi=require("node:path"),gI=P(Qd()),_ae=()=>{let t=[(0,Mi.join)(__dirname,"templates","workspace"),(0,Mi.join)(__dirname,"..","workspace","templates")];for(let e of t)if((0,qt.existsSync)(e))return e;throw new Error(`Workspace templates directory not found. Searched in: ${t.join(", ")}`)},Aae=(t,e)=>{let r=(0,qt.readFileSync)(t,"utf-8");return gI.default.compile(r)(e)},Bae=[{template:"package.json.hbs",output:"package.json"},{template:"biome.json.hbs",output:"biome.json"},{template:"turbo.json.hbs",output:"turbo.json"},{template:"bunfig.toml.hbs",output:"bunfig.toml"},{template:"gitignore.hbs",output:".gitignore"},{template:"editorconfig.hbs",output:".editorconfig"},{template:"npmrc.hbs",output:".npmrc"},{template:"infra/package.json.hbs",output:"infra/package.json"},{template:"infra/index.ts.hbs",output:"infra/index.ts"},{template:"infra/tsconfig.json.hbs",output:"infra/tsconfig.json"},{template:"infra/Pulumi.yaml.hbs",output:"infra/Pulumi.yaml"},{template:"infra/Pulumi.dev.yaml.hbs",output:"infra/Pulumi.dev.yaml"},{template:"infra/services/example.ts.hbs",output:"infra/services/example.ts"},{template:"apps/.gitkeep",output:"apps/.gitkeep",isStatic:!0},{template:"services/.gitkeep",output:"services/.gitkeep",isStatic:!0},{template:"packages/.gitkeep",output:"packages/.gitkeep",isStatic:!0},{template:"docs/.gitkeep",output:"docs/.gitkeep",isStatic:!0},{template:".github/copilot-instructions.md.hbs",output:".github/copilot-instructions.md"},{template:".github/README.md",output:".github/README.md",isStatic:!0,isGitHubCI:!0},{template:".github/dependabot.yml",output:".github/dependabot.yml",isStatic:!0,isGitHubCI:!0},{template:".github/workflows/lint-and-tests.yml.hbs",output:".github/workflows/lint-and-tests.yml",isGitHubCI:!0},{template:".github/workflows/build-and-deploy.yml.hbs",output:".github/workflows/build-and-deploy.yml",isGitHubCI:!0},{template:".github/workflows/publish-packages.yml",output:".github/workflows/publish-packages.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/setup-bun-install/action.yml.hbs",output:".github/actions/setup-bun-install/action.yml",isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/action.yml",output:".github/actions/check-image-tag-exists/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/index.js",output:".github/actions/check-image-tag-exists/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/action.yml",output:".github/actions/check-path-changes/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/index.js",output:".github/actions/check-path-changes/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/detect-skipped-services/action.yml",output:".github/actions/detect-skipped-services/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/action.yml",output:".github/actions/generate-scope-matrix/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/index.js",output:".github/actions/generate-scope-matrix/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/prepare-build-context/action.yml",output:".github/actions/prepare-build-context/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/action.yml",output:".github/actions/resolve-scope-tags/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/index.js",output:".github/actions/resolve-scope-tags/index.js",isStatic:!0,isGitHubCI:!0}],xI={title:"Creating workspace structure",task:async(t,e)=>{if((0,qt.existsSync)(t.cwd)){e.title="Workspace directory already exists, skipping...";return}let r=_ae(),n=t.includeGitHubCI??!0,i={projectName:t.projectName,githubOwner:t.githubOwner||"",pulumiStackBase:t.pulumiStackBase||t.projectName},s=Bae.filter(o=>!(o.isGitHubCI&&!n));for(let o of s){let a=(0,Mi.join)(t.cwd,o.output),u=(0,Mi.dirname)(a);if((0,qt.existsSync)(u)||(0,qt.mkdirSync)(u,{recursive:!0}),o.isStatic){let c=(0,Mi.join)(r,o.template);(0,qt.existsSync)(c)?(0,qt.writeFileSync)(a,(0,qt.readFileSync)(c)):(0,qt.writeFileSync)(a,"")}else{let c=(0,Mi.join)(r,o.template),l=Aae(c,i);(0,qt.writeFileSync)(a,l)}}e.title="Workspace structure created"}};var yI=mi({name:"workspace",description:"Create a new workspace with infrastructure setup",arguments:[["[name]","Name or path of the workspace"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["-o, --github-owner <owner>","GitHub organization or username"],["-s, --pulumi-stack <name>","Pulumi stack base name (org/project)"],["--no-github","Skip GitHub CI/CD workflows"]],exampleUsage:"pf new workspace my-platform -o my-org",buildContext:(t,e)=>{let r=(t.name??"my-platform").trim(),n=pt(r),i=e.packageManager??(e.yes?Dt():void 0),s=e.packageManager==="bun",o=!!e.yes,a=e.githubOwner??(o?"my-org":void 0),u=e.pulumiStack??(o?`${a}/${r}`:void 0),c=e.github!==void 0?e.github:o?!0:void 0;return{cwd:n,projectName:r,shouldInstallBun:s,packageManager:i,elapsedTime:0,userConfirmed:o,removeDir:o,githubOwner:a,pulumiStackBase:u,includeGitHubCI:c}},prompts:[$a,La,oP,aP,uP,Ma,ja,Pa],actions:[Na,Ia,xI,md,iP],onComplete:({projectName:t,includeGitHubCI:e})=>{H.breakLine().log(E.bold.green("Workspace created successfully!")),H.breakLine().log(E.bold("Next steps:")).log(` 1. ${E.cyan(`cd ${t}`)}`).log(` 2. ${E.cyan("bun pulumi login")}`).log(` 3. ${E.cyan("bun pulumi up --stack dev")}`),e&&H.breakLine().log(E.bold("GitHub Setup:")).log(" Configure these secrets in your GitHub repository:").log(` \u2022 ${E.yellow("PULUMI_ACCESS_TOKEN")} - Pulumi Cloud access token`).log(` \u2022 ${E.yellow("DIGITALOCEAN_TOKEN")} - DigitalOcean API token`).log(` \u2022 ${E.yellow("NPM_TOKEN")} - (optional) NPM token for private packages`),H.breakLine().log(E.bold("Structure created:")).log(" apps/ # Frontend applications").log(" services/ # Backend microservices").log(" packages/ # Shared libraries").log(" infra/").log(" \u251C\u2500\u2500 index.ts # Pulumi entry point").log(" \u251C\u2500\u2500 services/ # Service configs").log(" \u251C\u2500\u2500 Pulumi.yaml # Pulumi project config").log(" \u2514\u2500\u2500 Pulumi.dev.yaml # Dev stack config"),e&&H.log(" .github/").log(" \u251C\u2500\u2500 workflows/ # CI/CD workflows").log(" \u2514\u2500\u2500 actions/ # Custom actions"),H.breakLine().log("Happy coding! \u{1F389}").breakLine()}});var Dl=[{name:"Hono Microservice",value:"hono-micro",command:sI,supportsAi:!0},{name:"Nest Microservice",value:"nest-micro",command:DI,supportsAi:!0},{name:"Workspace (Infrastructure)",value:"workspace",command:yI,supportsAi:!1}],bI=()=>{let t=mi({name:"new",description:"Create a new project",arguments:[["[type]","Type of the project (e.g., nest-micro, shopware-plugin)"]],exampleUsage:"platform new nest-micro test-project",buildContext:e=>({projectType:e.type??"",useAi:!1,aiDescription:"",elapsedTime:0,cwd:process.cwd()}),prompts:[{enabled:e=>!e.projectType,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"select",message:"Select Project type",choices:Dl});e.projectType=Dl.find(i=>i.name===n)?.value||"",r.title=`Using ${E.bold(n)}`}},{enabled:e=>!!Dl.find(n=>n.value===e.projectType)?.supportsAi&&Da().valid,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"toggle",message:"Use AI to generate service code?",enabled:"Yes",disabled:"No",initial:!1});e.useAi=n,r.title=n?E.cyan("\u{1F916} AI-powered generation"):"Standard scaffolding"}},{enabled:e=>e.useAi,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"input",message:"\u{1F4E6} Service path (e.g., services/my-service):",initial:"services/my-hono-service"});e.servicePath=n.trim(),r.title=`Path: ${E.dim(n)}`}},{enabled:e=>e.useAi,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"input",message:"Describe what this service should do:"});e.aiDescription=n,r.title=`Description: ${E.dim(n.slice(0,50))}${n.length>50?"...":""}`}}],actions:[],onComplete:async e=>{Dl.find(s=>s.value===e.projectType)||t.error(E.red(`Project type ${e.projectType} is not supported.`));let r=t.commands.find(s=>s.name()===e.projectType),n={},i=[];e.useAi&&(n.ai=!0,n.description=e.aiDescription,e.servicePath&&i.push("servicePath")),await QO(r,e,n,i)}});for(let e of Dl)t.addCommand(e.command);return t};var bn=require("node:fs"),op=require("node:path");var CI=300,Tae=1e3,FI=["infra/services"],EI=["services","apps"],gl=null,xl=!1,Li=t=>{process.stdout.write(`${t}
306
306
  `)},kae=t=>new Promise(e=>setTimeout(e,t)),wI=(t,e)=>{let r=null;return(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>t(...n),e)}},Oae=()=>{process.stdout.write("\x1B[2J\x1B[0f")},Pae=t=>{let e=(0,op.join)(t,"package.json");try{let r=(0,bn.readFileSync)(e,"utf-8"),n=JSON.parse(r);return{watchDirs:n.pf?.dev?.watchDirs??FI,watchPackages:n.pf?.dev?.watchPackages??EI}}catch{return{watchDirs:FI,watchPackages:EI}}},SI=async()=>{if(gl?.pid){try{process.kill(-gl.pid,"SIGTERM")}catch{try{gl.kill("SIGTERM")}catch{}}gl=null,await kae(Tae)}},vI=t=>{gl=yk("turbo",["start:dev","--continue"],{cwd:t,envFile:".env.local",onStderr:e=>{xl||process.stderr.write(e)},onExit:e=>{xl||(Li(`
307
307
  Turbo exited with code ${e}`),process.exit(e??0))}})},_I=async t=>{Li("\u{1F4DD} Generating .env.local..."),await Yt("bun",["run","generate-env"],{cwd:t,quiet:!0})},Rae=async t=>{Li("\u{1F4E6} Installing dependencies..."),await Yt("bun",["install"],{cwd:t,quiet:!0})},Iae=t=>{for(let e of Object.keys(require.cache))t.some(r=>e.includes(r))&&delete require.cache[e]},AI=async(t,e,r,n=!1)=>{if(!xl){xl=!0;try{Iae(r),await SI(),Oae(),Li(`\u{1F504} Detected change in ${E.cyan(t.replace(/ /g,""))}, restarting...`),n&&await Rae(e),await _I(e),vI(e)}catch(i){Li(`\u274C Failed to restart: ${i}`)}finally{xl=!1}}},Mae=(t,e)=>{for(let r of t){let n=(0,op.join)(e,r),i=wI(s=>AI(s,e,t),CI);(0,bn.watch)(n,{recursive:!0},(s,o)=>{o?.endsWith(".ts")&&i(o)})}},Lae=(t,e,r)=>{for(let n of t){let i=(0,op.join)(e,n);if(!(0,bn.existsSync)(i))continue;let s=new Set((0,bn.readdirSync)(i,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)),o=wI(async()=>{let a=new Set((0,bn.readdirSync)(i,{withFileTypes:!0}).filter(l=>l.isDirectory()).map(l=>l.name)),u=[...a].filter(l=>!s.has(l)),c=[...s].filter(l=>!a.has(l));if(u.length>0||c.length>0){let l=[...u.map(f=>`+${f}`),...c.map(f=>`-${f}`)].join(", ");s=a,await AI(`${n}/ [${l}]`,e,r,!0)}},CI);(0,bn.watch)(i,{recursive:!1},()=>o())}},Nae=()=>{let t=async()=>{Li(`
308
308
  \u{1F44B} Shutting down...`),await SI(),process.exit(0)};process.on("SIGINT",t),process.on("SIGTERM",t)},BI=new ut("dev").description("Start development environment with hot reload").option("--no-watch","Disable watching for changes").action(async t=>{let e=Kc(),r=Pae(e);if(await _I(e),vI(e),!t.watch){Li(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossdelta/platform-sdk",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "CLI toolkit for scaffolding Turborepo workspaces with Pulumi infrastructure and Hono/NestJS microservices",
5
5
  "keywords": [
6
6
  "cli",