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