@stacksjs/stx 0.2.873 → 0.2.875
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-003ph86a.js +2 -0
- package/dist/chunk-027meh1k.js +2 -0
- package/dist/chunk-0bc3mwqd.js +2 -0
- package/dist/{chunk-gbtbfg7e.js → chunk-0g2mg8cw.js} +3 -3
- package/dist/chunk-0gv2mmr0.js +2 -0
- package/dist/{chunk-e631k202.js → chunk-0h6r7nvn.js} +38 -38
- package/dist/chunk-0j8zre1m.js +2 -0
- package/dist/{chunk-rb71xcfw.js → chunk-0qwbhv3f.js} +9 -9
- package/dist/{chunk-6mkn81pd.js → chunk-0sa9gqmc.js} +7 -7
- package/dist/chunk-1gfg6qmr.js +2 -0
- package/dist/{chunk-6ftee542.js → chunk-1q5w3xav.js} +2 -2
- package/dist/chunk-1tqp2s13.js +2 -0
- package/dist/chunk-1y7kfp5d.js +2 -0
- package/dist/chunk-1ztp5vkh.js +3 -0
- package/dist/chunk-24e4dapm.js +2 -0
- package/dist/{chunk-zktbzwkv.js → chunk-2qb9kp21.js} +3 -3
- package/dist/{chunk-01mwbg1r.js → chunk-2zaatnnh.js} +4 -4
- package/dist/chunk-32wvc376.js +2 -0
- package/dist/{chunk-h3j2zvms.js → chunk-3f9wctns.js} +2 -2
- package/dist/{chunk-v4xes880.js → chunk-3mz9bdf7.js} +3 -3
- package/dist/chunk-3te2y9qf.js +2 -0
- package/dist/{chunk-farh4p7f.js → chunk-3w7gacva.js} +2 -2
- package/dist/chunk-447jc6zc.js +2 -0
- package/dist/{chunk-s584xnzx.js → chunk-4517hny7.js} +2 -2
- package/dist/chunk-45rzd16g.js +1609 -0
- package/dist/{chunk-2drcj9wn.js → chunk-4m11kcxz.js} +8 -8
- package/dist/chunk-51ymssz5.js +2 -0
- package/dist/{chunk-xpzt4wwb.js → chunk-644ckv6e.js} +10 -10
- package/dist/{chunk-xr1yrdxy.js → chunk-6az66mrc.js} +14 -14
- package/dist/chunk-6dz5za5z.js +2 -0
- package/dist/{chunk-f30bpj7a.js → chunk-6ezt9kbe.js} +11 -11
- package/dist/chunk-6grkdknk.js +2 -0
- package/dist/chunk-6q9a5bph.js +2 -0
- package/dist/chunk-6rqef7wp.js +2 -0
- package/dist/{chunk-w3d7pwzg.js → chunk-6ykfy7eh.js} +2 -2
- package/dist/{chunk-vvddndcm.js → chunk-72p5annm.js} +4 -4
- package/dist/chunk-74x6j229.js +4 -0
- package/dist/{chunk-n3jw3xpj.js → chunk-75v0yxeh.js} +2 -2
- package/dist/chunk-7j11vgm1.js +3 -0
- package/dist/chunk-7ngfcdv9.js +2 -0
- package/dist/chunk-7njy024g.js +2 -0
- package/dist/{chunk-0489wcvq.js → chunk-88xayf21.js} +9 -9
- package/dist/{chunk-wa4w5bcn.js → chunk-95hbmv7k.js} +7 -7
- package/dist/{chunk-nack2xs5.js → chunk-976kgb3r.js} +5 -5
- package/dist/{chunk-mxdapaz2.js → chunk-9anqwafq.js} +3 -3
- package/dist/chunk-9e3ggwk7.js +2 -0
- package/dist/chunk-9mz2n39m.js +2 -0
- package/dist/chunk-a262spx7.js +2 -0
- package/dist/{chunk-j7q17ws8.js → chunk-a5yb8w7s.js} +3 -3
- package/dist/chunk-a8wn0snv.js +2 -0
- package/dist/{chunk-55zq2ha8.js → chunk-ae8q4gze.js} +5 -5
- package/dist/{chunk-hq0zqaqc.js → chunk-af6m1s2b.js} +1 -1
- package/dist/{chunk-hev4t4d5.js → chunk-afxfkb60.js} +6 -6
- package/dist/{chunk-aed45njs.js → chunk-az5rh7fs.js} +2 -2
- package/dist/chunk-b1tcym2x.js +2 -0
- package/dist/{chunk-j1efsjsb.js → chunk-b4d4tjvx.js} +5 -5
- package/dist/{chunk-hq4d1me0.js → chunk-b61dq7pz.js} +1 -1
- package/dist/{chunk-j89p53vx.js → chunk-bdh73gxd.js} +2 -2
- package/dist/{chunk-4068rmzv.js → chunk-bjjfr7qt.js} +2 -2
- package/dist/chunk-bs7g6jtt.js +2 -0
- package/dist/chunk-bspj1rf1.js +2 -0
- package/dist/chunk-bx3hpsxn.js +2 -0
- package/dist/chunk-byq488g4.js +2 -0
- package/dist/chunk-c8pzj57b.js +2 -0
- package/dist/{chunk-eq3mqbcn.js → chunk-cmh0bfkb.js} +5 -5
- package/dist/{chunk-7j0qkye5.js → chunk-d3q0cg47.js} +2 -2
- package/dist/{chunk-b666d8m6.js → chunk-d6gqh2wv.js} +1 -1
- package/dist/{chunk-vvxcebpn.js → chunk-dbvsa5ya.js} +2 -2
- package/dist/{chunk-b53rzbrh.js → chunk-dw0ttj6p.js} +2 -2
- package/dist/chunk-e2b2f502.js +2 -0
- package/dist/chunk-ec6mrad6.js +2 -0
- package/dist/chunk-eh2gec79.js +2 -0
- package/dist/{chunk-8hhhmscy.js → chunk-eknm4jrm.js} +2 -2
- package/dist/chunk-em31p5pb.js +2 -0
- package/dist/chunk-eqfsw6x4.js +2 -0
- package/dist/{chunk-4nb7egk0.js → chunk-esjr9qhe.js} +2 -2
- package/dist/chunk-ey1vwfpc.js +24 -0
- package/dist/{chunk-wk2rge05.js → chunk-f4vgagjb.js} +3 -3
- package/dist/chunk-fa57bncd.js +2 -0
- package/dist/{chunk-qjey0jk6.js → chunk-fdjx4vs3.js} +2 -2
- package/dist/chunk-fk79jbzn.js +2 -0
- package/dist/{chunk-8xjj7wjf.js → chunk-fnjm3xbf.js} +6 -6
- package/dist/{chunk-zfrzdje6.js → chunk-ft6em3wm.js} +6 -6
- package/dist/{chunk-w4a3fqf4.js → chunk-fy6ts0n4.js} +2 -2
- package/dist/{chunk-ct90b523.js → chunk-g33ycxe3.js} +5 -5
- package/dist/{chunk-scsmp2e5.js → chunk-g7qpnmbm.js} +14 -14
- package/dist/chunk-g97krv0d.js +2 -0
- package/dist/chunk-gn16yq49.js +2 -0
- package/dist/{chunk-qcxrcypb.js → chunk-gqtb53s8.js} +2 -2
- package/dist/chunk-gvs61tqn.js +2 -0
- package/dist/chunk-h2928108.js +2 -0
- package/dist/chunk-hd5bny2c.js +2 -0
- package/dist/chunk-j1ytbd6r.js +1184 -0
- package/dist/chunk-jm7qa3v3.js +2 -0
- package/dist/chunk-jmjgj3nh.js +2 -0
- package/dist/chunk-jqtpzzz4.js +12 -0
- package/dist/{chunk-hmdkf6c6.js → chunk-jqxerj6k.js} +2 -2
- package/dist/{chunk-3z1mmar2.js → chunk-jt5tzddc.js} +2 -2
- package/dist/{chunk-q50x1gfd.js → chunk-k1ew643q.js} +2 -2
- package/dist/chunk-kq8mffgf.js +2 -0
- package/dist/chunk-kx06jzdw.js +2 -0
- package/dist/{chunk-ysfeg3cn.js → chunk-kywe0f1v.js} +2 -2
- package/dist/{chunk-60yppcbb.js → chunk-kzc2tqzr.js} +2 -2
- package/dist/{chunk-9zrvh3pz.js → chunk-mce3g2wb.js} +2 -2
- package/dist/{chunk-bbq79tap.js → chunk-mw0rb1sf.js} +4 -4
- package/dist/chunk-n344ss97.js +2 -0
- package/dist/chunk-n5pvdrkb.js +2 -0
- package/dist/chunk-ne8q191s.js +2 -0
- package/dist/{chunk-e7s109j6.js → chunk-nnp6rf4c.js} +1 -1
- package/dist/chunk-np8wgbsa.js +3 -0
- package/dist/{chunk-tyvm49be.js → chunk-nv4c25zj.js} +3 -3
- package/dist/{chunk-tny8mz6q.js → chunk-p4e8myzj.js} +6 -6
- package/dist/{chunk-dhbpbjt3.js → chunk-p5m1z6e1.js} +6 -6
- package/dist/{chunk-18a3vdnq.js → chunk-pk714ynv.js} +4 -4
- package/dist/{chunk-csymxc5a.js → chunk-pp99rmjm.js} +15 -15
- package/dist/chunk-pqmjeea6.js +2 -0
- package/dist/chunk-q0k2gmva.js +2 -0
- package/dist/{chunk-e5xfbcp7.js → chunk-q7zc78az.js} +6 -6
- package/dist/chunk-qggwr60r.js +2 -0
- package/dist/chunk-qm3v4qb7.js +2 -0
- package/dist/{chunk-40h07m5w.js → chunk-qnwd5bz4.js} +1 -1
- package/dist/chunk-qrn1nza9.js +2 -0
- package/dist/chunk-qty0t69x.js +2 -0
- package/dist/{chunk-696cdgkg.js → chunk-qvrew79n.js} +1 -1
- package/dist/{chunk-tnp2ta5q.js → chunk-r09kz9bf.js} +2 -2
- package/dist/{chunk-q1wxgw5s.js → chunk-r2bxjna3.js} +2 -2
- package/dist/chunk-rzadf7vx.js +20 -0
- package/dist/{chunk-6vgr5g6d.js → chunk-rzd9hyhv.js} +2 -2
- package/dist/{chunk-8tk8yf91.js → chunk-s7fhpkvf.js} +6 -6
- package/dist/{chunk-ew5cey88.js → chunk-saqzk45g.js} +1 -1
- package/dist/{chunk-srgnevws.js → chunk-stn7p7f1.js} +2 -2
- package/dist/{chunk-xvj6yf0q.js → chunk-t4g3ka8c.js} +6 -6
- package/dist/chunk-ts37jw3s.js +2 -0
- package/dist/{chunk-cqhwzd9y.js → chunk-v0tdg16k.js} +5 -5
- package/dist/{chunk-j7f3h982.js → chunk-vmssv78v.js} +3 -3
- package/dist/{chunk-ymdw4fhd.js → chunk-vnrbjbrw.js} +2 -2
- package/dist/{chunk-gynvaceg.js → chunk-vznf808n.js} +5 -5
- package/dist/chunk-wkb7dhp7.js +2 -0
- package/dist/{chunk-m131znxe.js → chunk-wm029dh0.js} +13 -13
- package/dist/{chunk-hhbt8grm.js → chunk-wp0qpa50.js} +4 -4
- package/dist/chunk-wxyqp6g9.js +2 -0
- package/dist/{chunk-01c16zw4.js → chunk-wzvdr4ta.js} +2 -2
- package/dist/{chunk-e2t7mk29.js → chunk-x2ftkaz3.js} +2 -2
- package/dist/chunk-x76qvq1n.js +2 -0
- package/dist/{chunk-v37zmez0.js → chunk-xmws1gaf.js} +2 -2
- package/dist/{chunk-a8164hnf.js → chunk-xtaq95em.js} +1 -1
- package/dist/{chunk-5a0d3048.js → chunk-y2e2zm6y.js} +3 -3
- package/dist/chunk-y4hn1qh0.js +2 -0
- package/dist/{chunk-pywz8q4k.js → chunk-y75bds1g.js} +31 -31
- package/dist/chunk-yc8ggeh2.js +2 -0
- package/dist/{chunk-r0v2chpn.js → chunk-ydppkb8y.js} +2 -2
- package/dist/chunk-ydy0tfar.js +2 -0
- package/dist/chunk-yfed67yc.js +2 -0
- package/dist/{chunk-7ayvybdy.js → chunk-ysfgabpf.js} +3 -3
- package/dist/{chunk-fd1bpv35.js → chunk-yxdhz4ps.js} +2 -2
- package/dist/{chunk-rw5492e2.js → chunk-zc8a2erc.js} +4 -4
- package/dist/{chunk-7cvbz4eq.js → chunk-zn6n075d.js} +3 -3
- package/dist/cli.js +22 -22
- package/dist/component-library.d.ts +31 -1
- package/dist/component-library.js +74 -54
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/inherited-context.d.ts +14 -0
- package/dist/inherited-context.js +102 -0
- package/dist/native-component-context.d.ts +10 -0
- package/dist/native-component-context.js +94 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +12 -12
- package/dist/stx-virtual-ts.d.ts +14 -2
- package/dist/stx-virtual-ts.js +64 -34
- package/dist/typecheck.d.ts +5 -2
- package/dist/typecheck.js +29 -19
- package/package.json +5 -5
- package/dist/chunk-0g80km93.js +0 -2
- package/dist/chunk-1mzfynpk.js +0 -2
- package/dist/chunk-26s2jxvn.js +0 -2
- package/dist/chunk-2asyyky3.js +0 -2
- package/dist/chunk-36e94whg.js +0 -3
- package/dist/chunk-3t91wwbe.js +0 -2
- package/dist/chunk-46pxmpeb.js +0 -3
- package/dist/chunk-4es07dwb.js +0 -2
- package/dist/chunk-4pr29yrx.js +0 -2
- package/dist/chunk-4v70bs2q.js +0 -2
- package/dist/chunk-5nj2k8zf.js +0 -2
- package/dist/chunk-60ezkjcz.js +0 -2
- package/dist/chunk-6pczzq5f.js +0 -2
- package/dist/chunk-73k579v7.js +0 -2
- package/dist/chunk-7wqevtks.js +0 -2
- package/dist/chunk-85m8nyk6.js +0 -2
- package/dist/chunk-8q8xkw02.js +0 -2
- package/dist/chunk-9fyw1xkh.js +0 -3
- package/dist/chunk-9kghtf20.js +0 -2
- package/dist/chunk-are96jcb.js +0 -2
- package/dist/chunk-asrzmw7w.js +0 -2
- package/dist/chunk-ba91r7q9.js +0 -2
- package/dist/chunk-cvgbtmxp.js +0 -2
- package/dist/chunk-d0h18m2r.js +0 -2
- package/dist/chunk-d3mmnzwy.js +0 -2
- package/dist/chunk-d8zhtwnw.js +0 -2
- package/dist/chunk-d9f7zb5p.js +0 -2
- package/dist/chunk-df49nnj9.js +0 -2
- package/dist/chunk-dhjet15m.js +0 -2
- package/dist/chunk-djdganvr.js +0 -2
- package/dist/chunk-dy1brym3.js +0 -2
- package/dist/chunk-eczy00w6.js +0 -2
- package/dist/chunk-ek5mv2h8.js +0 -2
- package/dist/chunk-eprhhrzc.js +0 -712
- package/dist/chunk-f52b9hjv.js +0 -2
- package/dist/chunk-fbqk2w2k.js +0 -4
- package/dist/chunk-gc4bgven.js +0 -2
- package/dist/chunk-gvz0kqkz.js +0 -2
- package/dist/chunk-h2qgqjkn.js +0 -2
- package/dist/chunk-h8rpk597.js +0 -2
- package/dist/chunk-hcaedzck.js +0 -2
- package/dist/chunk-hmsjjw34.js +0 -2
- package/dist/chunk-j4zrq17p.js +0 -2
- package/dist/chunk-jq0zvr43.js +0 -2
- package/dist/chunk-k0ph8zr7.js +0 -2
- package/dist/chunk-kp12tsn0.js +0 -2
- package/dist/chunk-m9cperj4.js +0 -2
- package/dist/chunk-me7cxs0e.js +0 -2
- package/dist/chunk-meqsd5bt.js +0 -2
- package/dist/chunk-n0d4vbcv.js +0 -2051
- package/dist/chunk-natvnazg.js +0 -2
- package/dist/chunk-nxqsdt89.js +0 -20
- package/dist/chunk-p2kqsb5k.js +0 -2
- package/dist/chunk-p71c1wrw.js +0 -2
- package/dist/chunk-qhczf1wf.js +0 -20
- package/dist/chunk-rqa92xm4.js +0 -2
- package/dist/chunk-s92j8k4z.js +0 -2
- package/dist/chunk-sb8qv9wy.js +0 -2
- package/dist/chunk-ts1jwj54.js +0 -2
- package/dist/chunk-vk98r75z.js +0 -2
- package/dist/chunk-vmq773pb.js +0 -2
- package/dist/chunk-w8qr5414.js +0 -2
- package/dist/chunk-xjxcwrqs.js +0 -2
- package/dist/chunk-y0a8hex3.js +0 -2
- package/dist/chunk-y2ctxchq.js +0 -2
- package/dist/chunk-ytzzth34.js +0 -2
- package/dist/chunk-yxpjj003.js +0 -2
- package/dist/chunk-z347p6cg.js +0 -2
- package/dist/chunk-z3afnkan.js +0 -2
- package/dist/chunk-z6c4c951.js +0 -2
- package/dist/chunk-z9xe3xkg.js +0 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{P,d,m,O,p,
|
|
3
|
-
`)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<u-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},ie=()=>{if(b!==0)return;let B=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(B){let
|
|
2
|
+
import{P,d,m,O,p,Y}from"./chunk-pp99rmjm.js";import{K,Bs,Fe,L,Mt,Pr,Ue,We,s,y,Re,R}from"./chunk-j1ytbd6r.js";import{ft}from"./chunk-fdjx4vs3.js";import{N}from"./chunk-3w7gacva.js";import{de}from"./chunk-dbvsa5ya.js";import{V,rt}from"./chunk-bjjfr7qt.js";import{A,In}from"./chunk-1ztp5vkh.js";import M from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let b=c[r];if(b==="("||b==="["||b==="{")a++;else if(b===")"||b==="]"||b==="}")a--;else if(b===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,b=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=b.exec(r);while(n){let u=n.index,t=u+n[0].length-1,T=1,W=t+1;while(W<r.length&&T>0){if(r[W]==="(")T++;else if(r[W]===")")T--;W++}if(T!==0)break;let ie=r.substring(t+1,W-1),B=`${a}(${ie})`;r=r.substring(0,u)+B+r.substring(W),b.lastIndex=u+B.length,n=b.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,b=0,n=0,u=e.length,t=(B)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===B){n++;return}n++}},T=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let B=1;while(n<u&&B>0)if(e[n]==="{")B++,n++;else if(e[n]==="}")B--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")T();else n++;continue}n++}},W=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
|
|
3
|
+
`)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<u-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},ie=()=>{if(b!==0)return;let B=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(B){let Z=B[2];if(!r.has(Z))a.push(Z),r.add(Z);return}let se=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(se){let Z=se[1];if(!r.has(Z))a.push(Z),r.add(Z);return}let ee=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(ee){let Z=ee[1];if(!r.has(Z))a.push(Z),r.add(Z)}};while(n<u){if(W())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){T();continue}if(e[n]==="{"){b++,n++;continue}if(e[n]==="}"){b--,n++;continue}if(b===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))ie();n++}return a.join(", ")}function ve(c,e=""){let a=he(c).split(",").map((r)=>r.trim()).filter(Boolean);return`
|
|
4
4
|
(function() {
|
|
5
5
|
${ft("var",a)}
|
|
6
6
|
var __destroyHooks = [];
|
|
@@ -9,7 +9,7 @@ import{P,d,m,O,p,Z}from"./chunk-csymxc5a.js";import{K,js,je,L,Mt,Ar,Ve,Ue,s,y,Te
|
|
|
9
9
|
|
|
10
10
|
${c}
|
|
11
11
|
${e}})();
|
|
12
|
-
`}function
|
|
12
|
+
`}function ke(c,e){let r=he(c).split(",").map((u)=>u.trim()).filter(Boolean),b=new Set(K(c,!0).split(",").map((u)=>u.trim())),n=r.map((u)=>b.has(u)?` try { ${u}; Object.defineProperty(__scopeRegistration, ${JSON.stringify(u)}, ${Bs(u)}); } catch (e) { /* not actually top-level */ }`:` try { __scopeRegistration[${JSON.stringify(u)}] = ${u}; } catch (e) { /* not actually top-level */ }`).join(`
|
|
13
13
|
`);return`
|
|
14
14
|
// Register scope variables for STX runtime
|
|
15
15
|
if (!window.stx._scopes) window.stx._scopes = {};
|
|
@@ -22,7 +22,7 @@ ${n}
|
|
|
22
22
|
try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
|
|
23
23
|
if (typeof __stxLiveBindings !== 'undefined') Object.defineProperties(__scopeRegistration, Object.getOwnPropertyDescriptors(__stxLiveBindings));
|
|
24
24
|
window.stx._scopes['${e}'] = __scopeRegistration;
|
|
25
|
-
`}function
|
|
25
|
+
`}function Ie(c,e){return c.replace(/<script data-stx-scoped data-stx-run="always" data-stx-owner="([^"]*)"/g,(a,r)=>r===e?a:'<script data-stx-scoped data-stx-run="always"')}function ue(c,e){let a=ke(c,e);return Me(ve(c,a),e)}function Me(c,e){let a=`
|
|
26
26
|
(function() {
|
|
27
27
|
var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${e}"]') : null;
|
|
28
28
|
var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
|
|
@@ -44,11 +44,11 @@ ${n}
|
|
|
44
44
|
}
|
|
45
45
|
if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
|
|
46
46
|
}
|
|
47
|
-
})();`;return a+c+r}function
|
|
48
|
-
${w}`}if(ge&&!
|
|
49
|
-
`;continue}if(
|
|
50
|
-
`}}if(F.length>0){let{interpolateScriptExpressions:S}=await import("./chunk-
|
|
51
|
-
`+
|
|
52
|
-
`+k;return
|
|
47
|
+
})();`;return a+c+r}function Te(c,e){if(V(c)){let n=V(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:rt(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Mt(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let b=r[1]+r[2],n=r[1].slice(1),u=b.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),T=r[1],W=r[2];return{html:`${t}${T} data-stx-scope="${e}"${W}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Ae=0;function fe(c,e){let a=M.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Ae}`}var le=new Set,pe=new Set;function Xh(){le.clear(),pe.clear()}var Ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Yf(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],b=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",T=u[2],W=u[3]==="/"||Ce.has(T.toLowerCase());if(t){b=Math.max(0,b-1);continue}if(b===0)r.push(T);if(!W)b++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var nt=new P(500),Sc=new Set;function Jh(){Sc.clear()}function De(c){if(c.__onceStore instanceof Set)return c.__onceStore;return Sc}async function ms(c,e,a,r,b,n=new Set){let u=r.partialsDir||M.join(M.dirname(a),"partials");if(u&&!M.isAbsolute(u))u=M.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),T=De(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(T.has(i))return"";return T.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let C=o[1],z=W(C,u,a),E="";if(z&&await Bun.file(z).exists())b.add(z),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let C=t.substring(x+1,o-1),z=ae(C,0);if(z===-1){h.lastIndex=o;continue}let E=C.substring(0,z).trim(),H=C.substring(z+1).trim(),F=H.match(/^\s*['"]([^'"]+)['"]/);if(!F){h.lastIndex=o;continue}let _=F[1],J=H.substring(F[0].length),D,k=ae(J,0);if(k!==-1)D=J.substring(k+1).trim();try{let I=`Boolean(${E})`,j;if(m(I)){let oe=p(I,Object.keys(e));j=Boolean(oe(...Object.values(e)))}else j=Boolean(d(I,e));let te=v?!j:j,re="";if(te){let oe=W(_,u,a);if(oe&&await Bun.file(oe).exists())b.add(oe);re=`@include('${_}'${D?`, ${D}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(I){let j=I instanceof Error?I.message:String(I),te=y("Include",`Error evaluating ${f} condition: ${j}`,a,c,i);t=t.substring(0,i)+te+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),C=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!C){f.lastIndex=0,t=t.replace(o,"");continue}let[,z,E,H,F]=C;try{let _,J=E.trim();if(m(J))_=p(J,Object.keys(e))(...Object.values(e));else _=d(J,e);let D="";if(Array.isArray(_)&&_.length>0)for(let k of _){let I={...e,[H]:k},j=await se(z,I,c,h);D+=j}else if(F)D=await se(F,{},c,h);t=t.substring(0,h)+D+t.substring(x+1),f.lastIndex=0}catch(_){let J=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+y("Each",`Error in @each: ${J}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),C=l.match(/^\s*(\[[^\]]+\])/);if(!C){f.lastIndex=0,t=t.replace(o,"");continue}let z=C[1],E=l.slice(C[0].length),H,F=E.match(/^\s*,\s*\{/);if(F){E=E.slice(F[0].length-1);let D=1,k=1;while(k<E.length&&D>0){if(E[k]==="{")D++;else if(E[k]==="}"){if(D--,D===0)break}k++}H=E.substring(0,k+1),E=E.slice(k+1)}let _,J=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(J)_=J[1];try{let D=JSON.parse(z.replace(/'/g,'"')),k={};if(H)try{k=O(H,e)}catch(j){let te=j instanceof Error?j.message:String(j);if(r.debug){let re=y("Include",`Error parsing includeFirst variables: ${te}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let I=!1;for(let j of D){let te=W(j,u,a);if(!te)continue;if(await s(te)){let re=await se(j,k,c,h);t=t.replace(o,()=>re),I=!0;break}}if(!I)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let j=y("Include",`None of the includeFirst paths exist: ${z}`,a,c,h,o);t=t.replace(o,()=>j)}else t=t.replace(o,"")}catch(D){let k=D instanceof Error?D.message:String(D),I=y("Include",`Error processing @includeFirst: ${k}`,a,c,h,o);t=t.replace(o,()=>I)}f.lastIndex=0}}function W(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=M.resolve(v),x=M.resolve(M.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let F of r._layerPartialDirs??[]){let _=M.resolve(F,g);if(_.startsWith(`${M.resolve(F)}${M.sep}`)&&ye(_))return _}l=M.resolve(v,g)}else l=M.resolve(x,g);let o=M.normalize(l),C=o.startsWith(i+M.sep)||o===i,z=o.startsWith(x+M.sep)||o===x,E=!1,H=M.dirname(x);if(o.startsWith(H+M.sep)){if(!M.relative(H,o).split(M.sep).some((D)=>D.startsWith(".")&&D!=="."&&D!==".."))E=!0}if(!C&&!z&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=M.resolve(a);n.add(ie);function B(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),y("Include",v,a,h,g)}async function se(f,v={},h,g){let i=W(f,u,a);if(!i)return B(f,`Could not resolve path for include: ${f}`,h,g);let x=M.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>M.basename(o)).join(" -> ");return B(f,`Circular include detected: ${l}`,h,g)}try{b.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(S){let q=S instanceof Error?S.message:String(S);return B(f,`Error loading include file ${f}: ${q}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:S}=await import("./chunk-24e4dapm.js");l=S(l,e)}if(l&&(r.debug||!A()&&!In()))try{let{warnUnbalancedTags:S}=await import("./chunk-e2b2f502.js");S(l,i)}catch{}try{let{processESImports:S}=await import("./chunk-n344ss97.js");l=await S(l,e,i,r,b)}catch(S){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,S instanceof Error?S.message:S)}let o=l,C=L(o);if(C)o=C.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),H="";if(E)H=`<style${E[1]}>${E[2]}</style>`;let F=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(S,q,w)=>{if(!me(q))return"";return F.push({attrs:q,body:w}),`__STX_DATA_BLOCK_${F.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Re(l,i);for(let[S,q]of Object.entries(v))_[S]=q;let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,D=[...l.matchAll(J)].sort((S,q)=>{let w=(S[1]||"").includes("server"),X=(q[1]||"").includes("server");return Number(X)-Number(w)}),k="",I=null,j=!1,te=!1;for(let S of D){let q=S[1]||"",w=S[2]||"";if(me(q))continue;let X=q.includes("server"),be=Ue(q);if(!X&&!/\bsrc\s*=/i.test(q))Fe(w,i,r.strict);if(!X&&w.trim()){let{interpolateScriptExpressions:U}=await import("./chunk-9e3ggwk7.js");w=U(w,_,f)}let ce="";try{let{extractAndStripCssImports:U,renderVendorStyleTags:Q}=await import("./chunk-1tqp2s13.js"),ne=U(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(U){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,U instanceof Error?U.message:U)}if(be&&w.trim())w=We(w);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-1tqp2s13.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-em31p5pb.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:U}=await import("./chunk-7ngfcdv9.js");w=U(w)}let ge=Ee(w);if(!X){let{extractBridgeData:U,generateServerDataBridge:Q}=await import("./chunk-1tqp2s13.js"),ne=Q(w,U(_));if(ne)w=`${ne}
|
|
48
|
+
${w}`}if(ge&&!X){j=!0,I=fe(i,e);let U=N(w),Q=ue(U,I);k+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${I}">${Q}</script>
|
|
49
|
+
`;continue}if(X)try{let{extractVariables:U}=await import("./chunk-0gv2mmr0.js");await U(w,_,i)}catch(U){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,U)}if(!X&&!ge){let U=q.replace(/\bclient\b/i,"").trim();I=fe(i,e);let Q=N(w),ne=ue(Q,I);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))te=!0;k+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${I}"${U?` ${U}`:""}>${ne}</script>
|
|
50
|
+
`}}if(F.length>0){let{interpolateScriptExpressions:S}=await import("./chunk-9e3ggwk7.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(q,w)=>{let X=F[Number(w)];return`<script${X.attrs}>${S(X.body,_,f)}</script>`})}if(I){let S=Te(o,I);if(o=S.html,S.mergedIntoExisting){let w=I,X=S.mergedIntoExisting;k=k.split(`'${w}'`).join(`'${X}'`).split(`"${w}"`).join(`"${X}"`),I=X}else if(!S.stamped&&j&&!le.has(i))le.add(i),console.warn(`[stx] ${M.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(S.stamped&&S.root!=="body"&&(j||te)&&!pe.has(i)){let w=Yf(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${M.relative(process.cwd(),i)} declares ${j?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let q=S.stamped&&S.root!==null&&Pr(S.root);k=Ie(k,q?I:null)}if(o.includes("@include")||o.includes("@partial"))o=await ms(o,_,i,r,b,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-6dz5za5z.js"),G=re(o,_,i,void 0,!0);G=de(G,_,i),G=oe(G);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-0j8zre1m.js");if(G=xe(G,_,i,r),G=we(G,_,i),G=_e(G,_,i,r),G=R(G,_,i),H)G+=`
|
|
51
|
+
`+H;if(k)G+=`
|
|
52
|
+
`+k;return G}catch(l){if(l instanceof Y)throw l;let o=l instanceof Error?l.message:String(l);return B(f,`Error processing include ${f}: ${o}`,h,g)}}let ee=/@include\s*\(/g,Z;while((Z=ee.exec(t))!==null){let f=Z.index,v=f+Z[0].length-1,h=1,g=v+1;while(g<t.length&&h>0){if(t[g]==="(")h++;else if(t[g]===")")h--;g++}if(h!==0)break;let i=t.substring(f,g),x=t.substring(v+1,g-1),l=x.match(/^\s*['"]([^'"]+)['"]/);if(!l){ee.lastIndex=g;continue}let o=l[1],C,z=x.substring(l[0].length),E=ae(z,0);if(E!==-1)C=z.substring(E+1).trim();let H={};if(C)try{H=O(C,e)}catch(_){let J=_ instanceof Error?_.message:String(_);t=t.replace(i,y("Include",`Error parsing include variables for ${o}: ${J}`,a,c,f)),ee.lastIndex=0;continue}let F=await se(o,H,c,f);t=t.substring(0,f)+F+t.substring(g),ee.lastIndex=0}return t}function hs(c,e){let a=c;function r(b,n,u,t){let T=b,W=!0;while(W){W=!1;let ie=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),B=T.match(ie);if(!B||B.index===void 0)break;let se=B.index,ee=B[1],Z=se+B[0].length,f=new RegExp(`@${n}\\(`),v=new RegExp(`@${u}(?![a-z])`),h=1,g=Z,i=-1;while(h>0&&g<T.length){let l=T.slice(g),o=l.match(f),C=l.match(v),z=o?g+o.index:1/0,E=C?g+C.index:1/0;if(z<E)h++,g=z+(o[0].length||1);else if(E<1/0){if(h--,h===0){i=E;break}g=E+u.length+1}else break}if(i===-1)break;let x=T.slice(Z,i);if(!e[ee])e[ee]=[];if(t)e[ee].unshift(x);else e[ee].push(x);T=T.substring(0,se)+T.substring(i+`@${u}`.length),W=!0}return T}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function ys(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
|
|
53
53
|
`)})}
|
|
54
|
-
export{
|
|
54
|
+
export{Xh,Yf,nt,Sc,Jh,ms,hs,ys};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{pm}from"./chunk-9anqwafq.js";import"./chunk-0h6r7nvn.js";import"./chunk-644ckv6e.js";import"./chunk-6ezt9kbe.js";import"./chunk-r2bxjna3.js";import"./chunk-88xayf21.js";import"./chunk-7j11vgm1.js";import"./chunk-2qb9kp21.js";import"./chunk-dbvsa5ya.js";import"./chunk-4m11kcxz.js";import"./chunk-95hbmv7k.js";import"./chunk-xtaq95em.js";import"./chunk-dw0ttj6p.js";import"./chunk-6az66mrc.js";import"./chunk-a5yb8w7s.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import"./chunk-j1ytbd6r.js";import"./chunk-6ykfy7eh.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{pm as startInteractive};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{St,Jn,Ph}from"./chunk-wm029dh0.js";import{ye,Yn,Ih,Zn,Po,rs,ss,Oh,Nh,Dh,Qn,er,Io,os,Mh}from"./chunk-x2ftkaz3.js";import"./chunk-fdjx4vs3.js";export{Po as batch,Ph as default,Yn as derived,Zn as effect,St as generateSignalsRuntime,Jn as generateSignalsRuntimeDev,er as isDerived,Qn as isSignal,Ih as memo,ss as onDestroy,rs as onMount,os as peek,Dh as pendingLifecycleCounts,Nh as runDestroyCallbacks,Oh as runMountCallbacks,ye as state,Io as untrack,Mh as useOptimistic};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rg,ny,ry,sy,oy,sg,og,iy,ay,ii,cy,yr,br,Ts}from"./chunk-dw0ttj6p.js";import{ct}from"./chunk-75v0yxeh.js";import"./chunk-j1ytbd6r.js";import"./chunk-6ykfy7eh.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{oy as __setSignalsGeneratorsForTest,ct as cacheEngineFingerprint,br as cacheTemplate,yr as checkCache,cy as clearDevCaches,og as getCachedRouterScript,sg as getCachedSignalsRuntime,iy as getServeClientAsset,ii as getServeModuleBundle,Ts as hashFilePath,ry as invalidateFileCache,sy as invalidateFileCacheByDir,ny as readFileCached,ay as registerServeModuleBundle,rg as templateCache};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Rn,B}from"./chunk-kzc2tqzr.js";import m from"fs";import e from"path";async function $n(r,o,i){if(r.__stx_runtime_config)return;let n=Rn();if(n||i){r.__stx_runtime_config=n??B(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-eh2gec79.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=B(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Mi(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
|
|
3
3
|
declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
|
|
4
4
|
`),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
|
|
5
5
|
declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
|
|
6
6
|
`)}
|
|
7
|
-
export{
|
|
7
|
+
export{$n,Mi};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
${l.trim()}`)}catch(l){console.warn(`[stx] Failed to load composable ${o}:`,l)}if(D.length===0||M.size===0)return
|
|
2
|
+
import{Be,S,_,T,ne}from"./chunk-j1ytbd6r.js";import{C}from"./chunk-fdjx4vs3.js";import{N,Nn}from"./chunk-3w7gacva.js";import{a}from"./chunk-6az66mrc.js";import{ke,un,dn,pn}from"./chunk-rzadf7vx.js";import{Ct}from"./chunk-4m11kcxz.js";import{xt,Xn,nn,he}from"./chunk-bdh73gxd.js";import{A,On}from"./chunk-1ztp5vkh.js";import h from"path";var v=new Map,E=new Map,I=S(64),F=new Map,V=["composables","functions"];function H(e){let s=h.basename(e,".ts");return s==="index"||s==="types"||e.endsWith(".d.ts")}async function Y(e){if(e)return h.resolve(e);let s=`<default>:${process.cwd()}`,r=F.get(s);if(r!==void 0)return r;let t=await ee();if(t!==null)F.set(s,t);return t}async function ee(){let e=await a(),s=e.root||process.cwd(),r=e.composablesDir;if(r)return h.resolve(s,r);for(let t of V){let n=h.resolve(s,t);try{let c=new Bun.Glob("**/*.ts");for await(let i of c.scan({cwd:n,absolute:!0}))if(!H(i))return n}catch{}}return null}async function W(e){let s=Array.isArray(e)?e:e?[h.resolve(e)]:(await a())._layerComposableDirs??[await Y()].filter((t)=>!!t),r=new Map;for(let t of s){let n=new Bun.Glob("**/*.ts");try{for await(let c of n.scan({cwd:t,absolute:!0})){let i=h.relative(t,c);if(!H(c)&&!r.has(i))r.set(i,c)}}catch{}}return{key:s.join("\x00"),files:[...r.values()].sort()}}async function Ao(e){let{files:s}=await W(e),r=ne({loader:"ts",target:"browser",define:T()}),t=[];for(let n of s)try{let c=await Bun.file(n).text(),i=r.scan(c).exports.filter((u)=>u!=="default");if(i.length>0)t.push({file:n,names:i})}catch{}return t}function te(e,s){return new RegExp(`\\b${s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(e)}function R(e,s){let r=new Set(e.match(/\w+/g)),t=new Set;for(let n of s)if(/^\w+$/.test(n)?r.has(n):te(e,n))t.add(n);return t}var J=S(64);function X(e,s){let r=_(e,s.size),t=J.get(r);if(t)return t;let n;try{n=Be(e,s)}catch{n=R(e,s)}let c=[...e.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...e.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let i of c)for(let u of i[1].split(",")){let f=u.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(f&&s.has(f))n.add(f)}return J.set(r,n),n}function se(e){return!e||/^(?:module|(?:text|application)\/(?:java|ecma)script|application\/stx-[\w-]+)$/i.test(e)}var L=S(256);function oe(e,s){let r=new Set(s),t="",n=0,c=new Set;for(let i of e.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi)){t+=e.slice(n,i.index),n=i.index+i[0].length;let u=i[1]??"",f=i[2]??"",d=/\btype\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(u),m=d?(d[1]??d[2]??d[3]??"").trim():void 0;if(!se(m)){if(!/json/i.test(m??""))t+=` ${f} `;continue}let y=R(f,r);if(y.size===0)continue;let b=_(f,[...y].sort().join(",")),w=L.get(b);if(!w)w=X(f,y),L.set(b,w);for(let B of w)c.add(B)}t+=e.slice(n);for(let i of R(t,r))c.add(i);return c}function ie(e,s,r){let t=new Map;for(let{file:f,names:d}of e)for(let m of d)if(!t.has(m))t.set(m,f);let n=new Set(t.keys()),c=(f)=>{let d=[];for(let m of X(f,n))d.push(t.get(m));return d},i=new Set,u=r.flatMap((f,d)=>d===0?[...oe(f,t.keys())].map((m)=>t.get(m)):c(f));while(u.length>0){let f=[];for(let d of u){if(i.has(d))continue;i.add(d);for(let m of c(s.get(d)??""))if(!i.has(m))f.push(m)}u=f}return i}async function Rh(e,s,r,t){let{key:n,files:c}=await W(e);if(!n)return null;let i=()=>[...new Set([...c,...c.flatMap((o)=>ke(o))])],u=xt(i());if(c.length===0)return he(v,n,u,""),null;c.sort();let f=ne({loader:"ts",target:"browser",define:T()}),d=nn(E,n,u);if(!d){let o=new Map,l=[];for(let p of c)try{let x=await Bun.file(p).text();o.set(p,x);let g=f.scan(x).exports.filter((Q)=>Q!=="default");if(g.length>0)l.push({file:p,names:g})}catch{o.set(p,"")}d=he(E,n,u,{codeByFile:o,modules:l})}let{codeByFile:m,modules:y}=d,b;if(s===void 0)b=new Set(c);else{let o=r?[s,...r]:[s],l=_(o.join("\x00"),n,o.length,u),p=I.get(l);if(b=p??ie(y,m,o),!p)I.set(l,b)}if(b.size===0)return null;let w=c.filter((o)=>b.has(o)),B=()=>{if(!t)return;for(let o of w)t.push(o,...ke(o))},k=`${n}\x00${w.join("\x00")}\x00${dn()}`,P=nn(v,k,u);if(P!==void 0)return B(),P||null;let D=[],M=new Set,U=new Set;for(let o of w)try{let l=m.get(o)??await Bun.file(o).text(),p=h.basename(o,".ts");for(let g of l.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(g[1])U.add(g[1]);let x=[];try{for(let g of f.scan(l).exports)if(g!=="default")M.add(g),x.push(g)}catch{}if(l=N(l),un(l))l=await pn(l,o,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:x}),l=Ct(l);l=Nn(l),l=l.replace(/^export\s+(default\s+)?/gm,""),l=f.transformSync(l),D.push(`// Composable: ${p}
|
|
3
|
+
${l.trim()}`)}catch(l){console.warn(`[stx] Failed to load composable ${o}:`,l)}if(D.length===0||M.size===0)return he(v,k,u,""),null;let Z=[...M].map((o)=>` try { if (!(${JSON.stringify(o)} in __c)) __c[${JSON.stringify(o)}] = ${o}; } catch (e) {}`).join(`
|
|
4
4
|
`),z=JSON.stringify([...M]),j=D.join(`
|
|
5
5
|
|
|
6
6
|
`),q=C.filter((o)=>!U.has(o)&&new RegExp(`\\b${o}\\b`).test(j)).map((o)=>`var ${o} = __stx[${JSON.stringify(o)}];`).join(`
|
|
@@ -29,5 +29,5 @@ ${Z}
|
|
|
29
29
|
window[__n] = __c[__n];
|
|
30
30
|
__published[__n] = true;
|
|
31
31
|
}
|
|
32
|
-
})();`,G=A()?
|
|
33
|
-
export{
|
|
32
|
+
})();`,G=A()?On(O):O;return u=xt(i()),he(v,k,u,G),B(),G}function Ah(){v.clear(),Xn(),E.clear(),I.clear(),F.clear()}
|
|
33
|
+
export{Ao,Rh,Ah};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{at}from"./chunk-wp0qpa50.js";import{St,Jn}from"./chunk-wm029dh0.js";import{Mr,Lr,jr,Fr,Pe}from"./chunk-pp99rmjm.js";import{ge,xn,ml,hl}from"./chunk-j1ytbd6r.js";import{B}from"./chunk-kzc2tqzr.js";import{Mi}from"./chunk-6ykfy7eh.js";import{x}from"./chunk-644ckv6e.js";import{i}from"./chunk-0h6r7nvn.js";import{U,a}from"./chunk-6az66mrc.js";import{Bc}from"./chunk-zc8a2erc.js";import{jn,Bn,Ye,Oe,_a,Ca,Fn}from"./chunk-0qwbhv3f.js";import{fn,Ho}from"./chunk-cmh0bfkb.js";import{zn}from"./chunk-jt5tzddc.js";import{on,or,ir}from"./chunk-vnrbjbrw.js";import{Q}from"./chunk-95hbmv7k.js";import m from"fs";import c from"path";import{createHash as Y}from"crypto";function I(n){return Y("sha256").update(n).digest("hex").slice(0,8)}function W(n=!1){let l=n?Jn():St(),o=I(l);return{content:l,filename:`runtime.${o}.js`,hash:o}}function J(){let n=at(),l=I(n);return{content:n,filename:`router.${l}.js`,hash:l}}import V from"path";import{createHash as ee}from"crypto";function te(n={}){let l=new Set;return{context:new Proxy(n,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function q(n,l,o={}){let r=V.resolve(n),e=await Bun.file(r).text(),S=ee("sha256").update(e).digest("hex").slice(0,16);ml();let _={};try{_=await a(o.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let R=g[1];if(/\bserver\b/.test(R))y.push(g[2])}let u=new Set(y.flatMap((R)=>ge(R))),{context:D}=te({__filename:r,__dirname:V.dirname(r),__stx_serverDeclared:u}),A=new Set,T={...U,..._,...o,buildMode:"compile",strict:!1},f=await i(e,D,r,T,A),w=jn(f)+Bn(f)+Ye(f),j=hl();return{route:l,sourceFile:n,html:f,fragment:w,placeholders:j,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(A),contentHash:S,status:xn(e),streamTemplates:D.__streamTemplates}}var re=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function X(n,l){let o=0,r=0;if(!m.existsSync(n))return{copied:o,bytes:r};m.mkdirSync(l,{recursive:!0});function e(S,_){let y=m.readdirSync(S,{withFileTypes:!0});for(let d of y){if(re.has(d.name))continue;let g=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),o++,r+=m.statSync(u).size}}}return e(n,l),{copied:o,bytes:r}}async function Sm(n={}){let l=Date.now(),o=c.resolve(n.root||process.cwd()),r=c.resolve(o,n.outputDir||".output");console.log("[stx build] Starting production build...");let e=await a(o),S=c.resolve(o,n.componentsDir??e.componentsDir??"components"),_=c.resolve(o,n.partialsDir??e.partialsDir??"partials"),y=c.resolve(o,n.layoutsDir??e.layoutsDir??"layouts"),d=n.publicDir??e.publicDir??"public",g=Pe(e.app?.head,{known:Fr,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",A=n.routeRules??e.routeRules??{},T=zn(A),f=n.serverApi??e.serverApi,w=typeof f==="object"?f:{};if(f)fn(o,w);if(e.runtimeConfig)B(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let j=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of j)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=Q(o,{pagesDirs:e._layerPageDirs}),Z=["components","layouts","partials"],P=R.filter((s)=>!Z.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${P.length} page routes (${R.length-P.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=W(n.debug),b=J();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",b.filename),b.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${b.filename} (${(b.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let M=[],H=[];for(let s of P){let h=T(s.pattern),O=h.rendering==="prerender";if(O&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await q(s.filePath,s.pattern,{configDir:o,componentsDir:S,partialsDir:_,layoutsDir:y,debug:n.debug});if(M.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,b.filename),t.html=jr(t.html,g,{bodyScripts:[`<script src="/__stx/${b.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=Mr(t.html,u);if(g.htmlAttrs)t.html=Lr(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let G=p[1];t.html=t.html.replace(" "+G,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${G}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await x(t.html),O){let p=await Fn(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=Oe(t.html,D,!0);let K=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),L=c.join("server","pages",`${K}.compiled.json`),z=c.join("server","fragments",`${K}.html`);await Bun.write(c.join(r,L),JSON.stringify(t,null,2)),await Bun.write(c.join(r,z),t.fragment),H.push({pattern:s.pattern,compiledPath:L,fragmentPath:z,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:O}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let k=c.resolve(o,d);if(m.existsSync(k)){let{copied:s,bytes:h}=X(k,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let E=ir(o);if(E){let{copied:s,bytes:h}=X(E,c.join(r,"public",or));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${on}/`)}let F={runtime:v.filename,router:b.filename},C=_a(H,F,r);if(C.routeRules=A,C.routerContainer=D,f)C.apiRoutes=await Ho(o,r,w);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Mi(o,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(Bc(e._layerGraph),null,2));Ca(C,r);let N=Date.now()-l;return console.log(`
|
|
3
|
+
[stx build] Done in ${N}ms \u2014 ${M.length} pages compiled`),{pageCount:M.length,assets:F,outputDir:r,duration:N}}
|
|
4
|
+
export{Sm};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import n from"fs";import a from"path";import{fileURLToPath as s}from"url";var i;function
|
|
3
|
-
export{
|
|
2
|
+
import n from"fs";import a from"path";import{fileURLToPath as s}from"url";var i;function ct(){if(i)return i;let t="unknown";try{t=String(JSON.parse(n.readFileSync(new URL("../package.json",import.meta.url),"utf8")).version)}catch{}if(import.meta.url.endsWith(".ts"))try{let o=a.dirname(s(import.meta.url)),e=0;for(let r of n.readdirSync(o,{recursive:!0,withFileTypes:!0}))if(r.isFile()&&r.name.endsWith(".ts"))e=Math.max(e,n.statSync(a.join(r.parentPath,r.name)).mtimeMs);t+=`+src.${Math.trunc(e)}`}catch{}return i=t,t}
|
|
3
|
+
export{ct};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ty,xs,ti,Ss,gr,ni,ri,tg,ks,_s,Cs,si,_c,ng,Ct}from"./chunk-4m11kcxz.js";import"./chunk-95hbmv7k.js";import"./chunk-xtaq95em.js";import"./chunk-6az66mrc.js";import"./chunk-a5yb8w7s.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import{K}from"./chunk-j1ytbd6r.js";import"./chunk-6ykfy7eh.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{tg as bindLoopInterpolations,ty as clearScriptScanCache,ks as convertServerLoopAttributesToDirectives,ni as convertSignalDirectivesToAttributes,_s as convertSignalLoopsToAttributes,gr as extractClientSignalNames,K as extractExports,_c as findMarkupIndexOutsideScripts,Ss as hasSignalsSyntax,ti as parseLoopExpression,ri as preEvalLiteralReactiveIfs,Cs as processScriptSetup,si as processSignals,ng as rewriteStxImportSpecifiers,xs as scanScriptTags,Ct as stripStxRuntimeImports};
|