@kyro-cms/core 0.12.36 → 0.12.37
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/index.cjs +24 -1
- package/dist/cli/index.js +24 -1
- package/package.json +2 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -209,15 +209,38 @@ ${e.map(t=>{let o=C(t.slug);return ` ${N(t.slug)}: {
|
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
211
|
`,r}function K(){return new commander.Command("generate").description("Generate TypeScript types from collection configs").option("-c, --config <path>","Path to config file or directory","./src/kyro").option("-o, --output <path>","Output file path","./src/types/kyro.d.ts").option("-w, --watch","Watch for changes and regenerate").option("--url <url>","URL of a running Kyro CMS instance (enables remote mode)").option("--api-key <key>","API key for authentication (required with --url)").action(async r=>{if(r.url){r.url||(console.error("\u274C --url is required when using --api"),process.exit(1)),r.apiKey||(console.error("\u274C --api-key is required when using --api"),process.exit(1));let s=k.resolve(r.output);try{let a=await Y(r.url,r.apiKey),c=G(a),p=k.join(s,"..");R.existsSync(p)||R.mkdirSync(p,{recursive:!0}),R.writeFileSync(s,c);}catch(a){console.error("\u274C Error:",a.message),process.exit(1);}return}let t=k.resolve(r.config),o=k.resolve(r.output);try{let s=await glob.glob(`${t}/**/*.{ts,js}`);s.length===0&&(console.error("\u274C No config files found at:",t),process.exit(1));let a=[];for(let d of s)try{let m=await import(d),f=Object.values(m).filter(u=>u&&u.slug&&u.fields);a.push(...f);}catch{console.warn(`\u26A0\uFE0F Could not parse: ${d}`);}a.length===0&&(console.error("\u274C No valid collection configs found"),process.exit(1));let c=O(a),p=k.join(o,"..");if(R.existsSync(p)||R.mkdirSync(p,{recursive:!0}),R.writeFileSync(o,c),r.watch){let{watch:d}=await import('fs');d(t,{recursive:!0},async(m,f)=>{let u=[];for(let S of s)try{let y=await import(S+`?t=${Date.now()}`),w=Object.values(y).filter(h=>h&&h.slug&&h.fields);u.push(...w);}catch{}let A=O(u);R.writeFileSync(o,A);});}}catch(s){console.error("\u274C Error:",s.message),process.exit(1);}})}function V(e=3){return q__default.default.randomBytes(e).toString("hex")}function Z(){return q__default.default.randomBytes(12).toString("base64").replace(/[^a-zA-Z0-9]/g,"").slice(0,16)}function F(){let e=new commander.Command("deploy").description("Deploy Kyro CMS");return e.command("cloudflare").description("Deploy to Cloudflare Workers with Assets").option("-d, --database <type>","Database type (d1|postgres)").option("-u, --database-url <url>","PostgreSQL connection string").option("-n, --name <name>","Cloudflare project name").option("-b, --r2-bucket <name>","R2 storage bucket name").option("-e, --email <email>","Initial Super Admin email").option("-p, --password <password>","Initial Super Admin password").option("-y, --non-interactive","Skip all prompts and use defaults").action(async r=>{console.log(n__default.default.cyan("==============================================================================")),console.log(n__default.default.bold("\u{1F680} Kyro CMS Cloudflare Deployment (Workers)")),console.log(n__default.default.cyan(`==============================================================================
|
|
212
|
-
`));let t=V(),o=Z(),{database:s,databaseUrl:a,name:c,r2Bucket:p,email:d,password:m,nonInteractive:f}=r,u=`kyro-postgres-hd-${t}`;if(a&&!s&&(s="postgres"),!f&&process.stdout.isTTY){console.log(n__default.default.yellow.bold("\u{1F4CB} Setup Configuration")),console.log(n__default.default.dim(
|
|
212
|
+
`));let t=V(),o=Z(),{database:s,databaseUrl:a,name:c,r2Bucket:p,email:d,password:m,nonInteractive:f}=r,u=`kyro-postgres-hd-${t}`;if(a&&!s&&(s="postgres"),!f&&process.stdout.isTTY){console.log(n__default.default.yellow.bold("\u{1F4CB} Setup Configuration")),console.log(n__default.default.dim(`Answer the prompts below to configure your deployment.
|
|
213
|
+
`));let i=[];s||i.push({type:"select",name:"database",message:n__default.default.cyan("\u250C\u2500 ")+n__default.default.bold("Select Database Infrastructure")+`
|
|
214
|
+
`+n__default.default.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
215
|
+
`+n__default.default.magenta(" \u203A "),choices:[{title:"Native Cloudflare D1 (serverless SQLite, auto-provisioned)",value:"d1"},{title:"PostgreSQL (via Cloudflare Hyperdrive)",value:"postgres"}],initial:0}),s==="postgres"&&!a&&i.push({type:"text",name:"databaseUrl",message:n__default.default.cyan(`
|
|
216
|
+
\u250C\u2500 `)+n__default.default.bold("PostgreSQL Connection URL")+`
|
|
217
|
+
`+n__default.default.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
218
|
+
`+n__default.default.magenta(" \u203A ")}),c||i.push({type:"text",name:"name",message:n__default.default.cyan(`
|
|
219
|
+
\u250C\u2500 `)+n__default.default.bold("Cloudflare Project Name")+`
|
|
220
|
+
`+n__default.default.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
221
|
+
`+n__default.default.magenta(" \u203A ")+n__default.default.dim(`(default: kyro-app-${t})`),initial:`kyro-app-${t}`}),p||i.push({type:"text",name:"r2Bucket",message:n__default.default.cyan(`
|
|
222
|
+
\u250C\u2500 `)+n__default.default.bold("Cloudflare R2 Bucket Name")+`
|
|
223
|
+
`+n__default.default.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
224
|
+
`+n__default.default.magenta(" \u203A ")+n__default.default.dim(`(default: kyro-media-${t})`),initial:`kyro-media-${t}`}),d||i.push({type:"text",name:"email",message:n__default.default.cyan(`
|
|
225
|
+
\u250C\u2500 `)+n__default.default.bold("Initial Super Admin Email")+`
|
|
226
|
+
`+n__default.default.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
227
|
+
`+n__default.default.magenta(" \u203A ")+n__default.default.dim("(default: admin@kyro-cms.com)"),initial:"admin@kyro-cms.com"}),m||i.push({type:"text",name:"password",message:n__default.default.cyan(`
|
|
228
|
+
\u250C\u2500 `)+n__default.default.bold("Initial Super Admin Password")+`
|
|
229
|
+
`+n__default.default.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
230
|
+
`+n__default.default.magenta(" \u203A ")+n__default.default.dim("(default: auto-generate secure password)")});let l=await J__default.default(i);l.database&&(s=l.database),l.databaseUrl&&(a=l.databaseUrl),l.name&&(c=l.name),l.r2Bucket&&(p=l.r2Bucket),l.email&&(d=l.email),l.password&&(m=l.password);}c=c||`kyro-app-${t}`,p=p||`kyro-media-${t}`,d=d||"admin@kyro-cms.com",m=m||o,s=s||"d1",console.log(n__default.default.cyan(`
|
|
213
231
|
\u2699\uFE0F Configuration Summary:`)),console.log(` \u2022 Target Hosting: ${n__default.default.bold("Cloudflare Workers with Assets")}`),console.log(` \u2022 Database Mode : ${n__default.default.bold(s)}`),console.log(` \u2022 Project Name : ${n__default.default.bold(c)}`),console.log(` \u2022 R2 Bucket Name: ${n__default.default.bold(p)}`),console.log(` \u2022 Admin Email : ${n__default.default.bold(d)}`);let S=R__default.default.existsSync(k__default.default.join(process.cwd(),"pnpm-lock.yaml"))?"pnpm":"npm",y=`${S} dlx wrangler`;console.log(`
|
|
214
232
|
\u{1F50D} Checking Cloudflare Wrangler authentication...`);try{child_process.execSync(`${y} whoami`,{stdio:"ignore"}),console.log(n__default.default.green("\u2705 Cloudflare Wrangler Authenticated."));}catch{console.log(n__default.default.red("\u274C Cloudflare Wrangler authentication required.")),console.log(` Run ${n__default.default.bold(`${y} login`)} or set the ${n__default.default.bold("CLOUDFLARE_API_TOKEN")} env var.`),process.exit(1);}let w="",h="";if(s==="postgres"){a||(console.log(n__default.default.red("\u274C postgres mode requires a database URL.")),process.exit(1)),console.log(`
|
|
215
233
|
\u26A1 Provisioning Cloudflare Hyperdrive (${u})...`);try{let i=child_process.execSync(`${y} hyperdrive list --json`,{stdio:"pipe"}).toString(),b=JSON.parse(i.slice(i.indexOf("["))).find(D=>D.name===u);b&&(h=b.id||b.uuid);}catch{}if(!h)try{let i=child_process.execSync(`${y} hyperdrive create "${u}" --connection-string="${a}" --json`,{stdio:"pipe"}).toString(),l=JSON.parse(i.slice(i.indexOf("{")));h=l.id||l.uuid;}catch{}console.log(n__default.default.green(`\u2705 Hyperdrive Provisioned (ID: ${h||"auto"})`));}else {let i=`${c}-d1`;console.log(`
|
|
216
234
|
\u{1F5C2}\uFE0F Selecting or creating D1 database (${i})...`);try{let b=child_process.execSync(`${y} d1 create "${i}"`,{stdio:"pipe"}).toString().match(/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/i);b&&(w=b[1]);}catch{try{let b=child_process.execSync(`${y} d1 list --json`,{stdio:"pipe"}).toString(),_=JSON.parse(b).find(W=>W.name===i);_&&(w=_.id||_.uuid);}catch{}}console.log(n__default.default.green(`\u2705 Using D1 database: ${i} (ID: ${w})`));}console.log(`
|
|
217
235
|
\u{1F5C4}\uFE0F Provisioning R2 Bucket '${p}'...`);try{child_process.execSync(`${y} r2 bucket create "${p}"`,{stdio:"ignore"});}catch{console.log(`\u2139\uFE0F Bucket '${p}' already exists.`);}try{child_process.execSync(`echo "y" | ${y} r2 bucket dev-url enable "${p}"`,{stdio:"ignore"});}catch{}console.log(`
|
|
218
236
|
\u2699\uFE0F Generating wrangler.toml...`);let E=`name = "${c}"
|
|
237
|
+
main = "dist/server/entry.mjs"
|
|
219
238
|
compatibility_date = "2026-01-01"
|
|
220
239
|
compatibility_flags = ["nodejs_compat"]
|
|
240
|
+
|
|
241
|
+
[assets]
|
|
242
|
+
directory = "dist/client"
|
|
243
|
+
binding = "ASSETS"
|
|
221
244
|
`;s==="postgres"?E+=`
|
|
222
245
|
[[hyperdrive]]
|
|
223
246
|
binding = "HYPERDRIVE"
|
package/dist/cli/index.js
CHANGED
|
@@ -209,15 +209,38 @@ ${e.map(t=>{let o=C(t.slug);return ` ${N(t.slug)}: {
|
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
211
|
`,r}function K(){return new Command("generate").description("Generate TypeScript types from collection configs").option("-c, --config <path>","Path to config file or directory","./src/kyro").option("-o, --output <path>","Output file path","./src/types/kyro.d.ts").option("-w, --watch","Watch for changes and regenerate").option("--url <url>","URL of a running Kyro CMS instance (enables remote mode)").option("--api-key <key>","API key for authentication (required with --url)").action(async r=>{if(r.url){r.url||(console.error("\u274C --url is required when using --api"),process.exit(1)),r.apiKey||(console.error("\u274C --api-key is required when using --api"),process.exit(1));let s=resolve(r.output);try{let a=await Y(r.url,r.apiKey),c=G(a),p=join(s,"..");existsSync(p)||mkdirSync(p,{recursive:!0}),writeFileSync(s,c);}catch(a){console.error("\u274C Error:",a.message),process.exit(1);}return}let t=resolve(r.config),o=resolve(r.output);try{let s=await glob(`${t}/**/*.{ts,js}`);s.length===0&&(console.error("\u274C No config files found at:",t),process.exit(1));let a=[];for(let d of s)try{let m=await import(d),f=Object.values(m).filter(u=>u&&u.slug&&u.fields);a.push(...f);}catch{console.warn(`\u26A0\uFE0F Could not parse: ${d}`);}a.length===0&&(console.error("\u274C No valid collection configs found"),process.exit(1));let c=O(a),p=join(o,"..");if(existsSync(p)||mkdirSync(p,{recursive:!0}),writeFileSync(o,c),r.watch){let{watch:d}=await import('fs');d(t,{recursive:!0},async(m,f)=>{let u=[];for(let S of s)try{let y=await import(S+`?t=${Date.now()}`),w=Object.values(y).filter(h=>h&&h.slug&&h.fields);u.push(...w);}catch{}let A=O(u);writeFileSync(o,A);});}}catch(s){console.error("\u274C Error:",s.message),process.exit(1);}})}function V(e=3){return q.randomBytes(e).toString("hex")}function Z(){return q.randomBytes(12).toString("base64").replace(/[^a-zA-Z0-9]/g,"").slice(0,16)}function F(){let e=new Command("deploy").description("Deploy Kyro CMS");return e.command("cloudflare").description("Deploy to Cloudflare Workers with Assets").option("-d, --database <type>","Database type (d1|postgres)").option("-u, --database-url <url>","PostgreSQL connection string").option("-n, --name <name>","Cloudflare project name").option("-b, --r2-bucket <name>","R2 storage bucket name").option("-e, --email <email>","Initial Super Admin email").option("-p, --password <password>","Initial Super Admin password").option("-y, --non-interactive","Skip all prompts and use defaults").action(async r=>{console.log(n.cyan("==============================================================================")),console.log(n.bold("\u{1F680} Kyro CMS Cloudflare Deployment (Workers)")),console.log(n.cyan(`==============================================================================
|
|
212
|
-
`));let t=V(),o=Z(),{database:s,databaseUrl:a,name:c,r2Bucket:p,email:d,password:m,nonInteractive:f}=r,u=`kyro-postgres-hd-${t}`;if(a&&!s&&(s="postgres"),!f&&process.stdout.isTTY){console.log(n.yellow.bold("\u{1F4CB} Setup Configuration")),console.log(n.dim(
|
|
212
|
+
`));let t=V(),o=Z(),{database:s,databaseUrl:a,name:c,r2Bucket:p,email:d,password:m,nonInteractive:f}=r,u=`kyro-postgres-hd-${t}`;if(a&&!s&&(s="postgres"),!f&&process.stdout.isTTY){console.log(n.yellow.bold("\u{1F4CB} Setup Configuration")),console.log(n.dim(`Answer the prompts below to configure your deployment.
|
|
213
|
+
`));let i=[];s||i.push({type:"select",name:"database",message:n.cyan("\u250C\u2500 ")+n.bold("Select Database Infrastructure")+`
|
|
214
|
+
`+n.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
215
|
+
`+n.magenta(" \u203A "),choices:[{title:"Native Cloudflare D1 (serverless SQLite, auto-provisioned)",value:"d1"},{title:"PostgreSQL (via Cloudflare Hyperdrive)",value:"postgres"}],initial:0}),s==="postgres"&&!a&&i.push({type:"text",name:"databaseUrl",message:n.cyan(`
|
|
216
|
+
\u250C\u2500 `)+n.bold("PostgreSQL Connection URL")+`
|
|
217
|
+
`+n.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
218
|
+
`+n.magenta(" \u203A ")}),c||i.push({type:"text",name:"name",message:n.cyan(`
|
|
219
|
+
\u250C\u2500 `)+n.bold("Cloudflare Project Name")+`
|
|
220
|
+
`+n.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
221
|
+
`+n.magenta(" \u203A ")+n.dim(`(default: kyro-app-${t})`),initial:`kyro-app-${t}`}),p||i.push({type:"text",name:"r2Bucket",message:n.cyan(`
|
|
222
|
+
\u250C\u2500 `)+n.bold("Cloudflare R2 Bucket Name")+`
|
|
223
|
+
`+n.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
224
|
+
`+n.magenta(" \u203A ")+n.dim(`(default: kyro-media-${t})`),initial:`kyro-media-${t}`}),d||i.push({type:"text",name:"email",message:n.cyan(`
|
|
225
|
+
\u250C\u2500 `)+n.bold("Initial Super Admin Email")+`
|
|
226
|
+
`+n.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
227
|
+
`+n.magenta(" \u203A ")+n.dim("(default: admin@kyro-cms.com)"),initial:"admin@kyro-cms.com"}),m||i.push({type:"text",name:"password",message:n.cyan(`
|
|
228
|
+
\u250C\u2500 `)+n.bold("Initial Super Admin Password")+`
|
|
229
|
+
`+n.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")+`
|
|
230
|
+
`+n.magenta(" \u203A ")+n.dim("(default: auto-generate secure password)")});let l=await J(i);l.database&&(s=l.database),l.databaseUrl&&(a=l.databaseUrl),l.name&&(c=l.name),l.r2Bucket&&(p=l.r2Bucket),l.email&&(d=l.email),l.password&&(m=l.password);}c=c||`kyro-app-${t}`,p=p||`kyro-media-${t}`,d=d||"admin@kyro-cms.com",m=m||o,s=s||"d1",console.log(n.cyan(`
|
|
213
231
|
\u2699\uFE0F Configuration Summary:`)),console.log(` \u2022 Target Hosting: ${n.bold("Cloudflare Workers with Assets")}`),console.log(` \u2022 Database Mode : ${n.bold(s)}`),console.log(` \u2022 Project Name : ${n.bold(c)}`),console.log(` \u2022 R2 Bucket Name: ${n.bold(p)}`),console.log(` \u2022 Admin Email : ${n.bold(d)}`);let S=R.existsSync(k.join(process.cwd(),"pnpm-lock.yaml"))?"pnpm":"npm",y=`${S} dlx wrangler`;console.log(`
|
|
214
232
|
\u{1F50D} Checking Cloudflare Wrangler authentication...`);try{execSync(`${y} whoami`,{stdio:"ignore"}),console.log(n.green("\u2705 Cloudflare Wrangler Authenticated."));}catch{console.log(n.red("\u274C Cloudflare Wrangler authentication required.")),console.log(` Run ${n.bold(`${y} login`)} or set the ${n.bold("CLOUDFLARE_API_TOKEN")} env var.`),process.exit(1);}let w="",h="";if(s==="postgres"){a||(console.log(n.red("\u274C postgres mode requires a database URL.")),process.exit(1)),console.log(`
|
|
215
233
|
\u26A1 Provisioning Cloudflare Hyperdrive (${u})...`);try{let i=execSync(`${y} hyperdrive list --json`,{stdio:"pipe"}).toString(),b=JSON.parse(i.slice(i.indexOf("["))).find(D=>D.name===u);b&&(h=b.id||b.uuid);}catch{}if(!h)try{let i=execSync(`${y} hyperdrive create "${u}" --connection-string="${a}" --json`,{stdio:"pipe"}).toString(),l=JSON.parse(i.slice(i.indexOf("{")));h=l.id||l.uuid;}catch{}console.log(n.green(`\u2705 Hyperdrive Provisioned (ID: ${h||"auto"})`));}else {let i=`${c}-d1`;console.log(`
|
|
216
234
|
\u{1F5C2}\uFE0F Selecting or creating D1 database (${i})...`);try{let b=execSync(`${y} d1 create "${i}"`,{stdio:"pipe"}).toString().match(/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/i);b&&(w=b[1]);}catch{try{let b=execSync(`${y} d1 list --json`,{stdio:"pipe"}).toString(),_=JSON.parse(b).find(W=>W.name===i);_&&(w=_.id||_.uuid);}catch{}}console.log(n.green(`\u2705 Using D1 database: ${i} (ID: ${w})`));}console.log(`
|
|
217
235
|
\u{1F5C4}\uFE0F Provisioning R2 Bucket '${p}'...`);try{execSync(`${y} r2 bucket create "${p}"`,{stdio:"ignore"});}catch{console.log(`\u2139\uFE0F Bucket '${p}' already exists.`);}try{execSync(`echo "y" | ${y} r2 bucket dev-url enable "${p}"`,{stdio:"ignore"});}catch{}console.log(`
|
|
218
236
|
\u2699\uFE0F Generating wrangler.toml...`);let E=`name = "${c}"
|
|
237
|
+
main = "dist/server/entry.mjs"
|
|
219
238
|
compatibility_date = "2026-01-01"
|
|
220
239
|
compatibility_flags = ["nodejs_compat"]
|
|
240
|
+
|
|
241
|
+
[assets]
|
|
242
|
+
directory = "dist/client"
|
|
243
|
+
binding = "ASSETS"
|
|
221
244
|
`;s==="postgres"?E+=`
|
|
222
245
|
[[hyperdrive]]
|
|
223
246
|
binding = "HYPERDRIVE"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kyro-cms/core",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.37",
|
|
4
4
|
"description": "Astro-native headless CMS with multi-database adapters, multi-protocol APIs, and multi-vendor support",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -199,6 +199,7 @@
|
|
|
199
199
|
"@types/jsonwebtoken": "^9.0.9",
|
|
200
200
|
"@types/node": "^22.13.0",
|
|
201
201
|
"@types/nodemailer": "^7.0.11",
|
|
202
|
+
"@types/prompts": "^2.4.9",
|
|
202
203
|
"@types/react": "^19.2.17",
|
|
203
204
|
"@types/ssh2-sftp-client": "^9.0.6",
|
|
204
205
|
"@types/ws": "^8.18.1",
|