@every-app/cli 0.0.11 → 0.0.13
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/bash-complete.js +1 -1
- package/dist/chunk-5PTHALCD.js +7 -0
- package/dist/chunk-65T2UMWS.js +6 -0
- package/dist/chunk-FQY6RMLS.js +16 -0
- package/dist/chunk-MOGNJRIZ.js +6 -0
- package/dist/{chunk-GRM44DCG.js → chunk-ZBPM4ZWH.js} +4 -4
- package/dist/create-ZQQ5K45E.js +30 -0
- package/dist/deploy-XLA22GPF.js +31 -0
- package/dist/deploy-Z5667ULH.js +19 -0
- package/dist/index.js +1 -1
- package/dist/{remoteD1Shell-KTDD4RTN.js → remoteD1Shell-MWQWKJA4.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-A5HLZBEH.js +0 -13
- package/dist/chunk-B6LAGOID.js +0 -6
- package/dist/chunk-CQBCTFZE.js +0 -7
- package/dist/chunk-EKUNMDBZ.js +0 -4
- package/dist/create-7QPAFMNM.js +0 -32
- package/dist/deploy-SBTNFRA7.js +0 -43
- package/dist/deploy-UW25KWKD.js +0 -44
package/dist/bash-complete.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as o,b as s}from"./chunk-
|
|
2
|
+
import{a as o,b as s}from"./chunk-ZBPM4ZWH.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,7 @@
|
|
|
1
|
+
import{execa as w}from"execa";import{execa as p}from"execa";import a from"chalk";async function d(e,n,t){let{env:o,cwd:r,verbose:i=!1,description:m,logCommandToConsole:l=!0}=t;return i?u(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 u(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 i=p(e,n,{cwd:o,env:r,stdio:void 0,all:!0});i.stdout&&i.stdout.on("data",l=>{l.toString().split(`
|
|
2
|
+
`).forEach(s=>{s.trim()&&console.log(a.dim(` \u2502 ${s}`))})}),i.stderr&&i.stderr.on("data",l=>{l.toString().split(`
|
|
3
|
+
`).forEach(s=>{s.trim()&&console.error(a.dim(` \u2502 ${s}`))})});let m=await i;return console.log(a.dim(` \u2514\u2500 Complete
|
|
4
|
+
`)),m}async function h(){try{return await w("pnpm",["--version"],{stdio:"pipe"}),!0}catch{return!1}}async function P(e,n,t=!1){let o=await h();try{o?await d("pnpm",["install"],{cwd:e,verbose:t,description:n}):await d("npx",["pnpm","install"],{cwd:e,verbose:t,description:n})}catch(r){throw new Error(`Failed to install dependencies with pnpm: ${r instanceof Error?r.message:"Unknown error"}`)}}import{execa as g}from"execa";import c from"chalk";async function x(){let{stdout:e}=await g("npx",["wrangler","kv","namespace","list"]);return JSON.parse(e)}async function $(e){let{stdout:n}=await g("npx",["wrangler","kv","namespace","create",e]);return C(n)}function C(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 O(e,n=!1){n&&console.log(` Checking KV namespace: ${e}`);try{let o=(await x()).find(i=>i.title===e);if(o)return console.log(n?c.dim(` Linking to existing KV namespace: ${e} (${o.id})
|
|
5
|
+
`):" KV already set up."),o.id;n&&console.log(c.dim(` Creating new KV namespace: ${e}`));let r=await $(e);return console.log(n?c.green(` Created KV namespace: ${e} (${r})
|
|
6
|
+
`):c.green(" KV successfully created.")),r}catch(t){throw console.error(c.red(`Failed to get or create KV namespace: ${e}`),t instanceof Error?c.dim(`
|
|
7
|
+
${t.message}`):""),t}}export{d as a,P as b,O as c};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import k from"node:fs/promises";import d from"node:path";import g from"node:os";import*as u from"smol-toml";function y(){let e=g.homedir(),n=g.platform(),r;return n==="win32"?r=d.join(process.env.LOCALAPPDATA||d.join(e,"AppData","Local"),".wrangler"):n==="darwin"?r=d.join(e,"Library","Preferences",".wrangler"):r=d.join(e,".wrangler"),d.join(r,"config","default.toml")}async function b(){let e=y();try{let n=await k.readFile(e,"utf-8"),r=u.parse(n);if(!r.oauth_token||!r.refresh_token)throw new Error("OAuth tokens not found in wrangler config");return r}catch(n){throw n.code==="ENOENT"?new Error("Wrangler config not found. Please run 'npx wrangler login' first."):n}}function D(e){let n=new Date(e).getTime(),r=Date.now(),t=1*60*1e3;return n-r<t}async function _(e){let n=await fetch("https://dash.cloudflare.com/oauth2/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:e})});if(!n.ok)throw new Error(`Failed to refresh OAuth token: ${n.status} ${n.statusText}`);let r=await n.json();return{oauth_token:r.access_token,expiration_time:new Date(Date.now()+r.expires_in*1e3).toISOString(),refresh_token:r.refresh_token||e,scopes:r.scope?r.scope.split(" "):[]}}async function j(){let e=await b();return D(e.expiration_time)?(await _(e.refresh_token)).oauth_token:e.oauth_token}async function l(e,n={}){let r=await j(),t=await fetch(`https://api.cloudflare.com/client/v4${e}`,{...n,headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json",...n.headers}}),o=await t.json();if(!t.ok){let a=o.errors?o.errors.map(i=>`[${i.code}] ${i.message}`).join(", "):t.statusText;throw new Error(`Cloudflare API request failed: ${t.status} ${a}`)}if(!o.success){let a=o.errors.map(i=>`[${i.code}] ${i.message}`).join(", ");throw new Error(`Cloudflare API error: ${a}`)}return o.result}async function E(){let e=await l("/accounts");if(!e||e.length===0)throw new Error("No Cloudflare accounts found");let n=e[0];if(!n)throw new Error("No Cloudflare accounts found");return n.id}async function v(e){try{let n=await l(`/accounts/${e}/workers/subdomain`);if(!n||!n.subdomain)throw new Error("No workers.dev subdomain found for this account");return n.subdomain}catch(n){throw new Error(`Failed to get workers.dev subdomain: ${n instanceof Error?n.message:"Unknown error"}`)}}async function O(e,n){let r=n||await E(),t=await v(r);return`https://${e}.${t}.workers.dev`}import{execa as m}from"execa";import c from"chalk";async function x(){let{stdout:e}=await m("npx",["wrangler","d1","list","--json"]);return JSON.parse(e)}async function A(e){let{stdout:n}=await m("npx",["wrangler","d1","create",e]),r=n.match(/"database_id":\s*"([^"]+)"/);if(!r||!r[1])throw new Error("Failed to parse database ID from wrangler output");return r[1]}async function N(e,n=!1){n&&console.log(` Checking D1 database: ${e}`);try{let t=(await x()).find(a=>a.name===e);if(t)return console.log(n?c.dim(` Linking to existing D1 database: ${e} (${t.uuid})
|
|
2
|
+
`):" D1 already set up."),t.uuid;n&&console.log(c.dim(` Creating new D1 database: ${e}`));let o=await A(e);return console.log(n?c.green(` Created D1 database: ${e} (${o})
|
|
3
|
+
`):c.green(` D1 successfully created.
|
|
4
|
+
`)),o}catch(r){throw console.error(c.red(`Failed to get or create D1 database: ${e}`),r instanceof Error?c.dim(`
|
|
5
|
+
${r.message}`):""),r}}import f from"node:fs/promises";import w from"node:path";import*as s from"jsonc-parser";import P from"chalk";async function M(e){e.verbose&&console.log("Updating wrangler.jsonc with resource IDs and configuration...");let n=e.configPath;(await f.stat(n)).isDirectory()&&(n=w.join(n,"wrangler.jsonc"));let t=await f.readFile(n,"utf-8"),o=s.parse(t),a=[];if(o.d1_databases){if(o.d1_databases.length===0)throw new Error("No D1 databases found in wrangler.jsonc. Every app must have exactly one D1 database.");if(o.d1_databases.length>1)throw new Error(`Found ${o.d1_databases.length} D1 databases in wrangler.jsonc. Every app must have exactly one D1 database.`)}if(o.kv_namespaces){if(o.kv_namespaces.length===0)throw new Error("No KV namespaces found in wrangler.jsonc. Every app must have exactly one KV namespace.");if(o.kv_namespaces.length>1)throw new Error(`Found ${o.kv_namespaces.length} KV namespaces in wrangler.jsonc. Every app must have exactly one KV namespace.`)}if(e.name&&a.push(...s.modify(t,["name"],e.name,{})),e.d1DatabaseId&&a.push(...s.modify(t,["d1_databases",0,"database_id"],e.d1DatabaseId,{})),e.d1DatabaseName&&a.push(...s.modify(t,["d1_databases",0,"database_name"],e.d1DatabaseName,{})),e.kvNamespaceId&&a.push(...s.modify(t,["kv_namespaces",0,"id"],e.kvNamespaceId,{})),e.vars)for(let[h,p]of Object.entries(e.vars))a.push(...s.modify(t,["vars",h],p,{}));let i=s.applyEdits(t,a);await f.writeFile(n,i),e.verbose&&console.log(P.dim(` wrangler.jsonc updated successfully
|
|
6
|
+
`))}async function V(e){let n=await f.readFile(e,"utf-8"),r=s.parse(n);if(!r.name||typeof r.name!="string")throw new Error("Worker name not found in wrangler.jsonc");return r.name}async function K(e){let n=w.join(e,"wrangler.jsonc");try{let r=await f.readFile(n,"utf-8");return s.parse(r)}catch(r){throw r instanceof Error&&"code"in r&&r.code==="ENOENT"?new Error("wrangler.jsonc not found in current directory. Make sure you're running this command from your app's root directory."):r}}export{j as a,l as b,E as c,v as d,O as e,x as f,N as g,M as h,V as i,K as j};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{b as l,c as d,d as u}from"./chunk-65T2UMWS.js";import s from"chalk";import m from"enquirer";import{execa as g}from"execa";async function x(e="Do you want to deploy to Cloudflare?"){console.log(`Checking Cloudflare account...
|
|
2
|
+
`);try{let{stdout:n}=await g("npx",["wrangler","whoami"],{reject:!1}),t=n.split(`
|
|
3
|
+
`),r=[],o=!1;for(let a of t)if(r.push(a),a.includes("\u2514\u2500")&&a.includes("\u2534\u2500")&&a.includes("\u2518")){o=!0;break}let i=o?r.join(`
|
|
4
|
+
`):n;return console.log(s.dim(i)),console.log(),(await m.prompt({type:"confirm",name:"confirm",message:e,initial:!1})).confirm}catch(n){throw console.error(s.red(`
|
|
5
|
+
Failed to retrieve Cloudflare account information`)),console.error(s.dim(` Make sure you're logged in with: npx wrangler login
|
|
6
|
+
`)),n}}async function p(e,n){try{let t=n?{subdomain:n}:{},r=await l(`/accounts/${e}/workers/subdomain`,{method:"PUT",body:JSON.stringify(t)});if(!r||!r.subdomain)throw new Error("Failed to initialize workers.dev subdomain");return r.subdomain}catch(t){throw new Error(`Failed to initialize workers.dev subdomain: ${t instanceof Error?t.message:"Unknown error"}`)}}async function C(){let e=await d();try{return await u(e)}catch{console.log(s.yellow(`No workers.dev subdomain found for this account.
|
|
7
|
+
`)),console.log(s.dim("A workers.dev subdomain is required to deploy Workers applications.")),console.log(s.dim(`This subdomain will be used for all Workers you deploy: [worker-name].[subdomain].workers.dev
|
|
8
|
+
`));let r=(await m.prompt({type:"input",name:"subdomain",message:"Choose a subdomain name (alphanumeric and hyphens only):",validate:o=>!o||o.trim()===""?"Subdomain cannot be empty":/^[a-z0-9-]+$/.test(o)?o.startsWith("-")||o.endsWith("-")?"Subdomain cannot start or end with a hyphen":!0:"Subdomain must contain only lowercase letters, numbers, and hyphens"})).subdomain.trim();console.log(s.dim(`
|
|
9
|
+
Creating workers.dev subdomain: ${r}...
|
|
10
|
+
`));try{let o=await p(e,r);return console.log(s.green(`Successfully created subdomain: ${s.cyan(o)}
|
|
11
|
+
`)),o}catch(o){throw console.error(s.red(`
|
|
12
|
+
Failed to create workers.dev subdomain`),s.dim(`
|
|
13
|
+
${o instanceof Error?o.message:"Unknown error"}`)),o}}}import{execa as f}from"execa";import c from"chalk";async function b(e){let{stdout:n}=await f("npx",["wrangler","secret","list","--format","json"],{cwd:e});return JSON.parse(n)}async function P(e,n,t=!1){t&&console.log(c.dim(` Checking secret: ${e}`));let o=(await b(n)).some(i=>i.name===e);return o&&t&&console.log(c.dim(` Secret already exists
|
|
14
|
+
`)),o}async function E(e,n,t,r=!1,o){r&&o&&console.log(c.dim(` ${o}
|
|
15
|
+
`));let i=f("npx",["wrangler","secret","put",e],{cwd:t});i.stdin&&(i.stdin.write(n),i.stdin.end()),await i,r&&console.log(c.green(`Created secret: ${e}
|
|
16
|
+
`))}export{x as a,C as b,P as c,E as d};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as l}from"./chunk-5PTHALCD.js";import{e as m}from"./chunk-65T2UMWS.js";import o from"node:fs/promises";import a from"node:path";import d from"node:os";import p from"chalk";async function u(e,r,t={}){let i=t.exclude||[];await o.mkdir(r,{recursive:!0});let y=await o.readdir(e,{withFileTypes:!0});for(let n of y){let s=a.join(e,n.name),c=a.join(r,n.name);i.some(f=>n.name===f)||(n.isDirectory()?await u(s,c,t):await o.copyFile(s,c))}}async function h(e){try{return(await o.stat(e)).isDirectory()}catch{return!1}}async function E(e,r){let t=await m("every-app-gateway"),i=`# Vite client-side secrets
|
|
2
|
+
VITE_APP_ID=${r}
|
|
3
|
+
VITE_GATEWAY_URL=${t}
|
|
4
|
+
# Set Cloudflare secrets locally
|
|
5
|
+
GATEWAY_URL=${t}
|
|
6
|
+
`;await Promise.all([o.writeFile(a.join(e,".env.local"),i)])}async function T(e){return await o.mkdtemp(a.join(d.tmpdir(),e))}async function C(e,r=!1){try{await o.rm(e,{recursive:!0,force:!0}),r&&console.log(p.dim(` Removed: ${e}`))}catch{console.warn(p.yellow("\u26A0\uFE0F Warning: Failed to clean up temporary directory:"),e)}}async function $(e,r,t=!1){try{await l("git",["clone",e,r],{verbose:t,logCommandToConsole:!1})}catch(i){throw new Error(`Failed to clone repository from ${e}: ${i instanceof Error?i.message:"Unknown error"}`)}}export{u as a,h as b,E as c,T as d,C as e,$ 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.
|
|
2
|
-
`)}}),u=o({loader:async()=>{let{deploy:e}=await import("./deploy-
|
|
3
|
-
`)}}),y=o({loader:async()=>{let{remoteD1Shell:e}=await import("./remoteD1Shell-
|
|
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-
|
|
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.13";import{buildCommand as o,buildRouteMap as m}from"@stricli/core";var c=o({loader:async()=>import("./create-ZQQ5K45E.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-XLA22GPF.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
|
+
`)}}),y=o({loader:async()=>{let{remoteD1Shell:e}=await import("./remoteD1Shell-MWQWKJA4.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-Z5667ULH.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,30 @@
|
|
|
1
|
+
import{a as m,b as d,c as g,d as f,e as u,f as y}from"./chunk-MOGNJRIZ.js";import{a as l,b as c,c as h}from"./chunk-5PTHALCD.js";import{e as p,g as w,h as k}from"./chunk-65T2UMWS.js";import M from"chalk";import C from"chalk";import{execa as S}from"execa";async function b(){try{await S("pnpm",["--version"],{stdio:"pipe"})}catch{console.error(C.red(`
|
|
2
|
+
Error: pnpm is required but not installed. Please install it first:`)),console.error(C.cyan(` npm i -g pnpm
|
|
3
|
+
`)),process.exit(1)}}import P from"enquirer";function U(e){return!e||e.trim().length===0?"App ID cannot be empty":e.length>64?"App ID must be 64 characters or less":/^[a-z][a-z0-9-]*$/.test(e)?!0:"App ID must be in kebab-case format (lowercase letters, numbers, and hyphens only, starting with a letter)"}async function O(){let e=!1,o=null;for(;!e;)o=await P.prompt({type:"confirm",name:"acknowledged",message:o?`You must acknowledge this to proceed. Press y to continue.
|
|
4
|
+
`:"pnpm has been chosen as the package manager for Every App projects. Other package managers will not work with `every app deploy` currently.\n\n Press y to acknowledge this.",initial:!1}),o.acknowledged?e=!0:console.log()}async function D(){console.log(`Project Configuration
|
|
5
|
+
`);let e=await P.prompt({type:"input",name:"appId",message:"Enter your app ID (kebab-case format)",validate:U});return console.log(),await O(),{appId:e.appId}}import v from"node:path";import J from"chalk";var V="git@github.com:every-app/every-app.git",_="templates/simple-todo";async function x(e,o){o&&console.log(`Cloning template repository...
|
|
6
|
+
`);let n=await f("every-app-create-");await y(V,n,o),o&&console.log(`Extracting template...
|
|
7
|
+
`);let a=v.join(n,_),r=v.join(process.cwd(),e);if(await d(r))throw new Error(`Directory "${e}" already exists in the current location`);return await m(a,r,{exclude:["node_modules",".git","pnpm-lock.yaml","package-lock.json",".env.local",".env.production",".dev.vars","manual-steps.md"]}),o&&console.log(J.dim(` Template copied to ${r}
|
|
8
|
+
`)),{tempDir:n,targetDir:r}}import A from"chalk";async function E(e,o){console.log(o?`Creating Cloudflare resources...
|
|
9
|
+
`:`
|
|
10
|
+
Creating Cloudflare resources...
|
|
11
|
+
`);let n=await w(e,o),a=await h(e,o);return o&&(console.log(`Cloudflare resources ready:
|
|
12
|
+
`),console.log(A.dim(` D1 Database: ${e} (${n})`)),console.log(A.dim(` KV Namespace: ${e} (${a})
|
|
13
|
+
`))),{d1DatabaseId:n,kvNamespaceId:a}}import I from"node:fs/promises";import $ from"node:path";import W from"chalk";async function K(e,o){let n=$.join(e,"package.json"),a=JSON.parse(await I.readFile(n,"utf-8"));a.name=o,await I.writeFile(n,JSON.stringify(a,null,2)+`
|
|
14
|
+
`,"utf-8")}async function j(e,o,n,a,r){r&&console.log(`Updating configuration files...
|
|
15
|
+
`);let i=$.join(e,"wrangler.jsonc");await k({configPath:i,name:o,d1DatabaseId:n,d1DatabaseName:o,kvNamespaceId:a,verbose:r}),await K(e,o),await g(e,o),r&&console.log(W.dim(" Configuration updated"))}import s from"chalk";async function N(e,o){try{o||console.log(`
|
|
16
|
+
Setting up Cloudflare for local dev...`),await l("pnpm",["run","cf-typegen"],{cwd:e,verbose:o,logCommandToConsole:!1}),await l("pnpm",["run","build"],{cwd:e,verbose:o,logCommandToConsole:!1}),o||console.log(s.dim(` Finished.
|
|
17
|
+
`)),await l("pnpm",["run","db:migrate:local"],{cwd:e,verbose:o}),console.log(`
|
|
18
|
+
Local database migrations complete.
|
|
19
|
+
`)}catch{console.warn(s.yellow(`
|
|
20
|
+
Failed to run local migrations. You can run them manually with:`)),console.warn(s.dim(` pnpm run db:migrate:local
|
|
21
|
+
`))}}import t from"chalk";function T(e,o,n){console.log(t.green(`\u{1F389} Project created successfully!
|
|
22
|
+
`)),console.log(t.dim(`Location: ${o}
|
|
23
|
+
`)),console.log(`Next steps:
|
|
24
|
+
`),console.log(t.dim(` 1. ${t.bold(t.italic(`cd ${e}`))}`)),console.log(t.dim(` 2. ${t.bold(t.italic("pnpm run dev"))}`)),console.log(t.dim(` 3. Click "Add App" in your gateway: ${t.reset(t.cyan(n))}`)),console.log(t.dim(" 4. Configure App")),console.log(t.dim(` - App ID: ${t.bold(t.italic(`${e}`))}`)),console.log(t.dim(` - App URL: ${t.bold(t.italic("http://localhost:3001"))} (or whatever your dev url is)`)),console.log(t.dim(` 5. Click the app in the gateway and start building
|
|
25
|
+
`)),console.log(`Deploy to production:
|
|
26
|
+
`),console.log(t.dim(t.bold(t.italic(" every app deploy # Spin up KV Store, run migrations on prod db, deploy app to Cloudflare Workers.")))),console.log(t.dim(t.bold(t.italic(` pnpm run deploy # Deploy to Cloudflare
|
|
27
|
+
`))))}async function Io(e){let o=e.verbose||!1;await b(),console.log(`
|
|
28
|
+
Create a new Every App project
|
|
29
|
+
`);let n=null;try{let{appId:a}=await D(),{tempDir:r,targetDir:i}=await x(a,o);n=r;let{d1DatabaseId:F,kvNamespaceId:L}=await E(a,o);await j(i,a,F,L,o),console.log(),await c(i,"Installing dependencies for local dev...",o);let[,R]=await Promise.all([N(i,o),p("every-app-gateway")]);T(a,i,R)}catch(a){throw console.error(M.red(`
|
|
30
|
+
Failed to create project:`),a instanceof Error?a.message:"Unknown error"),a}finally{n&&await u(n)}}export{Io as default};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import{a as v,c as T,d as x}from"./chunk-FQY6RMLS.js";import{a as u,b,c as $}from"./chunk-5PTHALCD.js";import{a as D,c as E,e as f,f as _,g as A,h as C,j as k}from"./chunk-65T2UMWS.js";import h from"chalk";import U from"chalk";async function R(r,a,e=!1){if(console.log(`
|
|
2
|
+
Setting up Cloudflare your D1 Database and KV Store...
|
|
3
|
+
`),!r.d1_databases||r.d1_databases.length===0)throw new Error("No D1 databases found in wrangler.jsonc. Every app must have exactly one D1 database.");if(r.d1_databases.length>1)throw new Error(`Found ${r.d1_databases.length} D1 databases in wrangler.jsonc. Every app must have exactly one D1 database.`);if(!r.kv_namespaces||r.kv_namespaces.length===0)throw new Error("No KV namespaces found in wrangler.jsonc. Every app must have exactly one KV namespace.");if(r.kv_namespaces.length>1)throw new Error(`Found ${r.kv_namespaces.length} KV namespaces in wrangler.jsonc. Every app must have exactly one KV namespace.`);let n=r.d1_databases[0].database_name;if(!n)throw new Error("D1 database in wrangler.jsonc must have a database_name.");e&&console.log(U.bold(`Processing D1 database...
|
|
4
|
+
`));let t=await A(n,e);e&&console.log(U.bold(`Processing KV namespace...
|
|
5
|
+
`));let l=await $(a,e);return{d1DatabaseId:t,kvNamespaceId:l}}import P from"chalk";async function S(r,a,e=!1){if(!a.d1_databases||a.d1_databases.length===0){e&&console.log(P.dim(`No D1 databases configured, skipping migrations
|
|
6
|
+
`));return}try{console.log(),await u("npm",["run","db:migrate:prod"],{cwd:r,description:"Running any pending migrations against your remote D1 Database...",verbose:e}),console.log(`
|
|
7
|
+
Migrations completed!
|
|
8
|
+
`)}catch{console.warn(P.yellow(`Failed to run migrations. You may need to run them manually with: npm run db:migrate:prod
|
|
9
|
+
`))}}import L from"chalk";async function N(r,a,e,o){try{let n={...process.env,VITE_GATEWAY_URL:a,VITE_APP_ID:e};await u("npm",["run","deploy"],{cwd:r,description:`Deploying your application to Cloudflare workers...
|
|
10
|
+
|
|
11
|
+
15s to 1m depending on how long the app build takes
|
|
12
|
+
`,env:n,verbose:o})}catch(n){throw console.error(L.red(`
|
|
13
|
+
Failed to build or deploy`)),n}}import w from"chalk";import{randomUUID as V}from"node:crypto";import g from"chalk";async function y(r,a,e){try{let o=await D(),n=await fetch(`https://api.cloudflare.com/client/v4/accounts/${r}/d1/database/${a}/query`,{method:"POST",headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/json"},body:JSON.stringify({sql:e})}),t=await n.json();if(!n.ok||!t.success){let s=t.errors?t.errors.map(i=>`[${i.code}] ${i.message}`).join(", "):n.statusText;throw console.error(g.red(`
|
|
14
|
+
D1 Query Error:`)),console.error(g.dim(`SQL: ${e}`)),console.error(g.dim(`Error: ${s}`)),new Error(`D1 query failed: ${s}`)}let l=t.result;if(!l||l.length===0)throw new Error("No results returned from D1 query");let c=l[0];if(!c)throw new Error("First result is undefined");return c.results}catch(o){throw o instanceof Error&&!o.message.includes("D1 query failed")&&(console.error(g.red(`
|
|
15
|
+
D1 Query Error:`)),console.error(g.dim(`SQL: ${e}`))),o}}async function W(r,a,e=!1,o,n){try{e&&console.log("Adding apps to user gateways...");let t=await E(),c=(await _()).find(m=>m.name==="every-app-gateway");if(!c){console.warn(w.yellow(`every-app-gateway database not found. Skipping UserApp record creation.
|
|
16
|
+
`));return}let s=c.uuid,i=await y(t,s,"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=o||r,d=n||r;if(i.length===1)await F(t,s,i[0],r,a,p,d,e);else{e&&console.log(w.yellow(`Multiple users found (${i.length}). Adding app to all users...
|
|
17
|
+
`));for(let m of i)await F(t,s,m,r,a,p,d,e);e&&console.log(` UserApp records processed for ${i.length} users
|
|
18
|
+
`)}}catch(t){throw console.error(w.red("Failed to insert UserApp records:"),t instanceof Error?t.message:t),t}}async function F(r,a,e,o,n,t,l,c){let s=Math.floor(Date.now()/1e3);if((await y(r,a,`SELECT id FROM user_apps WHERE user_id = '${e.id}' AND app_id = '${o}'`)).length>0)c&&console.log(w.dim(` UserApp record already exists for user ${e.name} (${e.email})`));else{let d=`
|
|
19
|
+
INSERT INTO user_apps (id, user_id, app_id, name, description, app_url, created_at, updated_at)
|
|
20
|
+
VALUES ('${V()}', '${e.id}', '${o}', '${t}', '${l}', '${n}', ${s}, ${s})
|
|
21
|
+
`;await y(r,a,d),console.log(` UserApp record created for user ${e.name} (${e.email})`)}}async function I(r,a,e=!1){console.log("Configuring Secrets...");try{await T("GATEWAY_URL",a,e)||await x("GATEWAY_URL",r,a,e,`Setting GATEWAY_URL to: ${r}`),console.log(e?`Secret setup complete!
|
|
22
|
+
`:` Finished.
|
|
23
|
+
`)}catch(o){throw console.error(`
|
|
24
|
+
Failed to setup secrets`,o instanceof Error?`
|
|
25
|
+
${o.message}`:""),o}}async function we(r){let a=process.cwd(),e=r.verbose||!1,o=await k(a);if(!o.name)throw new Error("Worker name not found in wrangler.jsonc. Please add a 'name' field.");let n=o.name;if(console.log(h.bold(`
|
|
26
|
+
Project name: ${n}
|
|
27
|
+
`)),!await v("Do you want to deploy this app to Cloudflare?")){console.log(h.red(`
|
|
28
|
+
Deployment cancelled by user
|
|
29
|
+
`));return}let{d1DatabaseId:l,kvNamespaceId:c}=await R(o,n,e),s=await f("every-app-gateway");await C({configPath:a,d1DatabaseId:l,kvNamespaceId:c,verbose:e}),console.log(),await b(a,"Installing dependencies for Cloudflare deployment...",e),await S(a,o,e),await N(a,s,n,e),await I(s,a,e);let i=await f(o.name),p,d;o.name==="every-todo-app"&&(p="Todos",d="Minimal todo list"),await W(o.name,i,e,p,d),console.log(h.green(`Deployment successful!
|
|
30
|
+
`));let m=await f("every-app-gateway");console.log(`Try it out in your gateway: ${h.cyan(m)}
|
|
31
|
+
`)}export{we as deploy};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{d as g,e as w,f as E}from"./chunk-MOGNJRIZ.js";import{a as D,b as R,c,d as l}from"./chunk-FQY6RMLS.js";import{a as y,b as d,c as A}from"./chunk-5PTHALCD.js";import{c as f,e as u,g as T,h as C,i as _}from"./chunk-65T2UMWS.js";import m from"chalk";import N from"node:path";var P="every-app-gateway",U="every-app-gateway";async function k(o=!1){console.log(`
|
|
2
|
+
Setting up Cloudflare your D1 Database and KV Store...
|
|
3
|
+
`);let e=await f(),t=await T(P,o),r=await A(U,o);return{d1DatabaseId:t,kvNamespaceId:r,accountId:e}}import h from"node:path";var J="git@github.com:every-app/every-app.git",Y="apps/every-app-gateway";async function K(o,e=!1){await E(J,o,e);let t=h.join(o,Y);return console.log(),await d(t,"Installing dependencies for Cloudflare Deployment...",e),t}import G from"node:crypto";import S from"node:crypto";import p from"chalk";function B(){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 W(o,e,t=!1){console.log("Configuring Secrets...");try{if(await c("GATEWAY_URL",e,t)||await l("GATEWAY_URL",o,e,t,`Setting GATEWAY_URL to: ${o}`),!await c("BETTER_AUTH_SECRET",e,t)){let s=B();await l("BETTER_AUTH_SECRET",s,e,t,"Generating new Better Auth secret...")}let n=await c("JWT_PRIVATE_KEY",e,t),a=await c("JWT_PUBLIC_KEY",e,t);if(n&&a)t&&console.log(p.dim(` JWT key pair already exists
|
|
4
|
+
`));else if(!n&&!a){t&&console.log(p.dim(` Generating new JWT key pair...
|
|
5
|
+
`));let s=L();await l("JWT_PRIVATE_KEY",s.privateKey,e,t),await l("JWT_PUBLIC_KEY",s.publicKey,e,t),t&&console.log(p.green(`Created JWT key pair secrets
|
|
6
|
+
`))}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?`Secret setup complete!
|
|
7
|
+
`:` Finished.
|
|
8
|
+
`)}catch(r){throw console.error(`
|
|
9
|
+
Failed to setup secrets`,r instanceof Error?`
|
|
10
|
+
${r.message}`:""),r}}async function x(o,e,t,r=!1){await C({configPath:o,d1DatabaseId:e.d1DatabaseId,kvNamespaceId:e.kvNamespaceId,verbose:r}),await W(t,o,r);let i=G.randomUUID();await y("npm",["run","deploy"],{cwd:o,description:`Deploying your Gateway to Cloudflare workers...
|
|
11
|
+
|
|
12
|
+
This could take up to a minute.`,env:{...process.env,BETTER_AUTH_SECRET:i},verbose:r})}async function ye(o){let e=o.verbose||!1;if(!await D("Do you want to deploy EveryApp Gateway into this Cloudflare account?")){console.log(`
|
|
13
|
+
Deployment cancelled by user
|
|
14
|
+
`);return}await R();let r=await k(e),i=await g("gateway-deploy-");e&&console.log(m.dim(`Working directory: ${i}
|
|
15
|
+
`));let n=null;try{let a=await K(i,e),s=N.join(a,"wrangler.jsonc"),I=await _(s);n=await u(I),await x(a,r,n,e)}catch(a){throw console.error(`
|
|
16
|
+
Deployment failed:`,a instanceof Error?a.message:a),a}finally{await w(i,e)}if(!n)throw new Error("Worker URL not set properly during deployment");console.log(m.green(`
|
|
17
|
+
Gateway deployment successful!
|
|
18
|
+
`)),console.log(`Your Gateway is now live at: ${m.cyan(n)}
|
|
19
|
+
`)}export{ye 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-
|
|
2
|
+
import{a as r,b as o}from"./chunk-ZBPM4ZWH.js";import{run as i}from"@stricli/core";await i(o,process.argv.slice(2),r(process));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as d,
|
|
2
|
-
Example: every app remote-d1-shell -- npx drizzle-kit migrate`);let[a,...s]=e;if(!a)throw new Error("Invalid command");let o=await
|
|
1
|
+
import{a as d,c,f as l,j as g}from"./chunk-65T2UMWS.js";import t from"chalk";import{execa as h}from"execa";async function A(w,...e){let r=process.cwd();try{if(!e||e.length===0)throw new Error(`No command provided. Usage: every app remote-d1-shell -- <command>
|
|
2
|
+
Example: every app remote-d1-shell -- npx drizzle-kit migrate`);let[a,...s]=e;if(!a)throw new Error("Invalid command");let o=await g(r);if(!o.d1_databases||o.d1_databases.length===0)throw new Error("No D1 databases found in wrangler.jsonc. Please add a D1 database configuration.");let n=o.d1_databases[0].database_name;if(!n)throw new Error("No database_name found in D1 database configuration in wrangler.jsonc.");console.log("Retrieving shell info from Cloudflare...");let[f,m,b]=await Promise.all([c(),l(),d()]),i=m.find(p=>p.name===n);if(!i)throw new Error(`Database "${n}" not found in your Cloudflare account. Have you run \`every app deploy\` to create the database?`);let u=i.uuid;console.log(t.bold(`
|
|
3
3
|
Running: ${t.cyan([a,...s].join(" "))}
|
|
4
4
|
`)),await h(a,s,{cwd:r,stdio:"inherit",env:{...process.env,CLOUDFLARE_ACCOUNT_ID:f,CLOUDFLARE_DATABASE_ID:u,CLOUDFLARE_API_TOKEN:b}}),console.log(`
|
|
5
5
|
Command executed!`)}catch(a){throw console.error(t.red(`
|
package/package.json
CHANGED
package/dist/chunk-A5HLZBEH.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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};
|
package/dist/chunk-B6LAGOID.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import e from"chalk";import d from"enquirer";import{execa as c}from"execa";async function h(t="Do you want to deploy to Cloudflare?"){console.log(e.bold(`Checking Cloudflare account...
|
|
2
|
-
`));try{let{stdout:o}=await c("npx",["wrangler","whoami"],{reject:!1}),s=o.split(`
|
|
3
|
-
`),r=[],i=!1;for(let n of s)if(r.push(n),n.includes("\u2514\u2500")&&n.includes("\u2534\u2500")&&n.includes("\u2518")){i=!0;break}let a=i?r.join(`
|
|
4
|
-
`):o;return console.log(e.dim(a)),console.log(),(await d.prompt({type:"confirm",name:"confirm",message:t,initial:!1})).confirm}catch(o){throw console.error(e.red(`
|
|
5
|
-
Failed to retrieve Cloudflare account information`)),console.error(e.dim(` Make sure you're logged in with: npx wrangler login
|
|
6
|
-
`)),o}}export{h as a};
|
package/dist/chunk-CQBCTFZE.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import p from"node:fs/promises";import d from"node:path";import f from"node:os";import*as g from"smol-toml";function w(){let r=f.homedir(),n=f.platform(),e;return n==="win32"?e=d.join(process.env.LOCALAPPDATA||d.join(r,"AppData","Local"),".wrangler"):n==="darwin"?e=d.join(r,"Library","Preferences",".wrangler"):e=d.join(r,".wrangler"),d.join(e,"config","default.toml")}async function h(){let r=w();try{let n=await p.readFile(r,"utf-8"),e=g.parse(n);if(!e.oauth_token||!e.refresh_token)throw new Error("OAuth tokens not found in wrangler config");return e}catch(n){throw n.code==="ENOENT"?new Error("Wrangler config not found. Please run 'npx wrangler login' first."):n}}function k(r){let n=new Date(r).getTime(),e=Date.now(),t=1*60*1e3;return n-e<t}async function b(r){let n=await fetch("https://dash.cloudflare.com/oauth2/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:r})});if(!n.ok)throw new Error(`Failed to refresh OAuth token: ${n.status} ${n.statusText}`);let e=await n.json();return{oauth_token:e.access_token,expiration_time:new Date(Date.now()+e.expires_in*1e3).toISOString(),refresh_token:e.refresh_token||r,scopes:e.scope?e.scope.split(" "):[]}}async function y(){let r=await h();return k(r.expiration_time)?(await b(r.refresh_token)).oauth_token:r.oauth_token}async function l(r,n={}){let e=await y(),t=await fetch(`https://api.cloudflare.com/client/v4${r}`,{...n,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",...n.headers}}),o=await t.json();if(!t.ok){let s=o.errors?o.errors.map(c=>`[${c.code}] ${c.message}`).join(", "):t.statusText;throw new Error(`Cloudflare API request failed: ${t.status} ${s}`)}if(!o.success){let s=o.errors.map(c=>`[${c.code}] ${c.message}`).join(", ");throw new Error(`Cloudflare API error: ${s}`)}return o.result}async function _(){let r=await l("/accounts");if(!r||r.length===0)throw new Error("No Cloudflare accounts found");let n=r[0];if(!n)throw new Error("No Cloudflare accounts found");return n.id}async function A(r){try{let n=await l(`/accounts/${r}/workers/subdomain`);if(!n||!n.subdomain)throw new Error("No workers.dev subdomain found for this account");return n.subdomain}catch(n){throw new Error(`Failed to get workers.dev subdomain: ${n instanceof Error?n.message:"Unknown error"}`)}}async function $(r,n){let e=n||await _(),t=await A(e);return`https://${r}.${t}.workers.dev`}import u from"node:fs/promises";import D from"node:path";import*as a from"jsonc-parser";function T(r,n,e){let t=[];return e.name&&t.push(...a.modify(r,["name"],e.name,{})),n.d1_databases&&e.d1DatabaseId&&n.d1_databases.forEach((o,s)=>{t.push(...a.modify(r,["d1_databases",s,"database_id"],e.d1DatabaseId,{})),e.d1DatabaseName&&t.push(...a.modify(r,["d1_databases",s,"database_name"],e.d1DatabaseName,{}))}),n.kv_namespaces&&e.kvNamespaceId&&n.kv_namespaces.forEach((o,s)=>{t.push(...a.modify(r,["kv_namespaces",s,"id"],e.kvNamespaceId,{}))}),t}async function v(r,n){let e=await u.readFile(r,"utf-8"),t=a.parse(e),o=T(e,t,n),s=a.applyEdits(e,o);await u.writeFile(r,s)}async function N(r){let n=await u.readFile(r,"utf-8"),e=a.parse(n);if(!e.name||typeof e.name!="string")throw new Error("Worker name not found in wrangler.jsonc");return e.name}async function F(r){let n=D.join(r,"wrangler.jsonc");try{let e=await u.readFile(n,"utf-8");return a.parse(e)}catch(e){throw e instanceof Error&&"code"in e&&e.code==="ENOENT"?new Error("wrangler.jsonc not found in current directory. Make sure you're running this command from your app's root directory."):e}}import{execa as m}from"execa";import i from"chalk";async function C(){let{stdout:r}=await m("npx",["wrangler","d1","list","--json"]);return JSON.parse(r)}async function E(r){let{stdout:n}=await m("npx",["wrangler","d1","create",r]),e=n.match(/"database_id":\s*"([^"]+)"/);if(!e||!e[1])throw new Error("Failed to parse database ID from wrangler output");return e[1]}async function M(r){console.log(i.bold(`Checking D1 database: ${r}
|
|
2
|
-
`));try{let e=(await C()).find(o=>o.name===r);if(e)return console.log(i.green(`Linking to existing D1 database: ${r} (${e.uuid})
|
|
3
|
-
`)),e.uuid;console.log(i.bold(`Creating new D1 database: ${r}
|
|
4
|
-
`));let t=await E(r);return console.log(i.green(`Created D1 database: ${r} (${t})
|
|
5
|
-
`)),t}catch(n){throw console.error(i.red(`
|
|
6
|
-
Failed to get or create D1 database: ${r}`),n instanceof Error?i.dim(`
|
|
7
|
-
${n.message}`):""),n}}export{y as a,_ as b,$ as c,v as d,N as e,F as f,C as g,M as h};
|
package/dist/chunk-EKUNMDBZ.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
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};
|
package/dist/create-7QPAFMNM.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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};
|
package/dist/deploy-SBTNFRA7.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
Setting up secrets...
|
|
3
|
-
`));try{if(console.log(t.bold(`Checking secret: CORE_APP_URL
|
|
4
|
-
`)),await d("CORE_APP_URL",e)?console.log(t.dim(` Secret already exists
|
|
5
|
-
`)):(console.log(t.dim(` Setting CORE_APP_URL to: ${o}
|
|
6
|
-
`)),await g("CORE_APP_URL",o,e),console.log(t.green(`Created secret: CORE_APP_URL
|
|
7
|
-
`))),console.log(t.bold(`Checking secret: BETTER_AUTH_URL
|
|
8
|
-
`)),await d("BETTER_AUTH_URL",e)?console.log(t.dim(` Secret already exists
|
|
9
|
-
`)):(console.log(t.dim(` Setting BETTER_AUTH_URL to: ${o}
|
|
10
|
-
`)),await g("BETTER_AUTH_URL",o,e),console.log(t.green(`Created secret: BETTER_AUTH_URL
|
|
11
|
-
`))),console.log(t.bold(`Checking secret: BETTER_AUTH_SECRET
|
|
12
|
-
`)),await d("BETTER_AUTH_SECRET",e))console.log(t.dim(` Secret already exists
|
|
13
|
-
`));else{console.log(t.dim(` Generating new Better Auth secret...
|
|
14
|
-
`));let p=K();await g("BETTER_AUTH_SECRET",p,e),console.log(t.green(`Created secret: BETTER_AUTH_SECRET
|
|
15
|
-
`))}console.log(t.bold(`Checking secret: JWT_PRIVATE_KEY
|
|
16
|
-
`));let i=await d("JWT_PRIVATE_KEY",e),a=await d("JWT_PUBLIC_KEY",e);if(i&&a)console.log(t.dim(` JWT key pair already exists
|
|
17
|
-
`));else if(!i&&!a){console.log(t.dim(` Generating new JWT key pair...
|
|
18
|
-
`));let p=L();await g("JWT_PRIVATE_KEY",p.privateKey,e),await g("JWT_PUBLIC_KEY",p.publicKey,e),console.log(t.green(`Created JWT key pair secrets
|
|
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
|
-
`))}catch(r){throw console.error(t.red(`
|
|
21
|
-
Failed to setup secrets`),r instanceof Error?t.dim(`
|
|
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
|
-
Setting up Cloudflare resources...
|
|
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
|
-
`)),await u("pnpm",r,e),console.log(l.green(`Installation complete!
|
|
27
|
-
`)),r}catch(r){throw console.error(l.red(`
|
|
28
|
-
Failed to clone repository or install dependencies`),r instanceof Error?l.dim(`
|
|
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
|
-
Failed to update config or deploy`),s instanceof Error?l.dim(`
|
|
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
|
-
Deployment cancelled by user
|
|
34
|
-
`));return}let n=await v(),s=await w("gateway-deploy-");console.log(c.dim(`
|
|
35
|
-
Working directory: ${s}
|
|
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
|
-
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
|
-
`)),console.log(c.bold(`Your gateway is now live at: ${c.cyan(i)}
|
|
41
|
-
`)),console.log(c.dim(`Try it out by visiting the URL above in your browser.
|
|
42
|
-
`)),console.log(c.yellow(`Note: if you see an error in the browser, cloudflare may still be setting up your domain. Wait ~1 minute to see if resolves itself.
|
|
43
|
-
`))}export{de as deploy};
|
package/dist/deploy-UW25KWKD.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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};
|