@stacksjs/stx 0.2.364 → 0.2.365
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/{chunk-nfwtms2p.js → chunk-0t0b5yex.js} +1 -1
- package/dist/{chunk-t0e193kb.js → chunk-0thch80p.js} +1 -1
- package/dist/{chunk-wzebxbek.js → chunk-11v2ysbe.js} +1 -1
- package/dist/{chunk-yyxgghm5.js → chunk-1nv116m3.js} +1 -1
- package/dist/{chunk-23ftyfcz.js → chunk-1q2b0r3v.js} +1 -1
- package/dist/{chunk-c6b161h9.js → chunk-2aqq5j7c.js} +1 -1
- package/dist/{chunk-jq4h14y6.js → chunk-346jyc33.js} +1 -1
- package/dist/{chunk-whywmp6c.js → chunk-4dzsp35z.js} +1 -1
- package/dist/{chunk-8qp89yt9.js → chunk-5qs1t2cd.js} +1 -1
- package/dist/{chunk-4v04zysj.js → chunk-5t826ypq.js} +1 -1
- package/dist/{chunk-6xmkzx0a.js → chunk-6njr31wk.js} +1 -1
- package/dist/{chunk-p6avvxkg.js → chunk-6tk817fg.js} +1 -1
- package/dist/{chunk-s5qkcz77.js → chunk-77g77ygz.js} +1 -1
- package/dist/{chunk-asxfek33.js → chunk-7ptewn2w.js} +2 -2
- package/dist/{chunk-yectvv7c.js → chunk-7yyfbhna.js} +1 -1
- package/dist/{chunk-ddsfdbwt.js → chunk-8zdq8kk5.js} +1 -1
- package/dist/{chunk-7tp3zk2s.js → chunk-a47e67th.js} +1 -1
- package/dist/{chunk-08pf5tmf.js → chunk-atf4tj9y.js} +1 -1
- package/dist/{chunk-0d96p1my.js → chunk-bh1m0x85.js} +1 -1
- package/dist/{chunk-dj0c80w1.js → chunk-bszp4vx1.js} +1 -1
- package/dist/{chunk-2gkbht81.js → chunk-bxnx8sga.js} +1 -1
- package/dist/{chunk-wbwfsp44.js → chunk-czzy14fj.js} +48 -29
- package/dist/{chunk-wsqbnhcy.js → chunk-d5r4zwyd.js} +8 -8
- package/dist/{chunk-6xy59d9x.js → chunk-dk40tcv1.js} +1 -1
- package/dist/{chunk-6gns8q1a.js → chunk-eczq4cxz.js} +1 -1
- package/dist/{chunk-drk5v3wn.js → chunk-g63sh9bx.js} +1 -1
- package/dist/{chunk-7wvvzame.js → chunk-hyrm54da.js} +1 -1
- package/dist/{chunk-5qe5amz6.js → chunk-jerrq5k1.js} +1 -1
- package/dist/{chunk-y1vw94q2.js → chunk-k10f0c00.js} +1 -1
- package/dist/{chunk-3dkv2bqc.js → chunk-k3ktx8w2.js} +1 -1
- package/dist/{chunk-89c03r0q.js → chunk-kmd694ky.js} +2 -2
- package/dist/{chunk-bfecmzpa.js → chunk-mks2cgty.js} +1 -1
- package/dist/{chunk-szbgwctn.js → chunk-n5791wn3.js} +1 -1
- package/dist/{chunk-8zw9npx5.js → chunk-p33qyhtc.js} +1 -1
- package/dist/{chunk-gerew7rz.js → chunk-p8nasx5y.js} +1 -1
- package/dist/{chunk-zk0enyyh.js → chunk-pbt7f5h9.js} +1 -1
- package/dist/{chunk-7nf8tw22.js → chunk-q28ekhhb.js} +2 -2
- package/dist/{chunk-3xt912sq.js → chunk-r5dta1qf.js} +16 -16
- package/dist/{chunk-ck4n9zkv.js → chunk-r8hr3jhh.js} +1 -1
- package/dist/{chunk-rw0j25b8.js → chunk-ry56srm9.js} +1 -1
- package/dist/{chunk-e8nxcfp3.js → chunk-se8fh272.js} +1 -1
- package/dist/{chunk-h6jnte7x.js → chunk-syy0njsk.js} +1 -1
- package/dist/{chunk-tan44cyf.js → chunk-tfnq0cj6.js} +1 -1
- package/dist/{chunk-d8n3wqgy.js → chunk-ttw7qrz0.js} +1 -1
- package/dist/{chunk-8b5cwheg.js → chunk-v8ccphfs.js} +1 -1
- package/dist/{chunk-ec8pyr0w.js → chunk-wkeymrkg.js} +1 -1
- package/dist/{chunk-85tvgy7c.js → chunk-xr8ergcp.js} +1 -1
- package/dist/{chunk-md0h8d2h.js → chunk-y3ns6824.js} +1 -1
- package/dist/{chunk-xh55b3m0.js → chunk-z274qgsn.js} +1 -1
- package/dist/{chunk-bkeszcra.js → chunk-zjqw2fde.js} +1 -1
- package/dist/cli.js +8 -8
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/pwa.js +1 -1
- package/dist/signals.js +48 -29
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Hm as W,Lp as X}from"./chunk-
|
|
2
|
+
import{Hm as W,Lp as X}from"./chunk-r5dta1qf.js";import V from"fs";import M from"path";import*as Y from"readline";var j={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},Q={help:{description:"Show available commands",usage:"help [command]",handler:async(q,z)=>{if(q[0]&&Q[q[0]]){let A=Q[q[0]];console.log(`
|
|
3
3
|
${j.bold}${q[0]}${j.reset} - ${A.description}`),console.log(` Usage: ${j.cyan}${A.usage}${j.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${j.bold}Available Commands:${j.reset}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{sk as m}from"./chunk-
|
|
2
|
+
import{sk as m}from"./chunk-7ptewn2w.js";import{Sw as z}from"./chunk-m8kem5ca.js";import{existsSync as s,mkdirSync as T,copyFileSync as F,chmodSync as A}from"fs";import{join as Z,basename as Yq}from"path";import{spawn as j,execSync as Zq}from"child_process";import{tmpdir as c,homedir as P,platform as Lq}from"os";var Iq=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Le as c,Me as d,Ne as e,Oe as f,Pe as g,Qe as h,Re as i}from"./chunk-
|
|
2
|
+
import{Le as c,Me as d,Ne as e,Oe as f,Pe as g,Qe as h,Re as i}from"./chunk-346jyc33.js";import"./chunk-5qs1t2cd.js";import"./chunk-ra1s4s6b.js";import"./chunk-se8fh272.js";import"./chunk-ry56srm9.js";import"./chunk-qjvny3wf.js";import{Mp as a,Pp as b}from"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{d as virtualPathFor,h as typecheckStxFiles,e as sourcePathFor,i as formatTypecheckDiagnostics,g as findStxModuleDeclarations,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Lg as a,Mg as b,Ng as c,Og as d,Pg as e,Qg as f}from"./chunk-
|
|
2
|
+
import{Lg as a,Mg as b,Ng as c,Og as d,Pg as e,Qg as f}from"./chunk-bxnx8sga.js";import"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{c as renderSlot,d as processSlots,a as parseSlots,b as parseSlotElement,e as extractSlotContent,f as applySlots};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{no as a,oo as b,po as c,qo as d,ro as e,so as f,to as g,uo as h,vo as i,wo as j,xo as k,yo as l,zo as m}from"./chunk-
|
|
2
|
+
import{no as a,oo as b,po as c,qo as d,ro as e,so as f,to as g,uo as h,vo as i,wo as j,xo as k,yo as l,zo as m}from"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{m as stripStxRuntimeImports,b as scanScriptTags,l as rewriteStxImportSpecifiers,j as processSignals,h as processScriptSetup,f as preEvalLiteralReactiveIfs,c as parseLoopExpression,d as hasSignalsSyntax,k as findMarkupIndexOutsideScripts,i as extractExports,g as convertSignalLoopsToAttributes,e as convertSignalDirectivesToAttributes,a as clearScriptScanCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ve as a}from"./chunk-
|
|
2
|
+
import{Ve as a}from"./chunk-bszp4vx1.js";import"./chunk-0knxnyq6.js";import"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{a as buildApp};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fi as jH}from"./chunk-
|
|
2
|
+
import{fi as jH}from"./chunk-5qs1t2cd.js";import{Do as e,Mp as S,Np as zH,Op as qH,Rp as JH,Sp as WH,Tp as VH,Up as AH,Vp as GH,Wp as UH,Xp as FH,Yp as MH,Zp as XH,am as $H,xr as BH}from"./chunk-r5dta1qf.js";import{st as f}from"./chunk-w1asc0zd.js";import{Av as D}from"./chunk-7racewc5.js";import{existsSync as x,readFileSync as m}from"fs";import U from"path";var EH=new Set(["module","exports","require","$bool","window","document","console","confirm","alert","fetch"]),HH=e.filter((H)=>!EH.has(H)).sort(),KH=[...D].sort(),DH=[...new Set([...HH,...KH])].sort(),PH=new Set(HH),TH=new Set(KH),SH=new Set(DH),t=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function xH(H,K){if(K==="server")return`'${H}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${H}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${H}', so it is undefined in the browser.`}function QH(H,K){let Z=[];for(let q of K){if(q.offset===void 0)continue;let Y=q.kind==="server"?PH:TH;t.lastIndex=0;for(let z of q.code.matchAll(t)){let A=z.index+z[0].indexOf("{")+1;for(let G of z[1].matchAll(/[^,]+/g)){let X=G[0];if(/^\s*type\s/.test(X))continue;let M=/^\s*([A-Za-z_$][\w$]*)/.exec(X);if(!M)continue;let $=M[1];if(!SH.has($)||Y.has($))continue;let V=q.offset+A+G.index+M[0].length-$.length,J=H.slice(0,V),I=J.split(`
|
|
3
3
|
`).length;Z.push({line:I,column:V-(J.lastIndexOf(`
|
|
4
4
|
`)+1)+1,offset:V,length:$.length,name:$,kind:q.kind,message:xH($,q.kind)})}}}return Z}import w from"path";var hH="@stacksjs/stx-typescript-plugin";function kH(H,K){let Z=w.resolve(H);for(;;){let q=w.join(Z,"tsconfig.json");if(K(q))return q;let Y=w.dirname(Z);if(Y===Z)return;Z=Y}}function YH(H,K,Z){let q=kH(H,Z);if(!q)return;let Y=new Set,z=(A)=>{if(Y.has(A))return;Y.add(A);let G=K(A);if(!G)return;let X=G.compilerOptions?.plugins;if(Array.isArray(X)){let $=X.find((J)=>J?.name===hH),V=Array.isArray($?.libs)?$.libs.filter((J)=>typeof J==="string"):[];return $?{configPath:A,libs:V.map((J)=>w.resolve(w.dirname(A),J))}:null}let M=typeof G.extends==="string"?[G.extends]:Array.isArray(G.extends)?G.extends:[];for(let $ of[...M].reverse()){if(typeof $!=="string"||!$.startsWith("."))continue;let V=w.resolve(w.dirname(A),$.endsWith(".json")?$:`${$}.json`),J=z(V);if(J!==void 0)return J}return};return z(q)??void 0}function gH(H,K="",Z=""){let q=H.startLine>1?`
|
|
5
5
|
`.repeat(H.startLine-1):"",Y=UH(H)+qH(zH(H.code)),z=H.kind==="client"||H.kind==="plain"?VH(K,H.code):"";return GH(`${q+Y}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ue as a}from"./chunk-
|
|
2
|
+
import{Ue as a}from"./chunk-0t0b5yex.js";import"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{a as startInteractive};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ki as T,Li as u,Mi as A}from"./chunk-ra1s4s6b.js";import{_k as g,fl as h,ll as b}from"./chunk-
|
|
2
|
+
import{Ki as T,Li as u,Mi as A}from"./chunk-ra1s4s6b.js";import{_k as g,fl as h,ll as b}from"./chunk-se8fh272.js";import{bm as k,fq as B,xr as I,zo as f}from"./chunk-r5dta1qf.js";import{vv as D,wv as S}from"./chunk-ta6z7k4p.js";import{Av as F}from"./chunk-7racewc5.js";import P from"path";var j=new Map,K=new Map,n=["composables","functions"];function p(z){let H=P.basename(z,".ts");return H==="index"||H==="types"||z.endsWith(".d.ts")}async function r(z){if(z)return P.resolve(z);let H=`<default>:${process.cwd()}`,Y=K.get(H);if(Y!==void 0)return Y;let J=await l();if(J!==null)K.set(H,J);return J}async function l(){let z=await I(),H=z.root||process.cwd(),Y=z.composablesDir;if(Y)return P.resolve(H,Y);for(let J of n){let V=P.resolve(H,J);try{let Z=new Bun.Glob("**/*.ts");for await(let W of Z.scan({cwd:V,absolute:!0}))if(!p(W))return V}catch{}}return null}async function m(z){let H=Array.isArray(z)?z:z?[P.resolve(z)]:(await I())._layerComposableDirs??[await r()].filter((J)=>!!J),Y=new Map;for(let J of H){let V=new Bun.Glob("**/*.ts");try{for await(let Z of V.scan({cwd:J,absolute:!0})){let W=P.relative(J,Z);if(!p(Z)&&!Y.has(W))Y.set(W,Z)}}catch{}}return{key:H.join("\x00"),files:[...Y.values()].sort()}}async function Wq(z){let{files:H}=await m(z),Y=B({loader:"ts",target:"browser",define:k()}),J=[];for(let V of H)try{let Z=await Bun.file(V).text(),W=Y.scan(Z).exports.filter((G)=>G!=="default");if(W.length>0)J.push({file:V,names:W})}catch{}return J}function c(z,H){return new RegExp(`\\b${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(z)}function a(z,H,Y){let J=new Map;for(let{file:G,names:$}of z)for(let O of $)if(!J.has(O))J.set(O,G);let V=(G)=>{let $=[];for(let[O,w]of J)if(c(G,O))$.push(w);return $},Z=new Set,W=Y.flatMap(V);while(W.length>0){let G=[];for(let $ of W){if(Z.has($))continue;Z.add($);for(let O of V(H.get($)??""))if(!Z.has(O))G.push(O)}W=G}return Z}async function Yq(z,H,Y){let{key:J,files:V}=await m(z);if(!J)return null;let Z=()=>[...new Set([...V,...V.flatMap((q)=>g(q))])],W=T(Z());if(V.length===0)return A(j,J,W,""),null;V.sort();let G=B({loader:"ts",target:"browser",define:k()}),$=new Map,O=[];for(let q of V)try{let Q=await Bun.file(q).text();$.set(q,Q);let U=G.scan(Q).exports.filter((X)=>X!=="default");if(U.length>0)O.push({file:q,names:U})}catch{$.set(q,"")}let w=H===void 0?new Set(V):a(O,$,Y?[H,...Y]:[H]);if(w.size===0)return null;let _=V.filter((q)=>w.has(q)),M=`${J}\x00${_.join("\x00")}`,v=u(j,M,W);if(v!==void 0)return v||null;let R=[],L=new Set,C=new Set;for(let q of _)try{let Q=$.get(q)??await Bun.file(q).text(),U=P.basename(q,".ts");for(let X of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(X[1])C.add(X[1]);try{for(let X of G.scan(Q).exports)if(X!=="default")L.add(X)}catch{}if(Q=D(Q),h(Q))Q=await b(Q,q,{projectRoot:process.cwd(),externalizeUserModules:!1}),Q=f(Q);Q=S(Q),Q=Q.replace(/^export\s+(default\s+)?/gm,""),Q=G.transformSync(Q),R.push(`// Composable: ${U}
|
|
3
3
|
${Q.trim()}`)}catch(Q){console.warn(`[stx] Failed to load composable ${q}:`,Q)}if(R.length===0||L.size===0)return A(j,M,W,""),null;let t=[...L].map((q)=>` try { if (!(${JSON.stringify(q)} in __c)) __c[${JSON.stringify(q)}] = ${q}; } catch (e) {}`).join(`
|
|
4
4
|
`),N=JSON.stringify([...L]),E=R.join(`
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{go as b,ho as c,io as d}from"./chunk-
|
|
2
|
+
import{go as b,ho as c,io as d}from"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import{rv as a}from"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{b as rendersAsElement,c as processESImports,d as processComponents,a as freeIdentifiers};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Jt as H,Mt as F}from"./chunk-xk402w4a.js";import{Sw as I}from"./chunk-m8kem5ca.js";import J from"fs";import z from"path";async function N(w,A,j){if(w.__stx_runtime_config)return;let b=H();if(b||j){w.__stx_runtime_config=b??F(j);return}let q=z.dirname(z.resolve(A));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((D)=>J.existsSync(z.join(q,D)))){let{loadStxConfig:D}=await import("./chunk-
|
|
2
|
+
import{Jt as H,Mt as F}from"./chunk-xk402w4a.js";import{Sw as I}from"./chunk-m8kem5ca.js";import J from"fs";import z from"path";async function N(w,A,j){if(w.__stx_runtime_config)return;let b=H();if(b||j){w.__stx_runtime_config=b??F(j);return}let q=z.dirname(z.resolve(A));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((D)=>J.existsSync(z.join(q,D)))){let{loadStxConfig:D}=await import("./chunk-a47e67th.js"),G=await D(q);if(G.runtimeConfig)w.__stx_runtime_config=F(G.runtimeConfig);return}let B=z.dirname(q);if(B===q)return;q=B}}async function O(w,A){function j(b){if(b===null)return"null";if(Array.isArray(b))return`Array<${b.length?[...new Set(b.map(j))].join(" | "):"unknown"}>`;if(typeof b==="object")return`{ ${Object.entries(b).map(([q,B])=>`readonly ${JSON.stringify(q)}: ${j(B)}`).join("; ")} }`;return typeof b}await Bun.write(z.join(w,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
|
|
3
3
|
declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${j(A.public??{})} }
|
|
4
4
|
`),await Bun.write(z.join(w,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
|
|
5
5
|
declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${j(A.private??{})} }
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Kj as b,Lj as c,Mj as d,Nj as e,Oj as f,Pj as g,Qj as h,Rj as i,Sj as j,Tj as k,Uj as l,Vj as m,Wj as n,Xj as o}from"./chunk-
|
|
2
|
+
import{Kj as b,Lj as c,Mj as d,Nj as e,Oj as f,Pj as g,Qj as h,Rj as i,Sj as j,Tj as k,Uj as l,Vj as m,Wj as n,Xj as o}from"./chunk-jerrq5k1.js";import{ul as a}from"./chunk-qjvny3wf.js";import"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{b as templateCache,j as registerServeModuleBundle,c as readFileCached,e as invalidateFileCacheByDir,d as invalidateFileCache,o as hashFilePath,k as getServeModuleBundle,i as getServeClientAsset,g as getCachedSignalsRuntime,h as getCachedRouterScript,l as clearDevCaches,m as checkCache,n as cacheTemplate,a as cacheEngineFingerprint,f as __setSignalsGeneratorsForTest};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fi as a,gi as b,hi as c}from"./chunk-
|
|
2
|
+
import{fi as a,gi as b,hi as c}from"./chunk-5qs1t2cd.js";import"./chunk-ra1s4s6b.js";import"./chunk-se8fh272.js";import"./chunk-ry56srm9.js";import"./chunk-qjvny3wf.js";import"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{a as listComposableModules,b as getComposableScript,c as clearComposableCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ao as x,Io as k,Lp as w,Tl as A,Ul as b,_n as M,an as T,bn as y,lm as B,mo as R,nm as F,vr as P}from"./chunk-
|
|
2
|
+
import{Ao as x,Io as k,Lp as w,Tl as A,Ul as b,_n as M,an as T,bn as y,lm as B,mo as R,nm as F,vr as P}from"./chunk-r5dta1qf.js";import{Sw as v}from"./chunk-m8kem5ca.js";function j(K){return K.endsWith(".md")||K.endsWith(".markdown")}function C(K){let z=[];_(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let G=[...z];_(/<code\b[^>]*>[\s\S]*?<\/code>/gi,G);function _(J,Y){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(Y?.some((X)=>q>=X.start&&N<=X.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,Y)=>J.start-Y.start);let U="",Q=0;for(let J of z){if(J.start<Q)continue;U+=K.slice(Q,J.start),U+=`@raw${K.slice(J.start,J.end)}@endraw`,Q=J.end}return U+=K.slice(Q),U}async function D(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>b(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as f,resolve as H}from"path";function S(K){let z=K,G=M(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],Y=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],X=$[2],E=$[0],Z=N.includes("server");if(Y(X))J.push(E);else if(Z)Q.push(X);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,X,E=[];while((X=N.exec(q))!==null){let Z=X.index+X[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:X.index,end:L+9}),N.lastIndex=L+9}for(let Z=E.length-1;Z>=0;Z--)q=q.substring(0,E[Z].start)+q.substring(E[Z].end)}for(let N of U)q=q.replace(N,"");return{templateContent:q,serverScripts:Q,clientScripts:U,signalsScripts:J}}function g(K,z){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -14,5 +14,5 @@ ${Q.join(`
|
|
|
14
14
|
`)}`}else{if(G.processClientScripts!==!1&&Q.length>0){let N=Y.__stx_event_bindings||[],X=B(Y),Z=(await Promise.all(Q.map(async(I)=>{let W=I.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!W)return I;return await F(W[1],{eventBindings:N,templateContent:q,serverData:X,filePath:z})}))).join(`
|
|
15
15
|
`);if(q.match(/(<\/body>)/i))q=q.replace(/(<\/body>)/i,`${Z}
|
|
16
16
|
$1`);else q+=`
|
|
17
|
-
${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-
|
|
17
|
+
${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-eczq4cxz.js");q=await N(q)}catch{}return q}
|
|
18
18
|
export{j as pk,C as qk,D as rk,o as sk,r as tk,V as uk};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{So as a,To as b,Uo as c,Vo as d,Wo as e,Xo as f,Yo as g}from"./chunk-
|
|
2
|
+
import{So as a,To as b,Uo as c,Vo as d,Wo as e,Xo as f,Yo as g}from"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{a as resetUnscopedSignalWarnings,g as processStackReplacements,f as processStackPushDirectives,e as processIncludes,b as partialsCache,c as onceStore,d as clearOnceStore};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ki as O,Li as w,Mi as Z}from"./chunk-ra1s4s6b.js";import{_k as R,fl as U,ll as T}from"./chunk-
|
|
2
|
+
import{Ki as O,Li as w,Mi as Z}from"./chunk-ra1s4s6b.js";import{_k as R,fl as U,ll as T}from"./chunk-se8fh272.js";import{bm as M,fq as k,xr as C,zo as W}from"./chunk-r5dta1qf.js";import{vv as E,wv as L}from"./chunk-ta6z7k4p.js";import{Av as B}from"./chunk-7racewc5.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd(),externalizeUserModules:!1});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
|
|
3
3
|
${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(G.length===0)return Z(Y,z,K,""),null;let j=G.join(`
|
|
4
4
|
|
|
5
5
|
`),x=`;(function(){
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ar as f,vr as a,wr as b,xr as c,yr as d,zr as e}from"./chunk-
|
|
2
|
+
import{Ar as f,vr as a,wr as b,xr as c,yr as d,zr as e}from"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{Sw as H}from"./chunk-m8kem5ca.js";import P from"path";var $=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function G(...w){let v=new Set;for(let q of w){if(!q||!q.includes("__stxModules["))continue;for(let z of q.matchAll($))try{v.add(JSON.parse(`"${z[1]}"`))}catch{}}return[...v].sort()}async function T(w,v={}){if(w.length===0)return null;let q=process.cwd(),z=[],J=[];w.forEach((j,X)=>{let Z=j.startsWith("npm:")?j.slice(4):P.resolve(q,j),N=`__stxRegistered${X}`,O=JSON.stringify(j);z.push(`import * as ${N} from ${JSON.stringify(Z)};`),J.push(`if (!globalThis.__stxModules[${O}]) globalThis.__stxModules[${O}] = ${N};`)});let L=[...z,"globalThis.__stxModules = globalThis.__stxModules || {};",...J].join(`
|
|
3
|
-
`),B;try{let{bundleClientScript:j}=await import("./chunk-
|
|
3
|
+
`),B;try{let{bundleClientScript:j}=await import("./chunk-hyrm54da.js");B=await j(L,P.join(q,".stx-module-registry.ts"),{projectRoot:q,minify:v.minify,externalizeUserModules:!1,collectInputs:v.collectInputs})}catch(j){return console.warn("[stx] could not build the page module registry (#1957):",j),null}let{transformAutoImports:Q,generateAutoImportDestructuring:U}=await import("./chunk-xr8ergcp.js"),F=Q(B),V=U(F.stxImports,F.browserImports),{transformStoreImports:W}=await import("./chunk-bqm306xw.js");B=W(F.code);let M=JSON.stringify(new Bun.CryptoHasher("md5").update(L).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${M}]) return;`,` __stxBundles[${M}] = true;`,V,B,"})();"].join(`
|
|
4
4
|
`)}export{G as registeredModuleIdsIn,T as buildModuleRegistryScript};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Am as g,Bm as h,Cm as i,Dm as j,Em as k,Fm as l,Gm as m,Hm as n,Im as o,Jm as p,Km as q,Lm as r,um as a,vm as b,wm as c,xm as d,ym as e,zm as f}from"./chunk-
|
|
2
|
+
import{Am as g,Bm as h,Cm as i,Dm as j,Em as k,Fm as l,Gm as m,Hm as n,Im as o,Jm as p,Km as q,Lm as r,um as a,vm as b,wm as c,xm as d,ym as e,zm as f}from"./chunk-r5dta1qf.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-v8ccphfs.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-6njr31wk.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{j as usesSignalsInScript,r as unescapeHtml,p as resetRejectedExpressionWarnings,g as replaceInterpolations,c as registerFilters,b as registerFilter,n as processExpressions,m as interpolateScriptsInTemplate,k as interpolateScriptExpressions,l as interpolateScriptAttributes,d as getAllFilters,f as findMustacheEnd,q as evaluateExpression,i as escapeHtmlValue,h as escapeHtml,a as defaultFilters,e as clearCustomFilters,o as applyFilters};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{xg as I}from"./chunk-0knxnyq6.js";import{xr as H}from"./chunk-
|
|
2
|
+
import{xg as I}from"./chunk-0knxnyq6.js";import{xr as H}from"./chunk-r5dta1qf.js";import{Sw as G}from"./chunk-m8kem5ca.js";import L from"path";async function Q(k={}){let J=performance.now(),A=k.root||process.cwd(),j=await H(A),B=k.ssr?.routeRules??j.routeRules??{};if(I(B),!j.ssr&&Object.keys(B).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!j.ssr&&(k.ssr?.serverApi??j.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let D,E;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");D=await z({pagesDir:L.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-g63sh9bx.js");E=await z({root:A,outputDir:".output",debug:k.debug,...k.ssr})}let K=Math.round(performance.now()-J);return{mode:q,ssg:D,ssr:E,duration:K}}
|
|
3
3
|
export{Q as Ve};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Bm as b}from"./chunk-
|
|
2
|
+
import{Bm as b}from"./chunk-r5dta1qf.js";import{pv as L,tv as R}from"./chunk-met6wtbk.js";function P(j,U){let Q=1,J=U,B="<template",z="</template";while(J<j.length&&Q>0){let G=j.indexOf("<",J);if(G===-1)break;if(J=G,j.startsWith(B,J)&&(J+B.length>=j.length||/[\s>\/]/.test(j[J+B.length]))){Q++,J+=B.length;continue}if(j.startsWith(z,J)){let W=j.indexOf(">",J+z.length);if(W!==-1){if(Q--,Q===0)return W+1;J=W+1;continue}}J++}return Q===0?J:-1}var F=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function O(j,U){let Q=null;for(let J=U;J<j.length;J++){let B=j[J];if(Q){if(B==="\\"){J++;continue}if(B===Q)Q=null;continue}if(B==='"'||B==="'"){Q=B;continue}if(B===">")return J+1}return-1}function I(j,U,Q){let J=U.toLowerCase(),B=1,z=Q;while(z<j.length){let G=j.indexOf("<",z);if(G===-1)return-1;if(j.startsWith("<!--",G)){let $=j.indexOf("-->",G+4);z=$===-1?j.length:$+3;continue}let W=O(j,G+1);if(W===-1)return-1;let Z=j.slice(G,W),Y=Z.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(Y&&Y[2].toLowerCase()===J){if(Y[1]==="/"){if(B--,B===0)return W}else if(!/\/\s*>$/.test(Z))B++}z=W}return-1}function w(j){let U=[],Q=[],J=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,B=0;while(B<j.length){let z=j.indexOf("<",B);if(z===-1)break;if(j.startsWith("<!--",z)){let X=j.indexOf("-->",z+4);B=X===-1?j.length:X+3;continue}let G=O(j,z+1);if(G===-1)break;let W=j.slice(z,G),Z=W.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Z){B=G;continue}let Y=Z[2].toLowerCase();if(Z[1]==="/"){let X=Q.lastIndexOf(Y);if(X!==-1)Q.splice(X);B=G;continue}let $=/\/\s*>$/.test(W),K=Q.length===0?W.match(J):null;if(K){let X=K[1]||K[2],H=W.replace(J,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),_=$||F.has(Y)?-1:I(j,Y,G);if(_===-1)U.push({start:z,end:G,slotName:X,element:H}),B=G;else U.push({start:z,end:_,slotName:X,element:H+j.slice(G,_)}),B=_;continue}if(!$&&!F.has(Y)){if(Q.push(Y),Y==="script"||Y==="style"){let X=j.toLowerCase().indexOf(`</${Y}>`,G);if(X!==-1){B=X;continue}}}B=G}return U}function D(j){let U=[],Q=[],J=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,B=0;while(B<j.length){let z=j.indexOf("<",B);if(z===-1)break;if(j.startsWith("<!--",z)){let X=j.indexOf("-->",z+4);B=X===-1?j.length:X+3;continue}let G=O(j,z+1);if(G===-1)break;let W=j.slice(z,G),Z=W.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Z){B=G;continue}let Y=Z[1]==="/",$=Z[2].toLowerCase();if(Y){let X=Q.lastIndexOf($);if(X!==-1)Q.splice(X);B=G;continue}if($==="template"&&Q.length===0){let X=W.match(J);if(X){let H=P(j,G);if(H!==-1){let _=X[1]||X[2]||X[3];U.push({start:z,end:H,slotName:_,content:j.slice(G,H-11).trim(),propsBinding:X[4]||void 0}),B=H;continue}}}if(!/\/\s*>$/.test(W)&&!F.has($)){if(Q.push($),$==="script"||$==="style"){let X=j.toLowerCase().indexOf(`</${$}>`,G);if(X!==-1){B=X;continue}}}B=G}return U}function v(j){let U={default:"",named:new Map},Q=j,J=D(j);for(let z of J)U.named.set(z.slotName,{name:z.slotName,content:z.content,propsBinding:z.propsBinding});J.sort((z,G)=>G.start-z.start);for(let z of J)Q=Q.slice(0,z.start)+Q.slice(z.end);let B=w(Q);for(let z of B){let G=U.named.get(z.slotName);if(G)G.content+=z.element;else U.named.set(z.slotName,{name:z.slotName,content:z.element})}for(let z=B.length-1;z>=0;z--){let G=B[z];Q=Q.slice(0,G.start)+Q.slice(G.end)}return U.default=Q.trim(),U}function S(j){let U=j.match(/name\s*=\s*["']([^"']+)["']/),Q=U?U[1]:"",J={},B=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,z;while((z=B.exec(j))!==null)J[z[1]]=z[2];let G=j.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),W=G?G[1].trim():"";return{name:Q,props:J,defaultContent:W}}async function k(j,U,Q,J){if(!j)return Q;let B=j.content;if(j.propsBinding&&Object.keys(U).length>0){let z=j.propsBinding.trim(),G={...J};if(z.startsWith("{")&&z.endsWith("}")){let W=z.slice(1,-1).split(",").map((Z)=>Z.trim()).filter(Boolean);for(let Z of W){let[Y,$]=Z.split(":").map((X)=>X.trim()),K=$||Y;if(U[Y]!==void 0)G[K]=U[Y]}}else G[z]=U;B=N(B,G)}return B}function N(j,U){return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(Q,J)=>{try{let B=J.trim(),z=y(B,U);return b(String(z??""))}catch{return`{{ ${J} }}`}})}function y(j,U){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(j)){let J=j.split("."),B=U;for(let z of J)if(B&&typeof B==="object"&&z in B)B=B[z];else return;return B}let Q=j.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(Q){let[,J,B,z]=Q,G=U[J],W=parseInt(z,10);if(typeof G==="number")switch(B){case"+":return G+W;case"-":return G-W;case"*":return G*W;case"/":return G/W}}try{if(!L(j))return;return R(j,Object.keys(U))(...Object.values(U))}catch{return}}async function T(j,U,Q){let J=j;J=await C(J,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(G,W,Z,Y)=>{let $=U.named.get(W),K=Y?.trim()||"",X=Z||"",H={},_=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,q;while((q=_.exec(X))!==null){let A=q[1],V=q[2];H[A]=y(V,Q)}return await k($,H,K,Q)});let z=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return J=J.replace(z,(G,W,Z)=>{if(/\bname\s*=/.test(W||""))return G;let Y=Z?.trim()||"";return U.default||Y}),J}async function C(j,U,Q){let J=[],B=[];j.replace(U,(W,...Z)=>{let Y=Z[Z.length-2];return B.push({match:W,index:Y}),J.push(Q(W,...Z.slice(0,-2))),W});let z=await Promise.all(J),G=j;for(let W=B.length-1;W>=0;W--){let{match:Z,index:Y}=B[W];G=G.slice(0,Y)+z[W]+G.slice(Y+Z.length)}return G}function E(j){let U=v(j);return{defaultSlot:U.default,namedSlots:U.named}}async function x(j,U,Q,J){return await T(j,{default:U,named:Q},J)}
|
|
3
3
|
export{v as Lg,S as Mg,k as Ng,T as Og,E as Pg,x as Qg};
|
|
@@ -167,6 +167,25 @@ console.log('[stx] entering IIFE');
|
|
|
167
167
|
// Reactive Core
|
|
168
168
|
// ==========================================================================
|
|
169
169
|
|
|
170
|
+
// Compiled expression functions, by parameter list and body. A binding was
|
|
171
|
+
// compiled with new Function on every evaluation: a page with a few hundred
|
|
172
|
+
// names in scope rebuilt a function of a few hundred parameters for every
|
|
173
|
+
// binding of every row, every time a row re-rendered. Opening a 386-message
|
|
174
|
+
// conversation took seven seconds in WebKit, the window frozen meanwhile.
|
|
175
|
+
// A Function built this way closes over nothing, so one can be reused.
|
|
176
|
+
const __stxCompiled = new Map();
|
|
177
|
+
function __stxCompile(params, body) {
|
|
178
|
+
const key = params.join(',') + '\\x01' + body;
|
|
179
|
+
let fn = __stxCompiled.get(key);
|
|
180
|
+
if (!fn) {
|
|
181
|
+
fn = new Function(...params, body);
|
|
182
|
+
// Bounded: expressions are finite per page, but SPA navigation adds more.
|
|
183
|
+
if (__stxCompiled.size >= 5000) __stxCompiled.clear();
|
|
184
|
+
__stxCompiled.set(key, fn);
|
|
185
|
+
}
|
|
186
|
+
return fn;
|
|
187
|
+
}
|
|
188
|
+
|
|
170
189
|
let activeEffect = null;
|
|
171
190
|
const effectStack = [];
|
|
172
191
|
const pendingEffects = new Set();
|
|
@@ -756,7 +775,7 @@ else {
|
|
|
756
775
|
// First evaluate the base expression
|
|
757
776
|
let value;
|
|
758
777
|
try {
|
|
759
|
-
const fn =
|
|
778
|
+
const fn = __stxCompile(Object.keys(scope), 'return ' + valueExpr);
|
|
760
779
|
value = fn(...Object.values(scope));
|
|
761
780
|
}
|
|
762
781
|
catch (e) {
|
|
@@ -777,7 +796,7 @@ catch (e) {
|
|
|
777
796
|
if (/^['"].*['"]$/.test(arg)) return arg.slice(1, -1);
|
|
778
797
|
// Try to evaluate as expression in scope
|
|
779
798
|
try {
|
|
780
|
-
const fn =
|
|
799
|
+
const fn = __stxCompile(Object.keys(scope), 'return ' + arg);
|
|
781
800
|
return fn(...Object.values(scope));
|
|
782
801
|
}
|
|
783
802
|
catch (e) {
|
|
@@ -2069,7 +2088,7 @@ finally {
|
|
|
2069
2088
|
|| expressionUsesSignalApi(expr, prop);
|
|
2070
2089
|
})
|
|
2071
2090
|
: baseScope;
|
|
2072
|
-
const fn =
|
|
2091
|
+
const fn = __stxCompile(Object.keys(baseScope), 'return ' + expr);
|
|
2073
2092
|
const result = fn(...Object.values(scope));
|
|
2074
2093
|
// Post-eval unwrap \u2014 see evalAttrExpr note for the reason.
|
|
2075
2094
|
return (result && typeof result === 'function' && (result._isSignal || result._isDerived)) ? result() : result;
|
|
@@ -2237,7 +2256,7 @@ catch (e) {
|
|
|
2237
2256
|
const v = scope[k];
|
|
2238
2257
|
handlerScope[k] = (v && typeof v === 'function' && v._isStxLoopItem) ? v() : v;
|
|
2239
2258
|
});
|
|
2240
|
-
const fn =
|
|
2259
|
+
const fn = __stxCompile(Object.keys(handlerScope).concat(['$event']), expr);
|
|
2241
2260
|
fn(...Object.values(handlerScope), event);
|
|
2242
2261
|
}
|
|
2243
2262
|
catch (e) {
|
|
@@ -2547,7 +2566,7 @@ catch (e) {
|
|
|
2547
2566
|
return expressionCallsSignal(expression, prop)
|
|
2548
2567
|
|| expressionUsesSignalApi(expression, prop);
|
|
2549
2568
|
});
|
|
2550
|
-
var fn =
|
|
2569
|
+
var fn = __stxCompile(['__scope__'], 'with(__scope__) { return (' + expression + ') }');
|
|
2551
2570
|
value = fn(unwrapScope);
|
|
2552
2571
|
if (value && typeof value === 'function' && (value._isSignal || value._isDerived)) value = value();
|
|
2553
2572
|
}
|
|
@@ -2755,7 +2774,7 @@ catch (e) {
|
|
|
2755
2774
|
var memoExpr = el.getAttribute('data-stx-memo');
|
|
2756
2775
|
try {
|
|
2757
2776
|
var memoScope = { ...globalHelpers, ...scope, ...(findElementScope(el) || {}) };
|
|
2758
|
-
var memoFn =
|
|
2777
|
+
var memoFn = __stxCompile(Object.keys(memoScope), 'return ' + memoExpr);
|
|
2759
2778
|
var memoVals = JSON.stringify(memoFn(...Object.values(memoScope)));
|
|
2760
2779
|
if (el.__stx_memo_prev === memoVals) {
|
|
2761
2780
|
return; // Dependencies unchanged \u2014 skip re-processing
|
|
@@ -2808,7 +2827,7 @@ catch (e) {
|
|
|
2808
2827
|
else {
|
|
2809
2828
|
// Use auto-unwrap proxy (Feature #1)
|
|
2810
2829
|
const unwrapScope = createExpressionAutoUnwrapProxy(capturedScope, expr);
|
|
2811
|
-
const fn =
|
|
2830
|
+
const fn = __stxCompile(Object.keys(capturedScope), 'return ' + expr);
|
|
2812
2831
|
bindingNode.textContent = fn(...Object.values(unwrapScope));
|
|
2813
2832
|
}
|
|
2814
2833
|
}
|
|
@@ -2817,7 +2836,7 @@ catch (e) {
|
|
|
2817
2836
|
// because it converts the signal to its value before the expression runs.
|
|
2818
2837
|
// Retry without auto-unwrap so signal functions remain callable.
|
|
2819
2838
|
try {
|
|
2820
|
-
const fn =
|
|
2839
|
+
const fn = __stxCompile(Object.keys(capturedScope), 'return ' + expr);
|
|
2821
2840
|
bindingNode.textContent = fn(...Object.values(capturedScope));
|
|
2822
2841
|
}
|
|
2823
2842
|
catch (e2) {
|
|
@@ -2934,7 +2953,7 @@ else if (part) {
|
|
|
2934
2953
|
|
|
2935
2954
|
// Use auto-unwrap proxy (Feature #1)
|
|
2936
2955
|
const unwrapScope = createExpressionAutoUnwrapProxy(activeScope, expr);
|
|
2937
|
-
const fn =
|
|
2956
|
+
const fn = __stxCompile(['__scope__'], 'with(__scope__) { return (' + expr + ') }');
|
|
2938
2957
|
var value = maybeUnwrapSignal(fn(unwrapScope));
|
|
2939
2958
|
noteExprSuccess(expr);
|
|
2940
2959
|
return value;
|
|
@@ -2943,7 +2962,7 @@ catch (e) {
|
|
|
2943
2962
|
// Auto-unwrap can break explicit signal calls like errorData().message
|
|
2944
2963
|
// Retry without auto-unwrap so signal functions remain callable
|
|
2945
2964
|
try {
|
|
2946
|
-
const fn =
|
|
2965
|
+
const fn = __stxCompile(['__scope__'], 'with(__scope__) { return (' + expr + ') }');
|
|
2947
2966
|
var retried = maybeUnwrapSignal(fn(activeScope));
|
|
2948
2967
|
noteExprSuccess(expr);
|
|
2949
2968
|
return retried;
|
|
@@ -3257,7 +3276,7 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
|
|
|
3257
3276
|
return 'if(' + k + ' !== __s["' + k + '"]()) __s["' + k + '"].set(' + k + ')';
|
|
3258
3277
|
}).join(';');
|
|
3259
3278
|
var body = getVars + ';' + value + ';' + setVars;
|
|
3260
|
-
var fn2 =
|
|
3279
|
+
var fn2 = __stxCompile(['__s', '$event'], body);
|
|
3261
3280
|
fn2(eventCapturedScope, handlerEvent);
|
|
3262
3281
|
} else if (hasSignals) {
|
|
3263
3282
|
// Function calls with signals in scope keep any signal used through
|
|
@@ -3280,10 +3299,10 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
|
|
|
3280
3299
|
}
|
|
3281
3300
|
return 'var ' + k + ' = __s["' + k + '"] && typeof __s["' + k + '"] === "function" && __s["' + k + '"]._isSignal ? __s["' + k + '"]() : __s["' + k + '"]';
|
|
3282
3301
|
}).join(';');
|
|
3283
|
-
var fn3 =
|
|
3302
|
+
var fn3 = __stxCompile(['__s', '$event'], unwrapVars + ';' + value);
|
|
3284
3303
|
fn3(eventCapturedScope, handlerEvent);
|
|
3285
3304
|
} else {
|
|
3286
|
-
var fn =
|
|
3305
|
+
var fn = __stxCompile(Object.keys(eventCapturedScope).concat(['$event']), value);
|
|
3287
3306
|
fn(...Object.values(eventCapturedScope), handlerEvent);
|
|
3288
3307
|
}
|
|
3289
3308
|
}
|
|
@@ -3409,13 +3428,13 @@ catch (e) {
|
|
|
3409
3428
|
var value;
|
|
3410
3429
|
try {
|
|
3411
3430
|
var unwrapScope = createExpressionAutoUnwrapProxy(capturedScope, expr);
|
|
3412
|
-
var fn =
|
|
3431
|
+
var fn = __stxCompile(Object.keys(capturedScope), 'return ' + expr);
|
|
3413
3432
|
value = fn(...Object.values(unwrapScope));
|
|
3414
3433
|
} catch (e1) {
|
|
3415
3434
|
// Retry without unwrapping \u2014 handles edge cases where the proxy
|
|
3416
3435
|
// interferes with certain expression patterns
|
|
3417
3436
|
try {
|
|
3418
|
-
var fn2 =
|
|
3437
|
+
var fn2 = __stxCompile(Object.keys(capturedScope), 'return ' + expr);
|
|
3419
3438
|
value = fn2(...Object.values(capturedScope));
|
|
3420
3439
|
} catch (e2) {
|
|
3421
3440
|
// Suppress ReferenceError/TypeError during async init \u2014 a signal
|
|
@@ -3461,7 +3480,7 @@ catch (e) {
|
|
|
3461
3480
|
return direct();
|
|
3462
3481
|
try {
|
|
3463
3482
|
var unwrapScope = createExpressionAutoUnwrapProxy(capturedScope, expr);
|
|
3464
|
-
var fn =
|
|
3483
|
+
var fn = __stxCompile(['__scope__'], 'with(__scope__) { return (' + expr + ') }');
|
|
3465
3484
|
return fn(unwrapScope);
|
|
3466
3485
|
}
|
|
3467
3486
|
catch (e) {
|
|
@@ -3489,7 +3508,7 @@ else {
|
|
|
3489
3508
|
// Routing through it also drops the old requirement that every scope
|
|
3490
3509
|
// key be a valid identifier, since nothing is destructured now.
|
|
3491
3510
|
var writeScope = createModelWriteProxy(capturedScope);
|
|
3492
|
-
var writeFn =
|
|
3511
|
+
var writeFn = __stxCompile(['__scope__', '__v__'], 'with(__scope__) { ' + expr + ' = __v__ }');
|
|
3493
3512
|
writeFn(writeScope, val);
|
|
3494
3513
|
}
|
|
3495
3514
|
}
|
|
@@ -3603,7 +3622,7 @@ else {
|
|
|
3603
3622
|
const safeKeys = keys.filter(k => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k));
|
|
3604
3623
|
let fn;
|
|
3605
3624
|
try {
|
|
3606
|
-
fn =
|
|
3625
|
+
fn = __stxCompile(safeKeys, 'return ' + expr);
|
|
3607
3626
|
} catch (e) {
|
|
3608
3627
|
console.warn('[STX] bindClass compile error:', expr, e);
|
|
3609
3628
|
return;
|
|
@@ -3672,12 +3691,12 @@ else {
|
|
|
3672
3691
|
// throw TypeError.
|
|
3673
3692
|
try {
|
|
3674
3693
|
const unwrapScope = createExpressionAutoUnwrapProxy(capturedScope, expr);
|
|
3675
|
-
const fn =
|
|
3694
|
+
const fn = __stxCompile(Object.keys(capturedScope), 'return ' + expr);
|
|
3676
3695
|
return fn(...Object.values(unwrapScope));
|
|
3677
3696
|
}
|
|
3678
3697
|
catch (e1) {
|
|
3679
3698
|
try {
|
|
3680
|
-
const fn2 =
|
|
3699
|
+
const fn2 = __stxCompile(Object.keys(capturedScope), 'return ' + expr);
|
|
3681
3700
|
return fn2(...Object.values(capturedScope));
|
|
3682
3701
|
}
|
|
3683
3702
|
catch (e2) {
|
|
@@ -4163,7 +4182,7 @@ else {
|
|
|
4163
4182
|
return expressionCallsSignal(expression, prop)
|
|
4164
4183
|
|| expressionUsesSignalApi(expression, prop);
|
|
4165
4184
|
});
|
|
4166
|
-
const fn =
|
|
4185
|
+
const fn = __stxCompile(Object.keys(scope), 'return ' + expression);
|
|
4167
4186
|
return fn(...Object.values(unwrapScope));
|
|
4168
4187
|
}
|
|
4169
4188
|
catch (e) {
|
|
@@ -4186,7 +4205,7 @@ catch (e) {
|
|
|
4186
4205
|
});
|
|
4187
4206
|
// new Function body is non-strict, so with() works \u2014 only accessed
|
|
4188
4207
|
// properties trigger the proxy's get trap and register as dependencies
|
|
4189
|
-
const fn =
|
|
4208
|
+
const fn = __stxCompile(['__scope__'], 'with(__scope__) { return ' + expression + ' }');
|
|
4190
4209
|
return fn(unwrapScope);
|
|
4191
4210
|
} catch (e) {
|
|
4192
4211
|
if (!(e instanceof ReferenceError) && !(e instanceof TypeError)) console.warn('[STX] Expression error:', expression, e);
|
|
@@ -4281,7 +4300,7 @@ catch (e) {
|
|
|
4281
4300
|
try {
|
|
4282
4301
|
const scope = { [itemName]: item };
|
|
4283
4302
|
if (indexName) scope[indexName] = index;
|
|
4284
|
-
const fn =
|
|
4303
|
+
const fn = __stxCompile([itemName, indexName || '_idx'], 'return ' + keyExpr);
|
|
4285
4304
|
return String(fn(item, index));
|
|
4286
4305
|
} catch (e) {
|
|
4287
4306
|
return String(index);
|
|
@@ -4704,12 +4723,12 @@ catch (e) {
|
|
|
4704
4723
|
try {
|
|
4705
4724
|
var unwrapScope = createExpressionAutoUnwrapProxy(scope, expression);
|
|
4706
4725
|
// new Function body is non-strict, so with() works.
|
|
4707
|
-
var fn =
|
|
4726
|
+
var fn = __stxCompile(['__scope__'], 'with(__scope__) { return ' + expression + ' }');
|
|
4708
4727
|
return fn(unwrapScope);
|
|
4709
4728
|
}
|
|
4710
4729
|
catch (e1) {
|
|
4711
4730
|
try {
|
|
4712
|
-
var fn2 =
|
|
4731
|
+
var fn2 = __stxCompile(['__scope__'], 'with(__scope__) { return ' + expression + ' }');
|
|
4713
4732
|
return fn2(scope);
|
|
4714
4733
|
}
|
|
4715
4734
|
catch (e2) {
|
|
@@ -4953,14 +4972,14 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
|
|
|
4953
4972
|
try {
|
|
4954
4973
|
const scope = { ...globalHelpers, ...capturedComponentScope, ...(capturedElementScope || {}) };
|
|
4955
4974
|
const unwrapScope = createExpressionAutoUnwrapProxy(scope, expression);
|
|
4956
|
-
const fn =
|
|
4975
|
+
const fn = __stxCompile(['__scope__'], 'with(__scope__) { return ' + expression + ' }');
|
|
4957
4976
|
return fn(unwrapScope);
|
|
4958
4977
|
}
|
|
4959
4978
|
catch (e1) {
|
|
4960
4979
|
try {
|
|
4961
4980
|
// Retry without the unwrap proxy so call-syntax (signal()) works.
|
|
4962
4981
|
const scope2 = { ...globalHelpers, ...capturedComponentScope, ...(capturedElementScope || {}) };
|
|
4963
|
-
const fn2 =
|
|
4982
|
+
const fn2 = __stxCompile(['__scope__'], 'with(__scope__) { return ' + expression + ' }');
|
|
4964
4983
|
return fn2(scope2);
|
|
4965
4984
|
}
|
|
4966
4985
|
catch (e2) {
|
|
@@ -8253,7 +8272,7 @@ else {
|
|
|
8253
8272
|
if (matches) {
|
|
8254
8273
|
matches.forEach(match => {
|
|
8255
8274
|
const expr = match.replace(/^\\{\\{\\s*|\\s*\\}\\}$/g, '');
|
|
8256
|
-
const fn =
|
|
8275
|
+
const fn = __stxCompile(Object.keys(componentScope), 'return ' + expr);
|
|
8257
8276
|
const value = fn(...Object.values(componentScope));
|
|
8258
8277
|
result = result.replace(match, value != null ? value : '');
|
|
8259
8278
|
});
|
|
@@ -8280,7 +8299,7 @@ else if (el.tagName === 'META') {
|
|
|
8280
8299
|
matches.forEach(match => {
|
|
8281
8300
|
const expr = match.replace(/^\\{\\{\\s*|\\s*\\}\\}$/g, '');
|
|
8282
8301
|
if (/^__[A-Z_]+__$/.test(expr.trim())) return;
|
|
8283
|
-
const fn =
|
|
8302
|
+
const fn = __stxCompile(Object.keys(componentScope), 'return ' + expr);
|
|
8284
8303
|
const value = fn(...Object.values(componentScope));
|
|
8285
8304
|
result = result.replace(match, value != null ? value : '');
|
|
8286
8305
|
});
|