@lunora/cli 1.0.0-alpha.217 → 1.0.0-alpha.218
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.
- package/dist/bin.mjs +1 -1
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.mjs +1 -1
- package/dist/packem_chunks/handler.mjs +1 -1
- package/dist/packem_chunks/handler10.mjs +4 -1
- package/dist/packem_chunks/handler11.mjs +2 -4
- package/dist/packem_chunks/handler12.mjs +1 -2
- package/dist/packem_chunks/handler13.mjs +1 -1
- package/dist/packem_chunks/handler14.mjs +1 -1
- package/dist/packem_chunks/handler15.mjs +1 -1
- package/dist/packem_chunks/handler16.mjs +3 -1
- package/dist/packem_chunks/handler17.mjs +1 -3
- package/dist/packem_chunks/handler18.mjs +1 -1
- package/dist/packem_chunks/handler19.mjs +7 -1
- package/dist/packem_chunks/handler2.mjs +2 -1
- package/dist/packem_chunks/handler20.mjs +1 -7
- package/dist/packem_chunks/handler21.mjs +3 -1
- package/dist/packem_chunks/handler22.mjs +3 -2
- package/dist/packem_chunks/handler23.mjs +1 -3
- package/dist/packem_chunks/handler24.mjs +2 -3
- package/dist/packem_chunks/handler25.mjs +99 -1
- package/dist/packem_chunks/handler26.mjs +10 -99
- package/dist/packem_chunks/handler3.mjs +1 -2
- package/dist/packem_chunks/handler4.mjs +1 -1
- package/dist/packem_chunks/handler5.mjs +1 -1
- package/dist/packem_chunks/handler6.mjs +1 -1
- package/dist/packem_chunks/handler7.mjs +3 -1
- package/dist/packem_chunks/handler8.mjs +1 -3
- package/dist/packem_chunks/handler9.mjs +1 -1
- package/dist/packem_chunks/planDevCommand.mjs +6 -6
- package/dist/packem_chunks/runDeployCommand.mjs +1 -0
- package/dist/packem_chunks/runInitCommand.mjs +89 -63
- package/dist/packem_chunks/runMigrateGenerateCommand.mjs +3 -3
- package/dist/packem_shared/{COMMANDS-Cf45cyJN.mjs → COMMANDS-BbQ3-hLn.mjs} +1 -1
- package/dist/packem_shared/{DEFAULT_IMPORT_BATCH_SIZE-CYq3UJmD.mjs → DEFAULT_IMPORT_BATCH_SIZE-BPQYMEmV.mjs} +1 -1
- package/dist/packem_shared/{buildRegistryIndex-BcJgAx76.mjs → buildRegistryIndex-DVmy8fHE.mjs} +1 -1
- package/dist/packem_shared/catalog-Cbzph90w.mjs +1 -0
- package/dist/packem_shared/cli-DOBnG22n.mjs +3 -0
- package/dist/packem_shared/commands-CLLQuHqU.mjs +15 -0
- package/dist/packem_shared/{diffSnapshots-Cnoe8Ob4.mjs → diffSnapshots-DtC5Cs4Z.mjs} +3 -3
- package/dist/packem_shared/{import-8FCB0cUX.mjs → import-DuHtoh4_.mjs} +7 -7
- package/dist/packem_shared/resolve-BWFT7RvE.mjs +5 -0
- package/dist/packem_shared/runAddCommand-BABRWlOb.mjs +1 -0
- package/dist/packem_shared/schemaIrToSnapshot-VpPguG3W.mjs +1 -0
- package/dist/packem_shared/{storage-D5s4vbtJ.mjs → storage-DlUnv7uG.mjs} +1 -1
- package/dist/packem_shared/vectorize-metadata-Br1QnnS8.mjs +1 -0
- package/package.json +11 -11
- package/skills/lunora-deploy/SKILL.md +42 -11
- package/skills/lunora-functions/SKILL.md +42 -14
- package/skills/lunora-migration-helper/SKILL.md +4 -4
- package/skills/lunora-performance-audit/SKILL.md +8 -5
- package/skills/lunora-quickstart/SKILL.md +3 -3
- package/skills/lunora-setup-auth/SKILL.md +23 -6
- package/skills/lunora-setup-hyperdrive/SKILL.md +33 -13
- package/skills/lunora-setup-mail/SKILL.md +34 -28
- package/skills/lunora-setup-scheduler/SKILL.md +15 -10
- package/skills/lunora-setup-storage/SKILL.md +182 -25
- package/dist/packem_chunks/handler27.mjs +0 -10
- package/dist/packem_shared/catalog-CJaormx0.mjs +0 -1
- package/dist/packem_shared/cli-CqNvbTR1.mjs +0 -3
- package/dist/packem_shared/commands-YfMX-Mto.mjs +0 -19
- package/dist/packem_shared/resolve-DZAGzg67.mjs +0 -1
- package/dist/packem_shared/runAddCommand-vE21wRIK.mjs +0 -1
- package/dist/packem_shared/runDeployCommand-o64lz-UD.mjs +0 -1
- package/dist/packem_shared/schemaIrToSnapshot-ogkcpHjM.mjs +0 -1
- package/dist/packem_shared/vectorize-metadata-DbziRKpX.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as Ye}from"./commands-YfMX-Mto.mjs";var M={exports:{}},se,rr;function X(){if(rr)return se;rr=1;const r="2.0.0",i=256,t=Number.MAX_SAFE_INTEGER||9007199254740991,s=16,a=i-6;return se={MAX_LENGTH:i,MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:a,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},se}var ne,tr;function H(){return tr||(tr=1,ne=process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>console.error("SEMVER",...i):()=>{}),ne}var sr;function B(){return sr||(sr=1,(function(r,i){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:a}=X(),h=H();i=r.exports={};const u=i.re=[],f=i.safeRe=[],n=i.src=[],R=i.safeSrc=[],e=i.t={};let o=0;const c="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",a],[c,s]],L=O=>{for(const[P,_]of m)O=O.split(`${P}*`).join(`${P}{0,${_}}`).split(`${P}+`).join(`${P}{1,${_}}`);return O},E=(O,P,_)=>{const G=L(P),y=o++;h(O,y,P),e[O]=y,n[y]=P,R[y]=G,u[y]=new RegExp(P,_?"g":void 0),f[y]=new RegExp(G,_?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${c}*`),E("MAINVERSION",`(${n[e.NUMERICIDENTIFIER]})\\.(${n[e.NUMERICIDENTIFIER]})\\.(${n[e.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${n[e.NUMERICIDENTIFIERLOOSE]})\\.(${n[e.NUMERICIDENTIFIERLOOSE]})\\.(${n[e.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${n[e.NONNUMERICIDENTIFIER]}|${n[e.NUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${n[e.NONNUMERICIDENTIFIER]}|${n[e.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASE",`(?:-(${n[e.PRERELEASEIDENTIFIER]}(?:\\.${n[e.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${n[e.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[e.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${c}+`),E("BUILD",`(?:\\+(${n[e.BUILDIDENTIFIER]}(?:\\.${n[e.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${n[e.MAINVERSION]}${n[e.PRERELEASE]}?${n[e.BUILD]}?`),E("FULL",`^${n[e.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${n[e.MAINVERSIONLOOSE]}${n[e.PRERELEASELOOSE]}?${n[e.BUILD]}?`),E("LOOSE",`^${n[e.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${n[e.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${n[e.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${n[e.XRANGEIDENTIFIER]})(?:\\.(${n[e.XRANGEIDENTIFIER]})(?:\\.(${n[e.XRANGEIDENTIFIER]})(?:${n[e.PRERELEASE]})?${n[e.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${n[e.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[e.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[e.XRANGEIDENTIFIERLOOSE]})(?:${n[e.PRERELEASELOOSE]})?${n[e.BUILD]}?)?)?`),E("XRANGE",`^${n[e.GTLT]}\\s*${n[e.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${n[e.GTLT]}\\s*${n[e.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),E("COERCE",`${n[e.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",n[e.COERCEPLAIN]+`(?:${n[e.PRERELEASE]})?(?:${n[e.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",n[e.COERCE],!0),E("COERCERTLFULL",n[e.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${n[e.LONETILDE]}\\s+`,!0),i.tildeTrimReplace="$1~",E("TILDE",`^${n[e.LONETILDE]}${n[e.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${n[e.LONETILDE]}${n[e.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${n[e.LONECARET]}\\s+`,!0),i.caretTrimReplace="$1^",E("CARET",`^${n[e.LONECARET]}${n[e.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${n[e.LONECARET]}${n[e.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${n[e.GTLT]}\\s*(${n[e.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${n[e.GTLT]}\\s*(${n[e.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${n[e.GTLT]}\\s*(${n[e.LOOSEPLAIN]}|${n[e.XRANGEPLAIN]})`,!0),i.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${n[e.XRANGEPLAIN]})\\s+-\\s+(${n[e.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${n[e.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[e.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(M,M.exports)),M.exports}var ie,nr;function ze(){if(nr)return ie;nr=1;const r=Object.freeze({loose:!0}),i=Object.freeze({});return ie=s=>s?typeof s!="object"?r:s:i,ie}var ae,ir;function zr(){if(ir)return ae;ir=1;const r=/^[0-9]+$/,i=(s,a)=>{if(typeof s=="number"&&typeof a=="number")return s===a?0:s<a?-1:1;const h=r.test(s),u=r.test(a);return h&&u&&(s=+s,a=+a),s===a?0:h&&!u?-1:u&&!h?1:s<a?-1:1};return ae={compareIdentifiers:i,rcompareIdentifiers:(s,a)=>i(a,s)},ae}var oe,ar;function j(){if(ar)return oe;ar=1;const r=H(),{MAX_LENGTH:i,MAX_SAFE_INTEGER:t}=X(),{safeRe:s,t:a}=B(),h=ze(),{compareIdentifiers:u}=zr(),f=(R,e)=>{const o=e.split(".");if(o.length>R.length)return!1;for(let c=0;c<o.length;c++)if(u(R[c],o[c])!==0)return!1;return!0};class n{constructor(e,o){if(o=h(o),e instanceof n){if(e.loose===!!o.loose&&e.includePrerelease===!!o.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);r("SemVer",e,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;const c=e.trim().match(o.loose?s[a.LOOSE]:s[a.FULL]);if(!c)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map(m=>{if(/^[0-9]+$/.test(m)){const L=+m;if(L>=0&&L<t)return L}return m}):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(e instanceof n)){if(typeof e=="string"&&e===this.version)return 0;e=new n(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof n||(e=new n(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof n||(e=new n(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let o=0;do{const c=this.prerelease[o],m=e.prerelease[o];if(r("prerelease compare",o,c,m),c===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(c===void 0)return-1;if(c===m)continue;return u(c,m)}while(++o)}compareBuild(e){e instanceof n||(e=new n(e,this.options));let o=0;do{const c=this.build[o],m=e.build[o];if(r("build compare",o,c,m),c===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(c===void 0)return-1;if(c===m)continue;return u(c,m)}while(++o)}inc(e,o,c){if(e.startsWith("pre")){if(!o&&c===!1)throw new Error("invalid increment argument: identifier is empty");if(o){const m=`-${o}`.match(this.options.loose?s[a.PRERELEASELOOSE]:s[a.PRERELEASE]);if(!m||m[1]!==o)throw new Error(`invalid identifier: ${o}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",o,c);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",o,c);break;case"prepatch":this.prerelease.length=0,this.inc("patch",o,c),this.inc("pre",o,c);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",o,c),this.inc("pre",o,c);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const m=Number(c)?1:0;if(this.prerelease.length===0)this.prerelease=[m];else{let L=this.prerelease.length;for(;--L>=0;)typeof this.prerelease[L]=="number"&&(this.prerelease[L]++,L=-2);if(L===-1){if(o===this.prerelease.join(".")&&c===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(m)}}if(o){let L=[o,m];if(c===!1&&(L=[o]),f(this.prerelease,o)){const E=this.prerelease[o.split(".").length];isNaN(E)&&(this.prerelease=L)}else this.prerelease=L}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return oe=n,oe}var ue,or;function V(){if(or)return ue;or=1;const r=j();return ue=(t,s,a=!1)=>{if(t instanceof r)return t;try{return new r(t,s)}catch(h){if(!a)return null;throw h}},ue}var ce,ur;function tt(){if(ur)return ce;ur=1;const r=V();return ce=(t,s)=>{const a=r(t,s);return a?a.version:null},ce}var le,cr;function st(){if(cr)return le;cr=1;const r=V();return le=(t,s)=>{const a=r(t.trim().replace(/^[=v]+/,""),s);return a?a.version:null},le}var fe,lr;function nt(){if(lr)return fe;lr=1;const r=j();return fe=(t,s,a,h,u)=>{typeof a=="string"&&(u=h,h=a,a=void 0);try{return new r(t instanceof r?t.version:t,a).inc(s,h,u).version}catch{return null}},fe}var he,fr;function it(){if(fr)return he;fr=1;const r=V();return he=(t,s)=>{const a=r(t,null,!0),h=r(s,null,!0),u=a.compare(h);if(u===0)return null;const f=u>0,n=f?a:h,R=f?h:a,e=!!n.prerelease.length;if(!!R.prerelease.length&&!e){if(!R.patch&&!R.minor)return"major";if(R.compareMain(n)===0)return R.minor&&!R.patch?"minor":"patch"}const c=e?"pre":"";return a.major!==h.major?c+"major":a.minor!==h.minor?c+"minor":a.patch!==h.patch?c+"patch":"prerelease"},he}var Ee,hr;function at(){if(hr)return Ee;hr=1;const r=j();return Ee=(t,s)=>new r(t,s).major,Ee}var pe,Er;function ot(){if(Er)return pe;Er=1;const r=j();return pe=(t,s)=>new r(t,s).minor,pe}var me,pr;function ut(){if(pr)return me;pr=1;const r=j();return me=(t,s)=>new r(t,s).patch,me}var Re,mr;function ct(){if(mr)return Re;mr=1;const r=V();return Re=(t,s)=>{const a=r(t,s);return a&&a.prerelease.length?a.prerelease:null},Re}var de,Rr;function U(){if(Rr)return de;Rr=1;const r=j();return de=(t,s,a)=>new r(t,a).compare(new r(s,a)),de}var ve,dr;function lt(){if(dr)return ve;dr=1;const r=U();return ve=(t,s,a)=>r(s,t,a),ve}var $e,vr;function ft(){if(vr)return $e;vr=1;const r=U();return $e=(t,s)=>r(t,s,!0),$e}var Ie,$r;function Ke(){if($r)return Ie;$r=1;const r=j();return Ie=(t,s,a)=>{const h=new r(t,a),u=new r(s,a);return h.compare(u)||h.compareBuild(u)},Ie}var Le,Ir;function ht(){if(Ir)return Le;Ir=1;const r=Ke();return Le=(t,s)=>t.sort((a,h)=>r(a,h,s)),Le}var Ne,Lr;function Et(){if(Lr)return Ne;Lr=1;const r=Ke();return Ne=(t,s)=>t.sort((a,h)=>r(h,a,s)),Ne}var Se,Nr;function W(){if(Nr)return Se;Nr=1;const r=U();return Se=(t,s,a)=>r(t,s,a)>0,Se}var Oe,Sr;function Ze(){if(Sr)return Oe;Sr=1;const r=U();return Oe=(t,s,a)=>r(t,s,a)<0,Oe}var Ae,Or;function Kr(){if(Or)return Ae;Or=1;const r=U();return Ae=(t,s,a)=>r(t,s,a)===0,Ae}var Te,Ar;function Zr(){if(Ar)return Te;Ar=1;const r=U();return Te=(t,s,a)=>r(t,s,a)!==0,Te}var ge,Tr;function Je(){if(Tr)return ge;Tr=1;const r=U();return ge=(t,s,a)=>r(t,s,a)>=0,ge}var we,gr;function Qe(){if(gr)return we;gr=1;const r=U();return we=(t,s,a)=>r(t,s,a)<=0,we}var Pe,wr;function Jr(){if(wr)return Pe;wr=1;const r=Kr(),i=Zr(),t=W(),s=Je(),a=Ze(),h=Qe();return Pe=(f,n,R,e)=>{switch(n){case"===":return typeof f=="object"&&(f=f.version),typeof R=="object"&&(R=R.version),f===R;case"!==":return typeof f=="object"&&(f=f.version),typeof R=="object"&&(R=R.version),f!==R;case"":case"=":case"==":return r(f,R,e);case"!=":return i(f,R,e);case">":return t(f,R,e);case">=":return s(f,R,e);case"<":return a(f,R,e);case"<=":return h(f,R,e);default:throw new TypeError(`Invalid operator: ${n}`)}},Pe}var Ce,Pr;function pt(){if(Pr)return Ce;Pr=1;const r=j(),i=V(),{safeRe:t,t:s}=B();return Ce=(h,u)=>{if(h instanceof r)return h;if(typeof h=="number"&&(h=String(h)),typeof h!="string")return null;u=u||{};let f=null;if(!u.rtl)f=h.match(u.includePrerelease?t[s.COERCEFULL]:t[s.COERCE]);else{const m=u.includePrerelease?t[s.COERCERTLFULL]:t[s.COERCERTL];let L;for(;(L=m.exec(h))&&(!f||f.index+f[0].length!==h.length);)(!f||L.index+L[0].length!==f.index+f[0].length)&&(f=L),m.lastIndex=L.index+L[1].length+L[2].length;m.lastIndex=-1}if(f===null)return null;const n=f[2],R=f[3]||"0",e=f[4]||"0",o=u.includePrerelease&&f[5]?`-${f[5]}`:"",c=u.includePrerelease&&f[6]?`+${f[6]}`:"";return i(`${n}.${R}.${e}${o}${c}`,u)},Ce}var qe,Cr;function mt(){if(Cr)return qe;Cr=1;const r=V(),i=X(),t=j(),s=(f,n,R)=>{if(!i.RELEASE_TYPES.includes(n))return null;const e=a(f,R);return e&&h(e,n)},a=(f,n)=>{const R=f instanceof t?f.version:f;return r(R,n)},h=(f,n)=>{if(u(n))return f.version;switch(f.prerelease=[],n){case"major":f.minor=0,f.patch=0;break;case"minor":f.patch=0;break}return f.format()},u=f=>f.startsWith("pre");return qe=s,qe}var De,qr;function Rt(){if(qr)return De;qr=1;class r{constructor(){this.max=1e3,this.map=new Map}get(t){const s=this.map.get(t);if(s!==void 0)return this.map.delete(t),this.map.set(t,s),s}delete(t){return this.map.delete(t)}set(t,s){if(!this.delete(t)&&s!==void 0){if(this.map.size>=this.max){const h=this.map.keys().next().value;this.delete(h)}this.map.set(t,s)}return this}}return De=r,De}var _e,Dr;function F(){if(Dr)return _e;Dr=1;const r=/\s+/g;class i{constructor(l,$){if($=a($),l instanceof i)return l.loose===!!$.loose&&l.includePrerelease===!!$.includePrerelease?l:new i(l.raw,$);if(l instanceof h)return this.raw=l.value,this.set=[[l]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=l.trim().replace(r," "),this.set=this.raw.split("||").map(v=>this.parseRange(v.trim())).filter(v=>v.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const v=this.set[0];if(this.set=this.set.filter(S=>!P(S[0])),this.set.length===0)this.set=[v];else if(this.set.length>1){for(const S of this.set)if(S.length===1&&_(S[0])){this.set=[S];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let l=0;l<this.set.length;l++){l>0&&(this.formatted+="||");const $=this.set[l];for(let v=0;v<$.length;v++)v>0&&(this.formatted+=" "),this.formatted+=$[v].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(l){l=l.replace(O,"");const v=((this.options.includePrerelease&&L)|(this.options.loose&&E))+":"+l,S=s.get(v);if(S)return S;const d=this.options.loose,I=d?n[e.HYPHENRANGELOOSE]:n[e.HYPHENRANGE];l=l.replace(I,re(this.options.includePrerelease)),u("hyphen replace",l),l=l.replace(n[e.COMPARATORTRIM],o),u("comparator trim",l),l=l.replace(n[e.TILDETRIM],c),u("tilde trim",l),l=l.replace(n[e.CARETTRIM],m),u("caret trim",l);let g=l.split(" ").map(q=>y(q,this.options)).join(" ").split(/\s+/).map(q=>ee(q,this.options));d&&(g=g.filter(q=>(u("loose invalid filter",q,this.options),!!q.match(n[e.COMPARATORLOOSE])))),u("range list",g);const A=new Map,w=g.map(q=>new h(q,this.options));for(const q of w){if(P(q))return[q];A.set(q.value,q)}A.size>1&&A.has("")&&A.delete("");const b=[...A.values()];return s.set(v,b),b}intersects(l,$){if(!(l instanceof i))throw new TypeError("a Range is required");return this.set.some(v=>G(v,$)&&l.set.some(S=>G(S,$)&&v.every(d=>S.every(I=>d.intersects(I,$)))))}test(l){if(!l)return!1;if(typeof l=="string")try{l=new f(l,this.options)}catch{return!1}for(let $=0;$<this.set.length;$++)if(te(this.set[$],l,this.options))return!0;return!1}}_e=i;const t=Rt(),s=new t,a=ze(),h=Y(),u=H(),f=j(),{safeRe:n,src:R,t:e,comparatorTrimReplace:o,tildeTrimReplace:c,caretTrimReplace:m}=B(),{FLAG_INCLUDE_PRERELEASE:L,FLAG_LOOSE:E}=X(),O=new RegExp(R[e.BUILD],"g"),P=p=>p.value==="<0.0.0-0",_=p=>p.value==="",G=(p,l)=>{let $=!0;const v=p.slice();let S=v.pop();for(;$&&v.length;)$=v.every(d=>S.intersects(d,l)),S=v.pop();return $},y=(p,l)=>(p=p.replace(n[e.BUILD],""),u("comp",p,l),p=x(p,l),u("caret",p),p=D(p,l),u("tildes",p),p=Z(p,l),u("xrange",p),p=Q(p,l),u("stars",p),p),T=p=>!p||p.toLowerCase()==="x"||p==="*",C=(p,l,$)=>T(p)&&!T(l)||T(l)&&$&&!T($),D=(p,l)=>p.trim().split(/\s+/).map($=>N($,l)).join(" "),N=(p,l)=>{const $=l.loose?n[e.TILDELOOSE]:n[e.TILDE],v=l.includePrerelease?"-0":"";return p.replace($,(S,d,I,g,A)=>{u("tilde",p,S,d,I,g,A);let w;return T(d)?w="":T(I)?w=`>=${d}.0.0${v} <${+d+1}.0.0-0`:T(g)?w=`>=${d}.${I}.0${v} <${d}.${+I+1}.0-0`:A?(u("replaceTilde pr",A),w=`>=${d}.${I}.${g}-${A} <${d}.${+I+1}.0-0`):w=`>=${d}.${I}.${g} <${d}.${+I+1}.0-0`,u("tilde return",w),w})},x=(p,l)=>p.trim().split(/\s+/).map($=>K($,l)).join(" "),K=(p,l)=>{u("caret",p,l);const $=l.loose?n[e.CARETLOOSE]:n[e.CARET],v=l.includePrerelease?"-0":"";return p.replace($,(S,d,I,g,A)=>{u("caret",p,S,d,I,g,A);let w;return T(d)?w="":T(I)?w=`>=${d}.0.0${v} <${+d+1}.0.0-0`:T(g)?d==="0"?w=`>=${d}.${I}.0${v} <${d}.${+I+1}.0-0`:w=`>=${d}.${I}.0${v} <${+d+1}.0.0-0`:A?(u("replaceCaret pr",A),d==="0"?I==="0"?w=`>=${d}.${I}.${g}-${A} <${d}.${I}.${+g+1}-0`:w=`>=${d}.${I}.${g}-${A} <${d}.${+I+1}.0-0`:w=`>=${d}.${I}.${g}-${A} <${+d+1}.0.0-0`):(u("no pr"),d==="0"?I==="0"?w=`>=${d}.${I}.${g} <${d}.${I}.${+g+1}-0`:w=`>=${d}.${I}.${g} <${d}.${+I+1}.0-0`:w=`>=${d}.${I}.${g} <${+d+1}.0.0-0`),u("caret return",w),w})},Z=(p,l)=>(u("replaceXRanges",p,l),p.split(/\s+/).map($=>J($,l)).join(" ")),J=(p,l)=>{p=p.trim();const $=l.loose?n[e.XRANGELOOSE]:n[e.XRANGE];return p.replace($,(v,S,d,I,g,A)=>{if(u("xRange",p,v,S,d,I,g,A),C(d,I,g))return p;const w=T(d),b=w||T(I),q=b||T(g),k=q;return S==="="&&k&&(S=""),A=l.includePrerelease?"-0":"",w?S===">"||S==="<"?v="<0.0.0-0":v="*":S&&k?(b&&(I=0),g=0,S===">"?(S=">=",b?(d=+d+1,I=0,g=0):(I=+I+1,g=0)):S==="<="&&(S="<",b?d=+d+1:I=+I+1),S==="<"&&(A="-0"),v=`${S+d}.${I}.${g}${A}`):b?v=`>=${d}.0.0${A} <${+d+1}.0.0-0`:q&&(v=`>=${d}.${I}.0${A} <${d}.${+I+1}.0-0`),u("xRange return",v),v})},Q=(p,l)=>(u("replaceStars",p,l),p.trim().replace(n[e.STAR],"")),ee=(p,l)=>(u("replaceGTE0",p,l),p.trim().replace(n[l.includePrerelease?e.GTE0PRE:e.GTE0],"")),re=p=>(l,$,v,S,d,I,g,A,w,b,q,k)=>(T(v)?$="":T(S)?$=`>=${v}.0.0${p?"-0":""}`:T(d)?$=`>=${v}.${S}.0${p?"-0":""}`:I?$=`>=${$}`:$=`>=${$}${p?"-0":""}`,T(w)?A="":T(b)?A=`<${+w+1}.0.0-0`:T(q)?A=`<${w}.${+b+1}.0-0`:k?A=`<=${w}.${b}.${q}-${k}`:p?A=`<${w}.${b}.${+q+1}-0`:A=`<=${A}`,`${$} ${A}`.trim()),te=(p,l,$)=>{for(let v=0;v<p.length;v++)if(!p[v].test(l))return!1;if(l.prerelease.length&&!$.includePrerelease){for(let v=0;v<p.length;v++)if(u(p[v].semver),p[v].semver!==h.ANY&&p[v].semver.prerelease.length>0){const S=p[v].semver;if(S.major===l.major&&S.minor===l.minor&&S.patch===l.patch)return!0}return!1}return!0};return _e}var ye,_r;function Y(){if(_r)return ye;_r=1;const r=Symbol("SemVer ANY");class i{static get ANY(){return r}constructor(e,o){if(o=t(o),e instanceof i){if(e.loose===!!o.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,o),this.options=o,this.loose=!!o.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const o=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],c=e.match(o);if(!c)throw new TypeError(`Invalid comparator: ${e}`);this.operator=c[1]!==void 0?c[1]:"",this.operator==="="&&(this.operator=""),c[2]?this.semver=new f(c[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if(typeof e=="string")try{e=new f(e,this.options)}catch{return!1}return h(e,this.operator,this.semver,this.options)}intersects(e,o){if(!(e instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new n(e.value,o).test(this.value):e.operator===""?e.value===""?!0:new n(this.value,o).test(e.semver):(o=t(o),o.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!o.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||h(this.semver,"<",e.semver,o)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||h(this.semver,">",e.semver,o)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}ye=i;const t=ze(),{safeRe:s,t:a}=B(),h=Jr(),u=H(),f=j(),n=F();return ye}var je,yr;function z(){if(yr)return je;yr=1;const r=F();return je=(t,s,a)=>{try{s=new r(s,a)}catch{return!1}return s.test(t)},je}var Ge,jr;function dt(){if(jr)return Ge;jr=1;const r=F();return Ge=(t,s)=>new r(t,s).set.map(a=>a.map(h=>h.value).join(" ").trim().split(" ")),Ge}var be,Gr;function vt(){if(Gr)return be;Gr=1;const r=j(),i=F();return be=(s,a,h)=>{let u=null,f=null,n=null;try{n=new i(a,h)}catch{return null}return s.forEach(R=>{n.test(R)&&(!u||f.compare(R)===-1)&&(u=R,f=new r(u,h))}),u},be}var Ue,br;function $t(){if(br)return Ue;br=1;const r=j(),i=F();return Ue=(s,a,h)=>{let u=null,f=null,n=null;try{n=new i(a,h)}catch{return null}return s.forEach(R=>{n.test(R)&&(!u||f.compare(R)===1)&&(u=R,f=new r(u,h))}),u},Ue}var Fe,Ur;function It(){if(Ur)return Fe;Ur=1;const r=j(),i=F(),t=W();return Fe=(a,h)=>{a=new i(a,h);let u=new r("0.0.0");if(a.test(u)||(u=new r("0.0.0-0"),a.test(u)))return u;u=null;for(let f=0;f<a.set.length;++f){const n=a.set[f];let R=null;n.forEach(e=>{const o=new r(e.semver.version);switch(e.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!R||t(o,R))&&(R=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),R&&(!u||t(u,R))&&(u=R)}return u&&a.test(u)?u:null},Fe}var Ve,Fr;function Lt(){if(Fr)return Ve;Fr=1;const r=F();return Ve=(t,s)=>{try{return new r(t,s).range||"*"}catch{return null}},Ve}var xe,Vr;function er(){if(Vr)return xe;Vr=1;const r=j(),i=Y(),{ANY:t}=i,s=F(),a=z(),h=W(),u=Ze(),f=Qe(),n=Je();return xe=(e,o,c,m)=>{e=new r(e,m),o=new s(o,m);let L,E,O,P,_;switch(c){case">":L=h,E=f,O=u,P=">",_=">=";break;case"<":L=u,E=n,O=h,P="<",_="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,o,m))return!1;for(let G=0;G<o.set.length;++G){const y=o.set[G];let T=null,C=null;if(y.forEach(D=>{D.semver===t&&(D=new i(">=0.0.0")),T=T||D,C=C||D,L(D.semver,T.semver,m)?T=D:O(D.semver,C.semver,m)&&(C=D)}),T.operator===P||T.operator===_||(!C.operator||C.operator===P)&&E(e,C.semver))return!1;if(C.operator===_&&O(e,C.semver))return!1}return!0},xe}var ke,xr;function Nt(){if(xr)return ke;xr=1;const r=er();return ke=(t,s,a)=>r(t,s,">",a),ke}var Xe,kr;function St(){if(kr)return Xe;kr=1;const r=er();return Xe=(t,s,a)=>r(t,s,"<",a),Xe}var Be,Xr;function Ot(){if(Xr)return Be;Xr=1;const r=F();return Be=(t,s,a)=>(t=new r(t,a),s=new r(s,a),t.intersects(s,a)),Be}var Me,Br;function At(){if(Br)return Me;Br=1;const r=z(),i=U();return Me=(t,s,a)=>{const h=[];let u=null,f=null;const n=t.sort((c,m)=>i(c,m,a));for(const c of n)r(c,s,a)?(f=c,u||(u=c)):(f&&h.push([u,f]),f=null,u=null);u&&h.push([u,null]);const R=[];for(const[c,m]of h)c===m?R.push(c):!m&&c===n[0]?R.push("*"):m?c===n[0]?R.push(`<=${m}`):R.push(`${c} - ${m}`):R.push(`>=${c}`);const e=R.join(" || "),o=typeof s.raw=="string"?s.raw:String(s);return e.length<o.length?e:s},Me}var He,Mr;function Tt(){if(Mr)return He;Mr=1;const r=F(),i=Y(),{ANY:t}=i,s=z(),a=U(),h=(o,c,m={})=>{if(o===c)return!0;o=new r(o,m),c=new r(c,m);let L=!1;e:for(const E of o.set){for(const O of c.set){const P=n(E,O,m);if(L=L||P!==null,P)continue e}if(L)return!1}return!0},u=[new i(">=0.0.0-0")],f=[new i(">=0.0.0")],n=(o,c,m)=>{if(o===c)return!0;if(o.length===1&&o[0].semver===t){if(c.length===1&&c[0].semver===t)return!0;m.includePrerelease?o=u:o=f}if(c.length===1&&c[0].semver===t){if(m.includePrerelease)return!0;c=f}const L=new Set;let E,O;for(const N of o)N.operator===">"||N.operator===">="?E=R(E,N,m):N.operator==="<"||N.operator==="<="?O=e(O,N,m):L.add(N.semver);if(L.size>1)return null;let P;if(E&&O){if(P=a(E.semver,O.semver,m),P>0)return null;if(P===0&&(E.operator!==">="||O.operator!=="<="))return null}for(const N of L){if(E&&!s(N,String(E),m)||O&&!s(N,String(O),m))return null;for(const x of c)if(!s(N,String(x),m))return!1;return!0}let _,G,y,T,C=O&&!m.includePrerelease&&O.semver.prerelease.length?O.semver:!1,D=E&&!m.includePrerelease&&E.semver.prerelease.length?E.semver:!1;C&&C.prerelease.length===1&&O.operator==="<"&&C.prerelease[0]===0&&(C=!1);for(const N of c){if(T=T||N.operator===">"||N.operator===">=",y=y||N.operator==="<"||N.operator==="<=",E){if(D&&N.semver.prerelease&&N.semver.prerelease.length&&N.semver.major===D.major&&N.semver.minor===D.minor&&N.semver.patch===D.patch&&(D=!1),N.operator===">"||N.operator===">="){if(_=R(E,N,m),_===N&&_!==E)return!1}else if(E.operator===">="&&!N.test(E.semver))return!1}if(O){if(C&&N.semver.prerelease&&N.semver.prerelease.length&&N.semver.major===C.major&&N.semver.minor===C.minor&&N.semver.patch===C.patch&&(C=!1),N.operator==="<"||N.operator==="<="){if(G=e(O,N,m),G===N&&G!==O)return!1}else if(O.operator==="<="&&!N.test(O.semver))return!1}if(!N.operator&&(O||E)&&P!==0)return!1}return!(E&&y&&!O&&P!==0||O&&T&&!E&&P!==0||D||C)},R=(o,c,m)=>{if(!o)return c;const L=a(o.semver,c.semver,m);return L>0?o:L<0||c.operator===">"&&o.operator===">="?c:o},e=(o,c,m)=>{if(!o)return c;const L=a(o.semver,c.semver,m);return L<0?o:L>0||c.operator==="<"&&o.operator==="<="?c:o};return He=h,He}var We,Hr;function gt(){if(Hr)return We;Hr=1;const r=B(),i=X(),t=j(),s=zr(),a=V(),h=tt(),u=st(),f=nt(),n=it(),R=at(),e=ot(),o=ut(),c=ct(),m=U(),L=lt(),E=ft(),O=Ke(),P=ht(),_=Et(),G=W(),y=Ze(),T=Kr(),C=Zr(),D=Je(),N=Qe(),x=Jr(),K=pt(),Z=mt(),J=Y(),Q=F(),ee=z(),re=dt(),te=vt(),p=$t(),l=It(),$=Lt(),v=er(),S=Nt(),d=St(),I=Ot(),g=At(),A=Tt();return We={parse:a,valid:h,clean:u,inc:f,diff:n,major:R,minor:e,patch:o,prerelease:c,compare:m,rcompare:L,compareLoose:E,compareBuild:O,sort:P,rsort:_,gt:G,lt:y,eq:T,neq:C,gte:D,lte:N,cmp:x,coerce:K,truncate:Z,Comparator:J,Range:Q,satisfies:ee,toComparators:re,maxSatisfying:te,minSatisfying:p,minVersion:l,validRange:$,outside:v,gtr:S,ltr:d,intersects:I,simplifyRange:g,subset:A,SemVer:t,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers},We}var Wr=gt();const wt=[{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"}],Yr="auth",Bt=async r=>await r("Which auth provider?",wt,{default:Yr})??Yr,Mt="mail",Ht=[{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 1.x + Vite",label:"Solid",value:"auth-ui-solid"},{description:"Solid 2.0 + Vite (@solidjs/web)",label:"Solid 2",value:"auth-ui-solid-v2"},{description:"Analog",label:"Angular",value:"auth-ui-angular"}],Wt="auth-ui-react",Pt=r=>Object.hasOwn(r,"react-native")||Object.hasOwn(r,"@lunora/react-native")||Object.hasOwn(r,"expo"),Ct=r=>{if(!(r===void 0||Wr.validRange(r)===null))return Wr.minVersion(r)?.major},qt=r=>Object.hasOwn(r,"@solidjs/web")||(Ct(r["solid-js"])??0)>=2,Yt=r=>{const i=t=>Object.hasOwn(r,t);if(!Pt(r)){if(qt(r))return"auth-ui-solid-v2";if(i("@lunora/react"))return"auth-ui-react";if(i("@lunora/vue"))return"auth-ui-vue";if(i("@lunora/svelte"))return"auth-ui-svelte";if(i("@lunora/solid"))return"auth-ui-solid";if(i("@lunora/angular"))return"auth-ui-angular";if(i("react")||i("next"))return"auth-ui-react";if(i("vue")||i("nuxt"))return"auth-ui-vue";if(i("svelte")||i("@sveltejs/kit"))return"auth-ui-svelte";if(i("solid-js"))return"auth-ui-solid";if(i("@angular/core"))return"auth-ui-angular"}},zt=r=>{const i=r.trim();if(i==="")return;const t=i.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"}},Dt=/[^a-z0-9]+/u,Qr=(r,i,t)=>{let s=r.toLowerCase().split(Dt).filter(Boolean).join("-").slice(0,t);return s.endsWith("-")&&(s=s.slice(0,-1)),s.length>=i?s:void 0},_t="DB",yt="Name your D1 database (run `wrangler d1 create` to get its id, then put it in wrangler.jsonc)",et=r=>Qr(r,1,64),jt="lunora-db",Gt=r=>et(`${r}-db`)??jt,Kt=async(r,i)=>{const t=Gt(i);return et(await r(yt,{default:t,placeholder:t}))??t},Zt=(r,i)=>Ye(r,"d1_databases",{key:"binding",value:_t},"database_name",i),bt="SEND_EMAIL",Jt="Verified destination email for production delivery (blank = set it later in wrangler.jsonc)",Ut=r=>{const i=r.trim();if(i.length===0||i.includes(" "))return!1;const t=i.indexOf("@");if(t<=0||t!==i.lastIndexOf("@"))return!1;const s=i.slice(t+1);return s.length>=3&&s.includes(".")&&!s.startsWith(".")&&!s.endsWith(".")},Qt=(r,i)=>{const t=r.trim();if(t!==""){if(!Ut(t)){i(`"${t}" doesn't look like an email — leaving the placeholder; set destination_address in wrangler.jsonc.`);return}return t}},es=(r,i)=>Ye(r,"send_email",{key:"name",value:bt},"destination_address",i),Ft="UPLOADS",Vt="Name your R2 bucket (you can rename it in wrangler.jsonc later)",rt=r=>Qr(r,3,63),xt="lunora-uploads",kt=r=>rt(`${r}-uploads`)??xt,rs=async(r,i)=>{const t=kt(i);return rt(await r(Vt,{default:t,placeholder:t}))??t},ts=(r,i)=>Ye(r,"r2_buckets",{key:"binding",value:Ft},"bucket_name",i);export{Ht as A,Yr as D,Mt as E,Jt as M,et as a,Gt as b,Kt as c,kt as d,Bt as e,Yt as f,Wt as g,wt as h,Pt as i,es as j,Zt as k,zt as n,rs as p,Qt as r,rt as s,ts as w};
|
|
1
|
+
import{s as Ye}from"./commands-CLLQuHqU.mjs";var M={exports:{}},se,rr;function X(){if(rr)return se;rr=1;const r="2.0.0",i=256,t=Number.MAX_SAFE_INTEGER||9007199254740991,s=16,a=i-6;return se={MAX_LENGTH:i,MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:a,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},se}var ne,tr;function H(){return tr||(tr=1,ne=process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>console.error("SEMVER",...i):()=>{}),ne}var sr;function B(){return sr||(sr=1,(function(r,i){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:a}=X(),h=H();i=r.exports={};const u=i.re=[],f=i.safeRe=[],n=i.src=[],R=i.safeSrc=[],e=i.t={};let o=0;const c="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",a],[c,s]],L=O=>{for(const[P,_]of m)O=O.split(`${P}*`).join(`${P}{0,${_}}`).split(`${P}+`).join(`${P}{1,${_}}`);return O},E=(O,P,_)=>{const G=L(P),y=o++;h(O,y,P),e[O]=y,n[y]=P,R[y]=G,u[y]=new RegExp(P,_?"g":void 0),f[y]=new RegExp(G,_?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${c}*`),E("MAINVERSION",`(${n[e.NUMERICIDENTIFIER]})\\.(${n[e.NUMERICIDENTIFIER]})\\.(${n[e.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${n[e.NUMERICIDENTIFIERLOOSE]})\\.(${n[e.NUMERICIDENTIFIERLOOSE]})\\.(${n[e.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${n[e.NONNUMERICIDENTIFIER]}|${n[e.NUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${n[e.NONNUMERICIDENTIFIER]}|${n[e.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASE",`(?:-(${n[e.PRERELEASEIDENTIFIER]}(?:\\.${n[e.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${n[e.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[e.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${c}+`),E("BUILD",`(?:\\+(${n[e.BUILDIDENTIFIER]}(?:\\.${n[e.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${n[e.MAINVERSION]}${n[e.PRERELEASE]}?${n[e.BUILD]}?`),E("FULL",`^${n[e.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${n[e.MAINVERSIONLOOSE]}${n[e.PRERELEASELOOSE]}?${n[e.BUILD]}?`),E("LOOSE",`^${n[e.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${n[e.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${n[e.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${n[e.XRANGEIDENTIFIER]})(?:\\.(${n[e.XRANGEIDENTIFIER]})(?:\\.(${n[e.XRANGEIDENTIFIER]})(?:${n[e.PRERELEASE]})?${n[e.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${n[e.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[e.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[e.XRANGEIDENTIFIERLOOSE]})(?:${n[e.PRERELEASELOOSE]})?${n[e.BUILD]}?)?)?`),E("XRANGE",`^${n[e.GTLT]}\\s*${n[e.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${n[e.GTLT]}\\s*${n[e.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),E("COERCE",`${n[e.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",n[e.COERCEPLAIN]+`(?:${n[e.PRERELEASE]})?(?:${n[e.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",n[e.COERCE],!0),E("COERCERTLFULL",n[e.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${n[e.LONETILDE]}\\s+`,!0),i.tildeTrimReplace="$1~",E("TILDE",`^${n[e.LONETILDE]}${n[e.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${n[e.LONETILDE]}${n[e.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${n[e.LONECARET]}\\s+`,!0),i.caretTrimReplace="$1^",E("CARET",`^${n[e.LONECARET]}${n[e.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${n[e.LONECARET]}${n[e.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${n[e.GTLT]}\\s*(${n[e.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${n[e.GTLT]}\\s*(${n[e.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${n[e.GTLT]}\\s*(${n[e.LOOSEPLAIN]}|${n[e.XRANGEPLAIN]})`,!0),i.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${n[e.XRANGEPLAIN]})\\s+-\\s+(${n[e.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${n[e.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[e.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(M,M.exports)),M.exports}var ie,nr;function ze(){if(nr)return ie;nr=1;const r=Object.freeze({loose:!0}),i=Object.freeze({});return ie=s=>s?typeof s!="object"?r:s:i,ie}var ae,ir;function zr(){if(ir)return ae;ir=1;const r=/^[0-9]+$/,i=(s,a)=>{if(typeof s=="number"&&typeof a=="number")return s===a?0:s<a?-1:1;const h=r.test(s),u=r.test(a);return h&&u&&(s=+s,a=+a),s===a?0:h&&!u?-1:u&&!h?1:s<a?-1:1};return ae={compareIdentifiers:i,rcompareIdentifiers:(s,a)=>i(a,s)},ae}var oe,ar;function j(){if(ar)return oe;ar=1;const r=H(),{MAX_LENGTH:i,MAX_SAFE_INTEGER:t}=X(),{safeRe:s,t:a}=B(),h=ze(),{compareIdentifiers:u}=zr(),f=(R,e)=>{const o=e.split(".");if(o.length>R.length)return!1;for(let c=0;c<o.length;c++)if(u(R[c],o[c])!==0)return!1;return!0};class n{constructor(e,o){if(o=h(o),e instanceof n){if(e.loose===!!o.loose&&e.includePrerelease===!!o.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);r("SemVer",e,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;const c=e.trim().match(o.loose?s[a.LOOSE]:s[a.FULL]);if(!c)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map(m=>{if(/^[0-9]+$/.test(m)){const L=+m;if(L>=0&&L<t)return L}return m}):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(e instanceof n)){if(typeof e=="string"&&e===this.version)return 0;e=new n(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof n||(e=new n(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof n||(e=new n(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let o=0;do{const c=this.prerelease[o],m=e.prerelease[o];if(r("prerelease compare",o,c,m),c===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(c===void 0)return-1;if(c===m)continue;return u(c,m)}while(++o)}compareBuild(e){e instanceof n||(e=new n(e,this.options));let o=0;do{const c=this.build[o],m=e.build[o];if(r("build compare",o,c,m),c===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(c===void 0)return-1;if(c===m)continue;return u(c,m)}while(++o)}inc(e,o,c){if(e.startsWith("pre")){if(!o&&c===!1)throw new Error("invalid increment argument: identifier is empty");if(o){const m=`-${o}`.match(this.options.loose?s[a.PRERELEASELOOSE]:s[a.PRERELEASE]);if(!m||m[1]!==o)throw new Error(`invalid identifier: ${o}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",o,c);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",o,c);break;case"prepatch":this.prerelease.length=0,this.inc("patch",o,c),this.inc("pre",o,c);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",o,c),this.inc("pre",o,c);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const m=Number(c)?1:0;if(this.prerelease.length===0)this.prerelease=[m];else{let L=this.prerelease.length;for(;--L>=0;)typeof this.prerelease[L]=="number"&&(this.prerelease[L]++,L=-2);if(L===-1){if(o===this.prerelease.join(".")&&c===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(m)}}if(o){let L=[o,m];if(c===!1&&(L=[o]),f(this.prerelease,o)){const E=this.prerelease[o.split(".").length];isNaN(E)&&(this.prerelease=L)}else this.prerelease=L}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return oe=n,oe}var ue,or;function V(){if(or)return ue;or=1;const r=j();return ue=(t,s,a=!1)=>{if(t instanceof r)return t;try{return new r(t,s)}catch(h){if(!a)return null;throw h}},ue}var ce,ur;function tt(){if(ur)return ce;ur=1;const r=V();return ce=(t,s)=>{const a=r(t,s);return a?a.version:null},ce}var le,cr;function st(){if(cr)return le;cr=1;const r=V();return le=(t,s)=>{const a=r(t.trim().replace(/^[=v]+/,""),s);return a?a.version:null},le}var fe,lr;function nt(){if(lr)return fe;lr=1;const r=j();return fe=(t,s,a,h,u)=>{typeof a=="string"&&(u=h,h=a,a=void 0);try{return new r(t instanceof r?t.version:t,a).inc(s,h,u).version}catch{return null}},fe}var he,fr;function it(){if(fr)return he;fr=1;const r=V();return he=(t,s)=>{const a=r(t,null,!0),h=r(s,null,!0),u=a.compare(h);if(u===0)return null;const f=u>0,n=f?a:h,R=f?h:a,e=!!n.prerelease.length;if(!!R.prerelease.length&&!e){if(!R.patch&&!R.minor)return"major";if(R.compareMain(n)===0)return R.minor&&!R.patch?"minor":"patch"}const c=e?"pre":"";return a.major!==h.major?c+"major":a.minor!==h.minor?c+"minor":a.patch!==h.patch?c+"patch":"prerelease"},he}var Ee,hr;function at(){if(hr)return Ee;hr=1;const r=j();return Ee=(t,s)=>new r(t,s).major,Ee}var pe,Er;function ot(){if(Er)return pe;Er=1;const r=j();return pe=(t,s)=>new r(t,s).minor,pe}var me,pr;function ut(){if(pr)return me;pr=1;const r=j();return me=(t,s)=>new r(t,s).patch,me}var Re,mr;function ct(){if(mr)return Re;mr=1;const r=V();return Re=(t,s)=>{const a=r(t,s);return a&&a.prerelease.length?a.prerelease:null},Re}var de,Rr;function U(){if(Rr)return de;Rr=1;const r=j();return de=(t,s,a)=>new r(t,a).compare(new r(s,a)),de}var ve,dr;function lt(){if(dr)return ve;dr=1;const r=U();return ve=(t,s,a)=>r(s,t,a),ve}var $e,vr;function ft(){if(vr)return $e;vr=1;const r=U();return $e=(t,s)=>r(t,s,!0),$e}var Ie,$r;function Ke(){if($r)return Ie;$r=1;const r=j();return Ie=(t,s,a)=>{const h=new r(t,a),u=new r(s,a);return h.compare(u)||h.compareBuild(u)},Ie}var Le,Ir;function ht(){if(Ir)return Le;Ir=1;const r=Ke();return Le=(t,s)=>t.sort((a,h)=>r(a,h,s)),Le}var Ne,Lr;function Et(){if(Lr)return Ne;Lr=1;const r=Ke();return Ne=(t,s)=>t.sort((a,h)=>r(h,a,s)),Ne}var Se,Nr;function W(){if(Nr)return Se;Nr=1;const r=U();return Se=(t,s,a)=>r(t,s,a)>0,Se}var Oe,Sr;function Ze(){if(Sr)return Oe;Sr=1;const r=U();return Oe=(t,s,a)=>r(t,s,a)<0,Oe}var Ae,Or;function Kr(){if(Or)return Ae;Or=1;const r=U();return Ae=(t,s,a)=>r(t,s,a)===0,Ae}var Te,Ar;function Zr(){if(Ar)return Te;Ar=1;const r=U();return Te=(t,s,a)=>r(t,s,a)!==0,Te}var ge,Tr;function Je(){if(Tr)return ge;Tr=1;const r=U();return ge=(t,s,a)=>r(t,s,a)>=0,ge}var we,gr;function Qe(){if(gr)return we;gr=1;const r=U();return we=(t,s,a)=>r(t,s,a)<=0,we}var Pe,wr;function Jr(){if(wr)return Pe;wr=1;const r=Kr(),i=Zr(),t=W(),s=Je(),a=Ze(),h=Qe();return Pe=(f,n,R,e)=>{switch(n){case"===":return typeof f=="object"&&(f=f.version),typeof R=="object"&&(R=R.version),f===R;case"!==":return typeof f=="object"&&(f=f.version),typeof R=="object"&&(R=R.version),f!==R;case"":case"=":case"==":return r(f,R,e);case"!=":return i(f,R,e);case">":return t(f,R,e);case">=":return s(f,R,e);case"<":return a(f,R,e);case"<=":return h(f,R,e);default:throw new TypeError(`Invalid operator: ${n}`)}},Pe}var Ce,Pr;function pt(){if(Pr)return Ce;Pr=1;const r=j(),i=V(),{safeRe:t,t:s}=B();return Ce=(h,u)=>{if(h instanceof r)return h;if(typeof h=="number"&&(h=String(h)),typeof h!="string")return null;u=u||{};let f=null;if(!u.rtl)f=h.match(u.includePrerelease?t[s.COERCEFULL]:t[s.COERCE]);else{const m=u.includePrerelease?t[s.COERCERTLFULL]:t[s.COERCERTL];let L;for(;(L=m.exec(h))&&(!f||f.index+f[0].length!==h.length);)(!f||L.index+L[0].length!==f.index+f[0].length)&&(f=L),m.lastIndex=L.index+L[1].length+L[2].length;m.lastIndex=-1}if(f===null)return null;const n=f[2],R=f[3]||"0",e=f[4]||"0",o=u.includePrerelease&&f[5]?`-${f[5]}`:"",c=u.includePrerelease&&f[6]?`+${f[6]}`:"";return i(`${n}.${R}.${e}${o}${c}`,u)},Ce}var qe,Cr;function mt(){if(Cr)return qe;Cr=1;const r=V(),i=X(),t=j(),s=(f,n,R)=>{if(!i.RELEASE_TYPES.includes(n))return null;const e=a(f,R);return e&&h(e,n)},a=(f,n)=>{const R=f instanceof t?f.version:f;return r(R,n)},h=(f,n)=>{if(u(n))return f.version;switch(f.prerelease=[],n){case"major":f.minor=0,f.patch=0;break;case"minor":f.patch=0;break}return f.format()},u=f=>f.startsWith("pre");return qe=s,qe}var De,qr;function Rt(){if(qr)return De;qr=1;class r{constructor(){this.max=1e3,this.map=new Map}get(t){const s=this.map.get(t);if(s!==void 0)return this.map.delete(t),this.map.set(t,s),s}delete(t){return this.map.delete(t)}set(t,s){if(!this.delete(t)&&s!==void 0){if(this.map.size>=this.max){const h=this.map.keys().next().value;this.delete(h)}this.map.set(t,s)}return this}}return De=r,De}var _e,Dr;function F(){if(Dr)return _e;Dr=1;const r=/\s+/g;class i{constructor(l,$){if($=a($),l instanceof i)return l.loose===!!$.loose&&l.includePrerelease===!!$.includePrerelease?l:new i(l.raw,$);if(l instanceof h)return this.raw=l.value,this.set=[[l]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=l.trim().replace(r," "),this.set=this.raw.split("||").map(v=>this.parseRange(v.trim())).filter(v=>v.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const v=this.set[0];if(this.set=this.set.filter(S=>!P(S[0])),this.set.length===0)this.set=[v];else if(this.set.length>1){for(const S of this.set)if(S.length===1&&_(S[0])){this.set=[S];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let l=0;l<this.set.length;l++){l>0&&(this.formatted+="||");const $=this.set[l];for(let v=0;v<$.length;v++)v>0&&(this.formatted+=" "),this.formatted+=$[v].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(l){l=l.replace(O,"");const v=((this.options.includePrerelease&&L)|(this.options.loose&&E))+":"+l,S=s.get(v);if(S)return S;const d=this.options.loose,I=d?n[e.HYPHENRANGELOOSE]:n[e.HYPHENRANGE];l=l.replace(I,re(this.options.includePrerelease)),u("hyphen replace",l),l=l.replace(n[e.COMPARATORTRIM],o),u("comparator trim",l),l=l.replace(n[e.TILDETRIM],c),u("tilde trim",l),l=l.replace(n[e.CARETTRIM],m),u("caret trim",l);let g=l.split(" ").map(q=>y(q,this.options)).join(" ").split(/\s+/).map(q=>ee(q,this.options));d&&(g=g.filter(q=>(u("loose invalid filter",q,this.options),!!q.match(n[e.COMPARATORLOOSE])))),u("range list",g);const A=new Map,w=g.map(q=>new h(q,this.options));for(const q of w){if(P(q))return[q];A.set(q.value,q)}A.size>1&&A.has("")&&A.delete("");const b=[...A.values()];return s.set(v,b),b}intersects(l,$){if(!(l instanceof i))throw new TypeError("a Range is required");return this.set.some(v=>G(v,$)&&l.set.some(S=>G(S,$)&&v.every(d=>S.every(I=>d.intersects(I,$)))))}test(l){if(!l)return!1;if(typeof l=="string")try{l=new f(l,this.options)}catch{return!1}for(let $=0;$<this.set.length;$++)if(te(this.set[$],l,this.options))return!0;return!1}}_e=i;const t=Rt(),s=new t,a=ze(),h=Y(),u=H(),f=j(),{safeRe:n,src:R,t:e,comparatorTrimReplace:o,tildeTrimReplace:c,caretTrimReplace:m}=B(),{FLAG_INCLUDE_PRERELEASE:L,FLAG_LOOSE:E}=X(),O=new RegExp(R[e.BUILD],"g"),P=p=>p.value==="<0.0.0-0",_=p=>p.value==="",G=(p,l)=>{let $=!0;const v=p.slice();let S=v.pop();for(;$&&v.length;)$=v.every(d=>S.intersects(d,l)),S=v.pop();return $},y=(p,l)=>(p=p.replace(n[e.BUILD],""),u("comp",p,l),p=x(p,l),u("caret",p),p=D(p,l),u("tildes",p),p=Z(p,l),u("xrange",p),p=Q(p,l),u("stars",p),p),T=p=>!p||p.toLowerCase()==="x"||p==="*",C=(p,l,$)=>T(p)&&!T(l)||T(l)&&$&&!T($),D=(p,l)=>p.trim().split(/\s+/).map($=>N($,l)).join(" "),N=(p,l)=>{const $=l.loose?n[e.TILDELOOSE]:n[e.TILDE],v=l.includePrerelease?"-0":"";return p.replace($,(S,d,I,g,A)=>{u("tilde",p,S,d,I,g,A);let w;return T(d)?w="":T(I)?w=`>=${d}.0.0${v} <${+d+1}.0.0-0`:T(g)?w=`>=${d}.${I}.0${v} <${d}.${+I+1}.0-0`:A?(u("replaceTilde pr",A),w=`>=${d}.${I}.${g}-${A} <${d}.${+I+1}.0-0`):w=`>=${d}.${I}.${g} <${d}.${+I+1}.0-0`,u("tilde return",w),w})},x=(p,l)=>p.trim().split(/\s+/).map($=>K($,l)).join(" "),K=(p,l)=>{u("caret",p,l);const $=l.loose?n[e.CARETLOOSE]:n[e.CARET],v=l.includePrerelease?"-0":"";return p.replace($,(S,d,I,g,A)=>{u("caret",p,S,d,I,g,A);let w;return T(d)?w="":T(I)?w=`>=${d}.0.0${v} <${+d+1}.0.0-0`:T(g)?d==="0"?w=`>=${d}.${I}.0${v} <${d}.${+I+1}.0-0`:w=`>=${d}.${I}.0${v} <${+d+1}.0.0-0`:A?(u("replaceCaret pr",A),d==="0"?I==="0"?w=`>=${d}.${I}.${g}-${A} <${d}.${I}.${+g+1}-0`:w=`>=${d}.${I}.${g}-${A} <${d}.${+I+1}.0-0`:w=`>=${d}.${I}.${g}-${A} <${+d+1}.0.0-0`):(u("no pr"),d==="0"?I==="0"?w=`>=${d}.${I}.${g} <${d}.${I}.${+g+1}-0`:w=`>=${d}.${I}.${g} <${d}.${+I+1}.0-0`:w=`>=${d}.${I}.${g} <${+d+1}.0.0-0`),u("caret return",w),w})},Z=(p,l)=>(u("replaceXRanges",p,l),p.split(/\s+/).map($=>J($,l)).join(" ")),J=(p,l)=>{p=p.trim();const $=l.loose?n[e.XRANGELOOSE]:n[e.XRANGE];return p.replace($,(v,S,d,I,g,A)=>{if(u("xRange",p,v,S,d,I,g,A),C(d,I,g))return p;const w=T(d),b=w||T(I),q=b||T(g),k=q;return S==="="&&k&&(S=""),A=l.includePrerelease?"-0":"",w?S===">"||S==="<"?v="<0.0.0-0":v="*":S&&k?(b&&(I=0),g=0,S===">"?(S=">=",b?(d=+d+1,I=0,g=0):(I=+I+1,g=0)):S==="<="&&(S="<",b?d=+d+1:I=+I+1),S==="<"&&(A="-0"),v=`${S+d}.${I}.${g}${A}`):b?v=`>=${d}.0.0${A} <${+d+1}.0.0-0`:q&&(v=`>=${d}.${I}.0${A} <${d}.${+I+1}.0-0`),u("xRange return",v),v})},Q=(p,l)=>(u("replaceStars",p,l),p.trim().replace(n[e.STAR],"")),ee=(p,l)=>(u("replaceGTE0",p,l),p.trim().replace(n[l.includePrerelease?e.GTE0PRE:e.GTE0],"")),re=p=>(l,$,v,S,d,I,g,A,w,b,q,k)=>(T(v)?$="":T(S)?$=`>=${v}.0.0${p?"-0":""}`:T(d)?$=`>=${v}.${S}.0${p?"-0":""}`:I?$=`>=${$}`:$=`>=${$}${p?"-0":""}`,T(w)?A="":T(b)?A=`<${+w+1}.0.0-0`:T(q)?A=`<${w}.${+b+1}.0-0`:k?A=`<=${w}.${b}.${q}-${k}`:p?A=`<${w}.${b}.${+q+1}-0`:A=`<=${A}`,`${$} ${A}`.trim()),te=(p,l,$)=>{for(let v=0;v<p.length;v++)if(!p[v].test(l))return!1;if(l.prerelease.length&&!$.includePrerelease){for(let v=0;v<p.length;v++)if(u(p[v].semver),p[v].semver!==h.ANY&&p[v].semver.prerelease.length>0){const S=p[v].semver;if(S.major===l.major&&S.minor===l.minor&&S.patch===l.patch)return!0}return!1}return!0};return _e}var ye,_r;function Y(){if(_r)return ye;_r=1;const r=Symbol("SemVer ANY");class i{static get ANY(){return r}constructor(e,o){if(o=t(o),e instanceof i){if(e.loose===!!o.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,o),this.options=o,this.loose=!!o.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const o=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],c=e.match(o);if(!c)throw new TypeError(`Invalid comparator: ${e}`);this.operator=c[1]!==void 0?c[1]:"",this.operator==="="&&(this.operator=""),c[2]?this.semver=new f(c[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if(typeof e=="string")try{e=new f(e,this.options)}catch{return!1}return h(e,this.operator,this.semver,this.options)}intersects(e,o){if(!(e instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new n(e.value,o).test(this.value):e.operator===""?e.value===""?!0:new n(this.value,o).test(e.semver):(o=t(o),o.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!o.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||h(this.semver,"<",e.semver,o)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||h(this.semver,">",e.semver,o)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}ye=i;const t=ze(),{safeRe:s,t:a}=B(),h=Jr(),u=H(),f=j(),n=F();return ye}var je,yr;function z(){if(yr)return je;yr=1;const r=F();return je=(t,s,a)=>{try{s=new r(s,a)}catch{return!1}return s.test(t)},je}var Ge,jr;function dt(){if(jr)return Ge;jr=1;const r=F();return Ge=(t,s)=>new r(t,s).set.map(a=>a.map(h=>h.value).join(" ").trim().split(" ")),Ge}var be,Gr;function vt(){if(Gr)return be;Gr=1;const r=j(),i=F();return be=(s,a,h)=>{let u=null,f=null,n=null;try{n=new i(a,h)}catch{return null}return s.forEach(R=>{n.test(R)&&(!u||f.compare(R)===-1)&&(u=R,f=new r(u,h))}),u},be}var Ue,br;function $t(){if(br)return Ue;br=1;const r=j(),i=F();return Ue=(s,a,h)=>{let u=null,f=null,n=null;try{n=new i(a,h)}catch{return null}return s.forEach(R=>{n.test(R)&&(!u||f.compare(R)===1)&&(u=R,f=new r(u,h))}),u},Ue}var Fe,Ur;function It(){if(Ur)return Fe;Ur=1;const r=j(),i=F(),t=W();return Fe=(a,h)=>{a=new i(a,h);let u=new r("0.0.0");if(a.test(u)||(u=new r("0.0.0-0"),a.test(u)))return u;u=null;for(let f=0;f<a.set.length;++f){const n=a.set[f];let R=null;n.forEach(e=>{const o=new r(e.semver.version);switch(e.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!R||t(o,R))&&(R=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),R&&(!u||t(u,R))&&(u=R)}return u&&a.test(u)?u:null},Fe}var Ve,Fr;function Lt(){if(Fr)return Ve;Fr=1;const r=F();return Ve=(t,s)=>{try{return new r(t,s).range||"*"}catch{return null}},Ve}var xe,Vr;function er(){if(Vr)return xe;Vr=1;const r=j(),i=Y(),{ANY:t}=i,s=F(),a=z(),h=W(),u=Ze(),f=Qe(),n=Je();return xe=(e,o,c,m)=>{e=new r(e,m),o=new s(o,m);let L,E,O,P,_;switch(c){case">":L=h,E=f,O=u,P=">",_=">=";break;case"<":L=u,E=n,O=h,P="<",_="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,o,m))return!1;for(let G=0;G<o.set.length;++G){const y=o.set[G];let T=null,C=null;if(y.forEach(D=>{D.semver===t&&(D=new i(">=0.0.0")),T=T||D,C=C||D,L(D.semver,T.semver,m)?T=D:O(D.semver,C.semver,m)&&(C=D)}),T.operator===P||T.operator===_||(!C.operator||C.operator===P)&&E(e,C.semver))return!1;if(C.operator===_&&O(e,C.semver))return!1}return!0},xe}var ke,xr;function Nt(){if(xr)return ke;xr=1;const r=er();return ke=(t,s,a)=>r(t,s,">",a),ke}var Xe,kr;function St(){if(kr)return Xe;kr=1;const r=er();return Xe=(t,s,a)=>r(t,s,"<",a),Xe}var Be,Xr;function Ot(){if(Xr)return Be;Xr=1;const r=F();return Be=(t,s,a)=>(t=new r(t,a),s=new r(s,a),t.intersects(s,a)),Be}var Me,Br;function At(){if(Br)return Me;Br=1;const r=z(),i=U();return Me=(t,s,a)=>{const h=[];let u=null,f=null;const n=t.sort((c,m)=>i(c,m,a));for(const c of n)r(c,s,a)?(f=c,u||(u=c)):(f&&h.push([u,f]),f=null,u=null);u&&h.push([u,null]);const R=[];for(const[c,m]of h)c===m?R.push(c):!m&&c===n[0]?R.push("*"):m?c===n[0]?R.push(`<=${m}`):R.push(`${c} - ${m}`):R.push(`>=${c}`);const e=R.join(" || "),o=typeof s.raw=="string"?s.raw:String(s);return e.length<o.length?e:s},Me}var He,Mr;function Tt(){if(Mr)return He;Mr=1;const r=F(),i=Y(),{ANY:t}=i,s=z(),a=U(),h=(o,c,m={})=>{if(o===c)return!0;o=new r(o,m),c=new r(c,m);let L=!1;e:for(const E of o.set){for(const O of c.set){const P=n(E,O,m);if(L=L||P!==null,P)continue e}if(L)return!1}return!0},u=[new i(">=0.0.0-0")],f=[new i(">=0.0.0")],n=(o,c,m)=>{if(o===c)return!0;if(o.length===1&&o[0].semver===t){if(c.length===1&&c[0].semver===t)return!0;m.includePrerelease?o=u:o=f}if(c.length===1&&c[0].semver===t){if(m.includePrerelease)return!0;c=f}const L=new Set;let E,O;for(const N of o)N.operator===">"||N.operator===">="?E=R(E,N,m):N.operator==="<"||N.operator==="<="?O=e(O,N,m):L.add(N.semver);if(L.size>1)return null;let P;if(E&&O){if(P=a(E.semver,O.semver,m),P>0)return null;if(P===0&&(E.operator!==">="||O.operator!=="<="))return null}for(const N of L){if(E&&!s(N,String(E),m)||O&&!s(N,String(O),m))return null;for(const x of c)if(!s(N,String(x),m))return!1;return!0}let _,G,y,T,C=O&&!m.includePrerelease&&O.semver.prerelease.length?O.semver:!1,D=E&&!m.includePrerelease&&E.semver.prerelease.length?E.semver:!1;C&&C.prerelease.length===1&&O.operator==="<"&&C.prerelease[0]===0&&(C=!1);for(const N of c){if(T=T||N.operator===">"||N.operator===">=",y=y||N.operator==="<"||N.operator==="<=",E){if(D&&N.semver.prerelease&&N.semver.prerelease.length&&N.semver.major===D.major&&N.semver.minor===D.minor&&N.semver.patch===D.patch&&(D=!1),N.operator===">"||N.operator===">="){if(_=R(E,N,m),_===N&&_!==E)return!1}else if(E.operator===">="&&!N.test(E.semver))return!1}if(O){if(C&&N.semver.prerelease&&N.semver.prerelease.length&&N.semver.major===C.major&&N.semver.minor===C.minor&&N.semver.patch===C.patch&&(C=!1),N.operator==="<"||N.operator==="<="){if(G=e(O,N,m),G===N&&G!==O)return!1}else if(O.operator==="<="&&!N.test(O.semver))return!1}if(!N.operator&&(O||E)&&P!==0)return!1}return!(E&&y&&!O&&P!==0||O&&T&&!E&&P!==0||D||C)},R=(o,c,m)=>{if(!o)return c;const L=a(o.semver,c.semver,m);return L>0?o:L<0||c.operator===">"&&o.operator===">="?c:o},e=(o,c,m)=>{if(!o)return c;const L=a(o.semver,c.semver,m);return L<0?o:L>0||c.operator==="<"&&o.operator==="<="?c:o};return He=h,He}var We,Hr;function gt(){if(Hr)return We;Hr=1;const r=B(),i=X(),t=j(),s=zr(),a=V(),h=tt(),u=st(),f=nt(),n=it(),R=at(),e=ot(),o=ut(),c=ct(),m=U(),L=lt(),E=ft(),O=Ke(),P=ht(),_=Et(),G=W(),y=Ze(),T=Kr(),C=Zr(),D=Je(),N=Qe(),x=Jr(),K=pt(),Z=mt(),J=Y(),Q=F(),ee=z(),re=dt(),te=vt(),p=$t(),l=It(),$=Lt(),v=er(),S=Nt(),d=St(),I=Ot(),g=At(),A=Tt();return We={parse:a,valid:h,clean:u,inc:f,diff:n,major:R,minor:e,patch:o,prerelease:c,compare:m,rcompare:L,compareLoose:E,compareBuild:O,sort:P,rsort:_,gt:G,lt:y,eq:T,neq:C,gte:D,lte:N,cmp:x,coerce:K,truncate:Z,Comparator:J,Range:Q,satisfies:ee,toComparators:re,maxSatisfying:te,minSatisfying:p,minVersion:l,validRange:$,outside:v,gtr:S,ltr:d,intersects:I,simplifyRange:g,subset:A,SemVer:t,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers},We}var Wr=gt();const wt=[{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"}],Yr="auth",Bt=async r=>await r("Which auth provider?",wt,{default:Yr})??Yr,Mt="mail",Ht=[{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 1.x + Vite",label:"Solid",value:"auth-ui-solid"},{description:"Solid 2.0 + Vite (@solidjs/web)",label:"Solid 2",value:"auth-ui-solid-v2"},{description:"Analog",label:"Angular",value:"auth-ui-angular"}],Wt="auth-ui-react",Pt=r=>Object.hasOwn(r,"react-native")||Object.hasOwn(r,"@lunora/react-native")||Object.hasOwn(r,"expo"),Ct=r=>{if(!(r===void 0||Wr.validRange(r)===null))return Wr.minVersion(r)?.major},qt=r=>Object.hasOwn(r,"@solidjs/web")||(Ct(r["solid-js"])??0)>=2,Yt=r=>{const i=t=>Object.hasOwn(r,t);if(!Pt(r)){if(qt(r))return"auth-ui-solid-v2";if(i("@lunora/react"))return"auth-ui-react";if(i("@lunora/vue"))return"auth-ui-vue";if(i("@lunora/svelte"))return"auth-ui-svelte";if(i("@lunora/solid"))return"auth-ui-solid";if(i("@lunora/angular"))return"auth-ui-angular";if(i("react")||i("next"))return"auth-ui-react";if(i("vue")||i("nuxt"))return"auth-ui-vue";if(i("svelte")||i("@sveltejs/kit"))return"auth-ui-svelte";if(i("solid-js"))return"auth-ui-solid";if(i("@angular/core"))return"auth-ui-angular"}},zt=r=>{const i=r.trim();if(i==="")return;const t=i.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"}},Dt=/[^a-z0-9]+/u,Qr=(r,i,t)=>{let s=r.toLowerCase().split(Dt).filter(Boolean).join("-").slice(0,t);return s.endsWith("-")&&(s=s.slice(0,-1)),s.length>=i?s:void 0},_t="DB",yt="Name your D1 database (run `wrangler d1 create` to get its id, then put it in wrangler.jsonc)",et=r=>Qr(r,1,64),jt="lunora-db",Gt=r=>et(`${r}-db`)??jt,Kt=async(r,i)=>{const t=Gt(i);return et(await r(yt,{default:t,placeholder:t}))??t},Zt=(r,i)=>Ye(r,"d1_databases",{key:"binding",value:_t},"database_name",i),bt="SEND_EMAIL",Jt="Verified destination email for production delivery (blank = set it later in wrangler.jsonc)",Ut=r=>{const i=r.trim();if(i.length===0||i.includes(" "))return!1;const t=i.indexOf("@");if(t<=0||t!==i.lastIndexOf("@"))return!1;const s=i.slice(t+1);return s.length>=3&&s.includes(".")&&!s.startsWith(".")&&!s.endsWith(".")},Qt=(r,i)=>{const t=r.trim();if(t!==""){if(!Ut(t)){i(`"${t}" doesn't look like an email — leaving the placeholder; set destination_address in wrangler.jsonc.`);return}return t}},es=(r,i)=>Ye(r,"send_email",{key:"name",value:bt},"destination_address",i),Ft="UPLOADS",Vt="Name your R2 bucket (you can rename it in wrangler.jsonc later)",rt=r=>Qr(r,3,63),xt="lunora-uploads",kt=r=>rt(`${r}-uploads`)??xt,rs=async(r,i)=>{const t=kt(i);return rt(await r(Vt,{default:t,placeholder:t}))??t},ts=(r,i)=>Ye(r,"r2_buckets",{key:"binding",value:Ft},"bucket_name",i);export{Ht as A,Yr as D,Mt as E,Jt as M,et as a,Gt as b,Kt as c,kt as d,Bt as e,Yt as f,Wt as g,wt as h,Pt as i,es as j,Zt as k,zt as n,rs as p,Qt as r,rt as s,ts as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const d=e=>e.replaceAll(/([a-z\d])([A-Z])/gu,"$1_$2").toUpperCase().split(/[_-]+/u).filter(t=>t.length>0),E=new Set(["CREDENTIAL","CREDENTIALS","DSN","PASSPHRASE","PASSWD","PASSWORD","SECRET","TOKEN"]),S=["ACCESS_KEY","API_KEY","ENCRYPTION_KEY","PRIVATE_KEY","SIGNING_KEY"],l=/(?:apikey|passphrase|passwd|password|secret|token)$/iu,m=e=>d(e).some(t=>t==="PUBLIC"||t==="PUBLISHABLE"),g=e=>{if(m(e))return!1;const t=d(e);if(t.some(s=>E.has(s)))return!0;const r=t.join("_");return S.some(s=>r===s||r.endsWith(`_${s}`))||l.test(e)},I=e=>{switch(e){case"boolean":return"boolean";case"date":case"number":case"timestamp":return"number";case"id":case"literal":case"string":return"string";default:return}},A=/already (?:exists|indexed)|duplicate/iu,i=e=>["vectorize","create-metadata-index",e.index,`--property-name=${e.property}`,`--type=${e.type}`],_=async(e,t)=>{try{return await e(t)}catch(r){return{code:1,stderr:r instanceof Error?r.message:String(r)}}},T=async e=>{const{cwd:t,entries:r,exec:s,logger:u,spawner:p}=e,n=[];for(const a of r){const o=await _(p,{args:[...s.args,...i(a)],captureStderr:!0,command:s.command,cwd:t,stdoutToStderr:!0});if(o.code===0){n.push({entry:a,status:"created"});continue}const c=`${o.stderr??""}${o.stdout??""}`;if(A.test(c)){n.push({entry:a,status:"exists"});continue}n.push({entry:a,error:c.trim()||`exit code ${String(o.code)}`,status:"failed"}),u.warn(`could not create the Vectorize metadata index for "${a.property}" on "${a.index}" — filters on that property will match nothing until it exists. Run: wrangler ${i(a).join(" ")}`)}return n};export{i as c,T as e,g as i,I as m};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.218",
|
|
4
4
|
"description": "The Lunora CLI: init, dev, deploy, codegen, migrate, seed, doctor, insights, logs, registry, and the rest of the project commands",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@bomb.sh/tab": "0.0.22",
|
|
55
|
-
"@lunora/advisor": "1.0.0-alpha.
|
|
56
|
-
"@lunora/bindings": "1.0.0-alpha.
|
|
57
|
-
"@lunora/codegen": "1.0.0-alpha.
|
|
58
|
-
"@lunora/config": "1.0.0-alpha.
|
|
59
|
-
"@lunora/container": "1.0.0-alpha.
|
|
60
|
-
"@lunora/d1": "1.0.0-alpha.
|
|
61
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
62
|
-
"@lunora/mcp": "1.0.0-alpha.
|
|
63
|
-
"@lunora/runtime": "1.0.0-alpha.
|
|
64
|
-
"@lunora/seed": "1.0.0-alpha.
|
|
55
|
+
"@lunora/advisor": "1.0.0-alpha.106",
|
|
56
|
+
"@lunora/bindings": "1.0.0-alpha.47",
|
|
57
|
+
"@lunora/codegen": "1.0.0-alpha.151",
|
|
58
|
+
"@lunora/config": "1.0.0-alpha.185",
|
|
59
|
+
"@lunora/container": "1.0.0-alpha.41",
|
|
60
|
+
"@lunora/d1": "1.0.0-alpha.104",
|
|
61
|
+
"@lunora/errors": "1.0.0-alpha.30",
|
|
62
|
+
"@lunora/mcp": "1.0.0-alpha.106",
|
|
63
|
+
"@lunora/runtime": "1.0.0-alpha.89",
|
|
64
|
+
"@lunora/seed": "1.0.0-alpha.102",
|
|
65
65
|
"@visulima/cerebro": "3.0.6",
|
|
66
66
|
"@visulima/error": "6.1.0",
|
|
67
67
|
"@visulima/fs": "6.0.0",
|
|
@@ -29,9 +29,16 @@ D1 database, R2 buckets, and secrets — so the work is mostly making
|
|
|
29
29
|
|
|
30
30
|
`lunora deploy` runs a fixed pipeline:
|
|
31
31
|
|
|
32
|
-
1. **Codegen** — regenerates `lunora/_generated
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
1. **Codegen** — regenerates `lunora/_generated/`. It does **not** run
|
|
33
|
+
`tsc`: nothing in the deploy pipeline type-checks, and wrangler/esbuild
|
|
34
|
+
strips types, so a project with a TS error deploys. Run `lunora verify`
|
|
35
|
+
(which does run `tsc --noEmit`) as the CI type gate before this.
|
|
36
|
+
2. **Validate `wrangler.jsonc`** — a `compatibility_date` at or past the
|
|
37
|
+
minimum the runtime needs, the `SHARD` Durable Object binding and its
|
|
38
|
+
SQLite migration tag, and the shape of every declared binding. It does
|
|
39
|
+
**not** check `compatibility_flags`: `nodejs_compat` is what every
|
|
40
|
+
template ships and what dependencies reaching for `node:` builtins need,
|
|
41
|
+
but no Lunora package requires it, so nothing fails when it is missing.
|
|
35
42
|
3. **Schema-drift gate** — blocks if the committed baseline
|
|
36
43
|
(`lunora/.lunora-schema.json`) drifted with a breaking change and no
|
|
37
44
|
accompanying migration. The baseline is re-blessed only after the deploy
|
|
@@ -40,9 +47,23 @@ D1 database, R2 buckets, and secrets — so the work is mostly making
|
|
|
40
47
|
images).
|
|
41
48
|
|
|
42
49
|
Useful flags: `--env <name>` (Cloudflare environment), `--migrate` (run pending
|
|
43
|
-
data migrations against the live worker after deploy,
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
data migrations against the live worker after deploy), `--allow-schema-drift`
|
|
51
|
+
(override the gate — use sparingly), and `--update-schema-baseline` (re-bless
|
|
52
|
+
the baseline with the current shape).
|
|
53
|
+
|
|
54
|
+
`--migrate` has three hard requirements, checked **before** `wrangler deploy`,
|
|
55
|
+
so missing one aborts the whole deploy rather than skipping the migration:
|
|
56
|
+
|
|
57
|
+
- `--migrate-yes` — confirms running production data migrations. Always
|
|
58
|
+
required; there is no environment variable for it.
|
|
59
|
+
- `--migrate-url <https://…>` — the deploy target URL is only known after
|
|
60
|
+
wrangler runs, so it cannot be inferred. Omit it only when the checkout is
|
|
61
|
+
linked (`lunora link`) for this same `--env`.
|
|
62
|
+
- an admin token — `--migrate-token` or `LUNORA_ADMIN_TOKEN`.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
lunora deploy --migrate --migrate-yes --migrate-url https://app.example.com
|
|
66
|
+
```
|
|
46
67
|
|
|
47
68
|
## Preflight: `lunora doctor`
|
|
48
69
|
|
|
@@ -119,10 +140,19 @@ before the first request hits production.
|
|
|
119
140
|
- **Production:** `lunora deploy`. Separate D1 database / R2 buckets / secrets
|
|
120
141
|
from dev. Never point a dev worker at prod resources.
|
|
121
142
|
|
|
122
|
-
For `.global()` table DDL,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
143
|
+
For `.global()` table DDL, `lunora migrate generate` emits a reviewable SQL
|
|
144
|
+
file — but **no command applies it**, `lunora deploy` included. What actually
|
|
145
|
+
provisions a global table is the runtime, from the schema rather than from the
|
|
146
|
+
file: on first use it runs `CREATE TABLE IF NOT EXISTS` plus additive
|
|
147
|
+
`ADD COLUMN`, so additive changes land whether or not the file exists.
|
|
148
|
+
Anything the generator cannot express — a backfilling `UPDATE`, a rename
|
|
149
|
+
written as add/copy/drop, an index the schema does not declare — must be
|
|
150
|
+
applied by hand:
|
|
151
|
+
`wrangler d1 execute <DB> --remote --file=lunora/migrations/<file>.sql`. The
|
|
152
|
+
file is multi-statement, so it is not a `@lunora/d1` `Migration` either.
|
|
153
|
+
For data backfills, deploy first, then `lunora deploy --migrate --migrate-yes
|
|
154
|
+
--migrate-url <url>` (or `lunora migrate up --prod`). See
|
|
155
|
+
`lunora-migration-helper`.
|
|
126
156
|
|
|
127
157
|
## Common Pitfalls
|
|
128
158
|
|
|
@@ -147,4 +177,5 @@ secret put` for every prod secret.
|
|
|
147
177
|
- [ ] DO + container `class_name`s exported by the worker entry.
|
|
148
178
|
- [ ] Production secrets set via `wrangler secret put`.
|
|
149
179
|
- [ ] Schema changes migrated; the drift gate is green (no `--allow-schema-drift`).
|
|
150
|
-
- [ ] `lunora deploy` succeeded; `--migrate
|
|
180
|
+
- [ ] `lunora deploy` succeeded; `--migrate --migrate-yes --migrate-url <url>` run
|
|
181
|
+
if data backfills were pending.
|
|
@@ -70,15 +70,22 @@ Each function declares its inputs with `.input(...)` (a `v.*` map) and ends with
|
|
|
70
70
|
terminal `.query` / `.mutation` / `.action` handler. Export them as named
|
|
71
71
|
consts from `lunora/*.ts`; codegen surfaces them as `api.<file>.<name>`.
|
|
72
72
|
|
|
73
|
-
| Kind | Reads `ctx.db`
|
|
74
|
-
| ---------- |
|
|
75
|
-
| `query` | yes
|
|
76
|
-
| `mutation` | yes
|
|
77
|
-
| `action` |
|
|
73
|
+
| Kind | Reads `ctx.db` | Writes `ctx.db` | Side effects / `fetch` | Reactive |
|
|
74
|
+
| ---------- | -------------- | ------------------- | ---------------------- | -------- |
|
|
75
|
+
| `query` | yes | no | no | yes |
|
|
76
|
+
| `mutation` | yes | yes, transactional | no | — |
|
|
77
|
+
| `action` | yes | yes, autocommitting | yes | — |
|
|
78
|
+
|
|
79
|
+
The builders are **generated**, not imported from `@lunora/server`: codegen binds
|
|
80
|
+
them to your schema, so `ctx.db`, `v.id("channels")`, and index names are all
|
|
81
|
+
typed. `@lunora/server` exports the schema/HTTP/validator surface and
|
|
82
|
+
`LunoraError`, never `query` / `mutation` / `action`.
|
|
78
83
|
|
|
79
84
|
```ts
|
|
80
|
-
import
|
|
81
|
-
|
|
85
|
+
import { LunoraError } from "lunorash/server";
|
|
86
|
+
|
|
87
|
+
import type { Id } from "#lunora/_generated/server.js";
|
|
88
|
+
import { action, mutation, query, v } from "#lunora/_generated/server.js";
|
|
82
89
|
|
|
83
90
|
// `api` / `internal` come from codegen:
|
|
84
91
|
// import { api, internal } from "./_generated/api";
|
|
@@ -112,8 +119,12 @@ export const notifySlack = action.input({ messageId: v.id("messages") }).action(
|
|
|
112
119
|
|
|
113
120
|
- **Pick the right kind.** Reactive read → `query`. Transactional write →
|
|
114
121
|
`mutation`. External I/O (`fetch`, third-party SDKs, calling other functions)
|
|
115
|
-
→ `action`. An action has
|
|
116
|
-
|
|
122
|
+
→ `action`. An action has a `ctx.db`, but its own writes are not
|
|
123
|
+
transactional: each autocommits as it runs, so a later throw rolls nothing
|
|
124
|
+
back. Reach data through `ctx.runQuery` / `ctx.runMutation` — a mutation
|
|
125
|
+
called that way runs in the same all-or-nothing transaction a top-level one
|
|
126
|
+
gets, so put every write that has to land together in ONE mutation rather
|
|
127
|
+
than sequencing several from the action.
|
|
117
128
|
- **`internal*` variants** (`internalQuery`, `internalMutation`,
|
|
118
129
|
`internalAction`) are not exposed to clients — use them for server-only logic
|
|
119
130
|
called from actions, crons, or other functions.
|
|
@@ -186,23 +197,40 @@ Two exceptions to the usage scan, and one extra requirement:
|
|
|
186
197
|
action — see `lunora-setup-hyperdrive`. Bindings codegen can provision on its
|
|
187
198
|
own (e.g. `BROWSER` for `ctx.browser`) need no manual wrangler step.
|
|
188
199
|
|
|
189
|
-
`ctx.browser` and `ctx.sql` are **action-only** by design
|
|
190
|
-
non-deterministic
|
|
200
|
+
`ctx.browser` and `ctx.sql` are **action-only** by design. They are external,
|
|
201
|
+
non-deterministic I/O: a query is re-run on every subscription re-evaluation, so
|
|
202
|
+
a non-deterministic read makes reactivity wrong, and a mutation's writes are
|
|
203
|
+
transactional — a rollback cannot un-send a network call.
|
|
191
204
|
|
|
192
205
|
## HTTP endpoints
|
|
193
206
|
|
|
194
207
|
For webhooks or non-RPC HTTP, use `httpRouter` / `httpRoute` + `httpAction`:
|
|
195
208
|
|
|
209
|
+
`httpRouter()` takes **no arguments** — it returns a [Hono](https://hono.dev)
|
|
210
|
+
app you mount routes on, and you export the app. Passing it a routes object is a
|
|
211
|
+
type error (`Expected 0 arguments`), and from untyped code the routes simply
|
|
212
|
+
never mount.
|
|
213
|
+
|
|
196
214
|
```ts
|
|
215
|
+
// lunora/http.ts
|
|
197
216
|
import { httpAction, httpRouter } from "@lunora/server";
|
|
198
217
|
|
|
199
|
-
|
|
200
|
-
|
|
218
|
+
import { internal } from "./_generated/api";
|
|
219
|
+
|
|
220
|
+
const app = httpRouter();
|
|
221
|
+
|
|
222
|
+
app.post(
|
|
223
|
+
"/webhooks/stripe",
|
|
224
|
+
httpAction(async (ctx, request) => {
|
|
201
225
|
const event = await request.json();
|
|
226
|
+
|
|
202
227
|
await ctx.runMutation(internal.billing.record, { event });
|
|
228
|
+
|
|
203
229
|
return new Response("ok");
|
|
204
230
|
}),
|
|
205
|
-
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
export default app;
|
|
206
234
|
```
|
|
207
235
|
|
|
208
236
|
## Checklist
|
|
@@ -239,9 +239,9 @@ add the migration — not to bypass it.
|
|
|
239
239
|
- [ ] Widened the schema to accept both shapes; `lunora codegen` clean.
|
|
240
240
|
- [ ] Updated reads to handle both shapes; started writing the new shape.
|
|
241
241
|
- [ ] Deployed the widened schema.
|
|
242
|
-
- [ ] Authored a `defineMigration`; previewed with `lunora migrate up --dry-run`.
|
|
243
|
-
- [ ] Ran `lunora migrate up
|
|
244
|
-
structural changes.
|
|
245
|
-
- [ ] Verified completion with `lunora migrate status
|
|
242
|
+
- [ ] Authored a `defineMigration`; previewed with `lunora migrate up <id> --dry-run`.
|
|
243
|
+
- [ ] Ran `lunora migrate up <id>`; `lunora migrate generate` + deploy for
|
|
244
|
+
`.global()` structural changes.
|
|
245
|
+
- [ ] Verified completion with `lunora migrate status <id>`.
|
|
246
246
|
- [ ] Narrowed the schema (required / drop old field); removed both-shapes code.
|
|
247
247
|
- [ ] Deployed the final schema; schema-drift gate passed.
|
|
@@ -14,7 +14,7 @@ apply it across sibling functions consistently.
|
|
|
14
14
|
## When to Use
|
|
15
15
|
|
|
16
16
|
- Queries feel slow or read far more rows than they return.
|
|
17
|
-
- Mutations
|
|
17
|
+
- Mutations conflict (409 `CONFLICT`) under load (OCC).
|
|
18
18
|
- Subscriptions fan out updates too broadly or re-run too often.
|
|
19
19
|
- The Lunora Studio **Advisors** tab or `@lunora/advisor` flags a table.
|
|
20
20
|
|
|
@@ -98,10 +98,13 @@ column. Fix every sibling query on the table the same way.
|
|
|
98
98
|
|
|
99
99
|
## Problem Class: Write Conflicts (OCC)
|
|
100
100
|
|
|
101
|
-
**Symptom:** mutations on hot rows
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
**Symptom:** mutations on hot rows fail under concurrency, or the function tops
|
|
102
|
+
the write-conflict section of `lunora insights`. ShardDO uses optimistic
|
|
103
|
+
concurrency control — concurrent writes to the same DO that touch overlapping
|
|
104
|
+
state conflict. There is **no server-side retry loop**: the loser throws
|
|
105
|
+
`ConflictError` (code `CONFLICT`, HTTP 409) and the caller decides, so a client
|
|
106
|
+
that never handles it (`isConflictError` from `@lunora/client`) just surfaces
|
|
107
|
+
409s to the user.
|
|
105
108
|
|
|
106
109
|
**Fixes, in order of preference:**
|
|
107
110
|
|
|
@@ -207,7 +207,7 @@ Create a schema and a query/mutation to verify the full loop.
|
|
|
207
207
|
`lunora/schema.ts`:
|
|
208
208
|
|
|
209
209
|
```ts
|
|
210
|
-
import { defineSchema, defineTable, v } from "
|
|
210
|
+
import { defineSchema, defineTable, v } from "lunorash/server";
|
|
211
211
|
|
|
212
212
|
export default defineSchema({
|
|
213
213
|
todos: defineTable({
|
|
@@ -221,8 +221,8 @@ export default defineSchema({
|
|
|
221
221
|
`lunora/todos.ts`:
|
|
222
222
|
|
|
223
223
|
```ts
|
|
224
|
-
import type { Id } from "
|
|
225
|
-
import { mutation, query, v } from "
|
|
224
|
+
import type { Id } from "#lunora/_generated/server.js";
|
|
225
|
+
import { mutation, query, v } from "#lunora/_generated/server.js";
|
|
226
226
|
|
|
227
227
|
export const list = query.query(async ({ ctx }) => ctx.db.query("todos").withIndex("by_creation").collect());
|
|
228
228
|
|
|
@@ -9,8 +9,10 @@ description: Adds authentication to a Lunora app. Use for sign-up/sign-in, email
|
|
|
9
9
|
|
|
10
10
|
Wire authentication into a Lunora app using the `auth` registry item, which is
|
|
11
11
|
built on `@lunora/auth` (a thin wrapper over
|
|
12
|
-
[better-auth](https://www.better-auth.com)) with
|
|
13
|
-
`SessionDO`
|
|
12
|
+
[better-auth](https://www.better-auth.com)) with identity **and session** tables
|
|
13
|
+
in D1. (`SessionDO` is a standalone TTL'd token store `@lunora/auth` never
|
|
14
|
+
calls — don't wire it for auth. The Durable Object option is `LunoraAuthDO` /
|
|
15
|
+
`.auth({ namespace })`, which holds the whole better-auth schema.)
|
|
14
16
|
|
|
15
17
|
## When to Use
|
|
16
18
|
|
|
@@ -104,7 +106,9 @@ dependency). OAuth items need the provider's client id/secret added to
|
|
|
104
106
|
The runtime resolves the session and exposes the user on every context:
|
|
105
107
|
|
|
106
108
|
```ts
|
|
107
|
-
import { LunoraError
|
|
109
|
+
import { LunoraError } from "lunorash/server";
|
|
110
|
+
|
|
111
|
+
import { mutation, v } from "#lunora/_generated/server.js";
|
|
108
112
|
|
|
109
113
|
export const createDocument = mutation.input({ title: v.string() }).mutation(async ({ ctx, args: { title } }) => {
|
|
110
114
|
if (!ctx.auth.userId) {
|
|
@@ -119,22 +123,35 @@ call the better-auth server API — see the scaffolded `lunora/auth/index.ts`.
|
|
|
119
123
|
|
|
120
124
|
### In the UI (React)
|
|
121
125
|
|
|
126
|
+
`useAuth()` returns exactly `{ setToken, token, user }` — there is no `signIn` /
|
|
127
|
+
`signOut`. Lunora owns the **token**, not the sign-in flow: run the flow with
|
|
128
|
+
the better-auth client (`authClient.signIn.email(...)`), then hand the resulting
|
|
129
|
+
JWT to `setToken`. `setToken(null)` signs out.
|
|
130
|
+
|
|
122
131
|
```tsx
|
|
123
132
|
import { Authenticated, Unauthenticated, useAuth } from "@lunora/react";
|
|
124
133
|
|
|
134
|
+
import { authClient } from "./auth-client";
|
|
135
|
+
|
|
125
136
|
function Account() {
|
|
126
|
-
const {
|
|
137
|
+
const { setToken, user } = useAuth();
|
|
138
|
+
|
|
139
|
+
const signIn = async () => {
|
|
140
|
+
const { data } = await authClient.signIn.email({ email, password });
|
|
141
|
+
|
|
142
|
+
setToken(data?.token ?? null);
|
|
143
|
+
};
|
|
127
144
|
|
|
128
145
|
return (
|
|
129
146
|
<>
|
|
130
147
|
<Authenticated>
|
|
131
148
|
<span>Signed in as {user?.email}</span>
|
|
132
|
-
<button type="button" onClick={() =>
|
|
149
|
+
<button type="button" onClick={() => setToken(null)}>
|
|
133
150
|
Sign out
|
|
134
151
|
</button>
|
|
135
152
|
</Authenticated>
|
|
136
153
|
<Unauthenticated>
|
|
137
|
-
<button type="button" onClick={
|
|
154
|
+
<button type="button" onClick={signIn}>
|
|
138
155
|
Sign in
|
|
139
156
|
</button>
|
|
140
157
|
</Unauthenticated>
|
|
@@ -92,24 +92,41 @@ that's a remote resource only `wrangler hyperdrive create` can mint. Importing
|
|
|
92
92
|
lunora codegen
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
When codegen sees `ctx.sql` used, it adds `sql: SqlClient` to
|
|
96
|
-
only** — never `QueryCtx`/`MutationCtx` — with a JSDoc restating
|
|
97
|
-
determinism/realtime caveat
|
|
95
|
+
When codegen sees `ctx.sql` used, it adds `readonly sql: SqlClient` to
|
|
96
|
+
**`ActionCtx` only** — never `QueryCtx`/`MutationCtx` — with a JSDoc restating
|
|
97
|
+
the determinism/realtime caveat, and emits a `.hyperdrive()` method on the
|
|
98
|
+
generated app builder for you to supply the client (step 4).
|
|
98
99
|
|
|
99
|
-
## Step 4:
|
|
100
|
+
## Step 4: Wire the client once, on the app builder
|
|
100
101
|
|
|
101
|
-
|
|
102
|
+
`ctx.sql` is `readonly` — assigning to it inside a handler is a `TS2540`.
|
|
103
|
+
Codegen cannot build the client for you (turning a connection string into a
|
|
104
|
+
`SqlClient` needs the driver you chose), so it emits a config thunk you fill in
|
|
105
|
+
at the app level. It is called once per shard construction, not per request:
|
|
106
|
+
|
|
107
|
+
```ts title="src/server/index.ts"
|
|
108
|
+
import type { HyperdriveLike } from "@lunora/hyperdrive";
|
|
102
109
|
import { createHyperdrive, fromPostgresJs } from "@lunora/hyperdrive";
|
|
103
110
|
import postgres from "postgres";
|
|
104
111
|
|
|
105
|
-
import {
|
|
112
|
+
import { defineApp } from "../lunora/_generated/app.js";
|
|
113
|
+
|
|
114
|
+
const app = defineApp<Env>()
|
|
115
|
+
.shard((env) => env.SHARD)
|
|
116
|
+
.hyperdrive((env) => fromPostgresJs(postgres(createHyperdrive(env.HYPERDRIVE as HyperdriveLike).connectionString)))
|
|
117
|
+
.build();
|
|
118
|
+
|
|
119
|
+
export const ShardDO = app.ShardDO;
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Then read it from any action:
|
|
106
123
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
ctx.sql = fromPostgresJs(postgres(connectionString));
|
|
124
|
+
```ts
|
|
125
|
+
import { action, v } from "@/lunora/_generated/server";
|
|
110
126
|
|
|
111
|
-
|
|
112
|
-
})
|
|
127
|
+
export const listLegacyOrders = action
|
|
128
|
+
.input({ orgId: v.string() })
|
|
129
|
+
.action(async ({ ctx, args: { orgId } }) => ctx.sql.query<{ id: string; total: number }>("select id, total from orders where org = $1", [orgId]));
|
|
113
130
|
```
|
|
114
131
|
|
|
115
132
|
The package never rewrites SQL — use your driver's native placeholders (`$1` for
|
|
@@ -122,10 +139,13 @@ Postgres change. To make external data reactive, write a projection into a
|
|
|
122
139
|
`defineSchema` table from the same action — that write _is_ tracked:
|
|
123
140
|
|
|
124
141
|
```ts
|
|
142
|
+
import { api } from "@/lunora/_generated/api";
|
|
143
|
+
|
|
125
144
|
const [row] = await ctx.sql.query<{ id: string; total: number }>("select id, total from orders where id = $1", [id]);
|
|
126
145
|
|
|
127
|
-
// This write re-runs live queries reading `orders
|
|
128
|
-
|
|
146
|
+
// This write re-runs live queries reading `orders`. Pass the generated
|
|
147
|
+
// reference — `ctx.run*` takes a reference, not a "file:fn" string.
|
|
148
|
+
await ctx.runMutation(api.orders.upsert, { id: row.id, total: row.total });
|
|
129
149
|
```
|
|
130
150
|
|
|
131
151
|
## Common Pitfalls
|