@stacksjs/stx 0.2.841 → 0.2.843
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-01gwdj2y.js +2 -0
- package/dist/{chunk-321e41ck.js → chunk-02qbawwq.js} +3 -3
- package/dist/chunk-0571wwem.js +2 -0
- package/dist/chunk-0h3qftkx.js +2 -0
- package/dist/{chunk-p9d2txcg.js → chunk-11kp389s.js} +1 -1
- package/dist/chunk-1474zjtx.js +3 -0
- package/dist/{chunk-v4ybemgb.js → chunk-1c6kczkt.js} +4 -4
- package/dist/chunk-1cdxe8yt.js +2 -0
- package/dist/{chunk-g7rsd8st.js → chunk-1h6pb8d1.js} +5 -5
- package/dist/{chunk-30zf567p.js → chunk-25swv3t2.js} +1 -1
- package/dist/{chunk-7cg2f588.js → chunk-28zze2wm.js} +1 -1
- package/dist/chunk-29chh7cd.js +2 -0
- package/dist/{chunk-6wrf6302.js → chunk-2cafvex6.js} +2 -2
- package/dist/{chunk-8pj4v1eh.js → chunk-2ytaezad.js} +2 -2
- package/dist/chunk-339cn2s8.js +2 -0
- package/dist/{chunk-v3q126ys.js → chunk-3ba0nqwm.js} +2 -2
- package/dist/{chunk-ybmnf25a.js → chunk-3hfmeb1z.js} +1 -1
- package/dist/chunk-3kg5a5gp.js +2 -0
- package/dist/chunk-3qstewq3.js +2 -0
- package/dist/{chunk-4j08cbjd.js → chunk-3rjgm7qk.js} +5 -5
- package/dist/{chunk-y68xstqy.js → chunk-3sskqw4b.js} +1 -1
- package/dist/{chunk-axhg6nn9.js → chunk-3vh945rk.js} +5 -5
- package/dist/chunk-40r740w1.js +2 -0
- package/dist/chunk-469nzheq.js +2 -0
- package/dist/{chunk-8370x30n.js → chunk-47n5s7wk.js} +2 -2
- package/dist/chunk-4a93qzdg.js +2 -0
- package/dist/{chunk-gw5bf8e7.js → chunk-4mqr462h.js} +17 -17
- package/dist/{chunk-jxvxynnf.js → chunk-53b8r8d2.js} +6 -6
- package/dist/{chunk-mpc840yc.js → chunk-58pc09a1.js} +34 -34
- package/dist/chunk-5hhyqze9.js +2 -0
- package/dist/{chunk-m5bj2jnb.js → chunk-5p96rafz.js} +2 -2
- package/dist/{chunk-mhyd24bg.js → chunk-5y3m5vzg.js} +2 -2
- package/dist/chunk-60jtrz9f.js +2 -0
- package/dist/chunk-689qm4h4.js +2 -0
- package/dist/{chunk-t3p0jy0s.js → chunk-6hb75r07.js} +6 -6
- package/dist/chunk-6vcpmt0y.js +2 -0
- package/dist/{chunk-20rmh0be.js → chunk-6wgbm5tc.js} +3 -3
- package/dist/{chunk-nfdaem8g.js → chunk-6ygr2syc.js} +6 -6
- package/dist/{chunk-89d3h8mp.js → chunk-756bf5nt.js} +14 -14
- package/dist/{chunk-wbgc2n04.js → chunk-78q3apyy.js} +2 -2
- package/dist/{chunk-jc5y35b7.js → chunk-79wb76ya.js} +1 -1
- package/dist/{chunk-ngnr831a.js → chunk-7s411sa9.js} +5 -5
- package/dist/chunk-7xp2ec0v.js +2 -0
- package/dist/chunk-80cnt2vg.js +2 -0
- package/dist/{chunk-qfvddpcg.js → chunk-87ksn02m.js} +2 -2
- package/dist/{chunk-a1s5wqw4.js → chunk-8cahff21.js} +2 -2
- package/dist/{chunk-8qbp5skx.js → chunk-8g5dsjr0.js} +6 -6
- package/dist/chunk-8k8m9vf2.js +2 -0
- package/dist/chunk-8nq2snvy.js +2 -0
- package/dist/{chunk-xbcnnk8x.js → chunk-8qjf16yr.js} +4 -4
- package/dist/chunk-8s27mteq.js +2 -0
- package/dist/chunk-8weaawqm.js +2 -0
- package/dist/chunk-9egg8bb8.js +2 -0
- package/dist/chunk-9gkc04h5.js +2 -0
- package/dist/{chunk-11y84h2d.js → chunk-9mtyxvhk.js} +2 -2
- package/dist/chunk-9rcpahyb.js +2 -0
- package/dist/{chunk-t0jed809.js → chunk-9vg3jtzw.js} +6 -6
- package/dist/{chunk-d5h2qak7.js → chunk-9zjr0ty9.js} +5 -5
- package/dist/chunk-akw5585n.js +2 -0
- package/dist/chunk-as6x6be8.js +2 -0
- package/dist/{chunk-eqfs73sa.js → chunk-ast5jmcg.js} +9 -9
- package/dist/{chunk-1m16mvt4.js → chunk-b6qf7w2b.js} +4 -4
- package/dist/{chunk-qk079ca7.js → chunk-bqsrtvad.js} +2 -2
- package/dist/chunk-bv4rews8.js +2 -0
- package/dist/chunk-bygxt820.js +3 -0
- package/dist/chunk-c0grsrqj.js +2 -0
- package/dist/{chunk-7t57cnz9.js → chunk-c6yc6qsv.js} +5 -5
- package/dist/{chunk-g7hd7eh0.js → chunk-cjm92sfd.js} +2 -2
- package/dist/{chunk-c3gsnne5.js → chunk-cnav1x5k.js} +3 -3
- package/dist/chunk-d5bjpjbv.js +2 -0
- package/dist/{chunk-amh7h4bq.js → chunk-dbsexg52.js} +5 -5
- package/dist/chunk-dj0xp789.js +2 -0
- package/dist/chunk-e1vf62ck.js +2 -0
- package/dist/chunk-f1wv2q2z.js +2 -0
- package/dist/{chunk-aqvh8wx5.js → chunk-f39xf08q.js} +5 -5
- package/dist/chunk-fdq4ryhv.js +2 -0
- package/dist/{chunk-d0dzzpfx.js → chunk-fg80w4zk.js} +2 -2
- package/dist/{chunk-9xps62ek.js → chunk-fm8gfj2g.js} +2 -2
- package/dist/{chunk-a9tzjqny.js → chunk-fs5mshcs.js} +5 -5
- package/dist/chunk-fw7va7h4.js +2 -0
- package/dist/{chunk-d5ryynr2.js → chunk-ge54kqfy.js} +5 -5
- package/dist/chunk-gfcgtxnb.js +2 -0
- package/dist/{chunk-0kwpehta.js → chunk-gspxyygw.js} +4 -4
- package/dist/chunk-gvf0g8nf.js +2 -0
- package/dist/{chunk-97k72dfh.js → chunk-hc1f1yq8.js} +1 -1
- package/dist/{chunk-d6z2v5k7.js → chunk-hnhq2f69.js} +2 -2
- package/dist/{chunk-fp4291zm.js → chunk-hp3n1b9r.js} +3 -3
- package/dist/chunk-hpw6hq7p.js +2 -0
- package/dist/chunk-jabw4ck5.js +3 -0
- package/dist/{chunk-f1hkagxk.js → chunk-jf0a5ew8.js} +2 -2
- package/dist/{chunk-41s4jpkx.js → chunk-jfm28sz3.js} +4 -4
- package/dist/{chunk-5xvxrnfh.js → chunk-jn8jny22.js} +2 -2
- package/dist/chunk-jv2z9qb7.js +2 -0
- package/dist/chunk-k609nyan.js +2 -0
- package/dist/{chunk-q0s0kc66.js → chunk-ka5ea34g.js} +2 -2
- package/dist/{chunk-wf2h75wp.js → chunk-kaxsavhg.js} +5 -5
- package/dist/{chunk-2j5yane9.js → chunk-kxj5sp5w.js} +2 -2
- package/dist/chunk-kxydr8z4.js +2 -0
- package/dist/{chunk-2axvk5t9.js → chunk-m95pk7fk.js} +12 -12
- package/dist/chunk-mjhhvf6e.js +2 -0
- package/dist/{chunk-zvy88beh.js → chunk-mnt7jbek.js} +3 -3
- package/dist/chunk-n4c8srx8.js +2 -0
- package/dist/{chunk-23r3rby6.js → chunk-n91sm385.js} +2 -2
- package/dist/{chunk-4657mnht.js → chunk-ncrrxp60.js} +4 -4
- package/dist/chunk-nfxd6y75.js +2 -0
- package/dist/{chunk-vv71k945.js → chunk-nrn44374.js} +5 -5
- package/dist/{chunk-xmsf1bnx.js → chunk-ntg8ttm4.js} +3 -3
- package/dist/chunk-nv0hnx9x.js +2 -0
- package/dist/{chunk-zg44cf8a.js → chunk-pdzt72p8.js} +13 -13
- package/dist/{chunk-bp918end.js → chunk-py5x8fkq.js} +2 -2
- package/dist/{chunk-qca4e1ms.js → chunk-pz1y8krt.js} +63 -63
- package/dist/{chunk-j2vyhw8e.js → chunk-qg3hp77v.js} +2 -2
- package/dist/chunk-qtfj8z5d.js +2 -0
- package/dist/{chunk-1b1ntgt7.js → chunk-qz18x7f0.js} +1 -1
- package/dist/{chunk-ca3c5qx2.js → chunk-r3jf8v5a.js} +31 -31
- package/dist/{chunk-kd6r7z27.js → chunk-r4jwhy37.js} +2 -2
- package/dist/{chunk-xjk5sxkz.js → chunk-r7tr5dvd.js} +8 -8
- package/dist/chunk-r8pkv9s1.js +2 -0
- package/dist/{chunk-w2btre0d.js → chunk-rdmm3zvb.js} +4 -4
- package/dist/{chunk-x110ssw2.js → chunk-rpapxkdm.js} +3 -3
- package/dist/chunk-rrj3gv46.js +3 -0
- package/dist/{chunk-hamc1fmd.js → chunk-rs6evw29.js} +10 -10
- package/dist/{chunk-2fj5zev7.js → chunk-sw0e1sad.js} +1 -1
- package/dist/chunk-tp67ka3x.js +2 -0
- package/dist/{chunk-bq7qcndg.js → chunk-tpyk6b4c.js} +2 -2
- package/dist/{chunk-dgn87554.js → chunk-tzdwg9rw.js} +2 -2
- package/dist/chunk-vkrxrt0a.js +2 -0
- package/dist/chunk-vwyxvjnh.js +2 -0
- package/dist/chunk-vytbqwaz.js +3 -0
- package/dist/chunk-vzpbxgg7.js +2 -0
- package/dist/{chunk-fhkdkpca.js → chunk-wyprsedf.js} +4 -4
- package/dist/{chunk-x4f7efgp.js → chunk-x0dx1pyf.js} +3 -3
- package/dist/chunk-xrhr7dmv.js +2 -0
- package/dist/chunk-xvd3vdrw.js +2 -0
- package/dist/chunk-xvtp7nyj.js +2 -0
- package/dist/chunk-xy45tx27.js +2 -0
- package/dist/{chunk-k1jfzzqz.js → chunk-y4j82p7j.js} +6 -6
- package/dist/{chunk-rze2qphx.js → chunk-y7rdw6td.js} +2 -2
- package/dist/chunk-y8nx9aa6.js +709 -0
- package/dist/{chunk-vcx6dy59.js → chunk-yhzakgpp.js} +1 -1
- package/dist/chunk-z3qgv971.js +2 -0
- package/dist/chunk-z8qdhn60.js +2 -0
- package/dist/chunk-zfmcbhv2.js +2 -0
- package/dist/{chunk-kk66r2me.js → chunk-zjek9py2.js} +7 -7
- package/dist/chunk-zwzbcz37.js +2 -0
- package/dist/cli.js +20 -20
- package/dist/config.js +9 -4
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/expressions.d.ts +39 -9
- package/dist/expressions.js +36 -5
- package/dist/native/compiler/render-screen.js +2 -1
- package/dist/process.js +2 -2
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +6 -6
- package/dist/utils.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-02cntwd8.js +0 -2
- package/dist/chunk-1z5mj5m5.js +0 -2
- package/dist/chunk-2pgc087j.js +0 -2
- package/dist/chunk-32mf97nv.js +0 -2
- package/dist/chunk-37ad1ewp.js +0 -2
- package/dist/chunk-41sh9y5w.js +0 -2
- package/dist/chunk-4654xm1h.js +0 -2
- package/dist/chunk-4eagsz5d.js +0 -2
- package/dist/chunk-5t93dqft.js +0 -2
- package/dist/chunk-7hf37fqp.js +0 -2
- package/dist/chunk-7m0r7mq9.js +0 -2
- package/dist/chunk-7vhm0jj5.js +0 -3
- package/dist/chunk-86dq5z6j.js +0 -2
- package/dist/chunk-8c363c2r.js +0 -2
- package/dist/chunk-8w0n2rae.js +0 -2
- package/dist/chunk-8ye89bw9.js +0 -2
- package/dist/chunk-b0fkvrat.js +0 -2
- package/dist/chunk-b6w3457c.js +0 -2
- package/dist/chunk-b85ss74r.js +0 -3
- package/dist/chunk-bbza2wrb.js +0 -2
- package/dist/chunk-bqb9neap.js +0 -2
- package/dist/chunk-c18pafmf.js +0 -3
- package/dist/chunk-cnqhbdsx.js +0 -2
- package/dist/chunk-d1b7h0n5.js +0 -2
- package/dist/chunk-d44g9sek.js +0 -2
- package/dist/chunk-d5vr9g4b.js +0 -2
- package/dist/chunk-dpmr4sym.js +0 -2
- package/dist/chunk-e8dnsaxj.js +0 -2
- package/dist/chunk-eajm1dj6.js +0 -2
- package/dist/chunk-edb768c0.js +0 -2
- package/dist/chunk-ep17rnxb.js +0 -2
- package/dist/chunk-gaxx0z19.js +0 -2
- package/dist/chunk-gft9pg9n.js +0 -2
- package/dist/chunk-h8h79939.js +0 -2
- package/dist/chunk-hn6yd2az.js +0 -2
- package/dist/chunk-hnh12d0y.js +0 -2
- package/dist/chunk-hvd3hxs4.js +0 -2
- package/dist/chunk-j2z7prcv.js +0 -709
- package/dist/chunk-jap212a4.js +0 -3
- package/dist/chunk-jten8e2c.js +0 -2
- package/dist/chunk-jxxyz9yp.js +0 -2
- package/dist/chunk-ksc83y9t.js +0 -2
- package/dist/chunk-m33na5j5.js +0 -2
- package/dist/chunk-n7pvz99f.js +0 -2
- package/dist/chunk-nhk0aat9.js +0 -2
- package/dist/chunk-pjkdn8zf.js +0 -2
- package/dist/chunk-q88w2rv9.js +0 -2
- package/dist/chunk-r5bhgyes.js +0 -2
- package/dist/chunk-rmc6dfj4.js +0 -2
- package/dist/chunk-rwx9aby2.js +0 -2
- package/dist/chunk-rzfbffnv.js +0 -2
- package/dist/chunk-sv2d6nfe.js +0 -2
- package/dist/chunk-v3ccft8t.js +0 -2
- package/dist/chunk-vxzsspgc.js +0 -2
- package/dist/chunk-x5wkbcsf.js +0 -2
- package/dist/chunk-y0zhfyw4.js +0 -2
- package/dist/chunk-y64qhgv1.js +0 -2
- package/dist/chunk-y92nkb7x.js +0 -2
- package/dist/chunk-ya7m4wgr.js +0 -2
- package/dist/chunk-yecjczcy.js +0 -2
- package/dist/chunk-yjskeqaj.js +0 -2
- package/dist/chunk-yxqzarzh.js +0 -2
- package/dist/chunk-z4g64re8.js +0 -3
- package/dist/chunk-zay0083s.js +0 -2
package/dist/craft-entry.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-y8nx9aa6.js";import{_o,ka,_a}from"./chunk-ntg8ttm4.js";import"./chunk-r3jf8v5a.js";import"./chunk-756bf5nt.js";import"./chunk-n91sm385.js";import"./chunk-zjqvbcwa.js";import"./chunk-47n5s7wk.js";import"./chunk-cjm92sfd.js";import"./chunk-9mtyxvhk.js";import"./chunk-kxj5sp5w.js";import"./chunk-pz1y8krt.js";import"./chunk-pdzt72p8.js";import"./chunk-ncrrxp60.js";import"./chunk-y7rdw6td.js";import"./chunk-zjek9py2.js";import"./chunk-58pc09a1.js";import"./chunk-nrn44374.js";import"./chunk-ast5jmcg.js";import"./chunk-r7tr5dvd.js";import"./chunk-ge54kqfy.js";import"./chunk-4dxq7ft1.js";import"./chunk-fm8gfj2g.js";import{yu,Ca,kh,_h,Ea,Co,es,Ta,$a,Ch,Eh,Ra,Aa,Pa,Ia}from"./chunk-m95pk7fk.js";import"./chunk-wyprsedf.js";import"./chunk-vytbqwaz.js";import"./chunk-qz18x7f0.js";import"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-hp3n1b9r.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
|
|
3
3
|
`),scripts:t.scripts.join(`
|
|
4
4
|
`),metadata:{renderTime:0,cacheHit:!0,totalSize:c.html.length,componentCount:t.metadata.componentCount}}}let a;if(n.streaming)a=await H(t.tree,e);else a=h(t.tree,e);let i;if(n.hydrate){let o=j(a,t,e);a=o.html,i=o.data}if(n.minify)a=D(a);if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`;d.set(o,{html:a,timestamp:Date.now()})}let s=performance.now()-r;return{html:a,styles:t.styles.join(`
|
|
5
5
|
`),scripts:t.scripts.join(`
|
|
6
6
|
`),hydrationData:i,metadata:{renderTime:s,cacheHit:!1,totalSize:a.length,componentCount:t.metadata.componentCount}}}function V(t,e){let n=[],r=[],a=[],i=new Map,s=[];return y(t.tree,(o,c)=>{if(o.type==="component"&&o.componentName){if(T(o.componentName))n.push(o.componentName)}if(o.type==="element"&&o.tag){let p=J(o);if(p)s.push(p);if(o.props){for(let[l,f]of Object.entries(o.props))if(l.startsWith("on")&&typeof f==="string"){let g=`handler_${i.size}`;i.set(g,f)}}}if(o.isStatic&&o.type==="element")r.push(b(o));else if(!o.isStatic&&o.type!=="text")a.push(o.tag||o.componentName||"unknown")}),{nativeComponents:n,staticHTML:r,dynamicParts:a,eventHandlers:i,nativeWidgets:s}}function Y(t,e={}){let n=R(t),r=P(n,e),a=new Map,i=[];return y(n.tree,(s)=>{if(s.type==="component"&&s.componentName){if(T(s.componentName)){i.push(s.componentName);let o=`<!--craft:${s.componentName}:${s.hydrationKey||"default"}-->`;a.set(s.hydrationKey||s.componentName,o)}}}),{staticHTML:r,dynamicPlaceholders:a,craftComponents:i}}function M(t){let e={type:"fragment",children:[]},n=e,r=[e],a=t,i=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);while(a.length>0){let s=a.match(/^<(@?[\w-]+)([^>]*)>/);if(s){let[p,l,f]=s,g=z(f),u=l.startsWith("@craft-"),C=u?l:l.toLowerCase(),S={type:u?"component":"element",tag:C,props:g,children:[],componentName:u?C.slice(1):void 0,isStatic:!v(f),hydrationKey:F()};if(n.children=n.children||[],n.children.push(S),!i.has(C)&&!f.endsWith("/"))r.push(S),n=S;a=a.slice(p.length);continue}let o=a.match(/^<\/(@?[\w-]+)>/);if(o){let[p,l]=o,g=l.startsWith("@craft-")?l:l.toLowerCase();while(r.length>1){let u=r.pop();if(n=r[r.length-1],u.tag===g)break}a=a.slice(p.length);continue}let c=a.match(/^[^<]+/);if(c){let p=c[0];if(p.trim()){let l={type:"text",text:p,isStatic:!v(p)};n.children=n.children||[],n.children.push(l)}a=a.slice(p.length);continue}a=a.slice(1)}return e}function z(t){let e={},n=/([\w-:@]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S+)))?/g,r;while((r=n.exec(t))!==null){let[,a,i,s,o]=r,c=i??s??o??!0;e[a]=c}return e}function y(t,e,n=[]){if(e(t,n),t.children)t.children.forEach((r,a)=>{y(r,e,[...n,`${a}`])})}function h(t,e){switch(t.type){case"text":return x(t.text||"",e);case"element":case"component":{let n=t.tag||"div",r=N(t.props||{},e),a=(t.children||[]).map((i)=>h(i,e)).join("");if(!t.children||t.children.length===0){if(["input","br","hr","img","meta","link"].includes(n))return`<${n}${r} />`}return`<${n}${r}>${a}</${n}>`}case"fragment":return(t.children||[]).map((n)=>h(n,e)).join("");case"slot":return`<!--slot:${t.slotName||"default"}-->`;default:return""}}function b(t){if(t.type==="text")return t.text||"";let e=t.tag||"div",n=N(t.props||{},{});return`<${e}${n}></${e}>`}function N(t,e){let n=[];for(let[r,a]of Object.entries(t))if(a===!0)n.push(` ${r}`);else if(a!==!1&&a!==null&&a!==void 0){let i=x(String(a),e);n.push(` ${r}="${k(i)}"`)}return n.join("")}async function H(t,e){return h(t,e)}function P(t,e){let n=[];return y(t.tree,(r)=>{if(r.isStatic)n.push(h(r,e))}),n.join("")}function j(t,e,n){let r={templateId:e.id,context:n,dynamicParts:Array.from(e.dynamicParts.entries())},a=`
|
|
7
7
|
<script data-craft-hydration>
|
|
8
8
|
window.__CRAFT_HYDRATION__ = ${JSON.stringify(r)};
|
|
9
|
-
</script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{
|
|
9
|
+
</script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{yu as CRAFT_BRIDGE_SCRIPT,Co as CRAFT_COMPONENTS,Ta as CRAFT_COMPONENT_RUNTIME,es as CRAFT_COMPONENT_STYLES,_o as NATIVE_COMPONENTS,Ra as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,ka as compileToNative,_a as createHotReloadServer,Aa as findCraftBinary,Ca as generateCraftBridgeScript,V as generateCraftOptimizations,Ia as getAvailableFormats,Pa as getAvailableTargets,Eh as getCraftComponents,G as getSSRCacheStats,Ea as injectCraftBridge,kh as isCraftEnvironment,Y as prerenderForCraft,$a as processCraftComponents,_h as processCraftDirective,Ch as registerCraftComponent,Q as renderSSR};
|
package/dist/craft.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-y8nx9aa6.js";import{_o,ka,_a}from"./chunk-ntg8ttm4.js";import"./chunk-r3jf8v5a.js";import"./chunk-756bf5nt.js";import"./chunk-n91sm385.js";import"./chunk-zjqvbcwa.js";import"./chunk-47n5s7wk.js";import"./chunk-cjm92sfd.js";import"./chunk-9mtyxvhk.js";import"./chunk-kxj5sp5w.js";import"./chunk-pz1y8krt.js";import"./chunk-pdzt72p8.js";import"./chunk-ncrrxp60.js";import"./chunk-y7rdw6td.js";import"./chunk-zjek9py2.js";import"./chunk-58pc09a1.js";import"./chunk-nrn44374.js";import"./chunk-ast5jmcg.js";import"./chunk-r7tr5dvd.js";import"./chunk-ge54kqfy.js";import"./chunk-4dxq7ft1.js";import"./chunk-fm8gfj2g.js";import{yu,Ca,kh,_h,Ea,Co,es,Ta,$a,Ch,Eh,Ra,Aa,Pa,Ia}from"./chunk-m95pk7fk.js";import"./chunk-wyprsedf.js";import"./chunk-vytbqwaz.js";import"./chunk-qz18x7f0.js";import"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-hp3n1b9r.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
|
|
3
3
|
`),scripts:t.scripts.join(`
|
|
4
4
|
`),metadata:{renderTime:0,cacheHit:!0,totalSize:c.html.length,componentCount:t.metadata.componentCount}}}let a;if(n.streaming)a=await H(t.tree,e);else a=h(t.tree,e);let i;if(n.hydrate){let o=j(a,t,e);a=o.html,i=o.data}if(n.minify)a=D(a);if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`;d.set(o,{html:a,timestamp:Date.now()})}let s=performance.now()-r;return{html:a,styles:t.styles.join(`
|
|
5
5
|
`),scripts:t.scripts.join(`
|
|
6
6
|
`),hydrationData:i,metadata:{renderTime:s,cacheHit:!1,totalSize:a.length,componentCount:t.metadata.componentCount}}}function V(t,e){let n=[],r=[],a=[],i=new Map,s=[];return y(t.tree,(o,c)=>{if(o.type==="component"&&o.componentName){if(T(o.componentName))n.push(o.componentName)}if(o.type==="element"&&o.tag){let p=J(o);if(p)s.push(p);if(o.props){for(let[l,f]of Object.entries(o.props))if(l.startsWith("on")&&typeof f==="string"){let g=`handler_${i.size}`;i.set(g,f)}}}if(o.isStatic&&o.type==="element")r.push(b(o));else if(!o.isStatic&&o.type!=="text")a.push(o.tag||o.componentName||"unknown")}),{nativeComponents:n,staticHTML:r,dynamicParts:a,eventHandlers:i,nativeWidgets:s}}function Y(t,e={}){let n=R(t),r=P(n,e),a=new Map,i=[];return y(n.tree,(s)=>{if(s.type==="component"&&s.componentName){if(T(s.componentName)){i.push(s.componentName);let o=`<!--craft:${s.componentName}:${s.hydrationKey||"default"}-->`;a.set(s.hydrationKey||s.componentName,o)}}}),{staticHTML:r,dynamicPlaceholders:a,craftComponents:i}}function M(t){let e={type:"fragment",children:[]},n=e,r=[e],a=t,i=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);while(a.length>0){let s=a.match(/^<(@?[\w-]+)([^>]*)>/);if(s){let[p,l,f]=s,g=z(f),u=l.startsWith("@craft-"),C=u?l:l.toLowerCase(),S={type:u?"component":"element",tag:C,props:g,children:[],componentName:u?C.slice(1):void 0,isStatic:!v(f),hydrationKey:F()};if(n.children=n.children||[],n.children.push(S),!i.has(C)&&!f.endsWith("/"))r.push(S),n=S;a=a.slice(p.length);continue}let o=a.match(/^<\/(@?[\w-]+)>/);if(o){let[p,l]=o,g=l.startsWith("@craft-")?l:l.toLowerCase();while(r.length>1){let u=r.pop();if(n=r[r.length-1],u.tag===g)break}a=a.slice(p.length);continue}let c=a.match(/^[^<]+/);if(c){let p=c[0];if(p.trim()){let l={type:"text",text:p,isStatic:!v(p)};n.children=n.children||[],n.children.push(l)}a=a.slice(p.length);continue}a=a.slice(1)}return e}function z(t){let e={},n=/([\w-:@]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S+)))?/g,r;while((r=n.exec(t))!==null){let[,a,i,s,o]=r,c=i??s??o??!0;e[a]=c}return e}function y(t,e,n=[]){if(e(t,n),t.children)t.children.forEach((r,a)=>{y(r,e,[...n,`${a}`])})}function h(t,e){switch(t.type){case"text":return x(t.text||"",e);case"element":case"component":{let n=t.tag||"div",r=N(t.props||{},e),a=(t.children||[]).map((i)=>h(i,e)).join("");if(!t.children||t.children.length===0){if(["input","br","hr","img","meta","link"].includes(n))return`<${n}${r} />`}return`<${n}${r}>${a}</${n}>`}case"fragment":return(t.children||[]).map((n)=>h(n,e)).join("");case"slot":return`<!--slot:${t.slotName||"default"}-->`;default:return""}}function b(t){if(t.type==="text")return t.text||"";let e=t.tag||"div",n=N(t.props||{},{});return`<${e}${n}></${e}>`}function N(t,e){let n=[];for(let[r,a]of Object.entries(t))if(a===!0)n.push(` ${r}`);else if(a!==!1&&a!==null&&a!==void 0){let i=x(String(a),e);n.push(` ${r}="${k(i)}"`)}return n.join("")}async function H(t,e){return h(t,e)}function P(t,e){let n=[];return y(t.tree,(r)=>{if(r.isStatic)n.push(h(r,e))}),n.join("")}function j(t,e,n){let r={templateId:e.id,context:n,dynamicParts:Array.from(e.dynamicParts.entries())},a=`
|
|
7
7
|
<script data-craft-hydration>
|
|
8
8
|
window.__CRAFT_HYDRATION__ = ${JSON.stringify(r)};
|
|
9
|
-
</script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{
|
|
9
|
+
</script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{yu as CRAFT_BRIDGE_SCRIPT,Co as CRAFT_COMPONENTS,Ta as CRAFT_COMPONENT_RUNTIME,es as CRAFT_COMPONENT_STYLES,_o as NATIVE_COMPONENTS,Ra as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,ka as compileToNative,_a as createHotReloadServer,Aa as findCraftBinary,Ca as generateCraftBridgeScript,V as generateCraftOptimizations,Ia as getAvailableFormats,Pa as getAvailableTargets,Eh as getCraftComponents,G as getSSRCacheStats,Ea as injectCraftBridge,kh as isCraftEnvironment,Y as prerenderForCraft,$a as processCraftComponents,_h as processCraftDirective,Ch as registerCraftComponent,Q as renderSSR};
|
package/dist/expressions.d.ts
CHANGED
|
@@ -39,14 +39,6 @@ export declare function getAllFilters(): Record<string, FilterFunction>;
|
|
|
39
39
|
* Clear all custom filters (useful for testing)
|
|
40
40
|
*/
|
|
41
41
|
export declare function clearCustomFilters(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Replace every `{{ expr }}` span in `input`, each read whole by
|
|
44
|
-
* findMustacheEnd.
|
|
45
|
-
*
|
|
46
|
-
* `replacer` receives what String.replace passed before: the full matched text,
|
|
47
|
-
* the expression between the braces, and the offset of the match in `input`.
|
|
48
|
-
* An unterminated `{{` is left alone, as the old lazy regex also left it.
|
|
49
|
-
*/
|
|
50
42
|
export declare function replaceInterpolations(input: string, replacer: (match: string, expr: string, offset: number) => string, braces?: number): string;
|
|
51
43
|
/**
|
|
52
44
|
* HTML escape function to prevent XSS
|
|
@@ -128,9 +120,22 @@ export declare function interpolateScriptAttributes(attrs: string, context: Reco
|
|
|
128
120
|
*/
|
|
129
121
|
export declare function interpolateScriptsInTemplate(template: string, context: Record<string, any>, options?: InterpolateScriptsOptions): string;
|
|
130
122
|
/**
|
|
131
|
-
*
|
|
123
|
+
* The expression pass as every nested caller uses it: one uninterrupted sweep.
|
|
124
|
+
*
|
|
125
|
+
* `@for` renders through a loop generated by `new Function`, which calls back
|
|
126
|
+
* synchronously and reads the callback's return value to decide whether to
|
|
127
|
+
* break, so this entry point cannot become async without rewriting that.
|
|
132
128
|
*/
|
|
133
129
|
export declare function processExpressions(template: string, context: Record<string, any>, filePath: string): string;
|
|
130
|
+
/**
|
|
131
|
+
* The same pass, for the one caller that renders a whole document and can
|
|
132
|
+
* afford to return to the event loop while doing it (stacksjs/stx#2176).
|
|
133
|
+
*
|
|
134
|
+
* The output is the sweep's own, unchanged: dividing a scan is not the same as
|
|
135
|
+
* dividing a document, and every offset and scope the replacer reads still
|
|
136
|
+
* describes the whole string.
|
|
137
|
+
*/
|
|
138
|
+
export declare function processExpressionsChunked(template: string, context: Record<string, any>, filePath: string, yieldAfterMs?: number): Promise<string>;
|
|
134
139
|
/**
|
|
135
140
|
* Apply filters to a value
|
|
136
141
|
*/
|
|
@@ -204,4 +209,29 @@ export declare interface ExpressionRejection {
|
|
|
204
209
|
*/
|
|
205
210
|
// eslint-disable-next-line pickier/no-unused-vars
|
|
206
211
|
export type FilterFunction = (value: any, context: Record<string, any>, ...args: any[]) => any;
|
|
212
|
+
/**
|
|
213
|
+
* Replace every `{{ expr }}` span in `input`, each read whole by
|
|
214
|
+
* findMustacheEnd.
|
|
215
|
+
*
|
|
216
|
+
* `replacer` receives what String.replace passed before: the full matched text,
|
|
217
|
+
* the expression between the braces, and the offset of the match in `input`.
|
|
218
|
+
* An unterminated `{{` is left alone, as the old lazy regex also left it.
|
|
219
|
+
*/
|
|
220
|
+
/**
|
|
221
|
+
* A pass that can be driven to completion synchronously, or a chunk at a time.
|
|
222
|
+
*
|
|
223
|
+
* The scan below is one uninterrupted sweep, and on a page whose interpolations
|
|
224
|
+
* are not inside a loop that is the whole render: 20,000 of them cost about
|
|
225
|
+
* 1.3 seconds with 80-85% of it in a single stretch, during which the server
|
|
226
|
+
* answers nothing (stacksjs/stx#2176). A `@foreach` page is already divided
|
|
227
|
+
* into thousands of per-iteration pieces, which is why only the loop-free shape
|
|
228
|
+
* shows it.
|
|
229
|
+
*
|
|
230
|
+
* Dividing the SCAN rather than the document is what keeps this safe. Every
|
|
231
|
+
* offset the replacer receives is still an offset into the whole string, and
|
|
232
|
+
* the loop and slot scopes it consults are still computed over the whole
|
|
233
|
+
* string, so nothing about which expressions are evaluated or preserved
|
|
234
|
+
* changes -- only where the sweep is allowed to pause.
|
|
235
|
+
*/
|
|
236
|
+
declare type ChunkedPass<T> = Generator<void, T, void>;
|
|
207
237
|
export { findMustacheEnd } from './mustache-span';
|
package/dist/expressions.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { yieldDuringRendering } from "./performance-utils.js";
|
|
1
2
|
import { findMustacheEnd } from "./mustache-span.js";
|
|
2
3
|
export { findMustacheEnd } from "./mustache-span.js";
|
|
3
4
|
import fs from "node:fs";
|
|
@@ -243,11 +244,17 @@ export function clearCustomFilters() {
|
|
|
243
244
|
for (const key of Object.keys(customFilters))
|
|
244
245
|
delete customFilters[key];
|
|
245
246
|
}
|
|
246
|
-
|
|
247
|
+
function runToCompletion(pass) {
|
|
248
|
+
let step = pass.next();
|
|
249
|
+
while (!step.done)
|
|
250
|
+
step = pass.next();
|
|
251
|
+
return step.value;
|
|
252
|
+
}
|
|
253
|
+
function* replaceInterpolationsPass(input, replacer, braces, yieldAfterMs) {
|
|
247
254
|
const opener = "{".repeat(braces);
|
|
248
255
|
if (!input.includes(opener))
|
|
249
256
|
return input;
|
|
250
|
-
let output = "", cursor = 0;
|
|
257
|
+
let output = "", cursor = 0, sinceCheck = 0, lastPause = yieldAfterMs === Number.POSITIVE_INFINITY ? 0 : performance.now();
|
|
251
258
|
for (;; ) {
|
|
252
259
|
const open = input.indexOf(opener, cursor);
|
|
253
260
|
if (open === -1)
|
|
@@ -257,9 +264,20 @@ export function replaceInterpolations(input, replacer, braces = 2) {
|
|
|
257
264
|
break;
|
|
258
265
|
output += input.slice(cursor, open) + replacer(input.slice(open, close + braces), input.slice(open + braces, close), open);
|
|
259
266
|
cursor = close + braces;
|
|
267
|
+
if (++sinceCheck >= 64) {
|
|
268
|
+
sinceCheck = 0;
|
|
269
|
+
const now = performance.now();
|
|
270
|
+
if (now - lastPause >= yieldAfterMs) {
|
|
271
|
+
lastPause = now;
|
|
272
|
+
yield;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
260
275
|
}
|
|
261
276
|
return cursor === 0 ? input : output + input.slice(cursor);
|
|
262
277
|
}
|
|
278
|
+
export function replaceInterpolations(input, replacer, braces = 2) {
|
|
279
|
+
return runToCompletion(replaceInterpolationsPass(input, replacer, braces, Number.POSITIVE_INFINITY));
|
|
280
|
+
}
|
|
263
281
|
function isBraceLiteralInBinding(source, offset, expr) {
|
|
264
282
|
const quote = expr[0];
|
|
265
283
|
if (quote !== "'" && quote !== '"' && quote !== "`")
|
|
@@ -571,7 +589,7 @@ export function interpolateScriptsInTemplate(template, context, options = {}) {
|
|
|
571
589
|
});
|
|
572
590
|
return restoreStashedScripts(output, interpolatedScripts);
|
|
573
591
|
}
|
|
574
|
-
|
|
592
|
+
function* processExpressionsPass(template, context, filePath, yieldAfterMs) {
|
|
575
593
|
let output = template;
|
|
576
594
|
const styleMatcher = (html, i) => {
|
|
577
595
|
const end = matchStyleElement(html, i);
|
|
@@ -622,7 +640,7 @@ export function processExpressions(template, context, filePath) {
|
|
|
622
640
|
...scope,
|
|
623
641
|
names: new Set(loopBoundNames(`${scope.binding} in __slot`))
|
|
624
642
|
})), enclosingLoopNames = new Set(inheritedClientLoopNames(context));
|
|
625
|
-
output =
|
|
643
|
+
output = yield* replaceInterpolationsPass(output, (match, expr, offset) => {
|
|
626
644
|
const trimmedExpr = expr.trim();
|
|
627
645
|
if (isBraceLiteralInBinding(output, offset, expr))
|
|
628
646
|
return match;
|
|
@@ -666,13 +684,26 @@ export function processExpressions(template, context, filePath) {
|
|
|
666
684
|
const msg = error instanceof Error ? error.message : String(error);
|
|
667
685
|
return createDetailedErrorMessage("Expression", `Error evaluating: {{ ${trimmedExpr} }}: ${msg}`, filePath, template, offset, match);
|
|
668
686
|
}
|
|
669
|
-
});
|
|
687
|
+
}, 2, yieldAfterMs);
|
|
670
688
|
if (scriptBlocks.length > 0)
|
|
671
689
|
output = output.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g, (match, i) => scriptBlocks[Number(i)] ?? match);
|
|
672
690
|
if (styleBlocks.length > 0)
|
|
673
691
|
output = output.replace(/<!--__STX_STYLE_(\d+)__-->/g, (match, i) => styleBlocks[Number(i)] ?? match);
|
|
674
692
|
return output;
|
|
675
693
|
}
|
|
694
|
+
export function processExpressions(template, context, filePath) {
|
|
695
|
+
return runToCompletion(processExpressionsPass(template, context, filePath, Number.POSITIVE_INFINITY));
|
|
696
|
+
}
|
|
697
|
+
const DOCUMENT_YIELD_AFTER_MS = 100;
|
|
698
|
+
export async function processExpressionsChunked(template, context, filePath, yieldAfterMs = DOCUMENT_YIELD_AFTER_MS) {
|
|
699
|
+
const pass = processExpressionsPass(template, context, filePath, yieldAfterMs);
|
|
700
|
+
let step = pass.next();
|
|
701
|
+
while (!step.done) {
|
|
702
|
+
await yieldDuringRendering();
|
|
703
|
+
step = pass.next();
|
|
704
|
+
}
|
|
705
|
+
return step.value;
|
|
706
|
+
}
|
|
676
707
|
export function applyFilters(value, filterExpression, context) {
|
|
677
708
|
if (!filterExpression.trim())
|
|
678
709
|
return value;
|
|
@@ -27,7 +27,8 @@ export async function compileScreenSource(source, filePath, options = {}) {
|
|
|
27
27
|
_targetComponentFallbackNames: ["Button", "Checkbox", "Switch", "TextInput", "Image", "Video"],
|
|
28
28
|
_nativeHostAttrs: !0,
|
|
29
29
|
skipEventDirectives: !0,
|
|
30
|
-
_pluginComponentDirs: loaded._pluginComponentDirs ?? []
|
|
30
|
+
_pluginComponentDirs: loaded._pluginComponentDirs ?? [],
|
|
31
|
+
_componentPackageDirs: loaded._componentPackageDirs ?? []
|
|
31
32
|
}, context = { ...options.context ?? {}, __stx_inject_css: !1, __stx_native_screen: !0 }, dependencies = new Set([filePath]), renderedHtml = await processDirectives(source, context, filePath, config, dependencies), chromeDiagnostics = [], { html: content, chrome } = await extractLayoutChrome(await excludeNativeSubtrees(renderedHtml), (name) => {
|
|
32
33
|
chromeDiagnostics.push({ kind: "unknown-icon", tag: "data-native-chrome", name });
|
|
33
34
|
}), { html, manifest } = extractBindingManifest(await excludeNativeSubtrees(content)), theme = await appThemeCSS(root), { document, diagnostics } = await translateHtmlToDocument(theme ? `<style>${theme}</style>${html}` : html, {
|
package/dist/process.js
CHANGED
|
@@ -24,7 +24,7 @@ import { processCustomDirectives } from "./custom-directives.js";
|
|
|
24
24
|
import { processAppearanceBootstrapDirective } from "./appearance-bootstrap.js";
|
|
25
25
|
import { devHelpers, errorLogger, errorRecovery, safeExecuteAsync, StxRuntimeError, StxValidationError } from "./error-handling.js";
|
|
26
26
|
import { getHead as getHeadStatic } from "./head.js";
|
|
27
|
-
import { processExpressions, usesSignalsInScript } from "./expressions.js";
|
|
27
|
+
import { processExpressions, processExpressionsChunked, usesSignalsInScript } from "./expressions.js";
|
|
28
28
|
import { processBasicFormDirectives, processErrorDirective, processFormInputDirectives } from "./forms.js";
|
|
29
29
|
import { processTranslateDirective } from "./i18n.js";
|
|
30
30
|
import { processIncludes, processStackPushDirectives, processStackReplacements } from "./includes.js";
|
|
@@ -926,7 +926,7 @@ async function processOtherDirectives(template, context, filePath, options, depe
|
|
|
926
926
|
Prefer signals (state/derived/effect) for new components.`);
|
|
927
927
|
}
|
|
928
928
|
output = processServerBindings(output, context);
|
|
929
|
-
output = await
|
|
929
|
+
output = await processExpressionsChunked(output, context, filePath);
|
|
930
930
|
await yieldDuringRendering();
|
|
931
931
|
output = addCloakToUnresolvedExpressions(output);
|
|
932
932
|
output = addCloakToConditionalDirectives(output);
|
package/dist/pwa.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{no,
|
|
3
|
-
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-
|
|
2
|
+
import{no,Vt,El,Pg}from"./chunk-tzdwg9rw.js";import{to,Di,$g,Rg,Ag}from"./chunk-8g5dsjr0.js";import{kl,_l,Cl,Eg,Tg}from"./chunk-2ytaezad.js";import{We,An,Mi}from"./chunk-rk2ex6qx.js";import{Ig,Og,Ng,Dg,ro,yy}from"./chunk-8cahff21.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
|
|
3
|
+
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-vwyxvjnh.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
|
|
4
4
|
<html lang="en">
|
|
5
5
|
<head>
|
|
6
6
|
<meta charset="UTF-8">
|
|
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
|
|
|
233
233
|
}, 5000);
|
|
234
234
|
</script>
|
|
235
235
|
</body>
|
|
236
|
-
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=We(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=no(n,t);if(a){let s=
|
|
236
|
+
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=We(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=no(n,t);if(a){let s=Vt(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Di(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,_l as auditBuildOutput,kl as auditConfig,re as buildPwaAssets,Cl as calculateAuditResult,Tg as formatAuditResult,Mi as formatSize,j as generateManifest,_ as generateManifestJson,Rg as generateManifestLink,F as generateOfflinePage,We as generatePrecacheManifest,An as generatePrecacheManifestJs,M as generatePwaIcons,to as generatePwaTags,no as generateServiceWorker,Pg as generateServiceWorkerAuto,$g as generateSwRegistrationScript,Ag as generateThemeColorMeta,N as getExpectedIconPaths,Vt as getServiceWorkerFileName,Di as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,El as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,ro as pwaDirectives,Ig as pwaInstallDirective,Ng as pwaOfflineDirective,Dg as pwaPushDirective,Og as pwaUpdateDirective,yy as registerPwaDirectives,Eg as runPwaAudit,D as validateManifest};
|
package/dist/ssg.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-4y6hes3h.js";import{x,
|
|
3
|
-
`)}function J(t){return async()=>({paths:await t(),fallback:!1})}var Ot;function Lt(t){let r=s(t),{depths:n}=me(r),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,l;while((l=o.exec(r))!==null){if(n[l.index]!==0)continue;let u=x(r,"(",")",o.lastIndex-1),g=r.indexOf("{",u+1),v=x(r,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(l.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((l=e.exec(r))!==null){if(n[l.index]!==0)continue;let u=
|
|
2
|
+
import"./chunk-4y6hes3h.js";import{x,al}from"./chunk-756bf5nt.js";import"./chunk-n91sm385.js";import"./chunk-zjqvbcwa.js";import{At,y}from"./chunk-y8nx9aa6.js";import"./chunk-47n5s7wk.js";import"./chunk-cjm92sfd.js";import"./chunk-9mtyxvhk.js";import{_t,Ct,Et,Tt,$t,Rt}from"./chunk-kxj5sp5w.js";import{a}from"./chunk-pz1y8krt.js";import{$s}from"./chunk-pdzt72p8.js";import"./chunk-ncrrxp60.js";import"./chunk-9zjr0ty9.js";import{ye,tn,nn}from"./chunk-rdmm3zvb.js";import"./chunk-y7rdw6td.js";import{b}from"./chunk-zjek9py2.js";import{bt,i}from"./chunk-58pc09a1.js";import"./chunk-nrn44374.js";import"./chunk-ast5jmcg.js";import{ms}from"./chunk-r7tr5dvd.js";import"./chunk-ge54kqfy.js";import"./chunk-4dxq7ft1.js";import{tc,nc,rc}from"./chunk-02qbawwq.js";import{Qt,er,tr}from"./chunk-rrj3gv46.js";import{en}from"./chunk-jn8jny22.js";import"./chunk-vytbqwaz.js";import"./chunk-qz18x7f0.js";import{G,ve}from"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-hp3n1b9r.js";import{c}from"./chunk-bygxt820.js";import{s,me}from"./chunk-x0dx1pyf.js";import D from"fs";import f from"path";import{createHash as vt}from"crypto";function Pt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var kt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Dt(t){return Bun.hash(t).toString(16)}function ot(t,r={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let n=new Map,o=t.replace(kt,(e,u,g,v)=>{let w=v.trim();if(!w)return e;if(/\bdata-stx-src=/.test(g))return e;if(r.minify)w=Pt(w);let p=Dt(w);if(!n.has(p))n.set(p,w);let P=r.integrity?` data-stx-integrity="sha384-${vt("sha384").update(w).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),l=Array.from(n,([e,u])=>({hash:e,code:u}));return{html:o,chunks:l}}var It=new Set(["visible","idle"]);function ct(t){if(!t.includes("data-stx-src="))return t;let r=new Map,n=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=n.exec(t))!==null)r.set(o[1],o[2]);let l=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(It.has(r.get(u[1])||""))l.add(u[2]);let g=/<\/head\s*>/iy,v=y(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(l.size===0||v===-1)return t;let w=Array.from(l).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!w)return t;return t.slice(0,v)+w+t.slice(v)}var Bt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let r=t.trim();if(!r)return null;let n=/^https?:\/\//i.test(r)?r:`https://${r}`;try{return new URL(n).origin+new URL(n).pathname.replace(/\/$/,"")}catch{return null}}function jt(t){for(let r of Bt){let n=t[r];if(!n)continue;let o=X(n);if(o)return{url:o,source:"env",via:r}}return null}function lt(t){if(!t||typeof t!=="object")return null;let r=t,n=r.site?.url??r.url??r.app?.url;return typeof n==="string"?X(n):null}async function Ft(t){let{existsSync:r}=await import("fs"),n=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let l=n.resolve(t,o);if(!r(l))continue;try{let e=await import(l),u=lt(e.default??e);if(u)return u}catch{}}return null}async function ut(t={}){let r=t.cwd??process.cwd(),n=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let o=lt(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let l=await Ft(r);if(l)return{url:l,source:"site.config",via:"url"};let e=jt(n);if(e)return e;return{url:"http://localhost",source:"fallback"}}function dt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
|
|
3
|
+
`)}function J(t){return async()=>({paths:await t(),fallback:!1})}var Ot;function Lt(t){let r=s(t),{depths:n}=me(r),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,l;while((l=o.exec(r))!==null){if(n[l.index]!==0)continue;let u=x(r,"(",")",o.lastIndex-1),g=r.indexOf("{",u+1),v=x(r,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(l.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((l=e.exec(r))!==null){if(n[l.index]!==0)continue;let u=al(r,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function gt(t){let r="read";try{let n=await Bun.file(t).text();r="parse";let o=en(n),l=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(s(e.attrs))).sort((e,u)=>n.indexOf(e.fullTag)-n.indexOf(u.fullTag));for(let e of l){if(!/\bgetStaticPaths\b/.test(s(e.content)))continue;let u=(Ot??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(s(u)))continue;let g=Lt(u);if(/\bdefineStaticPaths\b/.test(s(g))&&At(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");r="execute";let v=Function("defineStaticPaths",`return (${g})`)(J);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let w=await v();r="result";let p=Array.isArray(w)?{paths:w}:w;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(n){return{kind:"error",phase:r,error:n instanceof Error?n:Error(String(n))}}}class pt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,r=""){this.cacheDir=t,this.salt=r}async load(){if(this.loaded)return;let t=f.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let r=JSON.parse(await Bun.file(t).text());for(let[n,o]of Object.entries(r))this.cache.set(n,o)}catch{}this.loaded=!0}async save(){await D.promises.mkdir(this.cacheDir,{recursive:!0});let t=f.join(this.cacheDir,"build-cache.json"),r={};for(let[n,o]of this.cache)r[n]=o;await Bun.write(t,JSON.stringify(r))}getHash(t,r){let n=D.statSync(t),o=`${this.salt}|${t}:${n.mtimeMs}`;for(let e of r)if(D.existsSync(e)){let u=D.statSync(e);o+=`:${e}:${u.mtimeMs}`}let l=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);l=(l<<5)-l+u,l=l&l}return Math.abs(l).toString(36)}get(t,r){let n=this.cache.get(t);if(!n)return null;let o=ft(r).some((u)=>D.existsSync(u)),l=[r,...n.dependencies??[]].some((u)=>u.endsWith(".stx")&&D.existsSync(u)&&ms(D.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||l)return this.cache.delete(t),null;let e=this.getHash(r,n.dependencies??[]);if(n.hash!==e)return this.cache.delete(t),null;return n.html}set(t,r,n,o){let l=this.getHash(r,n);this.cache.set(t,{hash:l,html:o,generatedAt:Date.now(),dependencies:n})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let r=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return f.join(this.cacheDir,"isr",r)}async get(t){let r=this.getFilePath(t);if(!await Bun.file(r).exists())return null;try{return JSON.parse(await Bun.file(r).text())}catch{return null}}async set(t,r){let n=this.getFilePath(t);await D.promises.mkdir(f.dirname(n),{recursive:!0}),await Bun.write(n,JSON.stringify(r))}async invalidate(t){let r=this.getFilePath(t);if(await Bun.file(r).exists())await D.promises.unlink(r)}async invalidatePattern(t){let r=f.join(this.cacheDir,"isr");if(!D.existsSync(r))return;let n=await D.promises.readdir(r);for(let o of n){let l=o.replace(/_/g,"/").replace(".json","");if(t.test(l))await D.promises.unlink(f.join(r,o))}}async needsRevalidation(t){let r=await this.get(t);if(!r)return!0;return Date.now()>r.revalidateAfter}}async function Ut(t){let r=[];if(!t.isDynamic)r.push({url:t.pattern,params:{}});else{let n=await gt(t.filePath);if(n.kind==="error")throw Error(`getStaticPaths ${n.phase} failed for ${t.pattern} (${t.filePath}): ${n.error.message}`,{cause:n.error});if(n.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),r;let o=n.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),r;for(let l of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(l.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);r.push({url:e,params:l.params,props:l.props,revalidate:l.revalidate})}}return r}function ft(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function Mt(t){for(let r of ft(t))if(await Bun.file(r).exists())try{let n=await import(r);if(typeof n.default==="function")return await n.default();else if(typeof n.default==="object")return n.default;else if(typeof n.getData==="function")return await n.getData();else{let{default:o,...l}=n;return l}}catch(n){console.error(`Error loading data file ${r}:`,n)}return null}async function Gt(t,r,n){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let l=o[1];if(!l.includes("getStaticProps"))return null;try{let e=l.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
|
|
4
4
|
return (async function getStaticProps() {
|
|
5
5
|
${e[1]}
|
|
6
6
|
})()
|
|
@@ -37,13 +37,13 @@ ${t.map((o)=>{let l=new URL(o.loc,r).href,e=` <url>
|
|
|
37
37
|
${n.join(`
|
|
38
38
|
`)}
|
|
39
39
|
</channel>
|
|
40
|
-
</rss>`}async function Vt(t={}){let r=Date.now();
|
|
40
|
+
</rss>`}async function Vt(t={}){let r=Date.now();nn();let n=await a(process.cwd()),o=n.build||{},l=await ut({explicit:t.domain||o.domain,stxConfig:n});if(l.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(dt());let e={router:t.router??n?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:l.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||n?.partialsDir||"",componentsDir:t.componentsDir||n?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,w={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&D.existsSync(e.outputDir))await D.promises.rm(e.outputDir,{recursive:!0});await D.promises.mkdir(e.outputDir,{recursive:!0});let E=e.cacheSalt;if(!E){let{resolveUserCssConfig:d,fingerprintConfig:m}=await import("./chunk-fdq4ryhv.js");try{E=m(await d(process.cwd()))}catch{}}let{prepareImageDelivery:S}=await import("./chunk-gfcgtxnb.js"),R=await S(e.publicDir,e.outputDir);if(R.count>0)console.log(`Optimized ${R.count} image(s) for responsive delivery`),E=[E,R.fingerprint].filter(Boolean).join(":");let A=new pt(e.cacheDir,E);if(e.cache)await A.load();try{let{generateCss:d}=await import("./chunk-fdq4ryhv.js");await d('<div class="bg-black"></div>')}catch{}_t();let wt=n?.routeMiddleware?.dir||"middleware";await Et(process.cwd(),wt);let V=Ct();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let yt=n?.routeMiddleware?.global||[];rc(n?.layoutsDir,c(process.cwd()));let Z=G(".",{pagesDir:e.pagesDir,pagesDirs:n?._layerPageDirs});console.log(`Found ${Z.length} routes`);let L=[];for(let d of Z)try{let m=await Ut(d);for(let k of m)L.push({route:d,url:k.url,params:k.params,props:k.props,revalidate:k.revalidate??e.revalidate})}catch(m){let k=m instanceof Error?m:Error(String(m));u.failedCount++,u.errors.push({route:d.pattern,error:k}),await e.hooks.onError?.(k,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,k)}u.totalPages=L.length+u.failedCount,console.log(`Generating ${L.length} pages...`);let U=[],Q=[];for(let d=0;d<L.length;d+=e.concurrency)Q.push(L.slice(d,d+e.concurrency));for(let d of Q)await Promise.all(d.map(async(m)=>{let{route:k,url:h,params:_,props:St,revalidate:rt}=m;try{await e.hooks.onPageStart?.(h);let M=await Bun.file(k.filePath).text(),T=Yt(M),xt=T?.middleware?Array.isArray(T.middleware)?T.middleware:[T.middleware]:[],nt=[...yt,...xt];if(nt.length>0){let B=Tt(h,_,T||{}),H=$t(B,null,void 0,{isServer:!0}),j=await Rt(nt,H);if(j.redirect){let C=typeof j.redirect==="string"?j.redirect:j.redirect.path||j.redirect,z=Zt(String(C),h),O=te(h,e);await D.promises.mkdir(f.dirname(O),{recursive:!0}),await Bun.write(O,z),u.successCount++,u.pages.push({route:h,outputPath:O,size:Buffer.byteLength(z),cached:!1}),U.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${C}`);return}if(j.abort){let C=typeof j.abort==="string"?j.abort:j.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${C}`);return}}let it=T?.validate;if(typeof it==="function")try{if(!await it({params:_})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let I=null,st=!1;if(e.cache){if(I=A.get(h,k.filePath),I)st=!0,u.cachedCount++}if(!I){let B=await mt(k,_,St,e,n);if(I=B.html,e.failOnIncludeError&&B.includeFailures.length>0)throw Error(`${B.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
|
41
41
|
${B.includeFailures.join(`
|
|
42
42
|
`)}
|
|
43
43
|
Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&B.serverScriptFailures.length>0)throw Error(`${B.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
|
|
44
44
|
${B.serverScriptFailures.join(`
|
|
45
45
|
`)}
|
|
46
|
-
Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)A.set(h,k.filePath,B.dependencies,I)}let N;if(e.trailingSlash)N=f.join(e.outputDir,h,"index.html");else N=h==="/"?f.join(e.outputDir,"index.html"):f.join(e.outputDir,`${h}.html`);if(e.chunkIslands){let{html:B,chunks:H}=ot(I,{integrity:e.integrityIslands,minify:e.minify});if(H.length>0){let j=f.join(e.outputDir,"_stx","islands");await D.promises.mkdir(j,{recursive:!0});for(let C of H){let z=f.join(j,`${C.hash}.js`);if(!await Bun.file(z).exists())await Bun.write(z,C.code);if(!g.has(C.hash)){g.add(C.hash);let O=Buffer.byteLength(C.code,"utf8");v+=O,w[C.hash]={bytes:O,file:`/_stx/islands/${C.hash}.js`}}}if(p[h]=H.map((C)=>C.hash),I=B,e.prefetchIslands)I=ct(I)}}if(await D.promises.mkdir(f.dirname(N),{recursive:!0}),await Bun.write(N,I),!Wt(h,I,T,e.sitemapExclude))U.push({loc:h,lastmod:new Date().toISOString().split("T")[0],priority:h==="/"?1:0.8});let at={route:h,outputPath:N,size:Buffer.byteLength(I,"utf8"),cached:st};if(rt!==!1)at.revalidateAt=Date.now()+rt*1000;u.pages.push(at),u.successCount++,await e.hooks.onPageEnd?.(h,I)}catch(M){u.failedCount++,u.errors.push({route:h,error:M}),await e.hooks.onError?.(M,h),console.error(`Error generating ${h}:`,M)}}));let tt=
|
|
46
|
+
Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)A.set(h,k.filePath,B.dependencies,I)}let N;if(e.trailingSlash)N=f.join(e.outputDir,h,"index.html");else N=h==="/"?f.join(e.outputDir,"index.html"):f.join(e.outputDir,`${h}.html`);if(e.chunkIslands){let{html:B,chunks:H}=ot(I,{integrity:e.integrityIslands,minify:e.minify});if(H.length>0){let j=f.join(e.outputDir,"_stx","islands");await D.promises.mkdir(j,{recursive:!0});for(let C of H){let z=f.join(j,`${C.hash}.js`);if(!await Bun.file(z).exists())await Bun.write(z,C.code);if(!g.has(C.hash)){g.add(C.hash);let O=Buffer.byteLength(C.code,"utf8");v+=O,w[C.hash]={bytes:O,file:`/_stx/islands/${C.hash}.js`}}}if(p[h]=H.map((C)=>C.hash),I=B,e.prefetchIslands)I=ct(I)}}if(await D.promises.mkdir(f.dirname(N),{recursive:!0}),await Bun.write(N,I),!Wt(h,I,T,e.sitemapExclude))U.push({loc:h,lastmod:new Date().toISOString().split("T")[0],priority:h==="/"?1:0.8});let at={route:h,outputPath:N,size:Buffer.byteLength(I,"utf8"),cached:st};if(rt!==!1)at.revalidateAt=Date.now()+rt*1000;u.pages.push(at),u.successCount++,await e.hooks.onPageEnd?.(h,I)}catch(M){u.failedCount++,u.errors.push({route:h,error:M}),await e.hooks.onError?.(M,h),console.error(`Error generating ${h}:`,M)}}));let tt=tn();if(tt.length>0){let d=tt.map((m)=>`${m.filePath}: ${m.message}`).join(`
|
|
47
47
|
`);throw Error(`Client script bundling failed:
|
|
48
48
|
${d}`)}if(e.cache)await A.save();if(e.generate404){let d=f.join(e.pagesDir,"404.stx");if(await Bun.file(d).exists()){let m=new Set,k={...n,minifyClient:!0,debug:!1,cache:!1},h=await i(await Bun.file(d).text(),{},d,k,m);await Bun.write(f.join(e.outputDir,"404.html"),h)}else await Bun.write(f.join(e.outputDir,"404.html"),`<!DOCTYPE html>
|
|
49
49
|
<html lang="en">
|
|
@@ -66,7 +66,7 @@ ${d}`)}if(e.cache)await A.save();if(e.generate404){let d=f.join(e.pagesDir,"404.
|
|
|
66
66
|
<a href="/">Go home</a>
|
|
67
67
|
</div>
|
|
68
68
|
</body>
|
|
69
|
-
</html>`)}for(let d of[500]){let m=f.join(e.pagesDir,`${d}.stx`);if(await Bun.file(m).exists()){let k=new Set,h={...n,minifyClient:!0,debug:!1,cache:!1},_=await i(await Bun.file(m).text(),{},m,h,k);await Bun.write(f.join(e.outputDir,`${d}.html`),_)}}let K=f.join(e.pagesDir,"error.stx");if(await Bun.file(K).exists()){let d=new Set,m={...n,minifyClient:!0,debug:!1,cache:!1},k=await i(await Bun.file(K).text(),{},K,m,d);await Bun.write(f.join(e.outputDir,"error.html"),k)}if(e.sitemap&&U.length>0){let d=qt(U,e.domain),m=f.join(e.outputDir,"sitemap.xml");await Bun.write(m,d),u.sitemapPath=m,console.log(`Generated sitemap.xml with ${U.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((h)=>typeof h==="string"),...d.disallow||[]],k=$s({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...m.length>0?{disallow:m}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(f.join(e.outputDir,"robots.txt"),k),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(d.getItems)m=await d.getItems();let k=Jt(d,m),h=f.join(e.outputDir,"rss.xml");await Bun.write(h,k),u.rssPath=h,console.log(`Generated rss.xml with ${m.length} items`)}let W=
|
|
69
|
+
</html>`)}for(let d of[500]){let m=f.join(e.pagesDir,`${d}.stx`);if(await Bun.file(m).exists()){let k=new Set,h={...n,minifyClient:!0,debug:!1,cache:!1},_=await i(await Bun.file(m).text(),{},m,h,k);await Bun.write(f.join(e.outputDir,`${d}.html`),_)}}let K=f.join(e.pagesDir,"error.stx");if(await Bun.file(K).exists()){let d=new Set,m={...n,minifyClient:!0,debug:!1,cache:!1},k=await i(await Bun.file(K).text(),{},K,m,d);await Bun.write(f.join(e.outputDir,"error.html"),k)}if(e.sitemap&&U.length>0){let d=qt(U,e.domain),m=f.join(e.outputDir,"sitemap.xml");await Bun.write(m,d),u.sitemapPath=m,console.log(`Generated sitemap.xml with ${U.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((h)=>typeof h==="string"),...d.disallow||[]],k=$s({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...m.length>0?{disallow:m}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(f.join(e.outputDir,"robots.txt"),k),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(d.getItems)m=await d.getItems();let k=Jt(d,m),h=f.join(e.outputDir,"rss.xml");await Bun.write(h,k),u.rssPath=h,console.log(`Generated rss.xml with ${m.length} items`)}let W=tc(e.outputDir);if(W.assets>0)console.log(`Externalized ${W.assets} asset(s) from ${W.pages} page(s) (${(W.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let q=nc(e.outputDir);if(q.assets>0)console.log(`Externalized ${q.assets} repeated asset(s) from ${q.pages} page(s) (${(q.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&D.existsSync(e.publicDir))await Y(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let et=tr();if(et)await Y(et,f.join(e.outputDir,er)),console.log(`Copied assets from ${Qt}`)}catch(E){throw await e.hooks.onError?.(E),E}if(u.buildTime=Date.now()-r,g.size>0){u.islandChunks={count:g.size,totalBytes:v};let E={generatedChunks:g.size,totalBytes:v,chunks:w,pages:p};await Bun.write(f.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(E,null,2))}await e.hooks.onBuildEnd?.(u);let P=u.islandChunks?`
|
|
70
70
|
Island chunks: ${u.islandChunks.count} (${(u.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
|
|
71
71
|
Build complete!
|
|
72
72
|
Total: ${u.totalPages} pages
|
|
@@ -87,4 +87,4 @@ Build complete!
|
|
|
87
87
|
<p>Redirecting to <a href="${t}">${t}</a>...</p>
|
|
88
88
|
<script>window.location.replace('${t}')</script>
|
|
89
89
|
</body>
|
|
90
|
-
</html>`}function
|
|
90
|
+
</html>`}function te(t,r){if(t==="/"||t==="")return f.join(r.outputDir,"index.html");let n=t.replace(/^\/|\/$/g,"");if(r.trailingSlash)return f.join(r.outputDir,n,"index.html");return f.join(r.outputDir,`${n}.html`)}var Fe={generateStaticSite:Vt,createISRHandler:Kt,defineStaticPaths:J,createMarkdownLoader:Xt};export{Kt as createISRHandler,Xt as createMarkdownLoader,Nt as declaresPageAction,Fe as default,J as defineStaticPaths,Vt as generateStaticSite,Wt as isExcludedFromSitemap};
|
package/dist/utils.js
CHANGED
|
@@ -764,7 +764,7 @@ export async function renderComponentWithSlot(componentPath, props, slotContent,
|
|
|
764
764
|
if (!searchDirs.includes(fallback))
|
|
765
765
|
searchDirs.push(fallback);
|
|
766
766
|
if (nameHasSharedCounterpart) {
|
|
767
|
-
const selected = (targetIsFallback ? options._pluginComponentDirs ?? [] : options._targetComponentDirs ?? []).filter((dir) => typeof dir === "string" && dir.length > 0);
|
|
767
|
+
const componentPackageDirs = (options._componentPackageDirs ?? []).filter((dir) => typeof dir === "string" && dir.length > 0), selected = (targetIsFallback ? componentPackageDirs.length ? componentPackageDirs : options._pluginComponentDirs ?? [] : options._targetComponentDirs ?? []).filter((dir) => typeof dir === "string" && dir.length > 0);
|
|
768
768
|
if (selected.length) {
|
|
769
769
|
const hostDirs = searchDirs.slice(packageDirCount).map((dir) => path.isAbsolute(dir) ? dir : path.resolve(resolveBase, dir)).filter((dir) => !selected.includes(dir)), overrideKey = `${baseName}\x00${hostDirs.join("\x00")}`;
|
|
770
770
|
let overridden = convergedOverrideCache.get(overrideKey);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.843",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -128,12 +128,12 @@
|
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@stacksjs/ts-css": "^0.3.21",
|
|
130
130
|
"@stacksjs/clapp": "^0.2.16",
|
|
131
|
-
"@stacksjs/desktop": "0.2.
|
|
132
|
-
"@stacksjs/sanitizer": "0.2.
|
|
131
|
+
"@stacksjs/desktop": "0.2.843",
|
|
132
|
+
"@stacksjs/sanitizer": "0.2.843",
|
|
133
133
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
134
|
-
"bun-plugin-stx": "0.2.
|
|
134
|
+
"bun-plugin-stx": "0.2.843",
|
|
135
135
|
"bunfig": "^0.15.21",
|
|
136
|
-
"stx-router": "0.2.
|
|
136
|
+
"stx-router": "0.2.843",
|
|
137
137
|
"ts-broadcasting": "^0.0.11",
|
|
138
138
|
"ts-images": "^0.2.22",
|
|
139
139
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-02cntwd8.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Il,oa,Ol,Nl,ia,Ml,Dl,Ll,jl,aa,Bl,tm}from"./chunk-g7rsd8st.js";import{ha,Vl}from"./chunk-q0s0kc66.js";import{ee,te,ne,Ln,he,$e,Gr,mt,Jt,jn,Bn,Fn,re,zn,Hn,Jr}from"./chunk-bq7qcndg.js";import{Xl}from"./chunk-wbgc2n04.js";import"./chunk-9xps62ek.js";export{te as DEFAULT_FORMATS,ne as DEFAULT_QUALITY,ee as DEFAULT_WIDTHS,Jr as ImageProcessingError,Nl as clearImageCache,ia as createImageDirective,Vl as createImageHandler,Dl as createImagePlugin,tm as defaultImageConfig,Hn as formatSize,aa as generateImageManifest,Jt as generateSizes,mt as generateSrcSet,jn as getFallbackVariant,Gr as getImageMetadata,re as getMimeType,zn as getTotalSize,Bn as groupVariantsByFormat,ha as handleImageRequest,Ml as imageDirective,he as isImageBackendAvailable,Fn as isImageFile,Ln as isSharpAvailable,jl as optimizeDirectory,Ll as optimizeImage,oa as parseImageComponent,$e as processImage,Ol as processImageComponents,Il as renderImageComponent,Xl as rewriteImagesWithSiblings,Bl as writeImageManifest};
|
package/dist/chunk-1z5mj5m5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Jg}from"./chunk-amh7h4bq.js";import"./chunk-mpc840yc.js";import"./chunk-kk66r2me.js";import"./chunk-eqfs73sa.js";import"./chunk-4dxq7ft1.js";import"./chunk-vv71k945.js";import"./chunk-jap212a4.js";import"./chunk-d5ryynr2.js";import"./chunk-1b1ntgt7.js";import"./chunk-xjk5sxkz.js";import"./chunk-aqvh8wx5.js";import"./chunk-2fj5zev7.js";import"./chunk-rze2qphx.js";import"./chunk-qca4e1ms.js";import"./chunk-fp4291zm.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import"./chunk-j2z7prcv.js";import"./chunk-g7hd7eh0.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{Jg as startInteractive};
|
package/dist/chunk-2pgc087j.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Di,Li,ji,Mg,Dg,Lg,El,jg,Bg}from"./chunk-p9d2txcg.js";export{Di as ImageProcessorCache,El as applyTransformations,Mg as clearImageCache,jg as generateResponsiveVariants,Bg as generateSrcset,Li as getCachedImageResult,Lg as optimizeImage,Dg as processImage,ji as setCachedImageResult};
|
package/dist/chunk-32mf97nv.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{kf,_f,ye,Cf,rc,nn,rn,Th,sc,sn,nr,Ef,Tf,$f,is,on,Rf,an,oc,$h}from"./chunk-w2btre0d.js";import"./chunk-d5h2qak7.js";import"./chunk-4y6hes3h.js";import"./chunk-qca4e1ms.js";import"./chunk-fp4291zm.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import"./chunk-j2z7prcv.js";import"./chunk-g7hd7eh0.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{nr as MODULE_SPECIFIER_PREFIX,kf as bundleCacheDir,_f as bundleCacheEntryLimit,$h as bundleClientEntriesSplit,an as bundleClientScript,rn as clearBundleFailures,ye as clientBundleDependencies,nn as getBundleFailures,sn as hasUserImports,on as moduleSubstitutionKey,Tf as normalizeRegistrySpecifiers,Rf as queueClientBundleBuild,rc as recordBundleFailure,Ef as registryIdForPath,sc as resolveBundlerFallback,$f as rewriteRegistryImports,Th as setBundlerFallbackMode,Cf as shouldLogBundlerDiagnostics,oc as tempBuildName,is as withModuleSubstitutes};
|
package/dist/chunk-37ad1ewp.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ch,vo,lh,uh,dh,ph}from"./chunk-axhg6nn9.js";import"./chunk-w2btre0d.js";import"./chunk-d5h2qak7.js";import"./chunk-4y6hes3h.js";import"./chunk-xjk5sxkz.js";import"./chunk-aqvh8wx5.js";import"./chunk-2fj5zev7.js";import"./chunk-qca4e1ms.js";import"./chunk-fp4291zm.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import"./chunk-j2z7prcv.js";import"./chunk-g7hd7eh0.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{ph as clearStoreCache,ch as getStoreScript,dh as getStoreScriptFor,uh as pageStoresAll,vo as storesRead,lh as storesReadInFiles};
|
package/dist/chunk-41sh9y5w.js
DELETED
package/dist/chunk-4654xm1h.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Bi,Fi,zi,Fg,Hi,Vi,zg,Ui,Wi,Tl,Hg}from"./chunk-x110ssw2.js";export{Bi as VideoProcessorCache,Tl as analyzeVideo,Fg as clearVideoCache,Wi as generateDASHManifest,Ui as generateHLSManifest,Hi as generatePoster,zg as generateSpriteSheet,Vi as generateThumbnails,Fi as getCachedVideoResult,Hg as processVideo,zi as setCachedVideoResult};
|
package/dist/chunk-4eagsz5d.js
DELETED
package/dist/chunk-5t93dqft.js
DELETED
package/dist/chunk-7hf37fqp.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{F,Uf,Zo,a,O,Wh,qh}from"./chunk-qca4e1ms.js";import"./chunk-fp4291zm.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import"./chunk-j2z7prcv.js";import"./chunk-g7hd7eh0.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{O as config,F as defaultConfig,Wh as defineStxConfig,Zo as discoverConfig,a as loadStxConfig,Uf as resolveStxDirectories,qh as validateConfig};
|
package/dist/chunk-7m0r7mq9.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{oi,ii,kt,de,gr,Rs,mr,As,Ps,qf,Kf,Xf,hr,Gf,Jf,Yf,Zf,Ec,Tc,$c,ai,Rc,Qf,_t,Ct,Et,Tt,$t,Rt,nt,eg}from"./chunk-2j5yane9.js";export{mr as Router,Yf as abortNavigation,Rs as bracketPathToRegex,_t as clearMiddleware,Tc as createClientCookieManager,$t as createMiddlewareContext,Tt as createRouteLocation,Ec as createServerCookieManager,$c as createStorageManager,Zf as defineMiddleware,Kf as defineRoute,Xf as defineRoutes,As as findErrorPage,Ps as formatRoutes,ii as generateRouteManifest,oi as generateRouteTypes,Rc as getMiddleware,Ct as getMiddlewareNames,nt as getRouterScript,eg as getRouterScriptDev,Qf as hasMiddleware,kt as isFileRequestPath,Et as loadMiddlewareFromDirectory,gr as matchRoute,Jf as navigateTo,de as patternToRegex,ai as registerMiddleware,Gf as resetRoutes,hr as route,Rt as runMiddleware,qf as setAppUrl};
|