@every-app/cli 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as o,b as s}from"./chunk-VCCHKIQU.js";import{proposeCompletions as r}from"@stricli/core";var t=process.argv.slice(3);process.env.COMP_LINE?.endsWith(" ")&&t.push("");await r(s,t,o(process));try{for(let{completion:p}of await r(s,t,o(process)))process.stdout.write(`${p}
2
+ import{a as o,b as s}from"./chunk-VEYZ6B3E.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 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.15";import{buildCommand as o,buildRouteMap as m}from"@stricli/core";var c=o({loader:async()=>import("./create-VJJX2DP5.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(`
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.16";import{buildCommand as o,buildRouteMap as m}from"@stricli/core";var c=o({loader:async()=>import("./create-PYI52Y7L.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
2
  `)}}),u=o({loader:async()=>{let{deploy:e}=await import("./deploy-GYS5YEN7.js");return e},parameters:{positional:{kind:"tuple",parameters:[]},flags:{verbose:{kind:"boolean",brief:"Show detailed output during deployment",optional:!0}}},docs:{brief:"Deploy an app to Cloudflare",fullDescription:["Deploys the current app to Cloudflare Workers from the current directory.","The deployment process:"," 1. Reads wrangler.jsonc to determine required resources"," 2. Creates or links D1 databases and KV namespaces"," 3. Updates wrangler.jsonc with resource IDs"," 4. Installs dependencies if needed"," 5. Runs database migrations against production D1"," 6. Builds and deploys using wrangler deploy"].join(`
3
3
  `)}}),y=o({loader:async()=>{let{remoteD1Shell:e}=await import("./remoteD1Shell-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-63XDLKWH.js");return e},parameters:{positional:{kind:"tuple",parameters:[]},flags:{repo:{kind:"parsed",parse:String,brief:"Git repository URL to deploy",optional:!0},verbose:{kind:"boolean",brief:"Show detailed output during deployment",optional:!0}}},docs:{brief:"Deploy the gateway application to Cloudflare",fullDescription:["Clones the gateway repository, installs dependencies, runs migrations, and deploys to Cloudflare Workers.","The deployment process:"," 1. Clones the repository to a temporary directory"," 2. Installs npm dependencies"," 3. Runs database migrations against production D1"," 4. Runs wrangler deploy"," 5. Cleans up temporary files"].join(`
4
+ `)}}),s=m({routes:{create:c,deploy:u,"remote-d1-shell":y},docs:{brief:"App management commands"}});import{buildCommand as f,buildRouteMap as b}from"@stricli/core";var h=f({loader:async()=>{let{deploy:e}=await import("./deploy-3XYMW3UD.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};
@@ -2,7 +2,7 @@ import{a as m,b as d,c as g,d as f,e as u,f as y}from"./chunk-MOGNJRIZ.js";impor
2
2
  Error: pnpm is required but not installed. Please install it first:`)),console.error(C.cyan(` npm i -g pnpm
3
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
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 _="git@github.com:every-app/every-app.git",V="templates/simple-todo";async function x(e,o){o&&console.log(`Cloning template repository...
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
6
  `);let n=await f("every-app-create-");await y(_,n,o),o&&console.log(`Extracting template...
7
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
8
  `)),{tempDir:n,targetDir:r}}import A from"chalk";async function E(e,o){console.log(`Creating Cloudflare resources...
@@ -1,6 +1,6 @@
1
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
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
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
4
  `));else if(!n&&!a){t&&console.log(p.dim(` Generating new JWT key pair...
5
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
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!
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-VCCHKIQU.js";import{run as i}from"@stricli/core";await i(o,process.argv.slice(2),r(process));
2
+ import{a as r,b as o}from"./chunk-VEYZ6B3E.js";import{run as i}from"@stricli/core";await i(o,process.argv.slice(2),r(process));
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "Every App CLI - Deploy and manage apps.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "version": "0.0.15",
7
+ "version": "0.0.16",
8
8
  "files": [
9
9
  "dist"
10
10
  ],