@lunora/cli
Version:
The Lunora CLI: init, dev, deploy, codegen, run, reset, and migrate commands
2 lines (1 loc) • 1.97 kB
JavaScript
import{d as s}from"./commands-BhX2Bo9B.mjs";const d=/[^a-z0-9]+/u,r=(e,t,a)=>{let n=e.toLowerCase().split(d).filter(Boolean).join("-").slice(0,a);return n.endsWith("-")&&(n=n.slice(0,-1)),n.length>=t?n:void 0},u="DB",c="Name your D1 database (run `wrangler d1 create` to get its id, then put it in wrangler.jsonc)",l=e=>r(e,1,64),h="lunora-db",m=e=>l(`${e}-db`)??h,y=async(e,t)=>{const a=m(t);return l(await e(c,{default:a,placeholder:a}))??a},_=(e,t)=>s(e,"d1_databases",{key:"binding",value:u},"database_name",t),f=[{description:"Email + password on better-auth (default)",label:"Email & password",value:"auth"},{description:"Clerk-hosted auth",label:"Clerk",value:"auth-clerk"},{description:"Auth0 (OIDC)",label:"Auth0",value:"auth-auth0"}],i="auth",j=async e=>await e("Which auth provider?",f,{default:i})??i,C="mail",D=e=>{const t=e.trim();if(t==="")return;const a=t.toLowerCase();return a==="auth"?{kind:"auth"}:a==="email"||a==="mail"?{kind:"email"}:{item:a,kind:"item"}},p="SEND_EMAIL",A="Verified destination email for production delivery (blank = set it later in wrangler.jsonc)",$=e=>{const t=e.trim();if(t.length===0||t.includes(" "))return!1;const a=t.indexOf("@");if(a<=0||a!==t.lastIndexOf("@"))return!1;const n=t.slice(a+1);return n.length>=3&&n.includes(".")&&!n.startsWith(".")&&!n.endsWith(".")},E=(e,t)=>{const a=e.trim();if(a!==""){if(!$(a)){t(`"${a}" doesn't look like an email — leaving the placeholder; set destination_address in wrangler.jsonc.`);return}return a}},L=(e,t)=>s(e,"send_email",{key:"name",value:p},"destination_address",t),b="UPLOADS",k="Name your R2 bucket (you can rename it in wrangler.jsonc later)",o=e=>r(e,3,63),g="lunora-uploads",w=e=>o(`${e}-uploads`)??g,O=async(e,t)=>{const a=w(t);return o(await e(k,{default:a,placeholder:a}))??a},W=(e,t)=>s(e,"r2_buckets",{key:"binding",value:b},"bucket_name",t);export{w as a,A as b,m as c,E as d,y as e,i as f,j as g,f as h,o as i,_ as j,L as l,C as n,D as o,W as p,l as r,O as u};