@every-app/cli 0.0.16 → 0.0.18
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-E3UJA43H.js +1 -0
- package/dist/chunk-EUEWNXPI.js +7 -0
- package/dist/chunk-GIXANRUK.js +6 -0
- package/dist/{chunk-VEYZ6B3E.js → chunk-K2FM2MLA.js} +4 -4
- package/dist/chunk-QCM42KG3.js +1 -0
- package/dist/chunk-SWRTSPS4.js +6 -0
- package/dist/{chunk-FQY6RMLS.js → chunk-UDDM3R6C.js} +1 -1
- package/dist/create-H2GLJX47.js +27 -0
- package/dist/deploy-EMXFJLBC.js +23 -0
- package/dist/deploy-OI3QF3EI.js +31 -0
- package/dist/index.js +1 -1
- package/dist/remoteD1Shell-D34XAC3H.js +6 -0
- package/package.json +3 -2
- package/dist/chunk-5PTHALCD.js +0 -7
- package/dist/chunk-65T2UMWS.js +0 -6
- package/dist/chunk-MOGNJRIZ.js +0 -6
- package/dist/create-PYI52Y7L.js +0 -27
- package/dist/deploy-3XYMW3UD.js +0 -19
- package/dist/deploy-GYS5YEN7.js +0 -31
- package/dist/remoteD1Shell-MWQWKJA4.js +0 -6
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-K2FM2MLA.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 @@
|
|
|
1
|
+
import{a as n}from"./chunk-EUEWNXPI.js";import{execa as o}from"execa";async function s(){try{return await o("pnpm",["--version"],{stdio:"pipe"}),!0}catch{return!1}}async function m(e,t,r=!1){let i=await s();try{i?await n("pnpm",["install"],{cwd:e,verbose:r,description:t}):await n("npx",["pnpm","install"],{cwd:e,verbose:r,description:t})}catch(a){throw new Error(`Failed to install dependencies with pnpm: ${a instanceof Error?a.message:"Unknown error"}`)}}export{m as a};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{execa as d}from"execa";import a from"chalk";async function x(e,t,n){let{env:r,cwd:i,verbose:o=!1,description:g,logCommandToConsole:l=!0}=n;return o?f(e,t,n):l?(console.log(`Running: ${e} ${t.join(" ")}`),g&&console.log(a.dim(` ${g}`)),await d(e,t,{cwd:i,env:r,stdio:"pipe"})):await d(e,t,{cwd:i,env:r,stdio:"pipe"})}async function f(e,t,{description:n,cwd:r,env:i}){console.log(a.dim(` \u250C\u2500 Running: ${e} ${t.join(" ")}`)),n&&console.log(a.dim(` \u2502 ${n}`));let o=d(e,t,{cwd:r,env:i,stdio:void 0,all:!0});o.stdout&&o.stdout.on("data",l=>{l.toString().split(`
|
|
2
|
+
`).forEach(s=>{s.trim()&&console.log(a.dim(` \u2502 ${s}`))})}),o.stderr&&o.stderr.on("data",l=>{l.toString().split(`
|
|
3
|
+
`).forEach(s=>{s.trim()&&console.error(a.dim(` \u2502 ${s}`))})});let g=await o;return console.log(a.dim(` \u2514\u2500 Complete
|
|
4
|
+
`)),g}import{execa as m}from"execa";import c from"chalk";async function p(){let{stdout:e}=await m("npx",["wrangler","kv","namespace","list"]);return JSON.parse(e)}async function w(e){let{stdout:t}=await m("npx",["wrangler","kv","namespace","create",e]);return $(t)}function $(e){let t=e.match(/"id":\s*"([a-f0-9]+)"/);if(!t||!t[1])throw new Error("Failed to parse namespace ID from wrangler output");return t[1]}async function E(e,t=!1){t&&console.log(` Checking KV namespace: ${e}`);try{let r=(await p()).find(o=>o.title===e);if(r)return console.log(t?c.dim(` Linking to existing KV namespace: ${e} (${r.id})
|
|
5
|
+
`):" KV already set up."),r.id;t&&console.log(c.dim(` Creating new KV namespace: ${e}`));let i=await w(e);return console.log(t?c.green(` Created KV namespace: ${e} (${i})
|
|
6
|
+
`):c.green(" KV successfully created.")),i}catch(n){throw console.error(c.red(`Failed to get or create KV namespace: ${e}`),n instanceof Error?c.dim(`
|
|
7
|
+
${n.message}`):""),n}}export{x as a,E as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{e as l}from"./chunk-SWRTSPS4.js";import r from"node:fs/promises";import n from"node:path";import f from"node:os";import m from"chalk";async function u(e,t,o={}){let a=o.exclude||[];await r.mkdir(t,{recursive:!0});let p=await r.readdir(e,{withFileTypes:!0});for(let i of p){let s=n.join(e,i.name),c=n.join(t,i.name);a.some(y=>i.name===y)||(i.isDirectory()?await u(s,c,o):await r.copyFile(s,c))}}async function x(e){try{return(await r.stat(e)).isDirectory()}catch{return!1}}async function h(e,t){let o=await l("every-app-gateway"),a=`# Vite client-side secrets
|
|
2
|
+
VITE_APP_ID=${t}
|
|
3
|
+
VITE_GATEWAY_URL=${o}
|
|
4
|
+
# Set Cloudflare secrets locally
|
|
5
|
+
GATEWAY_URL=${o}
|
|
6
|
+
`;await Promise.all([r.writeFile(n.join(e,".env.local"),a)])}async function T(e){return await r.mkdtemp(n.join(f.tmpdir(),e))}async function D(e,t=!1){try{await r.rm(e,{recursive:!0,force:!0}),t&&console.log(m.dim(` Removed: ${e}`))}catch{console.warn(m.yellow("\u26A0\uFE0F Warning: Failed to clean up temporary directory:"),e)}}export{u as a,x as b,h as c,T as d,D as e};
|
|
@@ -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.18";import{buildCommand as o,buildRouteMap as m}from"@stricli/core";var c=o({loader:async()=>import("./create-H2GLJX47.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-OI3QF3EI.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-D34XAC3H.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-EMXFJLBC.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 @@
|
|
|
1
|
+
import{a as d,c,f,j as D}from"./chunk-SWRTSPS4.js";import{execa as g}from"execa";async function m(o){let e=await D(o);if(!e.d1_databases||e.d1_databases.length===0)throw new Error("No D1 databases found in wrangler.jsonc. Please add a D1 database configuration.");let n=e.d1_databases[0];if(!n)throw new Error("No D1 database configuration found in wrangler.jsonc.");let a=n.database_name;if(!a)throw new Error("No database_name found in D1 database configuration in wrangler.jsonc.");let[r,s,i]=await Promise.all([c(),f(),d()]),t=s.find(u=>u.name===a);if(!t)throw new Error(`Database "${a}" not found in your Cloudflare account. Have you run deployment to create the database?`);return{CLOUDFLARE_ACCOUNT_ID:r,CLOUDFLARE_DATABASE_ID:t.uuid,CLOUDFLARE_API_TOKEN:i}}async function w(o,e,n){let{cwd:a,env:r={},verbose:s=!1}=n,i=await m(a),t={cwd:a,stdio:s?"inherit":"pipe",env:{...process.env,...r,...i}};await g(o,e,t)}export{m as a,w as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import b from"node:fs/promises";import f from"node:path";import u from"node:os";import*as l from"smol-toml";function y(){let e=u.homedir(),n=u.platform(),r;return n==="win32"?r=f.join(process.env.LOCALAPPDATA||f.join(e,"AppData","Local"),".wrangler"):n==="darwin"?r=f.join(e,"Library","Preferences",".wrangler"):r=f.join(e,".wrangler"),f.join(r,"config","default.toml")}async function D(){let e=y();try{let n=await b.readFile(e,"utf-8"),r=l.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 _(e){let n=new Date(e).getTime(),r=Date.now(),t=1*60*1e3;return n-r<t}async function j(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 v(){let e=await D();return _(e.expiration_time)?(await j(e.refresh_token)).oauth_token:e.oauth_token}async function m(e,n={}){let r=await v(),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 m("/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 x(e){try{let n=await m(`/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 F(e,n){let r=n||await E(),t=await x(r);return`https://${e}.${t}.workers.dev`}import g from"node:fs/promises";import p from"node:path";import*as s from"jsonc-parser";import A from"chalk";async function U(e){e.verbose&&console.log("Updating wrangler.jsonc with resource IDs and configuration...");let n=e.configPath;(await g.stat(n)).isDirectory()&&(n=p.join(n,"wrangler.jsonc"));let t=await g.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[w,k]of Object.entries(e.vars))a.push(...s.modify(t,["vars",w],k,{}));let i=s.applyEdits(t,a);await g.writeFile(n,i),e.verbose&&console.log(A.dim(` wrangler.jsonc updated successfully
|
|
2
|
+
`))}async function M(e){let n=await g.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 V(e){let n=p.join(e,"wrangler.jsonc");try{let r=await g.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}}import{execa as h}from"execa";import c from"chalk";import{z as d}from"zod";var P=d.object({uuid:d.string(),name:d.string(),created_at:d.string().optional(),version:d.string().optional()}),T=d.array(P);async function C(){let{stdout:e}=await h("npx",["wrangler","d1","list","--json"]),n=JSON.parse(e);return T.parse(n)}async function $(e){let{stdout:n}=await h("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 B(e,n=!1){n&&console.log(` Checking D1 database: ${e}`);try{let t=(await C()).find(a=>a.name===e);if(t)return console.log(n?c.dim(` Linking to existing D1 database: ${e} (${t.uuid})
|
|
3
|
+
`):" D1 already set up."),t.uuid;n&&console.log(c.dim(` Creating new D1 database: ${e}`));let o=await $(e);return console.log(n?c.green(` Created D1 database: ${e} (${o})
|
|
4
|
+
`):c.green(` D1 successfully created.
|
|
5
|
+
`)),o}catch(r){throw console.error(c.red(`Failed to get or create D1 database: ${e}`),r instanceof Error?c.dim(`
|
|
6
|
+
${r.message}`):""),r}}export{v as a,m as b,E as c,x as d,F as e,C as f,B as g,U as h,M as i,V as j};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as l,c as d,d as u}from"./chunk-
|
|
1
|
+
import{b as l,c as d,d as u}from"./chunk-SWRTSPS4.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
2
|
`);try{let{stdout:n}=await g("npx",["wrangler","whoami"],{reject:!1}),t=n.split(`
|
|
3
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
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(`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{a as c}from"./chunk-E3UJA43H.js";import{a as m,b as g,c as d,d as f,e as u}from"./chunk-GIXANRUK.js";import{a as l,b as w}from"./chunk-EUEWNXPI.js";import{e as p,g as y,h}from"./chunk-SWRTSPS4.js";import Y from"chalk";import k from"chalk";import{execa as U}from"execa";async function C(){try{await U("pnpm",["--version"],{stdio:"pipe"})}catch{console.error(k.red(`
|
|
2
|
+
Error: pnpm is required but not installed. Please install it first:`)),console.error(k.cyan(` npm i -g pnpm
|
|
3
|
+
`)),process.exit(1)}}import b from"enquirer";function O(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 J(){let e=!1,o=null;for(;!e;)o=await b.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 P(){console.log(`Project Configuration
|
|
5
|
+
`);let e=await b.prompt({type:"input",name:"appId",message:"Enter your app ID (kebab-case format)",validate:O});return console.log(),await J(),{appId:e.appId}}import x from"node:path";import S from"chalk";async function v(e,o,r=!1){try{await l("git",["clone",e,o],{verbose:r,logCommandToConsole:!1})}catch(n){throw new Error(`Failed to clone repository from ${e}: ${n instanceof Error?n.message:"Unknown error"}`)}}var _="https://github.com/every-app/every-app.git",V="templates/simple-todo";async function D(e,o){o&&console.log(`Cloning template repository...
|
|
6
|
+
`);let r=await f("every-app-create-");await v(_,r,o),o&&console.log(`Extracting template...
|
|
7
|
+
`);let n=x.join(r,V),a=x.join(process.cwd(),e);if(await g(a))throw new Error(`Directory "${e}" already exists in the current location`);return await m(n,a,{exclude:["node_modules",".git","pnpm-lock.yaml","package-lock.json",".env.local",".env.production",".dev.vars","manual-steps.md"]}),o&&console.log(S.dim(` Template copied to ${a}
|
|
8
|
+
`)),{tempDir:r,targetDir:a}}import E from"chalk";async function A(e,o){console.log(`Creating Cloudflare resources...
|
|
9
|
+
`);let r=await y(e,o),n=await w(e,o);return o&&(console.log(`Cloudflare resources ready:
|
|
10
|
+
`),console.log(E.dim(` D1 Database: ${e} (${r})`)),console.log(E.dim(` KV Namespace: ${e} (${n})
|
|
11
|
+
`))),{d1DatabaseId:r,kvNamespaceId:n}}import I from"node:fs/promises";import $ from"node:path";import W from"chalk";async function M(e,o){let r=$.join(e,"package.json"),n=JSON.parse(await I.readFile(r,"utf-8"));n.name=o,await I.writeFile(r,JSON.stringify(n,null,2)+`
|
|
12
|
+
`,"utf-8")}async function T(e,o,r,n,a){a&&console.log(`Updating configuration files...
|
|
13
|
+
`);let i=$.join(e,"wrangler.jsonc");await h({configPath:i,name:o,d1DatabaseId:r,d1DatabaseName:o,kvNamespaceId:n,verbose:a}),await M(e,o),await d(e,o),a&&console.log(W.dim(" Configuration updated"))}import s from"chalk";async function j(e,o){try{o||console.log(`
|
|
14
|
+
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.
|
|
15
|
+
`)),await l("pnpm",["run","db:migrate:local"],{cwd:e,verbose:o}),console.log(`
|
|
16
|
+
Local database migrations complete.
|
|
17
|
+
`)}catch{console.warn(s.yellow(`
|
|
18
|
+
Failed to run local migrations. You can run them manually with:`)),console.warn(s.dim(` pnpm run db:migrate:local
|
|
19
|
+
`))}}import t from"chalk";function N(e,o,r){console.log(t.green(`\u{1F389} Project created successfully!
|
|
20
|
+
`)),console.log(t.dim(`Location: ${o}
|
|
21
|
+
`)),console.log(`Next steps:
|
|
22
|
+
`),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(r))}`)),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
|
|
23
|
+
`)),console.log(`Deploy to production:
|
|
24
|
+
`),console.log(t.dim(t.bold(t.italic(" every app deploy # Deploys made easy using the Every App CLI"))))}async function To(e){let o=e.verbose||!1;await C(),console.log(`
|
|
25
|
+
Create a new Every App project
|
|
26
|
+
`);let r=null;try{let{appId:n}=await P(),{tempDir:a,targetDir:i}=await D(n,o);r=a;let{d1DatabaseId:F,kvNamespaceId:L}=await A(n,o);await T(i,n,F,L,o),console.log(),await c(i,"Installing dependencies for local dev...",o);let[,R]=await Promise.all([j(i,o),p("every-app-gateway")]);N(n,i,R)}catch(n){throw console.error(Y.red(`
|
|
27
|
+
Failed to create project:`),n instanceof Error?n.message:"Unknown error"),n}finally{r&&await u(r)}}export{To as default};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{d as w,e as E}from"./chunk-GIXANRUK.js";import{a as k,b as R,c as l,d as c}from"./chunk-UDDM3R6C.js";import{a as g,b as A}from"./chunk-EUEWNXPI.js";import{b as x}from"./chunk-QCM42KG3.js";import{c as y,e as u,g as T,h as C,i as _,j as h}from"./chunk-SWRTSPS4.js";import f from"chalk";import Q from"node:path";var J="every-app-gateway",N="every-app-gateway";async function S(t=!1){console.log(`
|
|
2
|
+
Setting up Cloudflare your D1 Database and KV Store...
|
|
3
|
+
`);let e=await y(),o=await T(J,t),r=await A(N,t);return{d1DatabaseId:o,kvNamespaceId:r,accountId:e}}import b from"node:crypto";import W from"node:crypto";import d from"chalk";function Y(){return W.randomBytes(32).toString("base64")}function $(){let{privateKey:t,publicKey:e}=W.generateKeyPairSync("rsa",{modulusLength:2048,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:t,publicKey:e}}async function D(t,e,o=!1){console.log("Configuring Secrets...");try{if(await l("GATEWAY_URL",e,o)||await c("GATEWAY_URL",t,e,o,`Setting GATEWAY_URL to: ${t}`),!await l("BETTER_AUTH_SECRET",e,o)){let s=Y();await c("BETTER_AUTH_SECRET",s,e,o,"Generating new Better Auth secret...")}let i=await l("JWT_PRIVATE_KEY",e,o),n=await l("JWT_PUBLIC_KEY",e,o);if(i&&n)o&&console.log(d.dim(` JWT key pair already exists
|
|
4
|
+
`));else if(!i&&!n){o&&console.log(d.dim(` Generating new JWT key pair...
|
|
5
|
+
`));let s=$();await c("JWT_PRIVATE_KEY",s.privateKey,e,o),await c("JWT_PUBLIC_KEY",s.publicKey,e,o),o&&console.log(d.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(o?`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 K(t,e,o,r=!1){await C({configPath:t,d1DatabaseId:e.d1DatabaseId,kvNamespaceId:e.kvNamespaceId,verbose:r});let a=b.randomUUID();console.log(),await g("npx",["wrangler","deploy"],{cwd:t,description:`Deploying your Gateway to Cloudflare workers...
|
|
11
|
+
|
|
12
|
+
This could take up to a minute.`,env:{...process.env,BETTER_AUTH_SECRET:a},verbose:r}),console.log(),await D(o,t,r)}import p from"chalk";async function P(t,e=!1){let o=await h(t);if(!o.d1_databases||o.d1_databases.length===0){e&&console.log(p.dim(`No D1 databases configured, skipping migrations
|
|
13
|
+
`));return}console.log(p.dim(`
|
|
14
|
+
Running database migrations...`));try{await x("npx",["drizzle-kit","migrate","--config=drizzle-prod.config.ts"],{cwd:t,verbose:e}),console.log(p.green(`Migrations completed!
|
|
15
|
+
`))}catch(r){console.warn(p.yellow(`Failed to run migrations. You may need to run them manually.
|
|
16
|
+
`)),e&&console.error(r)}}import U from"node:fs";import B from"node:path";import{Readable as v}from"node:stream";import{pipeline as M}from"node:stream/promises";import{createWriteStream as F}from"node:fs";import{spawn as z}from"node:child_process";import m from"chalk";var V="every-app",O="every-app",G="every-app-gateway-build.tar.gz";function H(){return`https://github.com/${V}/${O}/releases/download/gateway-latest/${G}`}async function j(t,e){let o=await fetch(t,{redirect:"follow"});if(!o.ok)throw new Error(`Failed to download file: ${o.status} ${o.statusText}`);if(!o.body)throw new Error("Response body is null");let r=F(e),a=v.fromWeb(o.body);await M(a,r)}async function q(t,e){return new Promise((o,r)=>{let a=z("tar",["-xzf",t,"-C",e]);a.on("error",r),a.on("close",i=>{i===0?o():r(new Error(`tar extraction failed with code ${i}`))})})}async function I(t,e=!1){let o=H();console.log(m.dim("Downloading gateway release (latest)...")),e&&console.log(m.dim(`URL: ${o}`)),U.mkdirSync(t,{recursive:!0});let r=B.join(t,G);try{await j(o,r)}catch(a){throw a instanceof Error&&a.message.includes("404")?new Error("Gateway release not found. Make sure a release has been published."):a}return e&&(console.log(m.dim(`Downloaded to: ${r}`)),console.log(m.dim("Extracting archive..."))),await q(r,t),U.unlinkSync(r),e&&console.log(m.dim("Extraction complete")),t}async function Ge(t){let e=t.verbose||!1;if(!await k("Do you want to deploy EveryApp Gateway into this Cloudflare account?")){console.log(`
|
|
17
|
+
Deployment cancelled by user
|
|
18
|
+
`);return}await R();let r=await S(e),a=await w("gateway-deploy-");e&&console.log(f.dim(`Working directory: ${a}
|
|
19
|
+
`));let i=null;try{let n=await I(a,e),s=Q.join(n,"wrangler.jsonc"),L=await _(s);i=await u(L),await K(n,r,i,e),await P(n,e)}catch(n){throw console.error(`
|
|
20
|
+
Deployment failed:`,n instanceof Error?n.message:n),n}finally{await E(a,e)}if(!i)throw new Error("Worker URL not set properly during deployment");console.log(f.green(`
|
|
21
|
+
Gateway deployment successful!
|
|
22
|
+
`)),console.log(`Your Gateway is now live at: ${f.cyan(i)}
|
|
23
|
+
`)}export{Ge as deploy};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import{a as b}from"./chunk-E3UJA43H.js";import{a as T,c as U,d as R}from"./chunk-UDDM3R6C.js";import{a as D,b as k}from"./chunk-EUEWNXPI.js";import{b as v}from"./chunk-QCM42KG3.js";import{a as E,c as _,e as f,f as A,g as $,h as x,j as C}from"./chunk-SWRTSPS4.js";import m from"chalk";import P from"chalk";async function S(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 t=r.d1_databases[0].database_name;if(!t)throw new Error("D1 database in wrangler.jsonc must have a database_name.");e&&console.log(P.bold(`Processing D1 database...
|
|
4
|
+
`));let n=await $(t,e);e&&console.log(P.bold(`Processing KV namespace...
|
|
5
|
+
`));let l=await k(a,e);return{d1DatabaseId:n,kvNamespaceId:l}}import y from"chalk";async function N(r,a,e=!1){if(!a.d1_databases||a.d1_databases.length===0){e&&console.log(y.dim(`No D1 databases configured, skipping migrations
|
|
6
|
+
`));return}try{console.log(),console.log(y.dim("Running any pending migrations against your remote D1 Database...")),await v("npx",["drizzle-kit","migrate","--config=drizzle-prod.config.ts"],{cwd:r,verbose:e}),console.log(y.green(`
|
|
7
|
+
Migrations completed!
|
|
8
|
+
`))}catch{console.warn(y.yellow(`Failed to run migrations. You may need to run them manually:
|
|
9
|
+
npx drizzle-kit migrate --config=drizzle-prod.config.ts
|
|
10
|
+
`))}}import V from"chalk";async function W(r,a,e,o){let t={...process.env,VITE_GATEWAY_URL:a,VITE_APP_ID:e};try{await D("npx",["vite","build"],{cwd:r,description:"Building your application...",env:t,verbose:o}),await D("npx",["wrangler","deploy"],{cwd:r,description:`Deploying your application to Cloudflare workers...
|
|
11
|
+
|
|
12
|
+
This could take up to a minute.`,env:t,verbose:o})}catch(n){throw console.error(V.red(`
|
|
13
|
+
Failed to build or deploy`)),n}}import h from"chalk";import{randomUUID as j}from"node:crypto";import u from"chalk";async function w(r,a,e){try{let o=await E(),t=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})}),n=await t.json();if(!t.ok||!n.success){let i=n.errors?n.errors.map(s=>`[${s.code}] ${s.message}`).join(", "):t.statusText;throw console.error(u.red(`
|
|
14
|
+
D1 Query Error:`)),console.error(u.dim(`SQL: ${e}`)),console.error(u.dim(`Error: ${i}`)),new Error(`D1 query failed: ${i}`)}let l=n.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(u.red(`
|
|
15
|
+
D1 Query Error:`)),console.error(u.dim(`SQL: ${e}`))),o}}async function F(r,a,e=!1,o,t){try{e&&console.log("Adding apps to user gateways...");let n=await _(),c=(await A()).find(g=>g.name==="every-app-gateway");if(!c){console.warn(h.yellow(`every-app-gateway database not found. Skipping UserApp record creation.
|
|
16
|
+
`));return}let i=c.uuid,s=await w(n,i,"SELECT id, name, email FROM users");if(s.length===0)throw new Error("No users found in the database. Please create a user first before deploying apps.");let p=o||r,d=t||r;if(s.length===1)await I(n,i,s[0],r,a,p,d,e);else{e&&console.log(h.yellow(`Multiple users found (${s.length}). Adding app to all users...
|
|
17
|
+
`));for(let g of s)await I(n,i,g,r,a,p,d,e);e&&console.log(` UserApp records processed for ${s.length} users
|
|
18
|
+
`)}}catch(n){throw console.error(h.red("Failed to insert UserApp records:"),n instanceof Error?n.message:n),n}}async function I(r,a,e,o,t,n,l,c){let i=Math.floor(Date.now()/1e3);if((await w(r,a,`SELECT id FROM user_apps WHERE user_id = '${e.id}' AND app_id = '${o}'`)).length>0)c&&console.log(h.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 ('${j()}', '${e.id}', '${o}', '${n}', '${l}', '${t}', ${i}, ${i})
|
|
21
|
+
`;await w(r,a,d),console.log(` UserApp record created for user ${e.name} (${e.email})`)}}async function L(r,a,e=!1){e&&console.log("Configuring Secrets...");try{await U("GATEWAY_URL",a,e)||await R("GATEWAY_URL",r,a,e,`Setting GATEWAY_URL to: ${r}`),e&&console.log(`Secret setup complete!
|
|
22
|
+
`)}catch(o){throw console.error(`
|
|
23
|
+
Failed to setup secrets`,o instanceof Error?`
|
|
24
|
+
${o.message}`:""),o}}async function he(r){let a=process.cwd(),e=r.verbose||!1,o=await C(a);if(!o.name)throw new Error("Worker name not found in wrangler.jsonc. Please add a 'name' field.");let t=o.name;if(console.log(m.bold(`
|
|
25
|
+
Project name: ${t}
|
|
26
|
+
`)),!await T("Do you want to deploy this app to Cloudflare?")){console.log(m.red(`
|
|
27
|
+
Deployment cancelled by user
|
|
28
|
+
`));return}let{d1DatabaseId:l,kvNamespaceId:c}=await S(o,t,e),i=await f("every-app-gateway");await x({configPath:a,d1DatabaseId:l,kvNamespaceId:c,verbose:e}),console.log(),await b(a,"Installing dependencies for Cloudflare deployment...",e),await N(a,o,e),await W(a,i,t,e),await L(i,a,e);let s=await f(o.name),p,d;o.name==="every-todo-app"&&(p="Todos",d="Minimal todo list"),await F(o.name,s,e,p,d),console.log(m.green(`
|
|
29
|
+
Deployment successful!`)),console.log(m.dim(` This app's url: ${m.cyan(s)}
|
|
30
|
+
`));let g=await f("every-app-gateway");console.log(`Access it on your gateway: ${m.cyan(g)}
|
|
31
|
+
`)}export{he 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-K2FM2MLA.js";import{run as i}from"@stricli/core";await i(o,process.argv.slice(2),r(process));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as c}from"./chunk-QCM42KG3.js";import"./chunk-SWRTSPS4.js";import r from"chalk";import{execa as l}from"execa";async function p(s,...o){let n=process.cwd();try{if(!o||o.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[e,...t]=o;if(!e)throw new Error("Invalid command");console.log("Retrieving shell info from Cloudflare...");let i=await c(n);console.log(r.bold(`
|
|
3
|
+
Running: ${r.cyan([e,...t].join(" "))}
|
|
4
|
+
`)),await l(e,t,{cwd:n,stdio:"inherit",env:{...process.env,...i}}),console.log(`
|
|
5
|
+
Command executed!`)}catch(e){throw console.error(r.red(`
|
|
6
|
+
Failed to execute command:`),e instanceof Error?e.message:e),e}}export{p as remoteD1Shell};
|
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.
|
|
7
|
+
"version": "0.0.18",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
"enquirer": "^2.4.1",
|
|
46
46
|
"execa": "^9.6.0",
|
|
47
47
|
"jsonc-parser": "^3.3.1",
|
|
48
|
-
"smol-toml": "^1.4.2"
|
|
48
|
+
"smol-toml": "^1.4.2",
|
|
49
|
+
"zod": "^4.1.13"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@types/node": "^22.18.13",
|
package/dist/chunk-5PTHALCD.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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};
|
package/dist/chunk-65T2UMWS.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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};
|
package/dist/chunk-MOGNJRIZ.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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};
|
package/dist/create-PYI52Y7L.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
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 Y from"chalk";import C from"chalk";import{execa as U}from"execa";async function b(){try{await U("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 O(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 J(){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 v(){console.log(`Project Configuration
|
|
5
|
-
`);let e=await P.prompt({type:"input",name:"appId",message:"Enter your app ID (kebab-case format)",validate:O});return console.log(),await J(),{appId:e.appId}}import D from"node:path";import S from"chalk";var _="https://github.com/every-app/every-app.git",V="templates/simple-todo";async function x(e,o){o&&console.log(`Cloning template repository...
|
|
6
|
-
`);let n=await f("every-app-create-");await y(_,n,o),o&&console.log(`Extracting template...
|
|
7
|
-
`);let a=D.join(n,V),r=D.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(S.dim(` Template copied to ${r}
|
|
8
|
-
`)),{tempDir:n,targetDir:r}}import A from"chalk";async function E(e,o){console.log(`Creating Cloudflare resources...
|
|
9
|
-
`);let n=await w(e,o),a=await h(e,o);return o&&(console.log(`Cloudflare resources ready:
|
|
10
|
-
`),console.log(A.dim(` D1 Database: ${e} (${n})`)),console.log(A.dim(` KV Namespace: ${e} (${a})
|
|
11
|
-
`))),{d1DatabaseId:n,kvNamespaceId:a}}import I from"node:fs/promises";import $ from"node:path";import M from"chalk";async function W(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)+`
|
|
12
|
-
`,"utf-8")}async function j(e,o,n,a,r){r&&console.log(`Updating configuration files...
|
|
13
|
-
`);let i=$.join(e,"wrangler.jsonc");await k({configPath:i,name:o,d1DatabaseId:n,d1DatabaseName:o,kvNamespaceId:a,verbose:r}),await W(e,o),await g(e,o),r&&console.log(M.dim(" Configuration updated"))}import s from"chalk";async function N(e,o){try{o||console.log(`
|
|
14
|
-
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.
|
|
15
|
-
`)),await l("pnpm",["run","db:migrate:local"],{cwd:e,verbose:o}),console.log(`
|
|
16
|
-
Local database migrations complete.
|
|
17
|
-
`)}catch{console.warn(s.yellow(`
|
|
18
|
-
Failed to run local migrations. You can run them manually with:`)),console.warn(s.dim(` pnpm run db:migrate:local
|
|
19
|
-
`))}}import t from"chalk";function T(e,o,n){console.log(t.green(`\u{1F389} Project created successfully!
|
|
20
|
-
`)),console.log(t.dim(`Location: ${o}
|
|
21
|
-
`)),console.log(`Next steps:
|
|
22
|
-
`),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
|
|
23
|
-
`)),console.log(`Deploy to production:
|
|
24
|
-
`),console.log(t.dim(t.bold(t.italic(" every app deploy # Deploys made easy using the Every App CLI"))))}async function Io(e){let o=e.verbose||!1;await b(),console.log(`
|
|
25
|
-
Create a new Every App project
|
|
26
|
-
`);let n=null;try{let{appId:a}=await v(),{tempDir:r,targetDir:i}=await x(a,o);n=r;let{d1DatabaseId:L,kvNamespaceId:F}=await E(a,o);await j(i,a,L,F,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(Y.red(`
|
|
27
|
-
Failed to create project:`),a instanceof Error?a.message:"Unknown error"),a}finally{n&&await u(n)}}export{Io as default};
|
package/dist/deploy-3XYMW3UD.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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="https://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});let i=G.randomUUID();console.log(),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}),console.log(),await W(t,o,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/deploy-GYS5YEN7.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import{a as T,c as v,d as x}from"./chunk-FQY6RMLS.js";import{a as f,b,c as $}from"./chunk-5PTHALCD.js";import{a as D,c as E,e as y,f as _,g as A,h as C,j as k}from"./chunk-65T2UMWS.js";import m 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 f("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 f("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 h from"chalk";import{randomUUID as V}from"node:crypto";import u from"chalk";async function w(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 i=t.errors?t.errors.map(s=>`[${s.code}] ${s.message}`).join(", "):n.statusText;throw console.error(u.red(`
|
|
14
|
-
D1 Query Error:`)),console.error(u.dim(`SQL: ${e}`)),console.error(u.dim(`Error: ${i}`)),new Error(`D1 query failed: ${i}`)}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(u.red(`
|
|
15
|
-
D1 Query Error:`)),console.error(u.dim(`SQL: ${e}`))),o}}async function F(r,a,e=!1,o,n){try{e&&console.log("Adding apps to user gateways...");let t=await E(),c=(await _()).find(g=>g.name==="every-app-gateway");if(!c){console.warn(h.yellow(`every-app-gateway database not found. Skipping UserApp record creation.
|
|
16
|
-
`));return}let i=c.uuid,s=await w(t,i,"SELECT id, name, email FROM users");if(s.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(s.length===1)await W(t,i,s[0],r,a,p,d,e);else{e&&console.log(h.yellow(`Multiple users found (${s.length}). Adding app to all users...
|
|
17
|
-
`));for(let g of s)await W(t,i,g,r,a,p,d,e);e&&console.log(` UserApp records processed for ${s.length} users
|
|
18
|
-
`)}}catch(t){throw console.error(h.red("Failed to insert UserApp records:"),t instanceof Error?t.message:t),t}}async function W(r,a,e,o,n,t,l,c){let i=Math.floor(Date.now()/1e3);if((await w(r,a,`SELECT id FROM user_apps WHERE user_id = '${e.id}' AND app_id = '${o}'`)).length>0)c&&console.log(h.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}', ${i}, ${i})
|
|
21
|
-
`;await w(r,a,d),console.log(` UserApp record created for user ${e.name} (${e.email})`)}}async function I(r,a,e=!1){e&&console.log("Configuring Secrets...");try{await v("GATEWAY_URL",a,e)||await x("GATEWAY_URL",r,a,e,`Setting GATEWAY_URL to: ${r}`),e&&console.log(`Secret setup complete!
|
|
22
|
-
`)}catch(o){throw console.error(`
|
|
23
|
-
Failed to setup secrets`,o instanceof Error?`
|
|
24
|
-
${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(m.bold(`
|
|
25
|
-
Project name: ${n}
|
|
26
|
-
`)),!await T("Do you want to deploy this app to Cloudflare?")){console.log(m.red(`
|
|
27
|
-
Deployment cancelled by user
|
|
28
|
-
`));return}let{d1DatabaseId:l,kvNamespaceId:c}=await R(o,n,e),i=await y("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,i,n,e),await I(i,a,e);let s=await y(o.name),p,d;o.name==="every-todo-app"&&(p="Todos",d="Minimal todo list"),await F(o.name,s,e,p,d),console.log(m.green(`
|
|
29
|
-
Deployment successful!`)),console.log(m.dim(` This app's url: ${m.cyan(s)}
|
|
30
|
-
`));let g=await y("every-app-gateway");console.log(`Access it on your gateway: ${m.cyan(g)}
|
|
31
|
-
`)}export{we as deploy};
|
|
@@ -1,6 +0,0 @@
|
|
|
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
|
-
Running: ${t.cyan([a,...s].join(" "))}
|
|
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
|
-
Command executed!`)}catch(a){throw console.error(t.red(`
|
|
6
|
-
Failed to generate shell configuration:`),a instanceof Error?a.message:a),a}}export{A as remoteD1Shell};
|