@every-app/cli 0.0.9 → 0.0.11

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.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as o,b as s}from"./chunk-KRQD7ZWZ.js";import{proposeCompletions as r}from"@stricli/core";var t=process.argv.slice(3);process.env.COMP_LINE?.endsWith(" ")&&t.push("");await r(s,t,o(process));try{for(let{completion:p}of await r(s,t,o(process)))process.stdout.write(`${p}
2
+ import{a as o,b as s}from"./chunk-GRM44DCG.js";import{proposeCompletions as r}from"@stricli/core";var t=process.argv.slice(3);process.env.COMP_LINE?.endsWith(" ")&&t.push("");await r(s,t,o(process));try{for(let{completion:p}of await r(s,t,o(process)))process.stdout.write(`${p}
3
3
  `)}catch{}
@@ -0,0 +1,13 @@
1
+ import{execa as p}from"execa";import a from"chalk";async function d(e,n,t){let{env:o,cwd:r,verbose:s=!1,description:m,logCommandToConsole:l=!0}=t;return s&&C(e,n,t),l?(console.log(`Running: ${e} ${n.join(" ")}`),m&&console.log(a.dim(` ${m}`)),await p(e,n,{cwd:r,env:o,stdio:"pipe"})):await p(e,n,{cwd:r,env:o,stdio:"pipe"})}async function C(e,n,{description:t,cwd:o,env:r}){console.log(a.dim(` \u250C\u2500 Running: ${e} ${n.join(" ")}`)),t&&console.log(a.dim(` \u2502 ${t}`));let s=p(e,n,{cwd:o,env:r,stdio:void 0,all:!0});s.stdout&&s.stdout.on("data",l=>{l.toString().split(`
2
+ `).forEach(i=>{i.trim()&&console.log(a.dim(` \u2502 ${i}`))})}),s.stderr&&s.stderr.on("data",l=>{l.toString().split(`
3
+ `).forEach(i=>{i.trim()&&console.error(a.dim(` \u2502 ${i}`))})});let m=await s;return console.log(a.dim(` \u2514\u2500 Complete
4
+ `)),m}import f from"node:fs/promises";import u from"node:path";import g from"chalk";async function x(e,n,t=!1){try{if(e==="pnpm"){await d("npx",["pnpm","install"],{cwd:n,verbose:t,logCommandToConsole:!1});return}await d(e,["install"],{cwd:n,logCommandToConsole:!1,verbose:t})}catch(o){throw new Error(`Failed to install dependencies with ${e}: ${o instanceof Error?o.message:"Unknown error"}`)}}async function $(e){try{return(await f.stat(u.join(e,"node_modules"))).isDirectory()}catch{return!1}}async function M(e,n=!1){if(!await $(e)){console.log(g.bold(`Installing dependencies...
5
+ `));try{let o=await f.access(u.join(e,"pnpm-lock.yaml")).then(()=>!0).catch(()=>!1),r=await f.access(u.join(e,"package-lock.json")).then(()=>!0).catch(()=>!1);await x(o?"pnpm":r?"npm":"pnpm",e,n),console.log(g.green(`Dependencies installed
6
+ `))}catch(o){throw console.error(g.red(`
7
+ Failed to install dependencies`)),o}}}import{execa as w}from"execa";import c from"chalk";async function y(){let{stdout:e}=await w("npx",["wrangler","kv","namespace","list"]);return JSON.parse(e)}async function k(e){let{stdout:n}=await w("npx",["wrangler","kv","namespace","create",e]);return b(n)}function b(e){let n=e.match(/"id":\s*"([a-f0-9]+)"/);if(!n||!n[1])throw new Error("Failed to parse namespace ID from wrangler output");return n[1]}async function I(e){console.log(c.bold(`Checking KV namespace: ${e}
8
+ `));try{let t=(await y()).find(r=>r.title===e);if(t)return console.log(c.green(`Linking to existing KV namespace: ${e} (${t.id})
9
+ `)),t.id;console.log(c.bold(`Creating new KV namespace: ${e}
10
+ `));let o=await k(e);return console.log(c.green(`Created KV namespace: ${e} (${o})
11
+ `)),o}catch(n){throw console.error(c.red(`
12
+ Failed to get or create KV namespace: ${e}`),n instanceof Error?c.dim(`
13
+ ${n.message}`):""),n}}export{d as a,x as b,M as c,I as d};
@@ -0,0 +1,4 @@
1
+ import{a as l}from"./chunk-A5HLZBEH.js";import{c as p}from"./chunk-CQBCTFZE.js";async function g(t,r,e=!1){try{await l("git",["clone",t,r],{verbose:e})}catch(i){throw new Error(`Failed to clone repository from ${t}: ${i instanceof Error?i.message:"Unknown error"}`)}}import o from"node:fs/promises";import n from"node:path";import d from"node:os";import y from"chalk";async function u(t,r,e={}){let i=e.exclude||[];await o.mkdir(r,{recursive:!0});let s=await o.readdir(t,{withFileTypes:!0});for(let a of s){let c=n.join(t,a.name),m=n.join(r,a.name);i.some(f=>a.name===f)||(a.isDirectory()?await u(c,m,e):await o.copyFile(c,m))}}async function O(t){try{return(await o.stat(t)).isDirectory()}catch{return!1}}async function R(t,r){let e=await p("every-app-gateway"),i=`CORE_APP_URL=${e}
2
+ `,s=`VITE_APP_ID=${r}
3
+ VITE_PARENT_ORIGIN=${e}
4
+ `;await Promise.all([o.writeFile(n.join(t,".dev.vars"),i),o.writeFile(n.join(t,".env.local"),s)])}async function j(t){return await o.mkdtemp(n.join(d.tmpdir(),t))}async function C(t,r=!1){try{await o.rm(t,{recursive:!0,force:!0}),r&&console.log(y.dim(` Removed: ${t}`))}catch{console.warn(y.yellow("\u26A0\uFE0F Warning: Failed to clean up temporary directory:"),t)}}export{g as a,u as b,O as c,R as d,j as e,C as f};
@@ -1,5 +1,5 @@
1
- import p from"node:fs";import l from"node:os";import d from"node:path";function A(e){return{process:e,os:l,fs:p,path:d}}import{buildApplication as g,buildRouteMap as C}from"@stricli/core";import{buildInstallCommand as v,buildUninstallCommand as D}from"@stricli/auto-complete";var r="@every-app/cli";var n="Every App CLI - Deploy and manage apps.";var a="0.0.9";import{buildCommand as o,buildRouteMap as m}from"@stricli/core";var c=o({loader:async()=>import("./create-NSFBGITH.js"),parameters:{positional:{kind:"tuple",parameters:[]}},docs:{brief:"Create a new app from the starter template",fullDescription:["Copies the simple-todo starter template and configures your local development environment.","","The command will:"," 1. Prompt for app ID (kebab-case) and package manager"," 2. Copy the template to a new directory"," 3. Create Cloudflare D1 database and KV namespace"," 4. Configure wrangler.jsonc, package.json, and .env files"," 5. Install dependencies and run local migrations","","After creation, run 'npm run dev' to start developing."].join(`
2
- `)}}),u=o({loader:async()=>{let{deploy:e}=await import("./deploy-EVIZXTLI.js");return e},parameters:{positional:{kind:"tuple",parameters:[]},flags:{verbose:{kind:"boolean",brief:"Show detailed output during deployment",optional:!0}}},docs:{brief:"Deploy an app to Cloudflare",fullDescription:["Deploys the current app to Cloudflare Workers from the current directory.","The deployment process:"," 1. Reads wrangler.jsonc to determine required resources"," 2. Creates or links D1 databases and KV namespaces"," 3. Updates wrangler.jsonc with resource IDs"," 4. Installs dependencies if needed"," 5. Runs database migrations against production D1"," 6. Builds and deploys using wrangler deploy"].join(`
1
+ import p from"node:fs";import l from"node:os";import d from"node:path";function A(e){return{process:e,os:l,fs:p,path:d}}import{buildApplication as g,buildRouteMap as C}from"@stricli/core";import{buildInstallCommand as v,buildUninstallCommand as D}from"@stricli/auto-complete";var r="@every-app/cli";var n="Every App CLI - Deploy and manage apps.";var a="0.0.11";import{buildCommand as o,buildRouteMap as m}from"@stricli/core";var c=o({loader:async()=>import("./create-7QPAFMNM.js"),parameters:{positional:{kind:"tuple",parameters:[]},flags:{verbose:{kind:"boolean",brief:"Show detailed output during creation",optional:!0}}},docs:{brief:"Create a new app from the starter template",fullDescription:["Copies the simple-todo starter template and configures your local development environment.","","The command will:"," 1. Prompt for app ID (kebab-case) and package manager"," 2. Copy the template to a new directory"," 3. Create Cloudflare D1 database and KV namespace"," 4. Configure wrangler.jsonc, package.json, and .env files"," 5. Install dependencies and run local migrations","","After creation, run 'npm run dev' to start developing."].join(`
2
+ `)}}),u=o({loader:async()=>{let{deploy:e}=await import("./deploy-UW25KWKD.js");return e},parameters:{positional:{kind:"tuple",parameters:[]},flags:{verbose:{kind:"boolean",brief:"Show detailed output during deployment",optional:!0}}},docs:{brief:"Deploy an app to Cloudflare",fullDescription:["Deploys the current app to Cloudflare Workers from the current directory.","The deployment process:"," 1. Reads wrangler.jsonc to determine required resources"," 2. Creates or links D1 databases and KV namespaces"," 3. Updates wrangler.jsonc with resource IDs"," 4. Installs dependencies if needed"," 5. Runs database migrations against production D1"," 6. Builds and deploys using wrangler deploy"].join(`
3
3
  `)}}),y=o({loader:async()=>{let{remoteD1Shell:e}=await import("./remoteD1Shell-KTDD4RTN.js");return e},parameters:{flags:{},positional:{kind:"array",parameter:{brief:"Command and arguments to run with environment variables",parse:String}}},docs:{brief:"Run a command with Cloudflare D1 connection environment variables",fullDescription:["Sets environment variables needed to connect to remote Cloudflare D1 and runs any command that requires D1 access.","","The command will:"," 1. Get the Cloudflare account ID"," 2. Look up the database ID from the database name in wrangler.jsonc"," 3. Get a valid OAuth token"," 4. Run the provided command with CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_DATABASE_ID, CLOUDFLARE_API_TOKEN, and MIGRATE_REMOTE set","","Common use cases:"," - Running Drizzle migrations: every app remote-d1-shell -- npx drizzle-kit migrate"," - Opening Drizzle Studio: every app remote-d1-shell -- npx drizzle-kit studio"," - Pushing schema changes: every app remote-d1-shell -- npx drizzle-kit push","","This command is useful for any operation that needs direct access to your production D1 database."].join(`
4
- `)}}),s=m({routes:{create:c,deploy:u,"remote-d1-shell":y},docs:{brief:"App management commands"}});import{buildCommand as f,buildRouteMap as b}from"@stricli/core";var h=f({loader:async()=>{let{deploy:e}=await import("./deploy-OU5FTS67.js");return e},parameters:{positional:{kind:"tuple",parameters:[]},flags:{repo:{kind:"parsed",parse:String,brief:"Git repository URL to deploy",optional:!0},verbose:{kind:"boolean",brief:"Show detailed output during deployment",optional:!0}}},docs:{brief:"Deploy the gateway application to Cloudflare",fullDescription:["Clones the gateway repository, installs dependencies, runs migrations, and deploys to Cloudflare Workers.","The deployment process:"," 1. Clones the repository to a temporary directory"," 2. Installs npm dependencies"," 3. Runs database migrations against production D1"," 4. Runs wrangler deploy"," 5. Cleans up temporary files"].join(`
4
+ `)}}),s=m({routes:{create:c,deploy:u,"remote-d1-shell":y},docs:{brief:"App management commands"}});import{buildCommand as f,buildRouteMap as b}from"@stricli/core";var h=f({loader:async()=>{let{deploy:e}=await import("./deploy-SBTNFRA7.js");return e},parameters:{positional:{kind:"tuple",parameters:[]},flags:{repo:{kind:"parsed",parse:String,brief:"Git repository URL to deploy",optional:!0},verbose:{kind:"boolean",brief:"Show detailed output during deployment",optional:!0}}},docs:{brief:"Deploy the gateway application to Cloudflare",fullDescription:["Clones the gateway repository, installs dependencies, runs migrations, and deploys to Cloudflare Workers.","The deployment process:"," 1. Clones the repository to a temporary directory"," 2. Installs npm dependencies"," 3. Runs database migrations against production D1"," 4. Runs wrangler deploy"," 5. Cleans up temporary files"].join(`
5
5
  `)}}),i=b({routes:{deploy:h},docs:{brief:"Gateway management commands"}});var w=C({routes:{app:s,gateway:i,install:v("every",{bash:"__every_bash_complete"}),uninstall:D("every",{bash:!0})},docs:{brief:n,hideRoute:{install:!0,uninstall:!0}}}),G=g(w,{name:r,versionInfo:{currentVersion:a},scanner:{allowArgumentEscapeSequence:!0}});export{A as a,G as b};
@@ -0,0 +1,32 @@
1
+ import{a as p,b as g,c as d,d as u,e as y,f}from"./chunk-EKUNMDBZ.js";import{a as l,b as m,d as k}from"./chunk-A5HLZBEH.js";import{d as w,h as b}from"./chunk-CQBCTFZE.js";import h from"node:fs/promises";import s from"node:path";import C from"enquirer";import e from"chalk";var E="git@github.com:every-app/every-app.git",I="templates/simple-todo";function $(a){return!a||a.trim().length===0?"App ID cannot be empty":a.length>64?"App ID must be 64 characters or less":/^[a-z][a-z0-9-]*$/.test(a)?!0:"App ID must be in kebab-case format (lowercase letters, numbers, and hyphens only, starting with a letter)"}async function j(){return(await C.prompt({type:"input",name:"appId",message:"Enter your app ID (kebab-case format)",initial:"my-cool-app",validate:$})).appId}async function x(){return(await C.prompt({type:"select",name:"packageManager",message:"Select your package manager",choices:[{name:"pnpm",message:"pnpm (recommended)"},{name:"npm",message:"npm"}],initial:0})).packageManager}async function A(a,n){let o=s.join(a,"package.json"),r=JSON.parse(await h.readFile(o,"utf-8"));r.name=n,await h.writeFile(o,JSON.stringify(r,null,2)+`
2
+ `,"utf-8")}async function M(a,n){try{await l("pnpm",["run","cf-typegen"],{cwd:a,verbose:n}),await l("pnpm",["run","build"],{cwd:a,verbose:n}),await l("npm",["run","db:migrate:local"],{cwd:a,verbose:n}),console.log(e.green(`
3
+ Local database migrations completed successfully
4
+ `))}catch{console.warn(e.yellow(`
5
+ Failed to run local migrations. You can run them manually with:`)),console.warn(e.dim(` npm run db:migrate:local
6
+ `))}}async function K(a){console.log(e.bold(`
7
+ Create a new Every App project
8
+ `));let n=null;try{console.log(e.bold(`Project Configuration
9
+ `));let o=await j(),r=await x();console.log(e.dim(`
10
+ Creating project: ${o}`)),console.log(e.dim(`Package manager: ${r}
11
+ `)),console.log(e.bold(`Cloning template repository...
12
+ `)),n=await y("every-app-create-"),await p(E,n),console.log(e.bold(`
13
+ Extracting template...
14
+ `));let P=s.join(n,I),t=s.join(process.cwd(),o);if(await d(t))throw new Error(`Directory "${o}" already exists in the current location`);await g(P,t,{exclude:["node_modules",".git","pnpm-lock.yaml","package-lock.json",".env.local",".env.production",".dev.vars","manual-steps.md"]}),console.log(e.green(`Template copied to ${t}
15
+ `)),console.log(e.bold(`Creating Cloudflare resources...
16
+ `));let i=await b(o),c=await k(o);console.log(e.green(`Cloudflare resources ready:
17
+ `)),console.log(e.dim(` D1 Database: ${o} (${i})`)),console.log(e.dim(` KV Namespace: ${o} (${c})
18
+ `)),console.log(e.bold(`Updating configuration files...
19
+ `));let D=s.join(t,"wrangler.jsonc");await w(D,{name:o,d1DatabaseId:i,d1DatabaseName:o,kvNamespaceId:c}),await A(t,o),await u(t,o),console.log(e.green(`Configuration updated
20
+ `)),console.log(e.bold(`Installing dependencies with ${r}...
21
+ `)),await m(r,t),console.log(e.green(`
22
+ Dependencies installed
23
+ `)),console.log(e.bold(`Running database migrations locally...
24
+ `));let v=a.verbose||!1;await M(t,v),console.log(e.bold.green(`
25
+ Project created successfully!
26
+ `)),console.log(e.dim(`Location: ${t}
27
+ `)),console.log(e.bold(`Next steps:
28
+ `)),console.log(e.cyan(` 1. cd ${o}`)),console.log(e.cyan(` 2. ${r} run dev`)),console.log(e.cyan(` 3. Open your browser and start building!
29
+ `)),console.log(e.bold(`Deploy to production:
30
+ `)),console.log(e.dim(` ${r} run db:migrate:prod # Run remote migrations`)),console.log(e.dim(` npm run deploy # Deploy to Cloudflare
31
+ `))}catch(o){throw console.error(e.red(`
32
+ Failed to create project:`),o instanceof Error?o.message:"Unknown error"),o}finally{n&&await f(n)}}export{K as default};
@@ -1,4 +1,4 @@
1
- import{a as y,e as w,f as T}from"./chunk-MLX4WISN.js";import{a as b}from"./chunk-B6LAGOID.js";import{a as m,b as u,d as C}from"./chunk-HFR3IFIX.js";import{b as f,c as E,d as _,e as R,h as A}from"./chunk-CQBCTFZE.js";import c from"chalk";import O from"node:path";import k from"node:path";import W from"node:crypto";import l from"chalk";import{execa as U}from"execa";import S from"node:crypto";import t from"chalk";function K(){return S.randomBytes(32).toString("base64")}function L(){let{privateKey:o,publicKey:e}=S.generateKeyPairSync("rsa",{modulusLength:2048,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:o,publicKey:e}}async function B(o){try{let{stdout:e}=await U("npx",["wrangler","secret","list","--format","json"],{cwd:o});return JSON.parse(e)}catch{return[]}}async function d(o,e){return(await B(e)).some(n=>n.name===o)}async function g(o,e,r){let n=U("npx",["wrangler","secret","put",o],{cwd:r});n.stdin&&(n.stdin.write(e),n.stdin.end()),await n}async function P(o,e){console.log(t.bold(`
1
+ import{a as y,e as w,f as T}from"./chunk-EKUNMDBZ.js";import{a as b}from"./chunk-B6LAGOID.js";import{a as m,b as u,d as A}from"./chunk-A5HLZBEH.js";import{b as f,c as E,d as _,e as R,h as C}from"./chunk-CQBCTFZE.js";import c from"chalk";import O from"node:path";import x from"node:path";import W from"node:crypto";import l from"chalk";import{execa as U}from"execa";import S from"node:crypto";import t from"chalk";function K(){return S.randomBytes(32).toString("base64")}function L(){let{privateKey:o,publicKey:e}=S.generateKeyPairSync("rsa",{modulusLength:2048,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:o,publicKey:e}}async function B(o){try{let{stdout:e}=await U("npx",["wrangler","secret","list","--format","json"],{cwd:o});return JSON.parse(e)}catch{return[]}}async function d(o,e){return(await B(e)).some(n=>n.name===o)}async function g(o,e,r){let n=U("npx",["wrangler","secret","put",o],{cwd:r});n.stdin&&(n.stdin.write(e),n.stdin.end()),await n}async function P(o,e){console.log(t.bold(`
2
2
  Setting up secrets...
3
3
  `));try{if(console.log(t.bold(`Checking secret: CORE_APP_URL
4
4
  `)),await d("CORE_APP_URL",e)?console.log(t.dim(` Secret already exists
@@ -19,23 +19,23 @@ Setting up secrets...
19
19
  `))}else throw new Error("JWT key pair is incomplete. Both JWT_PRIVATE_KEY and JWT_PUBLIC_KEY must exist together. Please delete the existing key and redeploy.");console.log(t.green(`Secret setup complete!
20
20
  `))}catch(r){throw console.error(t.red(`
21
21
  Failed to setup secrets`),r instanceof Error?t.dim(`
22
- ${r.message}`):""),r}}var x="git@github.com:every-app/every-app.git",J="every-app-gateway",H="every-app-gateway",N="apps/every-app-gateway";async function v(){console.log(l.bold(`
22
+ ${r.message}`):""),r}}var k="git@github.com:every-app/every-app.git",J="every-app-gateway",H="every-app-gateway",N="apps/every-app-gateway";async function v(){console.log(l.bold(`
23
23
  Setting up Cloudflare resources...
24
- `));let o=await f(),e=await A(J),r=await C(H);return{d1DatabaseId:e,kvNamespaceId:r,accountId:o}}async function I(o,e=!1){console.log(l.bold("Cloning gateway repository...")),console.log(l.dim(` Repository: ${x}
25
- `));try{await y(x,o,e);let r=k.join(o,N);return console.log(l.bold(`Installing dependencies in apps/every-app-gateway...
24
+ `));let o=await f(),e=await C(J),r=await A(H);return{d1DatabaseId:e,kvNamespaceId:r,accountId:o}}async function D(o,e=!1){console.log(l.bold("Cloning gateway repository...")),console.log(l.dim(` Repository: ${k}
25
+ `));try{await y(k,o,e);let r=x.join(o,N);return console.log(l.bold(`Installing dependencies in apps/every-app-gateway...
26
26
  `)),await u("pnpm",r,e),console.log(l.green(`Installation complete!
27
27
  `)),r}catch(r){throw console.error(l.red(`
28
28
  Failed to clone repository or install dependencies`),r instanceof Error?l.dim(`
29
- ${r.message}`):""),r}}async function h(o,e,r,n=!1){try{let s=k.join(o,"wrangler.jsonc");await _(s,{d1DatabaseId:e.d1DatabaseId,kvNamespaceId:e.kvNamespaceId}),await P(r,o),console.log(l.bold(`Deploying to Cloudflare...
30
- `));let i=W.randomUUID();await m("npm",["run","deploy"],{cwd:o,stdio:"inherit",env:{...process.env,BETTER_AUTH_SECRET:i},verbose:n})}catch(s){throw console.error(l.red(`
29
+ ${r.message}`):""),r}}async function I(o,e,r,n=!1){try{let s=x.join(o,"wrangler.jsonc");await _(s,{d1DatabaseId:e.d1DatabaseId,kvNamespaceId:e.kvNamespaceId}),await P(r,o),console.log(l.bold(`Deploying to Cloudflare...
30
+ `));let i=W.randomUUID();await m("npm",["run","deploy"],{cwd:o,description:"Deploying your Gateway to Cloudflare workers...",env:{...process.env,BETTER_AUTH_SECRET:i},verbose:n})}catch(s){throw console.error(l.red(`
31
31
  Failed to update config or deploy`),s instanceof Error?l.dim(`
32
32
  ${s.message}`):""),s}}async function de(o){let e=o.verbose||!1;if(!await b("Do you want to deploy EveryApp Gateway into this Cloudflare account?")){console.log(c.red(`
33
33
  Deployment cancelled by user
34
34
  `));return}let n=await v(),s=await w("gateway-deploy-");console.log(c.dim(`
35
35
  Working directory: ${s}
36
- `));let i=null;try{let a=await I(s,e);console.log(c.bold(`Determining worker URL...
37
- `));let p=O.join(a,"wrangler.jsonc"),D=await R(p);i=await E(D),console.log(c.green(`Worker will be deployed to: ${i}
38
- `)),await h(a,n,i,e)}catch(a){throw console.error(c.red(`
36
+ `));let i=null;try{let a=await D(s,e);console.log(c.bold(`Determining worker URL...
37
+ `));let p=O.join(a,"wrangler.jsonc"),h=await R(p);i=await E(h),console.log(c.green(`Worker will be deployed to: ${i}
38
+ `)),await I(a,n,i,e)}catch(a){throw console.error(c.red(`
39
39
  Deployment failed:`),a instanceof Error?a.message:a),a}finally{await T(s,e)}if(!i)throw new Error("Worker URL not net properly during deployment");console.log(c.bold.green(`\u{1F389} Gateway deployment successful!
40
40
  `)),console.log(c.bold(`Your gateway is now live at: ${c.cyan(i)}
41
41
  `)),console.log(c.dim(`Try it out by visiting the URL above in your browser.
@@ -0,0 +1,44 @@
1
+ import{a as R}from"./chunk-B6LAGOID.js";import{a as b,c as h,d as C}from"./chunk-A5HLZBEH.js";import{a as D,b as _,c as w,f as $,g as E,h as v}from"./chunk-CQBCTFZE.js";import o from"chalk";import T from"node:path";import k from"node:fs/promises";import{execa as I}from"execa";import*as g from"jsonc-parser";import{randomUUID as A}from"node:crypto";async function N(n,t){console.log(o.bold(`
2
+ Setting up Cloudflare resources...
3
+ `));let s=new Map,r=new Map;if(n.d1_databases&&n.d1_databases.length>0){console.log(o.bold(`Processing D1 databases...
4
+ `));for(let e=0;e<n.d1_databases.length;e++){let a=n.d1_databases[e].database_name;if(!a){console.warn(o.yellow(`Skipping D1 database at index ${e}: no database_name specified
5
+ `));continue}let l=await v(a);s.set(e,l)}}if(n.kv_namespaces&&n.kv_namespaces.length>0){console.log(o.bold(`Processing KV namespaces...
6
+ `));for(let e=0;e<n.kv_namespaces.length;e++){if(!n.kv_namespaces[e].binding){console.warn(o.yellow(`Skipping KV namespace at index ${e}: no binding specified
7
+ `));continue}let a=await C(t);r.set(e,a)}}return{d1Updates:s,kvUpdates:r}}async function S(n,t,s,r){console.log(o.bold(`Updating wrangler.jsonc with resource IDs...
8
+ `));let e=T.join(n,"wrangler.jsonc"),c=await k.readFile(e,"utf-8"),a=[];for(let[i,p]of t.entries())a.push(...g.modify(c,["d1_databases",i,"database_id"],p,{}));for(let[i,p]of s.entries())a.push(...g.modify(c,["kv_namespaces",i,"id"],p,{}));a.push(...g.modify(c,["vars","CORE_APP_URL"],r,{}));let l=g.applyEdits(c,a);await k.writeFile(e,l),console.log(o.green(`wrangler.jsonc updated successfully
9
+ `))}async function x(n,t){if(!t.d1_databases||t.d1_databases.length===0){console.log(o.dim(`No D1 databases configured, skipping migrations
10
+ `));return}console.log(o.bold(`Running database migrations...
11
+ `));try{console.log(o.dim(` Running production migrations...
12
+ `)),await I("npm",["run","db:migrate:prod"],{cwd:n,stdio:["inherit","inherit","inherit"]}),console.log(o.green(`Migrations completed
13
+ `))}catch{console.warn(o.yellow(`Failed to run migrations. You may need to run them manually with: npm run db:migrate:prod
14
+ `))}}async function j(n,t,s,r){console.log(o.bold(`Building and deploying to Cloudflare...
15
+ `));try{let e={...process.env,VITE_PARENT_ORIGIN:t,VITE_APP_ID:s};await b("npm",["run","deploy"],{cwd:n,description:"Deploying your application to Cloudflare workers...",env:e,verbose:r}),console.log(o.green(`
16
+ Deployment completed successfully!
17
+ `))}catch(e){throw console.error(o.red(`
18
+ Failed to build or deploy`)),e}}async function f(n,t,s){try{let r=await D(),e=await fetch(`https://api.cloudflare.com/client/v4/accounts/${n}/d1/database/${t}/query`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({sql:s})}),c=await e.json();if(!e.ok||!c.success){let i=c.errors?c.errors.map(p=>`[${p.code}] ${p.message}`).join(", "):e.statusText;throw console.error(o.red(`
19
+ D1 Query Error:`)),console.error(o.dim(`SQL: ${s}`)),console.error(o.dim(`Error: ${i}`)),new Error(`D1 query failed: ${i}`)}let a=c.result;if(!a||a.length===0)throw new Error("No results returned from D1 query");let l=a[0];if(!l)throw new Error("First result is undefined");return l.results}catch(r){throw r instanceof Error&&!r.message.includes("D1 query failed")&&(console.error(o.red(`
20
+ D1 Query Error:`)),console.error(o.dim(`SQL: ${s}`))),r}}async function M(n,t,s,r){console.log(o.bold(`
21
+ Setting up UserApp records...
22
+ `));try{let e=await _(),a=(await E()).find(d=>d.name==="every-app-gateway");if(!a){console.warn(o.yellow(`every-app-gateway database not found. Skipping UserApp record creation.
23
+ `));return}let l=a.uuid,i=await f(e,l,"SELECT id, name, email FROM users");if(i.length===0)throw new Error("No users found in the database. Please create a user first before deploying apps.");let p=s||n,m=r||n;if(i.length===1){let d=i[0],u=Math.floor(Date.now()/1e3);if((await f(e,l,`SELECT id FROM user_apps WHERE user_id = '${d.id}' AND app_id = '${n}'`)).length>0)console.log(o.yellow(`UserApp record already exists for user ${d.name} (${d.email}), skipping...
24
+ `));else{let y=`
25
+ INSERT INTO user_apps (id, user_id, app_id, name, description, app_url, created_at, updated_at)
26
+ VALUES ('${A()}', '${d.id}', '${n}', '${p}', '${m}', '${t}', ${u}, ${u})
27
+ `;await f(e,l,y),console.log(o.green(`UserApp record created for user ${d.name} (${d.email})
28
+ `))}}else{console.log(o.yellow(`Multiple users found (${i.length}). Adding app to all users...
29
+ `));for(let d of i){let u=Math.floor(Date.now()/1e3);if((await f(e,l,`SELECT id FROM user_apps WHERE user_id = '${d.id}' AND app_id = '${n}'`)).length>0)console.log(o.dim(` App already exists for user ${d.name} (${d.email}), skipping...
30
+ `));else{let y=`
31
+ INSERT INTO user_apps (id, user_id, app_id, name, description, app_url, created_at, updated_at)
32
+ VALUES ('${A()}', '${d.id}', '${n}', '${p}', '${m}', '${t}', ${u}, ${u})
33
+ `;await f(e,l,y),console.log(o.dim(` Added app for user ${d.name} (${d.email})
34
+ `))}}console.log(o.green(`UserApp records processed for ${i.length} users
35
+ `))}}catch(e){throw console.error(o.red("Failed to insert UserApp records:"),e instanceof Error?e.message:e),e}}async function F(n,t=!1,s=!1){try{console.log(o.bold(`
36
+ Reading project configuration...
37
+ `));let r=await $(n);if(!r.name)throw new Error("Worker name not found in wrangler.jsonc. Please add a 'name' field.");let e=r.name;if(console.log(o.dim(`Project name: ${e}
38
+ `)),!t&&!await R("Do you want to deploy this app to Cloudflare?")){console.log(o.red(`
39
+ Deployment cancelled by user
40
+ `));return}let{d1Updates:c,kvUpdates:a}=await N(r,e),l=await w("every-app-gateway");await S(n,c,a,l),await h(n,s),await x(n,r),await j(n,l,e,s);let i=await w(r.name),p,m;r.name==="every-todo-app"&&(p="Todos",m="Minimal todo list"),await M(r.name,i,p,m),console.log(o.bold.green(`\u{1F389} Deployment successful!
41
+ `)),console.log(o.bold(`Your app is now live at: ${o.cyan(i)}
42
+ `)),console.log(o.dim(`Try it out by visiting the URL above in your browser.
43
+ `))}catch(r){throw console.error(o.red(`
44
+ Deployment failed:`),r instanceof Error?r.message:r),r}}async function J(n){let t=process.cwd(),s=n.verbose||!1;await F(t,!1,s)}export{J as deploy};
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as r,b as o}from"./chunk-KRQD7ZWZ.js";import{run as i}from"@stricli/core";await i(o,process.argv.slice(2),r(process));
2
+ import{a as r,b as o}from"./chunk-GRM44DCG.js";import{run as i}from"@stricli/core";await i(o,process.argv.slice(2),r(process));
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "Every App CLI - Deploy and manage apps.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "version": "0.0.9",
7
+ "version": "0.0.11",
8
8
  "files": [
9
9
  "dist"
10
10
  ],
@@ -1,13 +0,0 @@
1
- import{execa as f}from"execa";import c from"chalk";async function p(e,n,o={}){let{env:t,cwd:r,verbose:m=!1}=o;if(m){console.log(c.dim(` \u250C\u2500 Running: ${e} ${n.join(" ")}`));let s=f(e,n,{cwd:r,env:t,stdio:void 0,all:!0});s.stdout&&s.stdout.on("data",l=>{l.toString().split(`
2
- `).forEach(a=>{a.trim()&&console.log(c.dim(` \u2502 ${a}`))})}),s.stderr&&s.stderr.on("data",l=>{l.toString().split(`
3
- `).forEach(a=>{a.trim()&&console.error(c.dim(` \u2502 ${a}`))})});let w=await s;return console.log(c.dim(` \u2514\u2500 Complete
4
- `)),w}else return console.log(`Running: ${e} ${n.join(" ")}`),await f(e,n,{cwd:r,env:t,stdio:"pipe"})}import u from"node:fs/promises";import g from"node:path";import d from"chalk";async function y(e,n,o=!1){try{if(e==="pnpm"){await p("npx",["pnpm","install"],{cwd:n,stdio:"inherit",verbose:o});return}await p(e,["install"],{cwd:n,stdio:"inherit",verbose:o})}catch(t){throw new Error(`Failed to install dependencies with ${e}: ${t instanceof Error?t.message:"Unknown error"}`)}}async function $(e){try{return(await u.stat(g.join(e,"node_modules"))).isDirectory()}catch{return!1}}async function C(e,n=!1){if(!await $(e)){console.log(d.bold(`Installing dependencies...
5
- `));try{let t=await u.access(g.join(e,"pnpm-lock.yaml")).then(()=>!0).catch(()=>!1),r=await u.access(g.join(e,"package-lock.json")).then(()=>!0).catch(()=>!1);await y(t?"pnpm":r?"npm":"pnpm",e,n),console.log(d.green(`Dependencies installed
6
- `))}catch(t){throw console.error(d.red(`
7
- Failed to install dependencies`)),t}}}import{execa as h}from"execa";import i from"chalk";async function x(){let{stdout:e}=await h("npx",["wrangler","kv","namespace","list"]);return JSON.parse(e)}async function P(e){let{stdout:n}=await h("npx",["wrangler","kv","namespace","create",e]);return b(n)}function b(e){let n=e.match(/"id":\s*"([a-f0-9]+)"/);if(!n||!n[1])throw new Error("Failed to parse namespace ID from wrangler output");return n[1]}async function S(e){console.log(i.bold(`Checking KV namespace: ${e}
8
- `));try{let o=(await x()).find(r=>r.title===e);if(o)return console.log(i.green(`Linking to existing KV namespace: ${e} (${o.id})
9
- `)),o.id;console.log(i.bold(`Creating new KV namespace: ${e}
10
- `));let t=await P(e);return console.log(i.green(`Created KV namespace: ${e} (${t})
11
- `)),t}catch(n){throw console.error(i.red(`
12
- Failed to get or create KV namespace: ${e}`),n instanceof Error?i.dim(`
13
- ${n.message}`):""),n}}export{p as a,y as b,C as c,S as d};
@@ -1,4 +0,0 @@
1
- import{a as m}from"./chunk-HFR3IFIX.js";import{c as p}from"./chunk-CQBCTFZE.js";async function g(t,e,r=!1){try{await m("git",["clone",t,e],{stdio:"inherit",verbose:r})}catch(i){throw new Error(`Failed to clone repository from ${t}: ${i instanceof Error?i.message:"Unknown error"}`)}}import o from"node:fs/promises";import n from"node:path";import f from"node:os";import y from"chalk";async function u(t,e,r={}){let i=r.exclude||[];await o.mkdir(e,{recursive:!0});let s=await o.readdir(t,{withFileTypes:!0});for(let a of s){let c=n.join(t,a.name),l=n.join(e,a.name);i.some(d=>a.name===d)||(a.isDirectory()?await u(c,l,r):await o.copyFile(c,l))}}async function O(t){try{return(await o.stat(t)).isDirectory()}catch{return!1}}async function R(t,e){let r=await p("every-app-gateway"),i=`CORE_APP_URL=${r}
2
- `,s=`VITE_APP_ID=${e}
3
- VITE_PARENT_ORIGIN=${r}
4
- `;await Promise.all([o.writeFile(n.join(t,".dev.vars"),i),o.writeFile(n.join(t,".env.local"),s)])}async function j(t){return await o.mkdtemp(n.join(f.tmpdir(),t))}async function I(t,e=!1){try{await o.rm(t,{recursive:!0,force:!0}),e&&console.log(y.dim(` Removed: ${t}`))}catch{console.warn(y.yellow("\u26A0\uFE0F Warning: Failed to clean up temporary directory:"),t)}}export{g as a,u as b,O as c,R as d,j as e,I as f};
@@ -1,32 +0,0 @@
1
- import{a as c,b as g,c as m,d,e as u,f as y}from"./chunk-MLX4WISN.js";import{b as p,d as b}from"./chunk-HFR3IFIX.js";import{d as f,h as w}from"./chunk-CQBCTFZE.js";import h from"node:fs/promises";import l from"node:path";import k from"enquirer";import{execa as D}from"execa";import e from"chalk";var v="git@github.com:every-app/every-app.git",E="templates/simple-todo";function I(a){return!a||a.trim().length===0?"App ID cannot be empty":a.length>64?"App ID must be 64 characters or less":/^[a-z][a-z0-9-]*$/.test(a)?!0:"App ID must be in kebab-case format (lowercase letters, numbers, and hyphens only, starting with a letter)"}async function $(){return(await k.prompt({type:"input",name:"appId",message:"Enter your app ID (kebab-case format)",initial:"my-cool-app",validate:I})).appId}async function j(){return(await k.prompt({type:"select",name:"packageManager",message:"Select your package manager",choices:[{name:"pnpm",message:"pnpm (recommended)"},{name:"npm",message:"npm"}],initial:0})).packageManager}async function x(a,n){let o=l.join(a,"package.json"),r=JSON.parse(await h.readFile(o,"utf-8"));r.name=n,await h.writeFile(o,JSON.stringify(r,null,2)+`
2
- `,"utf-8")}async function A(a){try{await D("npm",["run","db:migrate:local"],{cwd:a,stdio:["inherit","inherit","inherit"]}),console.log(e.green(`
3
- Local database migrations completed successfully
4
- `))}catch{console.warn(e.yellow(`
5
- Failed to run local migrations. You can run them manually with:`)),console.warn(e.dim(` npm run db:migrate:local
6
- `))}}async function z(a){console.log(e.bold(`
7
- Create a new Every App project
8
- `));let n=null;try{console.log(e.bold(`Project Configuration
9
- `));let o=await $(),r=await j();console.log(e.dim(`
10
- Creating project: ${o}`)),console.log(e.dim(`Package manager: ${r}
11
- `)),console.log(e.bold(`Cloning template repository...
12
- `)),n=await u("every-app-create-"),await c(v,n),console.log(e.bold(`
13
- Extracting template...
14
- `));let P=l.join(n,E),t=l.join(process.cwd(),o);if(await m(t))throw new Error(`Directory "${o}" already exists in the current location`);await g(P,t,{exclude:["node_modules",".git","pnpm-lock.yaml","package-lock.json",".env.local",".env.production",".dev.vars","manual-steps.md"]}),console.log(e.green(`Template copied to ${t}
15
- `)),console.log(e.bold(`Creating Cloudflare resources...
16
- `));let s=await w(o),i=await b(o);console.log(e.green(`Cloudflare resources ready:
17
- `)),console.log(e.dim(` D1 Database: ${o} (${s})`)),console.log(e.dim(` KV Namespace: ${o} (${i})
18
- `)),console.log(e.bold(`Updating configuration files...
19
- `));let C=l.join(t,"wrangler.jsonc");await f(C,{name:o,d1DatabaseId:s,d1DatabaseName:o,kvNamespaceId:i}),await x(t,o),await d(t,o),console.log(e.green(`Configuration updated
20
- `)),console.log(e.bold(`Installing dependencies with ${r}...
21
- `)),await p(r,t),console.log(e.green(`
22
- Dependencies installed
23
- `)),console.log(e.bold(`Running database migrations locally...
24
- `)),await A(t),console.log(e.bold.green(`
25
- Project created successfully!
26
- `)),console.log(e.dim(`Location: ${t}
27
- `)),console.log(e.bold(`Next steps:
28
- `)),console.log(e.cyan(` 1. cd ${o}`)),console.log(e.cyan(` 2. ${r} run dev`)),console.log(e.cyan(` 3. Open your browser and start building!
29
- `)),console.log(e.bold(`Deploy to production:
30
- `)),console.log(e.dim(` ${r} run db:migrate:prod # Run remote migrations`)),console.log(e.dim(` npm run deploy # Deploy to Cloudflare
31
- `))}catch(o){throw console.error(e.red(`
32
- Failed to create project:`),o instanceof Error?o.message:"Unknown error"),o}finally{n&&await y(n)}}export{z as default};
@@ -1,44 +0,0 @@
1
- import{a as C}from"./chunk-B6LAGOID.js";import{a as y,c as D,d as R}from"./chunk-HFR3IFIX.js";import{a as _,b as $,c as b,f as E,g as v,h as k}from"./chunk-CQBCTFZE.js";import n from"chalk";import U from"node:path";import h from"node:fs/promises";import{execa as N}from"execa";import*as g from"jsonc-parser";import{randomUUID as A}from"node:crypto";async function T(o,t){console.log(n.bold(`
2
- Setting up Cloudflare resources...
3
- `));let a=new Map,r=new Map;if(o.d1_databases&&o.d1_databases.length>0){console.log(n.bold(`Processing D1 databases...
4
- `));for(let e=0;e<o.d1_databases.length;e++){let s=o.d1_databases[e].database_name;if(!s){console.warn(n.yellow(`Skipping D1 database at index ${e}: no database_name specified
5
- `));continue}let c=await k(s);a.set(e,c)}}if(o.kv_namespaces&&o.kv_namespaces.length>0){console.log(n.bold(`Processing KV namespaces...
6
- `));for(let e=0;e<o.kv_namespaces.length;e++){if(!o.kv_namespaces[e].binding){console.warn(n.yellow(`Skipping KV namespace at index ${e}: no binding specified
7
- `));continue}let s=await R(t);r.set(e,s)}}return{d1Updates:a,kvUpdates:r}}async function S(o,t,a,r){console.log(n.bold(`Updating wrangler.jsonc with resource IDs...
8
- `));let e=U.join(o,"wrangler.jsonc"),i=await h.readFile(e,"utf-8"),s=[];for(let[d,p]of t.entries())s.push(...g.modify(i,["d1_databases",d,"database_id"],p,{}));for(let[d,p]of a.entries())s.push(...g.modify(i,["kv_namespaces",d,"id"],p,{}));s.push(...g.modify(i,["vars","CORE_APP_URL"],r,{}));let c=g.applyEdits(i,s);await h.writeFile(e,c),console.log(n.green(`wrangler.jsonc updated successfully
9
- `))}async function j(o,t){if(!t.d1_databases||t.d1_databases.length===0){console.log(n.dim(`No D1 databases configured, skipping migrations
10
- `));return}console.log(n.bold(`Running database migrations...
11
- `));try{console.log(n.dim(` Running production migrations...
12
- `)),await N("npm",["run","db:migrate:prod"],{cwd:o,stdio:["inherit","inherit","inherit"]}),console.log(n.green(`Migrations completed
13
- `))}catch{console.warn(n.yellow(`Failed to run migrations. You may need to run them manually with: npm run db:migrate:prod
14
- `))}}async function x(o,t,a,r){console.log(n.bold(`Building and deploying to Cloudflare...
15
- `));try{let e=U.join(o,"package.json"),i=JSON.parse(await h.readFile(e,"utf-8")),s={...process.env,VITE_PARENT_ORIGIN:t,VITE_APP_ID:a};i.scripts?.deploy?await y("npm",["run","deploy"],{cwd:o,stdio:"inherit",env:s,verbose:r}):(await y("npm",["run","build"],{cwd:o,stdio:"inherit",env:s,verbose:r}),await y("npx",["wrangler","deploy"],{cwd:o,stdio:"inherit",env:s,verbose:r})),console.log(n.green(`
16
- Deployment completed successfully!
17
- `))}catch(e){throw console.error(n.red(`
18
- Failed to build or deploy`)),e}}async function f(o,t,a){try{let r=await _(),e=await fetch(`https://api.cloudflare.com/client/v4/accounts/${o}/d1/database/${t}/query`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({sql:a})}),i=await e.json();if(!e.ok||!i.success){let d=i.errors?i.errors.map(p=>`[${p.code}] ${p.message}`).join(", "):e.statusText;throw console.error(n.red(`
19
- D1 Query Error:`)),console.error(n.dim(`SQL: ${a}`)),console.error(n.dim(`Error: ${d}`)),new Error(`D1 query failed: ${d}`)}let s=i.result;if(!s||s.length===0)throw new Error("No results returned from D1 query");let c=s[0];if(!c)throw new Error("First result is undefined");return c.results}catch(r){throw r instanceof Error&&!r.message.includes("D1 query failed")&&(console.error(n.red(`
20
- D1 Query Error:`)),console.error(n.dim(`SQL: ${a}`))),r}}async function M(o,t,a,r){console.log(n.bold(`
21
- Setting up UserApp records...
22
- `));try{let e=await $(),s=(await v()).find(l=>l.name==="every-app-gateway");if(!s){console.warn(n.yellow(`every-app-gateway database not found. Skipping UserApp record creation.
23
- `));return}let c=s.uuid,d=await f(e,c,"SELECT id, name, email FROM users");if(d.length===0)throw new Error("No users found in the database. Please create a user first before deploying apps.");let p=a||o,u=r||o;if(d.length===1){let l=d[0],m=Math.floor(Date.now()/1e3);if((await f(e,c,`SELECT id FROM user_apps WHERE user_id = '${l.id}' AND app_id = '${o}'`)).length>0)console.log(n.yellow(`UserApp record already exists for user ${l.name} (${l.email}), skipping...
24
- `));else{let w=`
25
- INSERT INTO user_apps (id, user_id, app_id, name, description, app_url, status, created_at, updated_at)
26
- VALUES ('${A()}', '${l.id}', '${o}', '${p}', '${u}', '${t}', 'installed', ${m}, ${m})
27
- `;await f(e,c,w),console.log(n.green(`UserApp record created for user ${l.name} (${l.email})
28
- `))}}else{console.log(n.yellow(`Multiple users found (${d.length}). Adding app to all users...
29
- `));for(let l of d){let m=Math.floor(Date.now()/1e3);if((await f(e,c,`SELECT id FROM user_apps WHERE user_id = '${l.id}' AND app_id = '${o}'`)).length>0)console.log(n.dim(` App already exists for user ${l.name} (${l.email}), skipping...
30
- `));else{let w=`
31
- INSERT INTO user_apps (id, user_id, app_id, name, description, app_url, status, created_at, updated_at)
32
- VALUES ('${A()}', '${l.id}', '${o}', '${p}', '${u}', '${t}', 'installed', ${m}, ${m})
33
- `;await f(e,c,w),console.log(n.dim(` Added app for user ${l.name} (${l.email})
34
- `))}}console.log(n.green(`UserApp records processed for ${d.length} users
35
- `))}}catch(e){throw console.error(n.red("Failed to insert UserApp records:"),e instanceof Error?e.message:e),e}}async function O(o,t=!1,a=!1){try{console.log(n.bold(`
36
- Reading project configuration...
37
- `));let r=await E(o);if(!r.name)throw new Error("Worker name not found in wrangler.jsonc. Please add a 'name' field.");let e=r.name;if(console.log(n.dim(`Project name: ${e}
38
- `)),!t&&!await C("Do you want to deploy this app to Cloudflare?")){console.log(n.red(`
39
- Deployment cancelled by user
40
- `));return}let{d1Updates:i,kvUpdates:s}=await T(r,e),c=await b("every-app-gateway");await S(o,i,s,c),await D(o,a),await j(o,r),await x(o,c,e,a);let d=await b(r.name),p,u;r.name==="every-todo-app"&&(p="Todos",u="Minimal todo list"),await M(r.name,d,p,u),console.log(n.bold.green(`\u{1F389} Deployment successful!
41
- `)),console.log(n.bold(`Your app is now live at: ${n.cyan(d)}
42
- `)),console.log(n.dim(`Try it out by visiting the URL above in your browser.
43
- `))}catch(r){throw console.error(n.red(`
44
- Deployment failed:`),r instanceof Error?r.message:r),r}}async function G(o){let t=process.cwd(),a=o.verbose||!1;await O(t,!1,a)}export{G as deploy};