@stacksjs/stx 0.2.801 → 0.2.803
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-bbt09ebh.js → chunk-0ekdbagy.js} +3 -3
- package/dist/{chunk-brhas9mp.js → chunk-0rjcbqk3.js} +2 -2
- package/dist/{chunk-83myk906.js → chunk-0svj1nfa.js} +4 -4
- package/dist/chunk-0xqec4yj.js +2 -0
- package/dist/{chunk-k4nhwd9p.js → chunk-16362f43.js} +2 -2
- package/dist/chunk-19nnq90g.js +2 -0
- package/dist/{chunk-kydgndkt.js → chunk-1carv1dw.js} +1 -1
- package/dist/{chunk-enpx5t99.js → chunk-1ydz2w3t.js} +1 -1
- package/dist/{chunk-9gwhs0gk.js → chunk-2ws2qe1k.js} +2 -2
- package/dist/chunk-36zj3myn.js +2 -0
- package/dist/chunk-3e85etrf.js +2 -0
- package/dist/{chunk-8kvj2wz0.js → chunk-3ebwrpax.js} +6 -6
- package/dist/{chunk-sprgkk9j.js → chunk-3ec6jf9b.js} +30 -30
- package/dist/{chunk-9nbv6nk4.js → chunk-3es17qjn.js} +9 -9
- package/dist/{chunk-2vejgrj7.js → chunk-3k4xb05m.js} +5 -5
- package/dist/{chunk-b9d70mgr.js → chunk-3vpgr6nk.js} +3 -3
- package/dist/{chunk-dq87xd5c.js → chunk-3z0e637x.js} +3 -3
- package/dist/{chunk-qxt6hdat.js → chunk-427mhgje.js} +1 -1
- package/dist/{chunk-gqgcsgc3.js → chunk-4jrf6gsk.js} +1 -1
- package/dist/chunk-4mb75g61.js +2 -0
- package/dist/chunk-4n7yqb9w.js +2 -0
- package/dist/chunk-5eqna31h.js +2 -0
- package/dist/{chunk-zfzjn93c.js → chunk-5s31y4m0.js} +15 -15
- package/dist/{chunk-6162chg7.js → chunk-5vxk8bz9.js} +43 -43
- package/dist/chunk-69cphbrz.js +420 -0
- package/dist/chunk-6a97a9wk.js +2 -0
- package/dist/{chunk-dwydz68f.js → chunk-6dcc4ezx.js} +1 -1
- package/dist/{chunk-7yb82rm6.js → chunk-6s9bk98p.js} +2 -2
- package/dist/chunk-72cm91wm.js +2 -0
- package/dist/{chunk-s763dt8e.js → chunk-77a2hse0.js} +6 -6
- package/dist/{chunk-mt95md1e.js → chunk-7agp0wj2.js} +1 -1
- package/dist/{chunk-gctyy7r9.js → chunk-7v1pwjke.js} +9 -9
- package/dist/{chunk-y9bj3566.js → chunk-7xs45trj.js} +2 -2
- package/dist/chunk-85w7kf2j.js +2 -0
- package/dist/chunk-87g1ryzs.js +2 -0
- package/dist/chunk-8g3bgcac.js +2 -0
- package/dist/{chunk-2fh4wvtv.js → chunk-8je2zse3.js} +34 -34
- package/dist/chunk-8m5w99f3.js +2 -0
- package/dist/chunk-8wd83rnz.js +2 -0
- package/dist/chunk-97daxgfk.js +2 -0
- package/dist/{chunk-f52esq8m.js → chunk-9h72drk3.js} +1 -1
- package/dist/chunk-9wmjmas8.js +2 -0
- package/dist/{chunk-x82zksaj.js → chunk-a0r4dpzs.js} +2 -2
- package/dist/{chunk-s85s2kd3.js → chunk-amewvsn1.js} +2 -2
- package/dist/chunk-aqydav9y.js +2 -0
- package/dist/chunk-aznnh6cy.js +3 -0
- package/dist/{chunk-33vr7x2t.js → chunk-baj6w8ja.js} +3 -3
- package/dist/{chunk-j0bbr6ee.js → chunk-bejj0gra.js} +3 -3
- package/dist/{chunk-w0zayhmg.js → chunk-c5vzr1va.js} +2 -2
- package/dist/{chunk-ddhkhhc7.js → chunk-cfbpvm5e.js} +2 -2
- package/dist/{chunk-k3rcpnzm.js → chunk-cmnze7at.js} +2 -2
- package/dist/{chunk-61h00ba5.js → chunk-cwnx4rxk.js} +6 -6
- package/dist/chunk-cxahdpzz.js +2 -0
- package/dist/chunk-d3gncxq1.js +2 -0
- package/dist/{chunk-d8rcba53.js → chunk-d47m4qat.js} +2 -2
- package/dist/{chunk-t0qh1m5e.js → chunk-d98hgxky.js} +4 -4
- package/dist/chunk-da886asf.js +2 -0
- package/dist/{chunk-25q462jp.js → chunk-dc584r4z.js} +4 -4
- package/dist/{chunk-fw9dhsd9.js → chunk-dqa1g676.js} +2 -2
- package/dist/{chunk-9kadf7pv.js → chunk-dvbd5fxe.js} +1 -1
- package/dist/{chunk-t5vjt37c.js → chunk-e39nkbt4.js} +3 -3
- package/dist/chunk-e6snnz4t.js +2 -0
- package/dist/chunk-e848m5tj.js +2 -0
- package/dist/chunk-et8n16k2.js +2 -0
- package/dist/{chunk-gqdkvwjp.js → chunk-evmxrmjb.js} +50 -50
- package/dist/chunk-ewzdsksb.js +2 -0
- package/dist/chunk-fsjkavq5.js +2 -0
- package/dist/chunk-g4sdthck.js +2 -0
- package/dist/{chunk-56j2egg3.js → chunk-g9xx8qh1.js} +3 -3
- package/dist/{chunk-6n5cbyes.js → chunk-gb3tv53p.js} +2 -2
- package/dist/chunk-gebb12ak.js +72 -0
- package/dist/{chunk-e08hzdpw.js → chunk-gmme8c1s.js} +1 -1
- package/dist/{chunk-nn1f1h3q.js → chunk-gq5ffpq0.js} +1 -1
- package/dist/chunk-gzs0ertq.js +2 -0
- package/dist/chunk-h9yvb9qn.js +2 -0
- package/dist/{chunk-j2v9f2dk.js → chunk-hn2me1qx.js} +2 -2
- package/dist/{chunk-vzmkex8f.js → chunk-hpqrcpjb.js} +1 -1
- package/dist/{chunk-gjf8cjdt.js → chunk-hwcfgs3e.js} +3 -3
- package/dist/chunk-j49t3p7e.js +2 -0
- package/dist/chunk-jjcw2pa9.js +2 -0
- package/dist/{chunk-hzs3h76s.js → chunk-k4csq6pk.js} +4 -4
- package/dist/{chunk-hyz90d8w.js → chunk-k5xyb0dq.js} +2 -2
- package/dist/{chunk-8ey61ppd.js → chunk-k86573fe.js} +5 -5
- package/dist/chunk-kn84qg00.js +2 -0
- package/dist/{chunk-wz3gk8js.js → chunk-kq0cee7k.js} +3 -3
- package/dist/{chunk-vg3scf4d.js → chunk-m1mrq876.js} +9 -9
- package/dist/chunk-m5cdkb11.js +2 -0
- package/dist/{chunk-akcyaxwv.js → chunk-m7hfcxt3.js} +2 -2
- package/dist/{chunk-r32pqvpq.js → chunk-mmh2k7ab.js} +5 -5
- package/dist/chunk-mrc7hc4a.js +2 -0
- package/dist/{chunk-t0bcbhvs.js → chunk-ncptqa8v.js} +5 -5
- package/dist/{chunk-sxee2rxz.js → chunk-ncyjaxyz.js} +1 -1
- package/dist/chunk-nmc1vj8f.js +2 -0
- package/dist/chunk-nrqv8s48.js +2 -0
- package/dist/{chunk-gzfvj15b.js → chunk-nsxjt6h3.js} +1 -1
- package/dist/{chunk-hcwjdpzv.js → chunk-p8wq37hd.js} +2 -2
- package/dist/chunk-pr6nrg6x.js +2 -0
- package/dist/{chunk-jce3scvg.js → chunk-ps5by9sq.js} +16 -16
- package/dist/{chunk-v47yfe9k.js → chunk-qeyzgyhk.js} +1 -1
- package/dist/{chunk-8xx1yf34.js → chunk-qm3hkrcw.js} +4 -4
- package/dist/{chunk-hp9e8nz6.js → chunk-r1vkk7qp.js} +2 -2
- package/dist/{chunk-2yxva96k.js → chunk-r9e0r6jx.js} +2 -2
- package/dist/chunk-rmpgtyqh.js +2 -0
- package/dist/chunk-rnz6g3xv.js +2 -0
- package/dist/{chunk-gvnfb6s2.js → chunk-rpen41w3.js} +2 -2
- package/dist/{chunk-x8m28yea.js → chunk-rssxm2jw.js} +2 -2
- package/dist/chunk-s1k2sc69.js +2 -0
- package/dist/chunk-s3z8jtfj.js +2 -0
- package/dist/{chunk-q3dsjk2b.js → chunk-s9xs2ff4.js} +6 -6
- package/dist/{chunk-znx5m1jv.js → chunk-sphc7xzx.js} +1 -1
- package/dist/chunk-syvsj91a.js +2 -0
- package/dist/{chunk-x8h81amr.js → chunk-t4j2rw91.js} +2 -2
- package/dist/chunk-tdcgskyy.js +2 -0
- package/dist/chunk-tzb0n60s.js +2 -0
- package/dist/chunk-va9w63nh.js +2 -0
- package/dist/{chunk-qpvwxppw.js → chunk-vbc8a8fh.js} +4 -4
- package/dist/{chunk-s9b6abkb.js → chunk-vkn133cs.js} +2 -2
- package/dist/chunk-w3dsj0a6.js +3 -0
- package/dist/chunk-w5xq1217.js +2 -0
- package/dist/{chunk-hrrrf46j.js → chunk-w6n4y2xg.js} +2 -2
- package/dist/chunk-wwbng2jf.js +2 -0
- package/dist/chunk-x2hc3zth.js +2 -0
- package/dist/chunk-x7qctqj2.js +2 -0
- package/dist/{chunk-c1bsagbe.js → chunk-xrd1md4j.js} +6 -6
- package/dist/{chunk-1htxem27.js → chunk-y2q46m8b.js} +3 -3
- package/dist/{chunk-2yb1rwmy.js → chunk-y7sf7aj0.js} +1 -1
- package/dist/{chunk-t65tn8ee.js → chunk-ybjfr7e8.js} +2 -2
- package/dist/{chunk-8adf5x29.js → chunk-ycr9bkww.js} +1 -1
- package/dist/{chunk-xtwcz8dg.js → chunk-yhfrs6yn.js} +7 -7
- package/dist/chunk-yjezsy4p.js +2 -0
- package/dist/{chunk-3ajbbtqx.js → chunk-zmckz1eq.js} +7 -7
- package/dist/cli.js +19 -19
- package/dist/client-parameter-bindings.js +10 -6
- package/dist/client-script.js +11 -10
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/compiler/inline-style.js +51 -28
- package/dist/native/runtime/craft-bridge.js +37 -4
- package/dist/performance-utils.d.ts +255 -115
- package/dist/pwa.js +3 -3
- package/dist/safe-evaluator.js +28 -3
- package/dist/ssg.js +5 -5
- package/package.json +5 -5
- package/dist/chunk-1yhrq2nx.js +0 -2
- package/dist/chunk-1zy94dxs.js +0 -2
- package/dist/chunk-26505qjh.js +0 -2
- package/dist/chunk-2ehn5r6d.js +0 -2
- package/dist/chunk-3gcdq401.js +0 -2
- package/dist/chunk-3rgb6kc1.js +0 -2
- package/dist/chunk-5fzvcr9v.js +0 -2
- package/dist/chunk-6b10096c.js +0 -2
- package/dist/chunk-6fq522rd.js +0 -2
- package/dist/chunk-6mdvx2bf.js +0 -2
- package/dist/chunk-6q0c9j7p.js +0 -2
- package/dist/chunk-77v7g18n.js +0 -2
- package/dist/chunk-7m4eesp0.js +0 -2
- package/dist/chunk-92te36hf.js +0 -2
- package/dist/chunk-9736003n.js +0 -2
- package/dist/chunk-9sgzv5ze.js +0 -2
- package/dist/chunk-acwqb3ys.js +0 -2
- package/dist/chunk-amc8xdcz.js +0 -2
- package/dist/chunk-b3b9tfpx.js +0 -2
- package/dist/chunk-bb3y1g34.js +0 -2
- package/dist/chunk-bf3va62c.js +0 -2
- package/dist/chunk-c2x9wea0.js +0 -2
- package/dist/chunk-cas0vn5m.js +0 -2
- package/dist/chunk-d1c1qggs.js +0 -2
- package/dist/chunk-dd1vqndp.js +0 -2
- package/dist/chunk-ef8p88as.js +0 -2
- package/dist/chunk-ej8q3kyc.js +0 -2
- package/dist/chunk-eszpqrxy.js +0 -2
- package/dist/chunk-fn4jk05k.js +0 -2
- package/dist/chunk-h72d9174.js +0 -2
- package/dist/chunk-jn6g5n02.js +0 -2
- package/dist/chunk-kdhsev5v.js +0 -3
- package/dist/chunk-nm20k22y.js +0 -2
- package/dist/chunk-nq4d91zm.js +0 -2
- package/dist/chunk-nv0n2hjg.js +0 -431
- package/dist/chunk-p9j909eq.js +0 -2
- package/dist/chunk-pmf53mgj.js +0 -2
- package/dist/chunk-ps9fcjyg.js +0 -2
- package/dist/chunk-pxxhhaaw.js +0 -3
- package/dist/chunk-q38vjqv2.js +0 -2
- package/dist/chunk-q78jxqnr.js +0 -2
- package/dist/chunk-qkck7zx0.js +0 -2
- package/dist/chunk-se44tmvx.js +0 -61
- package/dist/chunk-shag9bcm.js +0 -2
- package/dist/chunk-t4yy48dh.js +0 -2
- package/dist/chunk-t55nk8sw.js +0 -2
- package/dist/chunk-tkb335d7.js +0 -2
- package/dist/chunk-vse4ewax.js +0 -2
- package/dist/chunk-vy92xwbg.js +0 -2
- package/dist/chunk-whq40bdm.js +0 -2
- package/dist/chunk-wqt2hep2.js +0 -2
- package/dist/chunk-ys46rqxg.js +0 -2
- package/dist/chunk-zhz8er14.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Zo,Qo,ei,ti,Cs,Es,Hh,Vh,Uh,Wh,Ts,qh}from"./chunk-
|
|
2
|
+
import{Zo,Qo,ei,ti,Cs,Es,Hh,Vh,Uh,Wh,Ts,qh}from"./chunk-3z0e637x.js";import"./chunk-gebb12ak.js";export{qh as generateDefaultRobotsTxt,Ts as generateRobotsTxt,Vh as generateSitemap,Uh as generateSitemapIndex,ti as injectSeoTags,Cs as metaDirective,Zo as processMetaDirectives,ei as processSeoDirective,Qo as processStructuredData,Hh as registerSeoDirectives,Wh as scanForSitemapEntries,Es as structuredDataDirective};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{B,Bf,Go,a,I,Fh,zh}from"./chunk-evmxrmjb.js";import"./chunk-g9xx8qh1.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-hn2me1qx.js";import"./chunk-69cphbrz.js";import"./chunk-dqa1g676.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{I as config,B as defaultConfig,Fh as defineStxConfig,Go as discoverConfig,a as loadStxConfig,Bf as resolveStxDirectories,zh as validateConfig};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{m,h,p}from"./chunk-
|
|
2
|
+
import{m,h,p}from"./chunk-69cphbrz.js";import{B}from"./chunk-evmxrmjb.js";import{i}from"./chunk-8je2zse3.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Om(e,t={},o={}){let n={...B,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),g=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(g.trim())await m(g,y,e);let E=H(c),l=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let u=await i(c,y,e,n,l);for(let b=0;b<u.length;b+=s)r.enqueue(u.slice(b,b+s)),await new Promise((f)=>setTimeout(f,0))}else{let u=[],b=new RegExp(T.source,"g"),f;while((f=b.exec(c))!==null)u.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await i(I,y,e,n,l);r.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await i(_.content,y,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,y,e,n,l);r.enqueue(C)}}}}else{let w=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,y,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
|
|
3
3
|
<template data-suspense-fallback>Loading...</template>
|
|
4
4
|
</div>`),w.set(d.name,i(d.content,y,e,n,l))}r.enqueue(`
|
|
5
5
|
<script>
|
|
@@ -17,13 +17,13 @@ import{m,h,p}from"./chunk-nv0n2hjg.js";import{j}from"./chunk-gqdkvwjp.js";import
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
})();
|
|
20
|
-
</script>`);let x=Array.from(w.entries()).map(async([d,u])=>{r.enqueue(await
|
|
20
|
+
</script>`);let x=Array.from(w.entries()).map(async([d,u])=>{r.enqueue(await ba(d,u))});await Promise.all(x)}r.close()}catch(a){r.error(a)}}})}async function ba(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
|
|
21
21
|
<script>
|
|
22
22
|
window.__stxSuspense.resolve('${e}', \`${n}\`);
|
|
23
23
|
</script>`}catch(o){let n=o instanceof Error?o.message:String(o);return`
|
|
24
24
|
<script>
|
|
25
25
|
window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${p(n)}</div>');
|
|
26
|
-
</script>`}}var
|
|
26
|
+
</script>`}}var lu=`
|
|
27
27
|
<script>
|
|
28
28
|
(function(){
|
|
29
29
|
window.__stxSuspense = window.__stxSuspense || {
|
|
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
})();
|
|
46
|
-
</script>`;function z(e,t,o){if(!t||t<=0)return e;let n,s=new Promise((r,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}function Nm(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(s){try{if(s.enqueue(e),t.length>0)s.enqueue(
|
|
46
|
+
</script>`;function z(e,t,o){if(!t||t<=0)return e;let n,s=new Promise((r,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}function Nm(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(s){try{if(s.enqueue(e),t.length>0)s.enqueue(lu),await Promise.all(t.map(async(r)=>{let a=z(r.render(),n,r.id);s.enqueue(await ba(r.id,a))}));s.close()}catch(r){s.error(r)}}})}var A=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function Mm(e,t){return e.replace(A,(o,n,s)=>{let r=n.trim(),a=s.split(/@fallback/i),S=a[0].trim(),g=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[r]=S,`<div data-suspense="${r}">${g}</div>`})}function Dm(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,s])=>({id:n,render:s})):void 0}async function Lm(e,t={},o={}){let n={...B,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),g=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(g.trim())await m(g,y,e);let E=new Set,l=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(l!=="manual"&&R.test(c))){let x=await i(c,y,e,n,E);for(let d=0;d<x.length;d+=s)r.enqueue(x.slice(d,d+s))}else{let x=[],d=new RegExp(T.source,"g"),u;while((u=d.exec(c))!==null)x.push({name:u[1],content:u[2],start:u.index,end:u.index+u[0].length});let b=0;for(let f of x){if(f.start>b){let _=c.slice(b,f.start);if(_.trim()){let C=await i(_,y,e,n,E);r.enqueue(C)}}let v=await i(f.content,y,e,n,E);r.enqueue(v),b=f.end}if(b<c.length){let f=c.slice(b);if(f.trim()){let v=await i(f,y,e,n,E);r.enqueue(v)}}}r.close()}catch(a){r.error(a)}}})}async function jm(e,t={}){let o={...B,...t,streaming:{...q,...t.streaming}},n=await Bun.file(e).text(),s=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),r=s?s[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),S=a,g={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let l=c[1],R=c[2];g[l]=R}let y=a.replace(T,"");return{renderShell:async(l={})=>{let R={...l,__filename:e,__dirname:k.dirname(e)};return await m(r,R,e),i(y,R,e,o,new Set)},renderSection:async(l,R={})=>{try{if(!g[l])return`<div class="error-message">Section "${p(l)}" not found in template "${p(e)}"</div>`;let w={...R,__filename:e,__dirname:k.dirname(e)};await m(r,w,e);let x=new Set;return await i(g[l],w,e,o,x)}catch(w){let x=w instanceof Error?w.message:String(w);return h("Expression",x,e,g[l]||"",0,g[l]||"")}},getSections:()=>Object.keys(g),getTemplate:()=>S}}var uu={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let s=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${s} -->${e}<!-- @endsuspense:${s} -->`}},du={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let s=t[0].replace(/['"`]/g,""),r=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${s}-${Math.random().toString(36).substring(2,9)}`,S=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),g=S?S[1].trim():"",c=S?e.replace(S[0],""):e;return`<div data-island="${s}" data-island-id="${a}" data-priority="${r}">
|
|
47
47
|
${c}
|
|
48
48
|
<script type="application/json" data-island-props="${a}">
|
|
49
49
|
${g?`{${g}}`:"{}"}
|
|
50
50
|
</script>
|
|
51
|
-
</div>`}};function Bm(e={}){let t=[];if(e.streaming?.enabled)t.push(
|
|
51
|
+
</div>`}};function Bm(e={}){let t=[];if(e.streaming?.enabled)t.push(uu);if(e.hydration?.enabled)t.push(du);return t}async function Fm(e,t,o,n={}){return e}function zm(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(r,a){a.enqueue(o.encode(r))}})),s=new Headers(t.headers);if(!s.has("Content-Type"))s.set("Content-Type","text/html; charset=utf-8");if(!s.has("Transfer-Encoding"))s.set("Transfer-Encoding","chunked");if(!s.has("X-Content-Type-Options"))s.set("X-Content-Type-Options","nosniff");if(!s.has("X-Accel-Buffering"))s.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:s})}function Hm(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,s=Object.entries(o).map(([r,a])=>`'${r}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
|
|
52
52
|
`);if(t==="loader")return`
|
|
53
53
|
(function() {
|
|
54
54
|
window.__stx = window.__stx || {};
|
|
@@ -191,4 +191,4 @@ else {
|
|
|
191
191
|
stx.hydrate();
|
|
192
192
|
}
|
|
193
193
|
})();`}
|
|
194
|
-
export{Om,
|
|
194
|
+
export{Om,ba,lu,Nm,Mm,Dm,Lm,jm,uu,du,Bm,Fm,zm,Hm};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{nm,rm,sm,om,
|
|
2
|
+
import{nm,rm,sm,om,jl,im,am,cm,lm,um,dm,pm}from"./chunk-a0r4dpzs.js";export{dm as Broadcast,pm as BroadcastServer,jl as broadcast,lm as broadcastPresence,cm as broadcastPrivate,um as channel,nm as getBroadcastServer,om as loadChannels,rm as startBroadcasting,sm as stopBroadcasting,im as toUser,am as toUsers};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{er,$e}from"./chunk-7sh9fa3q.js";import{z,b,br,Ls,C}from"./chunk-nv0n2hjg.js";import{a,P}from"./chunk-gqdkvwjp.js";import{Oo}from"./chunk-wz3gk8js.js";import{nt}from"./chunk-5emrarpf.js";import{c}from"./chunk-brhas9mp.js";import{r,ge}from"./chunk-b9d70mgr.js";import p from"path";import B from"fs";import{AsyncLocalStorage as xt}from"async_hooks";import{randomUUID as yt}from"crypto";var $t=11;function X(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(p.basename(t))||Oo(t,e,n)}var at=2;function vf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?p.resolve(e):c(t,"bundle-cache")}function st(t,e){let n=t;for(let i of wt(e))if(i!==p.sep)n=n.split(i).join("\x00root");return n}var rt=new Map;function wt(t){let e=p.resolve(t),n=rt.get(e);if(!n){let i=e;try{i=B.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((l,d)=>d.length-l.length),rt.set(e,n)}return n}function bt(t,e){try{let n=B.statSync(t),i=p.resolve(e),l=t.startsWith(`${i}${p.sep}`);return{path:l?p.relative(i,t):t,...l?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(B.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?p.join(p.resolve(e),t.path):t.path}function St(t,e){for(let n of t){let i=ct(n,e);try{let l=B.statSync(i);if(l.size!==n.size)return!1;if(l.mtimeMs!==n.mtimeMs&&Bun.hash(B.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,vt=100;function xf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var H=new Map;async function jt(t){let e=H.get(t)??0;if(e>0&&e<vt){H.set(t,e+1);return}H.set(t,1);try{let n=(await B.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=xf();if(n.length<=i)return;let d=(await Promise.all(n.map(async(o)=>{try{return{name:o,at:(await B.promises.stat(p.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);d.sort((o,w)=>w.at-o.at);for(let o of d.slice(i)){let w=o.name.slice(0,-3);await B.promises.rm(p.join(t,`${w}.js`),{force:!0}),await B.promises.rm(p.join(t,`${w}.deps.json`),{force:!0})}k("pruned bundle cache to",i,"entries")}catch{}}function he(t){return lt.get(t)??[]}function Z(t,e){if(t)lt.set(t,e)}function Sf(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function k(...t){if(Sf())console.log("[stx:bundler]",...t)}var K=[];function tc(t,e,n){K.push({filePath:t||"<inline>",message:e,details:n})}function en(){return K.slice()}function tn(){K.length=0}var Q;function Sh(t){Q=t}function nc(){if(Q)return Q;try{let t=P.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Y=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function nn(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let l=n[1];if(!Y.some((o)=>o.test(l)))return k("detected user import:",l),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let l=n[1];if(/\.css(?:\?.*)?$/.test(l))continue;if(!Y.some((o)=>o.test(l)))return k("detected side-effect import:",l),!0}return!1}var Qn="stx-module:",Bt=/\.(?:[cm]?[jt]sx?|json)$/i;function kf(t,e){return p.relative(t,e).split(p.sep).join("/")}function _f(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,l,d)=>{let o=e.get(d);return o&&!d.startsWith(Qn)?`${i}${l}${o}${l}`:n})}function Cf(t,e){let n=0,i=(d)=>{let o=`__stxMod${n++}`,w=JSON.stringify(d);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${w}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(w)} + " is not registered on this page (#1957)");`),o},l=(d,o)=>{for(let w of d.split(",")){let I=w.trim();if(!I)continue;let M=I.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!M)continue;let S=M[1].startsWith('"')?JSON.parse(M[1]):M[1],f=M[2]??S;e.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o,w)=>{let I=w.slice(Qn.length),M=i(I),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))e.push(`var ${f[1]} = ${M}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${M};`);else if(S.startsWith("{"))l(S.replace(/^\{|\}$/g,""),M);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o)=>(i(o.slice(Qn.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,p.join(t,"index.ts"),p.join(t,"index.tsx"),p.join(t,"index.js"),p.join(t,"index.mjs")];for(let n of e)try{if(B.existsSync(n)&&B.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var G=new xt;function os(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,l]of[...t].sort(([d],[o])=>d<o?-1:d>o?1:0))n.update(`${i}\x00${l}\x00`);return G.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function rn(){return G.getStore()?.key??""}function ut(t,e,n,i,l,d,o=new Map,w,I,M){let S=new Map([[n,i],...M??[]]),f=(j)=>j!==void 0&&S.has(j),v=(j,s,u)=>{if(X(s,t,w))return null;if(!d||!f(j)||!Bt.test(s))return null;try{if(!B.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(s);let E=`${Qn}${kf(process.cwd(),s)}`;return o.set(u,E),{path:E,external:!0}},y=(j,s)=>{let u=f(j)?e:p.dirname(j),E=p.resolve(u,s);return it(E)??E};return{name:"stx-client-bundle",setup(j){if(j.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^\//},(s)=>{if(f(s.path))return{path:s.path};let u=it(s.path);if(u){let E=v(s.importer,u,s.path);if(E)return E;if(!f(u))l.add(u);return{path:u}}return{path:s.path,external:!0}}),j.onResolve({filter:/^\.\.?\//},(s)=>{let u=y(s.importer,s.path),E=v(s.importer,u,s.path);if(E)return E;return l.add(u),{path:u}}),j.onResolve({filter:/^[@~]\//},(s)=>{let u=p.resolve(t,s.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,p.join(u,"index.ts"),p.join(u,"index.tsx"),p.join(u,"index.js"),p.join(u,"index.mjs")];for(let h of E)if(B.existsSync(h)&&B.statSync(h,{throwIfNoEntry:!1})?.isFile()){let D=v(s.importer,h,s.path);if(D)return D;return k(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",h),l.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:u}}),d)j.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(!f(s.importer))return;let u=`${Qn}npm:${s.path}`;return o.set(s.path,u),{path:u,external:!0}});j.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(S.has(s.path))return{contents:S.get(s.path),loader:"ts"};if(X(s.path,t,w))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let u=p.extname(s.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(s.path))l.add(s.path);let h=I?.get(s.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:B.readFileSync(s.path,"utf8"),loader:E}})}}}var q=new Map,V=b(64),ot=Symbol.for("stx.client-bundle-build-queue");function Ef(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function sn(t,e,n={}){let i=n.projectRoot||process.cwd(),l=(await a(i)).serverApi,d=n.minify??!1,o=n.externalizeUserModules??!0,w=n.expose?.length?[...new Set(n.expose)].sort():void 0,I=n.cacheDir||vf(i),M=G.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${$t}\x00${nt()}\x00${JSON.stringify(l??!1)}\x00${o?"registry":"inline"}\x00${w?w.join(","):"*"}\x00${d?"minified":"readable"}\x00${M?.key??""}\x00${st(t,i)}\x00${st(e,i)}`);let f=S.digest("hex").slice(0,12),v=p.join(I,`${f}.js`),y=V.get(v);if(y){if(Ls(y.files)&&y.files.every((h)=>!X(h.path,i,l))){k("memo hit:",f);let h=y.files.map((D)=>D.path);return Z(e,h),n.collectInputs?.push(...h),y.code}V.delete(v),k("memo invalidated by dep change:",f)}let j=p.join(I,`${f}.deps.json`),s=Bun.file(v);if(await s.exists()){let h=Bun.file(j),D=!1,N=null;if(await h.exists())try{let O=JSON.parse(await h.text());if(O.metadataVersion===at&&Array.isArray(O.files)&&St(O.files,i))N=br(O.files.map((g)=>ct(g,i))),D=N.length===O.files.length&&!N.some((g)=>X(g.path,i,l))}catch{D=!1}if(D){if(k("cache hit:",f),N)Z(e,N.map((T)=>T.path)),n.collectInputs?.push(...N.map((T)=>T.path));let O=await s.text(),g=new Date;if(B.promises.utimes(v,g,g).catch(()=>{}),N)V.set(v,{code:O,files:N});return O}k("cache invalidated by dep change:",f)}let u=q.get(f);if(u){let h=await u;if(n.collectInputs)n.collectInputs.push(...(V.get(v)?.files??[]).map((D)=>D.path));return h}let E=Ef(()=>Et(t,e,{projectRoot:i,minify:d,cacheDir:I,hash:f,cachePath:v,depsPath:j,collectInputs:n.collectInputs,externalizeUserModules:o,serverApi:l,expose:w,throwOnFailure:n.throwOnFailure,substitutes:M?.modules}));q.set(f,E);try{return await E}finally{q.delete(f)}}function rc(t){return`${t}-${process.pid}-${yt()}`}async function kh(t,e){let{projectRoot:n}=e,i=rc(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),l=p.join(c(n,"bundle-tmp"),"out",i);B.mkdirSync(l,{recursive:!0});let d=new Map,o=new Map,w=0;for(let[f,v]of t){let y=p.join(n,`.stx-split-${i}-${w++}.ts`);d.set(y,v),o.set(p.basename(y).replace(/\.ts$/,""),f)}let[I,M]=[...d][0],S=new Set;try{let f=await Bun.build({entrypoints:[...d.keys()],outdir:l,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ut(n,p.dirname(e.filePath),I,M,S,!1,new Map,void 0,G.getStore()?.modules,d)],define:{"process.env.NODE_ENV":'"development"',...C()},root:n});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let j=p.basename(y.path);if(y.kind==="entry-point"){let s=o.get(j.replace(/\.js$/,""));if(s!==void 0)v.entries.set(s,await y.text())}else if(y.kind==="chunk")v.chunks.set(j.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...S),v}finally{try{B.rmSync(l,{recursive:!0,force:!0})}catch{}}}async function Et(t,e,n){let{projectRoot:i,minify:l,cacheDir:d,hash:o,cachePath:w,depsPath:I,externalizeUserModules:M}=n,S=c(i,"bundle-tmp"),f=rc(o),v=p.join(i,`.stx-client-${f}.ts`),y=p.join(S,"out",f);B.mkdirSync(y,{recursive:!0});let j=p.dirname(e),s=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=r(t),{depths:D,balanced:N}=ge(h),O=(R)=>!N||D[R]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!O(g.index))continue;if(g[2])g[2].split(",").forEach((R)=>{let m=_t(R);if(m)s.add(m)});else if(g[3])s.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!O(g.index))continue;s.add(g[2])}let T=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=T.exec(h))!==null){if(!O(g.index))continue;let R=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(R&&Y.some((m)=>m.test(R)))continue;if(g[1])s.add(g[1]);if(g[2])s.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let U=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(U)s.add(U)}}for(let R of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of R[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)s.delete(_)}let pt=s.size>0?`
|
|
3
|
-
export { ${[...s].join(", ")} }`:"";
|
|
4
|
-
`),ht=_.map(([x])=>`${x} = ${
|
|
2
|
+
import{er,$e}from"./chunk-7sh9fa3q.js";import{H,b,br,Ls,C}from"./chunk-69cphbrz.js";import{a,I}from"./chunk-evmxrmjb.js";import{Oo}from"./chunk-kq0cee7k.js";import{nt}from"./chunk-5emrarpf.js";import{c}from"./chunk-0rjcbqk3.js";import{r,ge}from"./chunk-3vpgr6nk.js";import p from"path";import B from"fs";import{AsyncLocalStorage as xt}from"async_hooks";import{randomUUID as yt}from"crypto";var $t=11;function W(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(p.basename(t))||Oo(t,e,n)}var at=2;function wf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?p.resolve(e):c(t,"bundle-cache")}function st(t,e){let n=t;for(let i of wt(e))if(i!==p.sep)n=n.split(i).join("\x00root");return n}var rt=new Map;function wt(t){let e=p.resolve(t),n=rt.get(e);if(!n){let i=e;try{i=B.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((l,d)=>d.length-l.length),rt.set(e,n)}return n}function bt(t,e){try{let n=B.statSync(t),i=p.resolve(e),l=t.startsWith(`${i}${p.sep}`);return{path:l?p.relative(i,t):t,...l?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(B.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?p.join(p.resolve(e),t.path):t.path}function St(t,e){for(let n of t){let i=ct(n,e);try{let l=B.statSync(i);if(l.size!==n.size)return!1;if(l.mtimeMs!==n.mtimeMs&&Bun.hash(B.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,vt=100;function vf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var G=new Map;async function jt(t){let e=G.get(t)??0;if(e>0&&e<vt){G.set(t,e+1);return}G.set(t,1);try{let n=(await B.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=vf();if(n.length<=i)return;let d=(await Promise.all(n.map(async(o)=>{try{return{name:o,at:(await B.promises.stat(p.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);d.sort((o,w)=>w.at-o.at);for(let o of d.slice(i)){let w=o.name.slice(0,-3);await B.promises.rm(p.join(t,`${w}.js`),{force:!0}),await B.promises.rm(p.join(t,`${w}.deps.json`),{force:!0})}A("pruned bundle cache to",i,"entries")}catch{}}function he(t){return lt.get(t)??[]}function Z(t,e){if(t)lt.set(t,e)}function xf(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function A(...t){if(xf())console.log("[stx:bundler]",...t)}var K=[];function ec(t,e,n){K.push({filePath:t||"<inline>",message:e,details:n})}function en(){return K.slice()}function tn(){K.length=0}var Q;function Sh(t){Q=t}function tc(){if(Q)return Q;try{let t=I.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Y=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function nn(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let l=n[1];if(!Y.some((o)=>o.test(l)))return A("detected user import:",l),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let l=n[1];if(/\.css(?:\?.*)?$/.test(l))continue;if(!Y.some((o)=>o.test(l)))return A("detected side-effect import:",l),!0}return!1}var Qn="stx-module:",Bt=/\.(?:[cm]?[jt]sx?|json)$/i;function Sf(t,e){return p.relative(t,e).split(p.sep).join("/")}function kf(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,l,d)=>{let o=e.get(d);return o&&!d.startsWith(Qn)?`${i}${l}${o}${l}`:n})}function _f(t,e){let n=0,i=(d)=>{let o=`__stxMod${n++}`,w=JSON.stringify(d);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${w}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(w)} + " is not registered on this page (#1957)");`),o},l=(d,o)=>{for(let w of d.split(",")){let D=w.trim();if(!D)continue;let M=D.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!M)continue;let S=M[1].startsWith('"')?JSON.parse(M[1]):M[1],f=M[2]??S;e.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o,w)=>{let D=w.slice(Qn.length),M=i(D),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))e.push(`var ${f[1]} = ${M}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${M};`);else if(S.startsWith("{"))l(S.replace(/^\{|\}$/g,""),M);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o)=>(i(o.slice(Qn.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,p.join(t,"index.ts"),p.join(t,"index.tsx"),p.join(t,"index.js"),p.join(t,"index.mjs")];for(let n of e)try{if(B.existsSync(n)&&B.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var X=new xt;function os(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,l]of[...t].sort(([d],[o])=>d<o?-1:d>o?1:0))n.update(`${i}\x00${l}\x00`);return X.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function rn(){return X.getStore()?.key??""}function ut(t,e,n,i,l,d,o=new Map,w,D,M){let S=new Map([[n,i],...M??[]]),f=(j)=>j!==void 0&&S.has(j),v=(j,s,u)=>{if(W(s,t,w))return null;if(!d||!f(j)||!Bt.test(s))return null;try{if(!B.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(s);let E=`${Qn}${Sf(process.cwd(),s)}`;return o.set(u,E),{path:E,external:!0}},y=(j,s)=>{let u=f(j)?e:p.dirname(j),E=p.resolve(u,s);return it(E)??E};return{name:"stx-client-bundle",setup(j){if(j.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^\//},(s)=>{if(f(s.path))return{path:s.path};let u=it(s.path);if(u){let E=v(s.importer,u,s.path);if(E)return E;if(!f(u))l.add(u);return{path:u}}return{path:s.path,external:!0}}),j.onResolve({filter:/^\.\.?\//},(s)=>{let u=y(s.importer,s.path),E=v(s.importer,u,s.path);if(E)return E;return l.add(u),{path:u}}),j.onResolve({filter:/^[@~]\//},(s)=>{let u=p.resolve(t,s.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,p.join(u,"index.ts"),p.join(u,"index.tsx"),p.join(u,"index.js"),p.join(u,"index.mjs")];for(let h of E)if(B.existsSync(h)&&B.statSync(h,{throwIfNoEntry:!1})?.isFile()){let O=v(s.importer,h,s.path);if(O)return O;return A(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",h),l.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:u}}),d)j.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(!f(s.importer))return;let u=`${Qn}npm:${s.path}`;return o.set(s.path,u),{path:u,external:!0}});j.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(S.has(s.path))return{contents:S.get(s.path),loader:"ts"};if(W(s.path,t,w))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let u=p.extname(s.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(s.path))l.add(s.path);let h=D?.get(s.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:B.readFileSync(s.path,"utf8"),loader:E}})}}}var q=new Map,P=b(64),ot=Symbol.for("stx.client-bundle-build-queue");function Cf(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function sn(t,e,n={}){let i=n.projectRoot||process.cwd(),l=(await a(i)).serverApi,d=n.minify??!1,o=n.externalizeUserModules??!0,w=n.expose?.length?[...new Set(n.expose)].sort():void 0,D=n.cacheDir||wf(i),M=X.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${$t}\x00${nt()}\x00${JSON.stringify(l??!1)}\x00${o?"registry":"inline"}\x00${w?w.join(","):"*"}\x00${d?"minified":"readable"}\x00${M?.key??""}\x00${st(t,i)}\x00${st(e,i)}`);let f=S.digest("hex").slice(0,12),v=p.join(D,`${f}.js`),y=P.get(v);if(y){if(Ls(y.files)&&y.files.every((h)=>!W(h.path,i,l))){A("memo hit:",f);let h=y.files.map((O)=>O.path);return Z(e,h),n.collectInputs?.push(...h),y.code}P.delete(v),A("memo invalidated by dep change:",f)}let j=p.join(D,`${f}.deps.json`),s=Bun.file(v);if(await s.exists()){let h=Bun.file(j),O=!1,k=null;if(await h.exists())try{let N=JSON.parse(await h.text());if(N.metadataVersion===at&&Array.isArray(N.files)&&St(N.files,i))k=br(N.files.map((g)=>ct(g,i))),O=k.length===N.files.length&&!k.some((g)=>W(g.path,i,l))}catch{O=!1}if(O){if(A("cache hit:",f),k)Z(e,k.map((U)=>U.path)),n.collectInputs?.push(...k.map((U)=>U.path));let N=await s.text(),g=new Date;if(B.promises.utimes(v,g,g).catch(()=>{}),k)P.set(v,{code:N,files:k});return N}A("cache invalidated by dep change:",f)}let u=q.get(f);if(u){let h=await u;if(n.collectInputs)n.collectInputs.push(...(P.get(v)?.files??[]).map((O)=>O.path));return h}let E=Cf(()=>Et(t,e,{projectRoot:i,minify:d,cacheDir:D,hash:f,cachePath:v,depsPath:j,collectInputs:n.collectInputs,externalizeUserModules:o,serverApi:l,expose:w,throwOnFailure:n.throwOnFailure,substitutes:M?.modules}));q.set(f,E);try{return await E}finally{q.delete(f)}}function nc(t){return`${t}-${process.pid}-${yt()}`}async function kh(t,e){let{projectRoot:n}=e,i=nc(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),l=p.join(c(n,"bundle-tmp"),"out",i);B.mkdirSync(l,{recursive:!0});let d=new Map,o=new Map,w=0;for(let[f,v]of t){let y=p.join(n,`.stx-split-${i}-${w++}.ts`);d.set(y,v),o.set(p.basename(y).replace(/\.ts$/,""),f)}let[D,M]=[...d][0],S=new Set;try{let f=await Bun.build({entrypoints:[...d.keys()],outdir:l,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ut(n,p.dirname(e.filePath),D,M,S,!1,new Map,void 0,X.getStore()?.modules,d)],define:{"process.env.NODE_ENV":'"development"',...C()},root:n});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let j=p.basename(y.path);if(y.kind==="entry-point"){let s=o.get(j.replace(/\.js$/,""));if(s!==void 0)v.entries.set(s,await y.text())}else if(y.kind==="chunk")v.chunks.set(j.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...S),v}finally{try{B.rmSync(l,{recursive:!0,force:!0})}catch{}}}async function Et(t,e,n){let{projectRoot:i,minify:l,cacheDir:d,hash:o,cachePath:w,depsPath:D,externalizeUserModules:M}=n,S=c(i,"bundle-tmp"),f=nc(o),v=p.join(i,`.stx-client-${f}.ts`),y=p.join(S,"out",f);B.mkdirSync(y,{recursive:!0});let j=p.dirname(e),s=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=r(t),{depths:O,balanced:k}=ge(h),N=(R)=>!k||O[R]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;if(g[2])g[2].split(",").forEach((R)=>{let m=_t(R);if(m)s.add(m)});else if(g[3])s.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;s.add(g[2])}let U=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=U.exec(h))!==null){if(!N(g.index))continue;let R=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(R&&Y.some((m)=>m.test(R)))continue;if(g[1])s.add(g[1]);if(g[2])s.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let L=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(L)s.add(L)}}for(let R of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of R[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)s.delete(_)}let pt=s.size>0?`
|
|
3
|
+
export { ${[...s].join(", ")} }`:"";A("bundling:",o,"from:",p.basename(e));let tt=new Set,et=new Map;try{let R=await Bun.build({entrypoints:[v],outdir:y,target:"browser",format:"esm",minify:l?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[ut(i,j,v,t+pt,tt,M,et,n.serverApi,n.substitutes)],define:{"process.env.NODE_ENV":l?'"production"':'"development"',...C()},root:i});if(!R.success){let F=R.logs.filter((T)=>T.level==="error").map((T)=>T.message).join(", ")||`Unable to bundle ${p.basename(e)}`,z=er(R.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",F),ec(e||"",F,z),n.throwOnFailure||tc()==="error")throw Error(F);return t}let m="";for(let x of R.outputs){m=await x.text();break}let _=[];for(let x of m.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let F of x[1].split(",")){let z=F.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(z){_.push([z[2],z[1]]);continue}let T=F.trim();if(/^[A-Za-z_$][\w$]*$/.test(T))_.push([T,T])}if(n.expose){let x=new Set(n.expose);for(let F=_.length-1;F>=0;F--)if(!x.has(_[F][0]))_.splice(F,1)}let L=[];m=_f(kf(m,et),L);let dt=m.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(m=m.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),l&&m)try{m=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(m)}catch{}let V=`__stxBundle_${o}`,ft=new Set(H(t,!0).split(",").map((x)=>x.trim())),mt=_.map(([x,F])=>`get ${JSON.stringify(x)}() { return ${F} }${ft.has(x)?`, set ${JSON.stringify(x)}(__stxValue_${F}) { ${F} = __stxValue_${F} }`:""}`).join(", "),gt=_.map(([x])=>`var ${x} = undefined;`).join(`
|
|
4
|
+
`),ht=_.map(([x])=>`${x} = ${V}[${JSON.stringify(x)}];`).join(`
|
|
5
5
|
`);if(m=`${dt.join(`
|
|
6
6
|
`)}
|
|
7
7
|
${gt}
|
|
8
|
-
var ${
|
|
9
|
-
${
|
|
8
|
+
var ${V} = (function() {
|
|
9
|
+
${L.join(`
|
|
10
10
|
`)}
|
|
11
11
|
${m}
|
|
12
12
|
return { ${mt} };
|
|
13
13
|
})();
|
|
14
14
|
${ht}
|
|
15
15
|
var __stxLiveBindings = typeof __stxLiveBindings === 'undefined' ? {} : __stxLiveBindings;
|
|
16
|
-
Object.keys(${
|
|
16
|
+
Object.keys(${V}).forEach(function(name) {
|
|
17
17
|
if (!Object.prototype.hasOwnProperty.call(__stxLiveBindings, name))
|
|
18
|
-
Object.defineProperty(__stxLiveBindings, name, Object.getOwnPropertyDescriptor(${
|
|
19
|
-
});`.trim(),
|
|
20
|
-
export{vf,
|
|
18
|
+
Object.defineProperty(__stxLiveBindings, name, Object.getOwnPropertyDescriptor(${V}, name));
|
|
19
|
+
});`.trim(),A("bundled:",o,"output:",m.length,"bytes"),s.size>0&&_.length===0)return console.warn(`[stx:bundler] dropped every binding for ${p.basename(e)} (${o}); serving the unbundled source and not caching this result`),t;B.mkdirSync(d,{recursive:!0}),await Bun.write(w,m);let J=br(tt);return await Bun.write(D,JSON.stringify({metadataVersion:at,files:J.map((x)=>bt(x.path,i)).filter((x)=>x!==null)})),Z(e,J.map((x)=>x.path)),n.collectInputs?.push(...J.map((x)=>x.path)),P.set(w,{code:m,files:J}),await jt(d),m}catch(R){let m=er(R,e||void 0),_=$e(R,e||void 0);if(console.warn(`[stx:bundler] error: ${_}`),ec(e||"",_,m),n.throwOnFailure||tc()==="error")throw R;return t}finally{try{B.rmSync(y,{recursive:!0,force:!0})}catch{}}}function _t(t){let e=t.trim();if(!e)return null;let n=e.indexOf("=");if(n!==-1)e=e.slice(0,n).trim();let i=e.indexOf(":");if(i!==-1)e=e.slice(i+1).trim();if(e.startsWith("..."))e=e.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(e)?e:null}
|
|
20
|
+
export{wf,vf,he,xf,ec,en,tn,Sh,tc,nn,Qn,Sf,kf,_f,os,rn,Cf,sn,nc,kh};
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import o from"fs";import u from"path";var h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"};function p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function Ue(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function Tn(e){if(e.entries.length===0)return"[]";return`[
|
|
3
3
|
${e.entries.map((t)=>` { url: '${t.url}', revision: '${t.revision}' }`).join(`,
|
|
4
4
|
`)}
|
|
5
|
-
]`}function
|
|
6
|
-
export{Ue,Tn,
|
|
5
|
+
]`}function Ii(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
|
|
6
|
+
export{Ue,Tn,Ii};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{lo,ea,Ur,uo,po,Rn,Kt,ta,Wr,qr,fo,go,Xg,Gg,pt}from"./chunk-mmh2k7ab.js";export{pt as DeployError,ea as calculateSha1,Ur as collectDeployFiles,qr as createDefaultNetlifyConfig,uo as createFileManifest,lo as createNetlifyClient,Xg as deploy,Wr as detectProjectConfig,po as filterRequiredFiles,Rn as formatSize,ta as generateNetlifyToml,Kt as getTotalSize,go as hasNetlifyConfig,Gg as initNetlify,fo as writeNetlifyConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ya,ou,Fn,Pm,iu,au,cu,Im}from"./chunk-y2q46m8b.js";import"./chunk-69cphbrz.js";import"./chunk-dqa1g676.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{Fn as Validator,ou as defineForm,iu as processErrorDirective,au as processErrorsDirective,Im as processFormValidationDirectives,cu as processHasErrorsDirective,ya as useForm,Pm as v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{wo,ch,lh}from"./chunk-16362f43.js";import"./chunk-7v1pwjke.js";import"./chunk-kq0cee7k.js";import"./chunk-7sh9fa3q.js";import"./chunk-yhfrs6yn.js";import"./chunk-3ebwrpax.js";import"./chunk-1carv1dw.js";import"./chunk-evmxrmjb.js";import"./chunk-g9xx8qh1.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-hn2me1qx.js";import"./chunk-69cphbrz.js";import"./chunk-dqa1g676.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{lh as clearComposableCache,ch as getComposableScript,wo as listComposableModules};
|