everyapp 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as o,c as s}from"./chunk-UJGAFRKR.js";import{proposeCompletions as r}from"@stricli/core";var t=process.argv.slice(3);process.env.COMP_LINE?.endsWith(" ")&&t.push("");await r(s,t,o(process));try{for(let{completion:p}of await r(s,t,o(process)))process.stdout.write(`${p}
2
+ import{a as o,c as s}from"./chunk-4QOYAWFS.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{}
@@ -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 D,buildUninstallCommand as v}from"@stricli/auto-complete";var r="everyapp";var a="Every App CLI - Deploy and manage apps.";var n="0.1.1";import{buildCommand as o,buildRouteMap as m}from"@stricli/core";var c=o({loader:async()=>import("./create-6OS5ZICZ.js"),parameters:{positional:{kind:"tuple",parameters:[{brief:"App ID (kebab-case format)",parse:String,optional:!0}]},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, deploys to Cloudflare, and configures local development.","","Usage: every app create [name]","","The command will:"," 1. Prompt for app ID (or use provided name)"," 2. Deploy to Cloudflare (D1 database, KV namespace, Worker)"," 3. Configure wrangler.jsonc, package.json, and .env files"," 4. Install dependencies and run local migrations","","After creation, run 'pnpm run dev' to start developing."].join(`
2
- `)}}),u=o({loader:async()=>{let{deploy:e}=await import("./deploy-3LXOLSMA.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
- `)}}),f=o({loader:async()=>{let{remoteD1Shell:e}=await import("./remoteD1Shell-2SMKHNPR.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: npx everyapp app remote-d1-shell -- npx drizzle-kit migrate"," - Opening Drizzle Studio: npx everyapp app remote-d1-shell -- npx drizzle-kit studio"," - Pushing schema changes: npx everyapp 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":f},docs:{brief:"App management commands"}});import{buildCommand as y,buildRouteMap as b}from"@stricli/core";var h=y({loader:async()=>{let{deploy:e}=await import("./deploy-TBTO5MQF.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},localGateway:{kind:"parsed",parse:String,brief:"Path to local gateway tarball (for testing)",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(`
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 D,buildUninstallCommand as v}from"@stricli/auto-complete";var r="everyapp";var a="Every App CLI - Deploy and manage apps.";var n="0.1.2";import{buildCommand as o,buildRouteMap as m}from"@stricli/core";var c=o({loader:async()=>import("./create-PG2E4QNS.js"),parameters:{positional:{kind:"tuple",parameters:[{brief:"App ID (kebab-case format)",parse:String,optional:!0}]},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, deploys to Cloudflare, and configures local development.","","Usage: every app create [name]","","The command will:"," 1. Prompt for app ID (or use provided name)"," 2. Deploy to Cloudflare (D1 database, KV namespace, Worker)"," 3. Configure wrangler.jsonc, package.json, and .env files"," 4. Install dependencies and run local migrations","","After creation, run 'pnpm run dev' to start developing."].join(`
2
+ `)}}),u=o({loader:async()=>{let{deploy:e}=await import("./deploy-EBQEMF4L.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
+ `)}}),f=o({loader:async()=>{let{remoteD1Shell:e}=await import("./remoteD1Shell-CLQGHPWT.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: npx everyapp app remote-d1-shell -- npx drizzle-kit migrate"," - Opening Drizzle Studio: npx everyapp app remote-d1-shell -- npx drizzle-kit studio"," - Pushing schema changes: npx everyapp 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":f},docs:{brief:"App management commands"}});import{buildCommand as y,buildRouteMap as b}from"@stricli/core";var h=y({loader:async()=>{let{deploy:e}=await import("./deploy-3IZUMSNO.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},localGateway:{kind:"parsed",parse:String,brief:"Path to local gateway tarball (for testing)",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:D("everyapp",{bash:"__everyapp_bash_complete"}),uninstall:v("everyapp",{bash:!0})},docs:{brief:a,hideRoute:{install:!0,uninstall:!0}}}),M=g(w,{name:r,versionInfo:{currentVersion:n},scanner:{allowArgumentEscapeSequence:!0}});export{A as a,n as b,M as c};
@@ -13,7 +13,8 @@ Please log in to Cloudflare.
13
13
  `),console.log(i.dim(" 1. Create a Cloudflare account (free, no credit card required):")),console.log(i.cyan(` https://dash.cloudflare.com/sign-up
14
14
  `)),console.log(i.dim(` - Skip any Cloudflare onboarding like configuring a domain, this is unnecessary for Every App.
15
15
  `)),console.log(i.dim(` 2. Check your email to verify your email address
16
- `)),console.log(i.dim(" 3. Log in to Cloudflare via the CLI:")),console.log(i.cyan(" npx wrangler login")),console.log(i.dim(" Learn more: ")+i.cyan(`https://developers.cloudflare.com/workers/wrangler/commands/#login
16
+ `)),console.log(i.dim(" 3. Log in to Cloudflare via the CLI:")),console.log(i.cyan(` npx wrangler login
17
+ `)),console.log(i.dim(" - Learn more: ")+i.cyan(`https://developers.cloudflare.com/workers/wrangler/commands/#login
17
18
  `))),process.exit(1)}}async function h(){let e=process.env.CLOUDFLARE_API_TOKEN;if(e)return e;let t=await L();if(N(t.expiration_time)){let n=await F(t.refresh_token);return await T(n),n.oauth_token}return t.oauth_token}async function s(e,t={}){let n=await h(),o=await fetch(`https://api.cloudflare.com/client/v4${e}`,{...t,headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json",...t.headers}}),r=await o.json();if(!o.ok){let a=r.errors?r.errors.map(u=>`[${u.code}] ${u.message}`).join(", "):o.statusText;throw new Error(`Cloudflare API request failed: ${o.status} ${a}`)}if(!r.success){let a=r.errors.map(u=>`[${u.code}] ${u.message}`).join(", ");throw new Error(`Cloudflare API error: ${a}`)}return r.result}async function l(){let e=process.env.CLOUDFLARE_ACCOUNT_ID;if(e)return e;let t=await s("/accounts");if(!t||t.length===0)throw new Error("No Cloudflare accounts found");let n=t[0];if(!n)throw new Error("No Cloudflare accounts found");return n.id}async function U(e){let t=await s(`/accounts/${e}`);if(!t||!t.id)throw new Error(`Account ${e} not found`);return t}async function D(e){try{let t=await s(`/accounts/${e}/workers/subdomain`);if(!t||!t.subdomain)throw new Error("No workers.dev subdomain found for this account");return t.subdomain}catch(t){throw new Error(`Failed to get workers.dev subdomain: ${t instanceof Error?t.message:"Unknown error"}`)}}async function j(e,t){let n=t||await l(),o=await D(n);return`https://${e}.${o}.workers.dev`}import y from"chalk";var R={EMAIL_NOT_VERIFIED:10034,R2_NOT_ENABLED:10042},S={[R.EMAIL_NOT_VERIFIED]:{userMessage:"Almost there! Your Cloudflare account email needs to be verified first.",action:`To verify your email address:
18
19
 
19
20
  1. Check your inbox for a verification email from Cloudflare
@@ -1,4 +1,4 @@
1
- import{b as A,f as O,i as _,k as G,l as V}from"./chunk-H3HRJHG3.js";import{a as v,c as k,e as y,g as D,h as x,i as $,j as P,k as S,l as w,q as T,s as N}from"./chunk-MUQDAOOV.js";import j from"node:fs/promises";import B from"node:path";import*as L from"jsonc-parser";import{z as g}from"zod";var F="every-app.jsonc",Q=g.object({appId:g.string().min(1,"appId cannot be empty"),displayName:g.string().min(1,"displayName cannot be empty").optional(),description:g.string().optional()});async function C(t){let o=B.join(t,F);try{let e=await j.readFile(o,"utf-8"),r=L.parse(e);return Q.parse(r)}catch(e){if(e instanceof Error&&"code"in e&&e.code==="ENOENT")throw new Error("every-app.jsonc not found. Make sure you're running this command from an Every App project directory.");if(e instanceof g.ZodError){let r=e.issues.map(n=>n.message).join(", ");throw new Error(`Invalid every-app.jsonc: ${r}`)}throw e}}function z(t){return t.split("-").map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" ")}async function ae(t,o){let e=B.join(t,F),r={...o,displayName:o.displayName??z(o.appId)},n=JSON.stringify(r,null,2)+`
1
+ import{b as A,f as O,i as _,k as G,l as V}from"./chunk-IVSQUHSD.js";import{a as v,c as k,e as y,g as D,h as x,i as $,j as P,k as S,l as w,q as T,s as N}from"./chunk-AUQOQVKD.js";import j from"node:fs/promises";import B from"node:path";import*as L from"jsonc-parser";import{z as g}from"zod";var F="every-app.jsonc",Q=g.object({appId:g.string().min(1,"appId cannot be empty"),displayName:g.string().min(1,"displayName cannot be empty").optional(),description:g.string().optional()});async function C(t){let o=B.join(t,F);try{let e=await j.readFile(o,"utf-8"),r=L.parse(e);return Q.parse(r)}catch(e){if(e instanceof Error&&"code"in e&&e.code==="ENOENT")throw new Error("every-app.jsonc not found. Make sure you're running this command from an Every App project directory.");if(e instanceof g.ZodError){let r=e.issues.map(n=>n.message).join(", ");throw new Error(`Invalid every-app.jsonc: ${r}`)}throw e}}function z(t){return t.split("-").map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" ")}async function ae(t,o){let e=B.join(t,F),r={...o,displayName:o.displayName??z(o.appId)},n=JSON.stringify(r,null,2)+`
2
2
  `;await j.writeFile(e,n)}async function ie(t){return(await C(t)).appId}import c from"chalk";async function K({appId:t,needsR2Bucket:o=!1,verbose:e=!1}){console.log(`
3
3
  Setting up your Cloudflare ${o?"D1 Database, KV Store, and R2 Bucket":"D1 Database and KV Store"}...
4
4
  `);let n=await y(),s=v(t),i;o&&(i=await H(s,n,e));let a=await Y(s,n,e),p=await J(s,n,e);return{d1DatabaseId:a,kvNamespaceId:p,r2BucketName:i,resourceName:s}}async function Y(t,o,e){e&&(console.log(c.bold(`Processing D1 database...
@@ -1,4 +1,4 @@
1
- import{g as l}from"./chunk-MUQDAOOV.js";import r from"node:fs/promises";import n from"node:path";import f from"node:os";import p from"chalk";async function u(e,t,i={}){let a=i.exclude||[];await r.mkdir(t,{recursive:!0});let m=await r.readdir(e,{withFileTypes:!0});for(let o of m){let s=n.join(e,o.name),c=n.join(t,o.name);a.some(y=>o.name===y)||(o.isDirectory()?await u(s,c,i):await r.copyFile(s,c))}}async function P(e){try{return(await r.stat(e)).isDirectory()}catch{return!1}}async function x({targetDir:e,appId:t}){let i=await l("every-app-gateway"),a=`# Vite client-side secrets
1
+ import{g as l}from"./chunk-AUQOQVKD.js";import r from"node:fs/promises";import n from"node:path";import f from"node:os";import p from"chalk";async function u(e,t,i={}){let a=i.exclude||[];await r.mkdir(t,{recursive:!0});let m=await r.readdir(e,{withFileTypes:!0});for(let o of m){let s=n.join(e,o.name),c=n.join(t,o.name);a.some(y=>o.name===y)||(o.isDirectory()?await u(s,c,i):await r.copyFile(s,c))}}async function P(e){try{return(await r.stat(e)).isDirectory()}catch{return!1}}async function x({targetDir:e,appId:t}){let i=await l("every-app-gateway"),a=`# Vite client-side secrets
2
2
  VITE_APP_ID=${t}
3
3
  VITE_GATEWAY_URL=${i}
4
4
  # Set Cloudflare secrets locally
@@ -1,4 +1,4 @@
1
- import{d as m,e as p,f as h,g as x,m as O,n as b,o as C,r as I,u as k}from"./chunk-MUQDAOOV.js";import L from"enquirer";import A from"chalk";async function N(){if(process.env.CLOUDFLARE_API_TOKEN){let n=process.env.CLOUDFLARE_ACCOUNT_ID;return n||(console.log(A.yellow(`
1
+ import{d as m,e as p,f as h,g as x,m as O,n as b,o as C,r as I,u as k}from"./chunk-AUQOQVKD.js";import L from"enquirer";import A from"chalk";async function N(){if(process.env.CLOUDFLARE_API_TOKEN){let n=process.env.CLOUDFLARE_ACCOUNT_ID;return n||(console.log(A.yellow(`
2
2
  CLOUDFLARE_ACCOUNT_ID is required when using CLOUDFLARE_API_TOKEN
3
3
  `)),process.exit(1)),h(n)}let o=await O(),{account:e,otherAccounts:t}=C(o);return b(e,t),{id:e.account.id,name:e.account.name}}async function V(o="this"){let e=await N();process.env.CLOUDFLARE_API_TOKEN&&(console.log(A.dim(` ${e.name} (${e.id})`)),console.log());let{confirm:t}=await L.prompt({type:"confirm",name:"confirm",message:`Do you want to deploy ${o} to ${e.name}?`,initial:!1});return t}import u from"chalk";var D="every-app-gateway";async function X(o){try{return await fetch(o,{method:"HEAD",signal:AbortSignal.timeout(5e3)}),!0}catch(e){let t=e instanceof Error?e.message.toLowerCase():"",n=e instanceof Error&&"cause"in e&&e.cause?.code?.toLowerCase()||"";return!["ssl","tls","certificate","cert","cipher","handshake","secure"].some(i=>t.includes(i)||n.includes(i))}}async function W(o){try{let e=await fetch(`${o}/api/admin/has-owner`);return e.ok?(await e.json()).hasOwner:!1}catch{return!1}}async function _(){try{let o=await p();return await m(`/accounts/${o}/workers/scripts/${D}/settings`),!0}catch{return!1}}async function E(){return x(D)}async function G(){if(!await _())return{isDeployed:!1,hasOwner:!1,gatewayUrl:await E()};let e=await E();return{isDeployed:!0,hasOwner:await W(e),gatewayUrl:e}}async function Z(){let{isDeployed:o,hasOwner:e,gatewayUrl:t}=await G();if(o||(console.log(u.yellow(`
4
4
  Gateway not deployed
@@ -1,4 +1,4 @@
1
- import{a as k,c as v}from"./chunk-VVLDB7KF.js";import{a as f,b as u,c as y,d as w,e as h}from"./chunk-XOMLGESF.js";import{a as C,b as a,e as x}from"./chunk-H3HRJHG3.js";import{b as g}from"./chunk-MUQDAOOV.js";import d from"chalk";async function P({url:o,targetDir:e,verbose:t=!1}){try{await a("git",["clone",o,e],{verbose:t,logCommandToConsole:!1})}catch(r){throw new Error(`Failed to clone repository from ${o}: ${r instanceof Error?r.message:"Unknown error"}`)}}async function b({targetDir:o,verbose:e=!1}){try{await a("git",["init"],{verbose:e,logCommandToConsole:!1,cwd:o}),await a("git",["add","."],{verbose:e,logCommandToConsole:!1,cwd:o}),await a("git",["commit","-m","Starter template"],{verbose:e,logCommandToConsole:!1,cwd:o})}catch(t){throw new Error(`Failed to initialize git repository: ${t instanceof Error?t.message:"Unknown error"}`)}}import N from"node:fs/promises";import S from"node:path";import c from"chalk";var J=["every-app.jsonc","every-app.json"];async function T(){let o=process.cwd();for(let e of J){let t=S.join(o,e);try{await N.access(t),console.log(c.yellow(`
1
+ import{a as k,c as v}from"./chunk-B4II75QC.js";import{a as f,b as u,c as y,d as w,e as h}from"./chunk-FBRQP77Z.js";import{a as C,b as a,e as x}from"./chunk-IVSQUHSD.js";import{b as g}from"./chunk-AUQOQVKD.js";import d from"chalk";async function P({url:o,targetDir:e,verbose:t=!1}){try{await a("git",["clone",o,e],{verbose:t,logCommandToConsole:!1})}catch(r){throw new Error(`Failed to clone repository from ${o}: ${r instanceof Error?r.message:"Unknown error"}`)}}async function b({targetDir:o,verbose:e=!1}){try{await a("git",["init"],{verbose:e,logCommandToConsole:!1,cwd:o}),await a("git",["add","."],{verbose:e,logCommandToConsole:!1,cwd:o}),await a("git",["commit","-m","Starter template"],{verbose:e,logCommandToConsole:!1,cwd:o})}catch(t){throw new Error(`Failed to initialize git repository: ${t instanceof Error?t.message:"Unknown error"}`)}}import N from"node:fs/promises";import S from"node:path";import c from"chalk";var J=["every-app.jsonc","every-app.json"];async function T(){let o=process.cwd();for(let e of J){let t=S.join(o,e);try{await N.access(t),console.log(c.yellow(`
2
2
  Already inside an Every App project`)),console.log(c.dim(` Found ${e}
3
3
  `)),console.log(`To create a new app, run app create from the directory where you store your projects.
4
4
  `),console.log("If you meant to deploy this app, run:"),console.log(c.dim(` npx everyapp app deploy
@@ -1,4 +1,4 @@
1
- import{d as _,e as D}from"./chunk-XOMLGESF.js";import{a as W,b as v,c as w,d as u,f as K,g as y,h as S,i as L,j as P,l as d}from"./chunk-H3HRJHG3.js";import{b as C,e as T,g as b,i as A,j as R,l as k,p as x,q as G,r as $}from"./chunk-MUQDAOOV.js";import m from"chalk";import pe from"node:path";import c from"chalk";var H="every-app-gateway",z="every-app-gateway";async function U({verbose:e=!1}={}){console.log(`
1
+ import{d as _,e as D}from"./chunk-FBRQP77Z.js";import{a as W,b as v,c as w,d as u,f as K,g as y,h as S,i as L,j as P,l as d}from"./chunk-IVSQUHSD.js";import{b as C,e as T,g as b,i as A,j as R,l as k,p as x,q as G,r as $}from"./chunk-AUQOQVKD.js";import m from"chalk";import pe from"node:path";import c from"chalk";var H="every-app-gateway",z="every-app-gateway";async function U({verbose:e=!1}={}){console.log(`
2
2
  Setting up your Cloudflare D1 Database and KV Store...
3
3
  `);let t=await T(),a=await j(H,t,e),o=await q(z,t,e);return console.log(),{d1DatabaseId:a,kvNamespaceId:o,accountId:t}}async function j(e,t,a){a&&console.log(` Checking D1 database: ${e}`);let o=await A(e,t);return a?o.wasCreated?console.log(c.green(` Created D1 database: ${e} (${o.id})
4
4
  `)):console.log(c.dim(` Linking to existing D1 database: ${e} (${o.id})
@@ -1,4 +1,4 @@
1
- import{b as s,c as i}from"./chunk-VVLDB7KF.js";import{a,e as l}from"./chunk-H3HRJHG3.js";import{b as p}from"./chunk-MUQDAOOV.js";import o from"chalk";import d from"node:fs/promises";import w from"node:path";import c from"chalk";var g=["every-app.jsonc","every-app.json"];async function m(){let r=process.cwd();for(let e of g){let t=w.join(r,e);try{await d.access(t);return}catch{}}console.log(c.yellow(`
1
+ import{b as s,c as i}from"./chunk-B4II75QC.js";import{a,e as l}from"./chunk-IVSQUHSD.js";import{b as p}from"./chunk-AUQOQVKD.js";import o from"chalk";import d from"node:fs/promises";import w from"node:path";import c from"chalk";var g=["every-app.jsonc","every-app.json"];async function m(){let r=process.cwd();for(let e of g){let t=w.join(r,e);try{await d.access(t);return}catch{}}console.log(c.yellow(`
2
2
  Not inside an Every App project`)),console.log(c.dim(` No every-app.jsonc found
3
3
  `)),console.log("To create a new app, run the below command from the directory where you store your projects:"),console.log(c.dim(` npx everyapp app create
4
4
  `)),process.exit(1)}async function F(r){await p(),await l();let e=process.cwd(),t=r.verbose||!1;await m();let n=await s(e);if(console.log(o.bold(`
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as c,b as r,c as p}from"./chunk-UJGAFRKR.js";import{run as b}from"@stricli/core";import n from"chalk";var f="https://registry.npmjs.org/everyapp?fields=dist-tags",g=2e3;async function d(){try{let t=new AbortController,s=setTimeout(()=>t.abort(),g),e=await fetch(f,{signal:t.signal});return clearTimeout(s),e.ok?(await e.json())["dist-tags"].latest:null}catch{return null}}function h(t,s){let e=t.split(".").map(Number),i=s.split(".").map(Number);for(let o=0;o<Math.max(e.length,i.length);o++){let a=e[o]??0,l=i[o]??0;if(a<l)return!0;if(a>l)return!1}return!1}function u(){return d().then(t=>t&&t!==r&&h(r,t)?{updateAvailable:!0,latestVersion:t,currentVersion:r}:{updateAvailable:!1,currentVersion:r})}function m(t){t.updateAvailable&&t.latestVersion&&(console.log(),console.log(n.yellow(` Update available: ${t.currentVersion} \u2192 ${t.latestVersion}`)),console.log(n.dim(` npx: ${n.cyan("npx everyapp@latest")}`)),console.log(n.dim(` global: ${n.cyan("npm update -g everyapp")}`)))}var v=u();await b(p,process.argv.slice(2),c(process));var C=await v;m(C);
2
+ import{a as c,b as r,c as p}from"./chunk-4QOYAWFS.js";import{run as b}from"@stricli/core";import n from"chalk";var f="https://registry.npmjs.org/everyapp?fields=dist-tags",g=2e3;async function d(){try{let t=new AbortController,s=setTimeout(()=>t.abort(),g),e=await fetch(f,{signal:t.signal});return clearTimeout(s),e.ok?(await e.json())["dist-tags"].latest:null}catch{return null}}function h(t,s){let e=t.split(".").map(Number),i=s.split(".").map(Number);for(let o=0;o<Math.max(e.length,i.length);o++){let a=e[o]??0,l=i[o]??0;if(a<l)return!0;if(a>l)return!1}return!1}function u(){return d().then(t=>t&&t!==r&&h(r,t)?{updateAvailable:!0,latestVersion:t,currentVersion:r}:{updateAvailable:!1,currentVersion:r})}function m(t){t.updateAvailable&&t.latestVersion&&(console.log(),console.log(n.yellow(` Update available: ${t.currentVersion} \u2192 ${t.latestVersion}`)),console.log(n.dim(` npx: ${n.cyan("npx everyapp@latest")}`)),console.log(n.dim(` global: ${n.cyan("npm update -g everyapp")}`)))}var v=u();await b(p,process.argv.slice(2),c(process));var C=await v;m(C);
@@ -1,4 +1,4 @@
1
- import{b as i,t as a}from"./chunk-MUQDAOOV.js";import r from"chalk";import{execa as l}from"execa";async function g(m,...o){await i();let n=process.cwd();try{if(!o||o.length===0)throw new Error(`No command provided. Usage: npx everyapp app remote-d1-shell -- <command>
1
+ import{b as i,t as a}from"./chunk-AUQOQVKD.js";import r from"chalk";import{execa as l}from"execa";async function g(m,...o){await i();let n=process.cwd();try{if(!o||o.length===0)throw new Error(`No command provided. Usage: npx everyapp app remote-d1-shell -- <command>
2
2
  Example: npx everyapp 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 c=await a(n);console.log(r.bold(`
3
3
  Running: ${r.cyan([e,...t].join(" "))}
4
4
  `)),await l(e,t,{cwd:n,stdio:"inherit",env:{...process.env,...c}}),console.log(`
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.1.1",
7
+ "version": "0.1.2",
8
8
  "files": [
9
9
  "dist"
10
10
  ],