@lunora/cli
Version:
The Lunora CLI: init, dev, deploy, codegen, run, reset, and migrate commands
2 lines (1 loc) • 3.07 kB
JavaScript
import{d as r}from"./commands-B1SpMXov.mjs";const o=[{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"}],n="auth",O=async a=>await a("Which auth provider?",o,{default:n})??n,S="mail",y=[{description:"Next, react-router, TanStack Start, Astro islands",label:"React",value:"auth-ui-react"},{description:"Nuxt, Vue + Vite",label:"Vue",value:"auth-ui-vue"},{description:"SvelteKit, Svelte + Vite",label:"Svelte",value:"auth-ui-svelte"},{description:"TanStack Start Solid, Solid + Vite",label:"Solid",value:"auth-ui-solid"},{description:"Analog",label:"Angular",value:"auth-ui-angular"}],x="auth-ui-react",d=a=>Object.hasOwn(a,"react-native")||Object.hasOwn(a,"@lunora/react-native")||Object.hasOwn(a,"expo"),_=a=>{const e=t=>Object.hasOwn(a,t);if(!d(a)){if(e("@lunora/react"))return"auth-ui-react";if(e("@lunora/vue"))return"auth-ui-vue";if(e("@lunora/svelte"))return"auth-ui-svelte";if(e("@lunora/solid"))return"auth-ui-solid";if(e("@lunora/angular"))return"auth-ui-angular";if(e("react")||e("next"))return"auth-ui-react";if(e("vue")||e("nuxt"))return"auth-ui-vue";if(e("svelte")||e("@sveltejs/kit"))return"auth-ui-svelte";if(e("solid-js"))return"auth-ui-solid";if(e("@angular/core"))return"auth-ui-angular"}},A=a=>{const e=a.trim();if(e==="")return;const t=e.toLowerCase();return t==="auth-ui"||t==="auth-ui-"?{kind:"auth-ui"}:t==="auth"?{kind:"auth"}:t==="email"||t==="mail"?{kind:"email"}:{item:t,kind:"item"}},c=/[^a-z0-9]+/u,u=(a,e,t)=>{let i=a.toLowerCase().split(c).filter(Boolean).join("-").slice(0,t);return i.endsWith("-")&&(i=i.slice(0,-1)),i.length>=e?i:void 0},h="DB",v="Name your D1 database (run `wrangler d1 create` to get its id, then put it in wrangler.jsonc)",l=a=>u(a,1,64),f="lunora-db",b=a=>l(`${a}-db`)??f,V=async(a,e)=>{const t=b(e);return l(await a(v,{default:t,placeholder:t}))??t},C=(a,e)=>r(a,"d1_databases",{key:"binding",value:h},"database_name",e),m="SEND_EMAIL",D="Verified destination email for production delivery (blank = set it later in wrangler.jsonc)",p=a=>{const e=a.trim();if(e.length===0||e.includes(" "))return!1;const t=e.indexOf("@");if(t<=0||t!==e.lastIndexOf("@"))return!1;const i=e.slice(t+1);return i.length>=3&&i.includes(".")&&!i.startsWith(".")&&!i.endsWith(".")},N=(a,e)=>{const t=a.trim();if(t!==""){if(!p(t)){e(`"${t}" doesn't look like an email — leaving the placeholder; set destination_address in wrangler.jsonc.`);return}return t}},E=(a,e)=>r(a,"send_email",{key:"name",value:m},"destination_address",e),$="UPLOADS",g="Name your R2 bucket (you can rename it in wrangler.jsonc later)",s=a=>u(a,3,63),k="lunora-uploads",w=a=>s(`${a}-uploads`)??k,L=async(a,e)=>{const t=w(e);return s(await a(g,{default:t,placeholder:t}))??t},W=(a,e)=>r(a,"r2_buckets",{key:"binding",value:$},"bucket_name",e);export{N as a,D as b,l as c,A as d,b as e,V as f,n as g,_ as h,s as i,y as j,o as k,S as l,E as m,O as n,w as o,W as p,C as q,d as r,x as s,L as u};