UNPKG

@lunora/cli

Version:

The Lunora CLI: init, dev, deploy, codegen, migrate, seed, doctor, insights, logs, registry, and the rest of the project commands

3 lines (2 loc) 3.56 kB
import{d as i}from"./commands-CG9qEtqR.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"}],r="auth",y=async a=>await a("Which auth provider?",o,{default:r})??r,O="mail",S=[{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=a=>{const t=e=>Object.hasOwn(a,e);if(!d(a)){if(t("@lunora/react"))return"auth-ui-react";if(t("@lunora/vue"))return"auth-ui-vue";if(t("@lunora/svelte"))return"auth-ui-svelte";if(t("@lunora/solid"))return"auth-ui-solid";if(t("@lunora/angular"))return"auth-ui-angular";if(t("react")||t("next"))return"auth-ui-react";if(t("vue")||t("nuxt"))return"auth-ui-vue";if(t("svelte")||t("@sveltejs/kit"))return"auth-ui-svelte";if(t("solid-js"))return"auth-ui-solid";if(t("@angular/core"))return"auth-ui-angular"}},_=a=>{const t=a.trim();if(t==="")return;const e=t.toLowerCase();return e==="auth-ui"||e==="auth-ui-"?{kind:"auth-ui"}:e==="auth"?{kind:"auth"}:e==="email"||e==="mail"?{kind:"email"}:{item:e,kind:"item"}},c=/[^a-z0-9]+/u,s=(a,t,e)=>{let n=a.toLowerCase().split(c).filter(Boolean).join("-").slice(0,e);return n.endsWith("-")&&(n=n.slice(0,-1)),n.length>=t?n:void 0},h="DB",f="Name your D1 database (run `wrangler d1 create` to get its id, then put it in wrangler.jsonc)",u=a=>s(a,1,64),p="lunora-db",v=a=>u(`${a}-db`)??p,L=async(a,t)=>{const e=v(t);return u(await a(f,{default:e,placeholder:e}))??e},V=(a,t)=>i(a,"d1_databases",{key:"binding",value:h},"database_name",t),$="SEND_EMAIL",C="Verified destination email for production delivery (blank = set it later in wrangler.jsonc)",b=a=>{const t=a.trim();if(t.length===0||t.includes(" "))return!1;const e=t.indexOf("@");if(e<=0||e!==t.lastIndexOf("@"))return!1;const n=t.slice(e+1);return n.length>=3&&n.includes(".")&&!n.startsWith(".")&&!n.endsWith(".")},D=(a,t)=>{const e=a.trim();if(e!==""){if(!b(e)){t(`"${e}" doesn't look like an email — leaving the placeholder; set destination_address in wrangler.jsonc.`);return}return e}},N=(a,t)=>i(a,"send_email",{key:"name",value:$},"destination_address",t),m="UPLOADS",g="Name your R2 bucket (you can rename it in wrangler.jsonc later)",l=a=>s(a,3,63),k="lunora-uploads",w=a=>l(`${a}-uploads`)??k,E=async(a,t)=>{const e=w(t);return l(await a(g,{default:e,placeholder:e}))??e},W=(a,t)=>i(a,"r2_buckets",{key:"binding",value:m},"bucket_name",t),I=(a,t)=>{for(const e of a)(e.status==="created"||e.status==="updated")&&t.success(`${e.status} ${e.path}${e.tool} now skips Lunora's generated files`),e.status==="failed"&&t.warn(`could not configure ${e.tool} to skip Lunora's generated files: ${e.message??"unknown error"}. Add the entries by hand, or re-run once the path is writable.`),e.status==="manual"&&e.snippet!==void 0&&t.warn(`${e.path} needs an entry so ${e.tool} skips Lunora's generated files — add: ${e.snippet}`)};export{D as a,C as b,u as c,_ as d,v as e,L as f,r as g,y as h,l as i,A as j,S as k,O as l,o as m,I as n,w as o,W as p,N as q,d as r,x as s,V as t,E as u};