@stacksjs/stx 0.2.416 → 0.2.417
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-072f6hnz.js +2 -0
- package/dist/{chunk-a47yp92z.js → chunk-072mzamc.js} +5 -5
- package/dist/{chunk-dd5fa7d6.js → chunk-08p07eq7.js} +2 -2
- package/dist/chunk-0x076wz1.js +2 -0
- package/dist/{chunk-zyxp0nb3.js → chunk-0xgf3xgy.js} +16 -16
- package/dist/chunk-1680nbq4.js +2816 -0
- package/dist/{chunk-7tabykst.js → chunk-25n4gmek.js} +2 -2
- package/dist/chunk-2gfj59pt.js +2 -0
- package/dist/chunk-2gntnw7e.js +2 -0
- package/dist/chunk-2hvvwhmv.js +2 -0
- package/dist/{chunk-rfdqrv5v.js → chunk-31a8eh0j.js} +4 -4
- package/dist/{chunk-vvs75dse.js → chunk-3aqe7wy7.js} +2 -2
- package/dist/{chunk-x0mq57pe.js → chunk-3f5td68v.js} +2 -2
- package/dist/chunk-3senpdjt.js +3 -0
- package/dist/{chunk-jr4dwkvc.js → chunk-3wmxb126.js} +2 -2
- package/dist/{chunk-znbay168.js → chunk-47h689h6.js} +2 -2
- package/dist/chunk-4bhertga.js +2 -0
- package/dist/chunk-4s9dypby.js +2 -0
- package/dist/{chunk-rqc4jx2v.js → chunk-5f3k2mke.js} +1 -1
- package/dist/{chunk-nj8edn4m.js → chunk-5fwy3xap.js} +3 -3
- package/dist/{chunk-zcctf7tx.js → chunk-5vzamjf6.js} +4 -4
- package/dist/chunk-5z56g0n4.js +2 -0
- package/dist/chunk-68rq2fqt.js +12 -0
- package/dist/chunk-6ad0nseq.js +2 -0
- package/dist/{chunk-rhw7pqhy.js → chunk-76japd6k.js} +4 -4
- package/dist/chunk-7eazcxzf.js +2 -0
- package/dist/chunk-7hy29tcy.js +2 -0
- package/dist/{chunk-gxrewzhv.js → chunk-7q1yy18q.js} +2 -2
- package/dist/{chunk-rp4khnan.js → chunk-85bm5xrm.js} +3 -3
- package/dist/{chunk-bfjzfrw3.js → chunk-865xvpp2.js} +2 -2
- package/dist/chunk-8fyqbq14.js +2 -0
- package/dist/chunk-92xzpt6p.js +2 -0
- package/dist/{chunk-sh5c60a2.js → chunk-94ky725r.js} +2 -2
- package/dist/{chunk-89xcpdsp.js → chunk-9af8qbwb.js} +5 -5
- package/dist/{chunk-m9xdkzm6.js → chunk-9bq4w4d6.js} +3 -3
- package/dist/chunk-9kmmafp4.js +2 -0
- package/dist/{chunk-gq97zh73.js → chunk-9r5ycpdg.js} +3 -3
- package/dist/{chunk-fctjn68q.js → chunk-9yt899e7.js} +6 -6
- package/dist/chunk-atgwc7r7.js +2 -0
- package/dist/{chunk-a688m6js.js → chunk-ayd5r3se.js} +2 -2
- package/dist/{chunk-yzv8n6qw.js → chunk-bk5ndwv3.js} +2 -2
- package/dist/chunk-bs6y5wy2.js +2 -0
- package/dist/{chunk-j8rxdbe5.js → chunk-bt11a8z4.js} +3 -3
- package/dist/{chunk-fkhxz1dx.js → chunk-c8p4v1rd.js} +5 -5
- package/dist/chunk-ccg6xjr1.js +2 -0
- package/dist/chunk-ckv4aty5.js +2 -0
- package/dist/{chunk-1ctvgd7v.js → chunk-d0ynfema.js} +1 -1
- package/dist/chunk-d6h9rpm4.js +30 -0
- package/dist/chunk-dbh7h0kt.js +2 -0
- package/dist/chunk-dhqkg0ph.js +2 -0
- package/dist/{chunk-6agy2x1f.js → chunk-dw961rvn.js} +2 -2
- package/dist/{chunk-h8wegkb5.js → chunk-dym1eteb.js} +1 -1
- package/dist/{chunk-41k0th97.js → chunk-e2m674vf.js} +4 -4
- package/dist/{chunk-9t2xx2y4.js → chunk-e83j8xe9.js} +4 -4
- package/dist/chunk-ettat5ah.js +2 -0
- package/dist/{chunk-cn9hgyh5.js → chunk-ev8bhsc0.js} +2 -2
- package/dist/chunk-f4ws0qcd.js +2 -0
- package/dist/chunk-f97v10zr.js +2 -0
- package/dist/chunk-fe5st320.js +2 -0
- package/dist/chunk-fet3hce8.js +2 -0
- package/dist/chunk-fq7128p1.js +2 -0
- package/dist/{chunk-y5cqkmkf.js → chunk-fr8jq2ys.js} +2 -2
- package/dist/chunk-fwy2h1ms.js +2 -0
- package/dist/{chunk-ddk6fx5b.js → chunk-fxhvkenf.js} +2 -2
- package/dist/{chunk-v096a6fw.js → chunk-g947brd0.js} +6 -6
- package/dist/{chunk-wjag92ch.js → chunk-gfm7g98y.js} +85 -85
- package/dist/chunk-gtkhykc4.js +2 -0
- package/dist/{chunk-vvp4cmfq.js → chunk-h8f18cc5.js} +6 -6
- package/dist/chunk-h8pkm7c5.js +2 -0
- package/dist/{chunk-yt6h8c6g.js → chunk-hg3tyzn5.js} +11 -11
- package/dist/{chunk-std6xw3y.js → chunk-hkxxfzfd.js} +2 -2
- package/dist/{chunk-3wrmz1j9.js → chunk-hm2k9a04.js} +7 -7
- package/dist/chunk-hneg0155.js +2 -0
- package/dist/chunk-hs90en70.js +2 -0
- package/dist/{chunk-n5k88y07.js → chunk-jfjym18d.js} +5 -5
- package/dist/chunk-jgsgd6rt.js +17 -0
- package/dist/chunk-jn3njpxs.js +2 -0
- package/dist/chunk-ka8x4sw6.js +18 -0
- package/dist/{chunk-9rnh52t2.js → chunk-kds79hq3.js} +11 -11
- package/dist/{chunk-rg6csnkw.js → chunk-kkj5x9rp.js} +1 -1
- package/dist/chunk-mcqn70v8.js +3 -0
- package/dist/chunk-mcs7p3fy.js +2 -0
- package/dist/{chunk-wpe72ann.js → chunk-mj6fme15.js} +5 -5
- package/dist/{chunk-yk63jd7v.js → chunk-mj9yv1vb.js} +1 -1
- package/dist/chunk-mmtg0jxd.js +2 -0
- package/dist/chunk-mrsxwd0h.js +2 -0
- package/dist/chunk-mscky0ww.js +2 -0
- package/dist/chunk-mtphm33a.js +2 -0
- package/dist/chunk-p2jbc71s.js +2 -0
- package/dist/{chunk-p1tb8kxq.js → chunk-pb0fgdvn.js} +4 -4
- package/dist/{chunk-at0ar6t3.js → chunk-psmdbcbc.js} +4 -4
- package/dist/chunk-pvd9k3kx.js +2 -0
- package/dist/chunk-pz1jc3db.js +2 -0
- package/dist/chunk-q8swb7na.js +4 -0
- package/dist/{chunk-7mbpjv9e.js → chunk-qmzwhtr2.js} +2 -2
- package/dist/chunk-qvr6e2ve.js +3 -0
- package/dist/chunk-ra0pkkvd.js +2 -0
- package/dist/chunk-rcbtd4w3.js +2 -0
- package/dist/chunk-rd2r9jvn.js +2 -0
- package/dist/chunk-s8srb8bg.js +2 -0
- package/dist/{chunk-3t0yaexe.js → chunk-sjjc670z.js} +9 -9
- package/dist/chunk-snf2b68p.js +2 -0
- package/dist/chunk-t2bfwr9v.js +2 -0
- package/dist/chunk-tbmwdahm.js +2 -0
- package/dist/{chunk-388rx71h.js → chunk-v15g9jjh.js} +6 -6
- package/dist/{chunk-de2pv6ys.js → chunk-vdqa5gt7.js} +2 -2
- package/dist/{chunk-rv5bk83t.js → chunk-vepc9rbt.js} +2 -2
- package/dist/{chunk-0es4h5v1.js → chunk-vfdwvt23.js} +2 -2
- package/dist/chunk-vpv896zx.js +2 -0
- package/dist/{chunk-3g8zzdgs.js → chunk-vyfg2qd2.js} +5 -5
- package/dist/{chunk-tfhjbjq5.js → chunk-w5zmvn7b.js} +3 -3
- package/dist/chunk-w6h63b48.js +2 -0
- package/dist/{chunk-cq408jrm.js → chunk-wgzxmh7w.js} +3 -3
- package/dist/{chunk-ppse812s.js → chunk-wpkxbggq.js} +1 -1
- package/dist/chunk-wrk3gkgg.js +2 -0
- package/dist/chunk-wtd71jsa.js +2 -0
- package/dist/{chunk-c4bkj1xw.js → chunk-wweasgq9.js} +18 -18
- package/dist/chunk-wymf1ek6.js +2 -0
- package/dist/chunk-wz8hyh8h.js +4 -0
- package/dist/chunk-x32wpjs0.js +2 -0
- package/dist/chunk-x4q2eyt0.js +2 -0
- package/dist/chunk-x95ejws0.js +2 -0
- package/dist/chunk-xket8ejt.js +2 -0
- package/dist/{chunk-t9axxwy9.js → chunk-xt6d3zws.js} +4 -4
- package/dist/{chunk-qff4qkx5.js → chunk-xvn3sv3v.js} +3 -3
- package/dist/{chunk-tfexmdkt.js → chunk-xwkdv585.js} +2 -2
- package/dist/{chunk-ae7j3n39.js → chunk-y9t55tv7.js} +6 -6
- package/dist/chunk-ypfzy1mq.js +2 -0
- package/dist/{chunk-7zjvsacw.js → chunk-yrbzsrde.js} +2 -2
- package/dist/chunk-zg68pwy8.js +2 -0
- package/dist/chunk-zs58fnme.js +2 -0
- package/dist/chunk-zy3p0vmx.js +3 -0
- package/dist/cli.js +21 -21
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/ts-css.d.ts +11 -0
- package/dist/dev-server/ts-css.js +13 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +17 -17
- package/package.json +5 -5
- package/dist/chunk-02k2v1mb.js +0 -2
- package/dist/chunk-0dh1rgg8.js +0 -2
- package/dist/chunk-0hrqt5c2.js +0 -2
- package/dist/chunk-0vtk2rpr.js +0 -2
- package/dist/chunk-1rd3jzrq.js +0 -2
- package/dist/chunk-26j2q9rq.js +0 -32
- package/dist/chunk-2py27bzq.js +0 -2
- package/dist/chunk-2qa7hjp2.js +0 -3
- package/dist/chunk-35e6zj5x.js +0 -2
- package/dist/chunk-3ch40ebr.js +0 -2
- package/dist/chunk-49cpqjx2.js +0 -2
- package/dist/chunk-4k1nkp9r.js +0 -2
- package/dist/chunk-50vq8k55.js +0 -2
- package/dist/chunk-56pkjk55.js +0 -2
- package/dist/chunk-5hnh00ry.js +0 -2
- package/dist/chunk-5j52h3e3.js +0 -2
- package/dist/chunk-5y1mekxe.js +0 -2
- package/dist/chunk-5zryk911.js +0 -2
- package/dist/chunk-72w28vm8.js +0 -2
- package/dist/chunk-7s7k94as.js +0 -2
- package/dist/chunk-7wb6jf17.js +0 -2
- package/dist/chunk-8cbkqckh.js +0 -2
- package/dist/chunk-8ycy1b0e.js +0 -2
- package/dist/chunk-8ygks6dx.js +0 -3
- package/dist/chunk-95165j9c.js +0 -4
- package/dist/chunk-9fyss0yk.js +0 -3
- package/dist/chunk-aqrnpgn7.js +0 -2
- package/dist/chunk-b9rebdtq.js +0 -2
- package/dist/chunk-c4thhfx9.js +0 -2
- package/dist/chunk-cw6kqb63.js +0 -2
- package/dist/chunk-d3vtgnep.js +0 -2
- package/dist/chunk-d4ynv4z2.js +0 -2
- package/dist/chunk-d7xrewxq.js +0 -2
- package/dist/chunk-dg1n3g1d.js +0 -2785
- package/dist/chunk-ecr598p7.js +0 -2
- package/dist/chunk-eev80mpy.js +0 -2
- package/dist/chunk-ef5vz9w5.js +0 -2
- package/dist/chunk-et0rr8c7.js +0 -3
- package/dist/chunk-f5qd84w8.js +0 -2
- package/dist/chunk-g69tnqga.js +0 -2
- package/dist/chunk-gacycmb0.js +0 -2
- package/dist/chunk-ggywfyzm.js +0 -2
- package/dist/chunk-gp1bhn7t.js +0 -2
- package/dist/chunk-gr3r9xdh.js +0 -2
- package/dist/chunk-gyv1t0f0.js +0 -30
- package/dist/chunk-hec0bvvf.js +0 -12
- package/dist/chunk-hg1eq72d.js +0 -2
- package/dist/chunk-hvyqs5tf.js +0 -2
- package/dist/chunk-kbysqxmd.js +0 -2
- package/dist/chunk-kjbv8a3m.js +0 -2
- package/dist/chunk-kmnsrvrp.js +0 -2
- package/dist/chunk-m6fvj7g1.js +0 -2
- package/dist/chunk-mgw2cvb7.js +0 -2
- package/dist/chunk-mvwt1c8f.js +0 -2
- package/dist/chunk-nvh31cxn.js +0 -2
- package/dist/chunk-p34gbb4z.js +0 -2
- package/dist/chunk-peyt18ce.js +0 -2
- package/dist/chunk-qpx8kvd8.js +0 -2
- package/dist/chunk-qzkebqm3.js +0 -4
- package/dist/chunk-rb272g9d.js +0 -3
- package/dist/chunk-rh1dyfsn.js +0 -2
- package/dist/chunk-rspc8gn8.js +0 -2
- package/dist/chunk-rvs61c88.js +0 -2
- package/dist/chunk-sf1vhfrb.js +0 -2
- package/dist/chunk-tc274fcv.js +0 -18
- package/dist/chunk-ty7t3gp4.js +0 -3
- package/dist/chunk-vc9wa97m.js +0 -2
- package/dist/chunk-wjzqz3yr.js +0 -2
- package/dist/chunk-x7j0krz8.js +0 -2
- package/dist/chunk-xkv0evbf.js +0 -2
- package/dist/chunk-y6rahx7t.js +0 -17
- package/dist/chunk-yt452b4a.js +0 -2
- package/dist/chunk-yxfx44fv.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ll,jl}from"./chunk-psmdbcbc.js";import"./chunk-jgsgd6rt.js";import"./chunk-mj6fme15.js";import"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{jl as clearStoreCache,Ll as getStoreScript};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{L,j,B,
|
|
2
|
+
import{L,j,B,Pt,G,se,_e,ct,It,Dt,Ot,F,Mt,Nt}from"./chunk-vfdwvt23.js";import{Ue}from"./chunk-xwkdv585.js";function To(s,r={}){let{src:e,alt:t,width:n,height:a,sizes:i="100vw",loading:m="lazy",priority:o=!1,quality:u=B,placeholder:l="none",formats:f=j,widths:y=L,decoding:c="async",fetchpriority:h,objectFit:d,objectPosition:g}=s,{class:p,style:v}=s,{processedImage:w,variants:I,optimize:b=!0,isDev:A=!1}=r;if(I&&I.length>0)return ee(s,I,w);if(A||!b)return te(s);return re(s)}function ee(s,r,e){let{src:t,alt:n,width:a,height:i,sizes:m="100vw",loading:o="lazy",priority:u=!1,decoding:l="async",fetchpriority:f,objectFit:y,objectPosition:c,placeholder:h="none"}=s,{class:d,style:g}=s,p=Dt(r),v=It(r),w=typeof m==="object"?ct(m):m,I=e?e.aspectRatio:a&&i?Number(a)/Number(i):void 0,b=[];if(I)b.push(`aspect-ratio: ${I}`);if(y)b.push(`object-fit: ${y}`);if(c)b.push(`object-position: ${c}`);if(g)b.push(g);let A=b.length>0?` style="${b.join("; ")}"`:"",S=d?` class="${d}"`:"",C=u?"":` loading="${o}"`,T=` decoding="${l}"`,O=f?` fetchpriority="${f}"`:u?' fetchpriority="high"':"",V=["avif","webp","jpeg","png"],q=[];for(let k of V){let z=p.get(k);if(z&&z.length>0){let M=_e(z),X=F(k);q.push(` <source type="${X}" srcset="${M}" sizes="${w}" />`)}}let N="",W="",E;if(h!=="none"&&e?.placeholder){let k=`img-${Math.random().toString(36).slice(2,8)}`;if(N=`<div class="stx-image-wrapper" id="${k}">`,W="</div>",h==="blur")E=`
|
|
3
3
|
#${k} {
|
|
4
4
|
position: relative;
|
|
5
5
|
background-image: url('${e.placeholder}');
|
|
@@ -16,21 +16,21 @@ import{L,j,B,jt,Z,oe,Ie,dt,Bt,Ft,zt,F,Ht,Vt}from"./chunk-0es4h5v1.js";import{qe}
|
|
|
16
16
|
#${k} {
|
|
17
17
|
background-color: ${e.placeholder};
|
|
18
18
|
}
|
|
19
|
-
`.trim()}let J=a?` width="${a}"`:e?` width="${e.width}"`:"",K=i?` height="${i}"`:e?` height="${e.height}"`:"",
|
|
19
|
+
`.trim()}let J=a?` width="${a}"`:e?` width="${e.width}"`:"",K=i?` height="${i}"`:e?` height="${e.height}"`:"",Z=`${N}<picture>
|
|
20
20
|
${q.join(`
|
|
21
21
|
`)}
|
|
22
22
|
<img
|
|
23
23
|
src="${v?.url||t}"
|
|
24
24
|
alt="${U(n)}"${J}${K}${S}${A}${C}${T}${O}
|
|
25
25
|
/>
|
|
26
|
-
</picture>${W}`,_;if(u&&v){let k=p.get("webp"),z=k?.[Math.floor(k.length/2)]||v,M=F(z.format);_=`<link rel="preload" as="image" href="${z.url}" type="${M}" />`}return{html:
|
|
26
|
+
</picture>${W}`,_;if(u&&v){let k=p.get("webp"),z=k?.[Math.floor(k.length/2)]||v,M=F(z.format);_=`<link rel="preload" as="image" href="${z.url}" type="${M}" />`}return{html:Z,preloadLink:_,placeholderCss:E}}function te(s){let{src:r,alt:e,width:t,height:n,loading:a="lazy",decoding:i="async",priority:m=!1,fetchpriority:o,objectFit:u,objectPosition:l}=s,{class:f,style:y}=s,c=[];if(u)c.push(`object-fit: ${u}`);if(l)c.push(`object-position: ${l}`);if(y)c.push(y);let h=c.length>0?` style="${c.join("; ")}"`:"",d=f?` class="${f}"`:"",g=t?` width="${t}"`:"",p=n?` height="${n}"`:"",v=m?"":` loading="${a}"`,w=` decoding="${i}"`,I=o?` fetchpriority="${o}"`:m?' fetchpriority="high"':"";return{html:`<img src="${r}" alt="${U(e)}"${g}${p}${d}${h}${v}${w}${I} />`}}function re(s){let{src:r,alt:e,width:t,height:n,sizes:a="100vw",loading:i="lazy",priority:m=!1,quality:o=B,formats:u=j,widths:l=L,decoding:f="async",fetchpriority:y,objectFit:c,objectPosition:h}=s,{class:d,style:g}=s,p=[];if(c)p.push(`object-fit: ${c}`);if(h)p.push(`object-position: ${h}`);if(g)p.push(g);let v=p.length>0?` style="${p.join("; ")}"`:"",w=d?` class="${d}"`:"",I=t?` width="${t}"`:"",b=n?` height="${n}"`:"",A=m?"":` loading="${i}"`,S=` decoding="${f}"`,C=y?` fetchpriority="${y}"`:m?' fetchpriority="high"':"",T=typeof a==="object"?ct(a):a,O=`
|
|
27
27
|
data-stx-image
|
|
28
28
|
data-src="${r}"
|
|
29
29
|
data-sizes="${T}"
|
|
30
30
|
data-quality="${o}"
|
|
31
31
|
data-formats="${u.join(",")}"
|
|
32
32
|
data-widths="${l.join(",")}"
|
|
33
|
-
`.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${U(e)}"${I}${b}${w}${v}${A}${S}${C} ${O} />`}}function
|
|
33
|
+
`.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${U(e)}"${I}${b}${w}${v}${A}${S}${C} ${O} />`}}function Hs(s){let r=s.match(/<Image\s+([^>]*?)\/?>/);if(!r)return null;let e=r[1],t={},n=/(\w+)(?:=(?:"([^"]*)"|'([^']*)'|(\{[^}]+\})))?/g,a;while((a=n.exec(e))!==null){let[,i,m,o,u]=a,l=m??o??u??!0;switch(i){case"src":t.src=String(l);break;case"alt":t.alt=String(l);break;case"width":t.width=Number(l)||l;break;case"height":t.height=Number(l)||l;break;case"sizes":t.sizes=String(l);break;case"loading":t.loading=l;break;case"priority":t.priority=l===!0||l==="true";break;case"quality":t.quality=Number(l);break;case"placeholder":t.placeholder=l;break;case"class":t.class=String(l);break;case"style":t.style=String(l);break;case"decoding":t.decoding=l;break;case"fetchpriority":t.fetchpriority=l;break;case"objectFit":t.objectFit=l;break;case"objectPosition":t.objectPosition=String(l);break}}if(!t.src||!t.alt)return null;return t}async function _o(s,r){let e=/<Image\s+[^>]*?\/?>/g,t=[],n=[],a=s,i,m=[];while((i=e.exec(s))!==null)m.push({match:i[0],index:i.index});for(let o=m.length-1;o>=0;o--){let{match:u}=m[o],l=Hs(u);if(l){let f=await r(l);if(a=a.replace(u,f.html),f.preloadLink)t.push(f.preloadLink);if(f.placeholderCss)n.push(f.placeholderCss)}}return{html:a,preloadLinks:t,styles:n}}function U(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var D=new Map;function Ro(){D.clear()}async function ae(s,r){let e=`${s}:${JSON.stringify(r)}`;if(D.has(e))return D.get(e);try{let t=await se(s,r);return D.set(e,t),t}catch{return null}}function Vs(){return Ue({name:"image",hasEndTag:!1,description:"Render an optimized image with responsive variants",transform:async(s,r,e)=>{let{src:t,alt:n,options:a}=ie(s,r,e);if(!t)return console.warn("@image directive: missing src argument"),"<!-- @image: missing src -->";let i={widths:a.widths||(a.width?[a.width]:L),formats:a.formats||j,quality:a.quality||B,placeholder:(a.placeholder==="color"?"dominant-color":a.placeholder)||"none"};if(!await G())return H(t,n||"",a);let o=await ae(t,i);if(!o)return H(t,n||"",a);return oe(o,n||"",a)}})}function ie(s,r,e){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let n=s.trim();if(n.startsWith("@image(")||n.startsWith("("))n=n.replace(/^@image\(/,"").replace(/^\(/,"").replace(/\)$/,"");let a=ne(n),i=a[0]||"",m=a[1]||"",o={};if(i&&!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")){let u=e[i];if(typeof u==="string")i=u}if(a[2])try{if(typeof a[2]==="string")o=JSON.parse(a[2]);else o=a[2]}catch{}return{src:i,alt:m,options:o}}function ne(s){let r=[],e="",t=!1,n="",a=0,i=0;for(let m=0;m<s.length;m++){let o=s[m],u=m>0?s[m-1]:"";if((o==='"'||o==="'")&&u!=="\\"){if(!t)t=!0,n=o;else if(o===n)t=!1,n="";else e+=o;continue}if(!t){if(o==="{")a++;if(o==="}")a--;if(o==="[")i++;if(o==="]")i--;if(o===","&&a===0&&i===0){r.push(e.trim()),e="";continue}}e+=o}if(e.trim())r.push(e.trim());return r}function H(s,r,e){let t=[`src="${x(s)}"`];if(r)t.push(`alt="${x(r)}"`);if(e.width)t.push(`width="${e.width}"`);if(e.height)t.push(`height="${e.height}"`);if(e.class)t.push(`class="${x(e.class)}"`);if(e.style)t.push(`style="${x(e.style)}"`);if(e.lazy!==!1)t.push('loading="lazy"');return t.push('decoding="async"'),`<img ${t.join(" ")} />`}function oe(s,r,e){let{variants:t,placeholder:n,width:a,height:i,aspectRatio:m}=s,o=new Map;for(let g of t){let p=o.get(g.format)||[];p.push(g),o.set(g.format,p)}let u=["avif","webp","jpeg","png"],l=[];for(let g of u){let p=o.get(g);if(p&&p.length>0){let v=_e(p),w=F(g),I=e.sizes||"100vw";l.push(` <source type="${w}" srcset="${x(v)}" sizes="${x(I)}" />`)}}let f=o.get("jpeg")||[],y=f.length>0?f[Math.floor(f.length/2)]:t[Math.floor(t.length/2)],c=[`src="${y?.url||s.src}"`,`alt="${x(r)}"`];if(e.width||a)c.push(`width="${e.width||a}"`);if(e.height||i)c.push(`height="${e.height||i}"`);if(e.class)c.push(`class="${x(e.class)}"`);let h=[];if(m)h.push(`aspect-ratio: ${m.toFixed(4)}`);if(e.style)h.push(e.style);if(h.length>0)c.push(`style="${h.join("; ")}"`);if(e.lazy!==!1&&!e.priority)c.push('loading="lazy"');if(c.push('decoding="async"'),e.priority)c.push('fetchpriority="high"');let d=`<picture>
|
|
34
34
|
`;if(d+=l.join(`
|
|
35
35
|
`)+`
|
|
36
36
|
`,d+=` <img ${c.join(" ")} />
|
|
@@ -39,5 +39,5 @@ ${d}
|
|
|
39
39
|
</div>`}else if(e.placeholder==="color"){let p=n.replace(/[^a-zA-Z0-9#(),.\s%-]/g,"");d=`<div id="${g}" class="stx-image-placeholder" style="background-color: ${p};">
|
|
40
40
|
${d}
|
|
41
41
|
</div>`}}if(e.priority&&y){let g=F(y.format);d=`<link rel="preload" as="image" href="${x(y.url)}" type="${g}" />
|
|
42
|
-
`+d}return d}function x(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var
|
|
43
|
-
export{
|
|
42
|
+
`+d}return d}function x(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var Ao=Vs();import P from"fs";import R from"path";function Po(s={}){let{inputDirs:r=["public","src/assets","assets"],outputDir:e="dist/images",baseUrl:t="/images",formats:n=j,widths:a=L,quality:i=B,placeholder:m="none",concurrency:o=4,cache:u=!0,cacheDir:l=".stx/image-cache",referencedOnly:f=!1,verbose:y=!1}=s,c={imageReferences:new Set,processedImages:new Map,stats:{totalImages:0,optimizedImages:0,savedBytes:0,variants:0}};return{name:"stx-image-optimization",async setup(h){if(!await G()){console.warn("[stx-images] no image backend available, optimization disabled");return}if(u)await P.promises.mkdir(l,{recursive:!0});if(y){let g=await Pt();console.log("[stx-images] Plugin initialized"),console.log(` Backend: ${g?"sharp (native fast path) + ts-images":"ts-images (pure TS)"}`),console.log(` Input dirs: ${r.join(", ")}`),console.log(` Output dir: ${e}`),console.log(` Formats: ${n.join(", ")}`),console.log(` Widths: ${a.join(", ")}`)}},async buildStart(){c.imageReferences.clear(),c.processedImages.clear(),c.stats={totalImages:0,optimizedImages:0,savedBytes:0,variants:0}},async transform(h,d){if(d.endsWith(".html")||d.endsWith(".stx")){let g=ce(h);for(let p of g)c.imageReferences.add(p)}if(h.includes("<Image")||h.includes("@image"))return await ge(h,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t,processedImages:c.processedImages});return h},async buildEnd(h){if(!await G())return;await P.promises.mkdir(e,{recursive:!0});let g=[];for(let w of r){if(!P.existsSync(w))continue;let I=await Q(w);g.push(...I)}let p=f?g.filter((w)=>le(w,c.imageReferences)):g;if(c.stats.totalImages=p.length,y)console.log(`[stx-images] Processing ${p.length} images...`);let v=Y(p,o);for(let w of v)await Promise.all(w.map(async(I)=>{try{let b=await se(I,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t});c.processedImages.set(I,b),c.stats.optimizedImages++,c.stats.variants+=b.variants.length;let A=P.statSync(I).size,S=Mt(b.variants);if(c.stats.savedBytes+=Math.max(0,A-S/b.variants.length),y)console.log(` \u2713 ${R.basename(I)} \u2192 ${b.variants.length} variants`)}catch(b){console.error(`[stx-images] Error processing ${I}:`,b)}}));if(console.log("[stx-images] Optimization complete:"),console.log(` Images: ${c.stats.optimizedImages}/${c.stats.totalImages}`),console.log(` Variants: ${c.stats.variants}`),c.stats.savedBytes>0)console.log(` Saved: ~${Nt(c.stats.savedBytes)}`)}}}function ce(s){let r=[],e=/src=["']([^"']+\.(jpg|jpeg|png|webp|avif|gif))["']/gi,t;while((t=e.exec(s))!==null)r.push(t[1]);let n=/<Image[^>]+src=["']([^"']+)["']/gi;while((t=n.exec(s))!==null)r.push(t[1]);let a=/@image\s*\(\s*['"]([^'"]+)['"]/gi;while((t=a.exec(s))!==null)r.push(t[1]);let i=/background(?:-image)?:\s*url\(["']?([^"')]+\.(jpg|jpeg|png|webp|avif|gif))["']?\)/gi;while((t=i.exec(s))!==null)r.push(t[1]);return r}function le(s,r){let e=R.basename(s);for(let t of r)if(t.endsWith(e)||t.includes(e))return!0;return!1}async function ge(s,r){return s}async function Q(s){let r=[];async function e(t){let n=await P.promises.readdir(t,{withFileTypes:!0});for(let a of n){let i=R.join(t,a.name);if(a.isDirectory())await e(i);else if(a.isFile()&&Ot(i))r.push(i)}}return await e(s),r}function Y(s,r){let e=[];for(let t=0;t<s.length;t+=r)e.push(s.slice(t,t+r));return e}async function Io(s,r,e={}){if(!await G())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");return se(s,{...e,outputDir:r})}async function Do(s,r,e={}){let{formats:t=j,widths:n=L,quality:a=B,placeholder:i="none",concurrency:m=4,verbose:o=!1}=e;if(!await G())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");await P.promises.mkdir(r,{recursive:!0});let l=await Q(s),f=[],y={totalImages:l.length,optimizedImages:0,savedBytes:0,variants:0},c=Y(l,m);for(let h of c){let d=await Promise.all(h.map(async(g)=>{try{let p=await se(g,{formats:t,widths:n,quality:a,placeholder:i,outputDir:r,baseUrl:"/"});if(y.optimizedImages++,y.variants+=p.variants.length,o)console.log(` \u2713 ${R.basename(g)}`);return p}catch(p){return console.error(`Error processing ${g}:`,p),null}}));f.push(...d.filter((g)=>g!==null))}return{processed:f,stats:y}}function Us(s){let r={};for(let e of s)r[e.src]={variants:e.variants,placeholder:e.placeholder};return r}async function Oo(s,r){let e=Us(s);await Bun.write(r,JSON.stringify(e,null,2))}var Mc={enabled:!0,widths:[320,640,768,1024,1280,1536,1920],formats:["webp","jpeg"],quality:80,devOptimize:!1,cacheDir:".stx/image-cache",placeholder:"none",inputDirs:["public","src/assets","assets"],outputDir:"dist/images",baseUrl:"/images"};
|
|
43
|
+
export{To,Hs,_o,Ro,Vs,Ao,Po,Io,Do,Us,Oo,Mc};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ra,sa,ia,oa,aa,ca,la,ua,da,pa,ol}from"./chunk-g947brd0.js";export{ra as createIslandRegistry,ol as default,pa as generateIslandManifest,ia as generatePartialHydrationCSS,ca as hydrateAll,aa as hydrateByStrategy,oa as hydrateIsland,la as isHydrated,ua as onHydrated,sa as processPartialHydrationDirectives,da as processStaticDirectives};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{yi}from"./chunk-ka8x4sw6.js";import{u}from"./chunk-cg8hg6cs.js";import{existsSync as z,mkdirSync as v,copyFileSync as k,chmodSync as T}from"fs";import{join as o,basename as te}from"path";import{spawn as E,execSync as re}from"child_process";import{tmpdir as M,homedir as q,platform as ae}from"os";var eu=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -465,7 +465,7 @@ else if (data.type === 'event' && data.method) {
|
|
|
465
465
|
}
|
|
466
466
|
})();
|
|
467
467
|
</script>
|
|
468
|
-
`;function
|
|
468
|
+
`;function ci(e={}){let{debug:r=!1,timeout:a=30000}=e;return`
|
|
469
469
|
<script>
|
|
470
470
|
(function() {
|
|
471
471
|
'use strict';
|
|
@@ -931,9 +931,9 @@ else if (data.type === 'event' && data.method) {
|
|
|
931
931
|
}
|
|
932
932
|
})();
|
|
933
933
|
</script>
|
|
934
|
-
`.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${a}`)}function
|
|
934
|
+
`.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${a}`)}function tu(){return!1}function nu(e,r={}){let a=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(a,(i,s)=>{let t={};if(s)try{t=JSON.parse(s.replace(/'/g,'"'))}catch{try{t=Function(`return ${s}`)()}catch{console.warn(`[stx] Invalid @craft config: ${s}`)}}return ci(t)})}function li(e,r={}){if(e.includes("__craftBridgeInitialized"))return e;let a=ci(r);if(e.includes("</head>"))return e.replace("</head>",`${a}
|
|
935
935
|
</head>`);if(e.includes("<body"))return e.replace(/(<body[^>]*>)/,`$1
|
|
936
|
-
${a}`);return a+e}var
|
|
936
|
+
${a}`);return a+e}var Pr={button:{nativeType:"craft-button",fallbackTag:"button",fallbackClasses:"craft-button",nativeProps:["variant","size","disabled","loading"]},"text-input":{nativeType:"craft-text-input",fallbackTag:"input",fallbackClasses:"craft-text-input",nativeProps:["placeholder","value","type","disabled","readonly"]},textarea:{nativeType:"craft-textarea",fallbackTag:"textarea",fallbackClasses:"craft-textarea",nativeProps:["placeholder","value","rows","disabled","readonly"]},checkbox:{nativeType:"craft-checkbox",fallbackTag:"input",fallbackClasses:"craft-checkbox",nativeProps:["checked","disabled","label"],render:(e,r)=>{let a=e.checked?"checked":"",i=e.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
|
|
937
937
|
<input type="checkbox" class="craft-checkbox" ${a} ${i}>
|
|
938
938
|
<span class="craft-checkbox-label">${r||e.label||""}</span>
|
|
939
939
|
</label>`}},radio:{nativeType:"craft-radio",fallbackTag:"input",fallbackClasses:"craft-radio",nativeProps:["checked","disabled","name","value","label"]},select:{nativeType:"craft-select",fallbackTag:"select",fallbackClasses:"craft-select",nativeProps:["value","disabled","options","placeholder"]},slider:{nativeType:"craft-slider",fallbackTag:"input",fallbackClasses:"craft-slider",nativeProps:["value","min","max","step","disabled"],render:(e,r)=>{let a=e.min??0,i=e.max??100,s=e.step??1,t=e.value??50,n=e.disabled?"disabled":"";return`<input type="range" class="craft-slider" min="${a}" max="${i}" step="${s}" value="${t}" ${n}>`}},label:{nativeType:"craft-label",fallbackTag:"span",fallbackClasses:"craft-label",nativeProps:["text","for"]},badge:{nativeType:"craft-badge",fallbackTag:"span",fallbackClasses:"craft-badge",nativeProps:["variant","size"]},avatar:{nativeType:"craft-avatar",fallbackTag:"div",fallbackClasses:"craft-avatar",nativeProps:["src","alt","size","fallback"],render:(e,r)=>{let a=e.size||40,i=e.src,s=String(e.alt||""),t=e.fallback||(s?s.charAt(0).toUpperCase():"?");if(i)return`<img class="craft-avatar" src="${i}" alt="${s}" style="width:${a}px;height:${a}px;border-radius:50%">`;return`<div class="craft-avatar craft-avatar-fallback" style="width:${a}px;height:${a}px;border-radius:50%;display:flex;align-items:center;justify-content:center">${t}</div>`}},progress:{nativeType:"craft-progress",fallbackTag:"div",fallbackClasses:"craft-progress",nativeProps:["value","max","variant"],render:(e,r)=>{let a=Number(e.value)||0,i=Number(e.max)||100;return`<div class="craft-progress"><div class="craft-progress-bar" style="width:${Math.min(100,Math.max(0,a/i*100))}%"></div></div>`}},spinner:{nativeType:"craft-spinner",fallbackTag:"div",fallbackClasses:"craft-spinner",nativeProps:["size"],render:(e,r)=>{let a=e.size||24;return`<div class="craft-spinner" style="width:${a}px;height:${a}px"></div>`}},card:{nativeType:"craft-card",fallbackTag:"div",fallbackClasses:"craft-card",nativeProps:["title","subtitle","variant"]},modal:{nativeType:"craft-modal",fallbackTag:"dialog",fallbackClasses:"craft-modal",nativeProps:["open","title","closable","size"],render:(e,r)=>{let a=e.open?"open":"",i=e.title||"";return`<dialog class="craft-modal" ${a}>
|
|
@@ -947,7 +947,7 @@ ${a}`);return a+e}var Fr={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
947
947
|
</details>`}},divider:{nativeType:"craft-divider",fallbackTag:"hr",fallbackClasses:"craft-divider",nativeProps:["orientation","variant"]},table:{nativeType:"craft-table",fallbackTag:"table",fallbackClasses:"craft-table",nativeProps:["columns","rows","sortable","selectable"]},list:{nativeType:"craft-list",fallbackTag:"ul",fallbackClasses:"craft-list",nativeProps:["items","selectable"]},tree:{nativeType:"craft-tree",fallbackTag:"div",fallbackClasses:"craft-tree",nativeProps:["nodes","expandable","selectable"]},alert:{nativeType:"craft-alert",fallbackTag:"div",fallbackClasses:"craft-alert",nativeProps:["variant","title","dismissible"],render:(e,r)=>{let a=e.variant||"info",i=e.title||"";return`<div class="craft-alert craft-alert-${a}" role="alert">
|
|
948
948
|
${i?`<div class="craft-alert-title">${i}</div>`:""}
|
|
949
949
|
<div class="craft-alert-content">${r}</div>
|
|
950
|
-
</div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(e,r)=>{let a=e.content||"",i=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${a}" data-position="${i}">${r}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections","spaces","selectedSpace"],render:j},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:H},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:V},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:W},pagination:{nativeType:"craft-pagination",fallbackTag:"nav",fallbackClasses:"craft-pagination",nativeProps:["total","page","pageSize"]},"code-editor":{nativeType:"craft-code-editor",fallbackTag:"textarea",fallbackClasses:"craft-code-editor",nativeProps:["value","language","theme","readonly","lineNumbers"]},"file-browser":{nativeType:"craft-file-browser",fallbackTag:"div",fallbackClasses:"craft-file-browser",nativeProps:["path","showHidden","selectable"]},"color-picker":{nativeType:"craft-color-picker",fallbackTag:"input",fallbackClasses:"craft-color-picker",nativeProps:["value","format"],render:(e,r)=>`<input type="color" class="craft-color-picker" value="${e.value||"#000000"}">`},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(e,r)=>{let a=e.value||"",i=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${a}" min="${i}" max="${s}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(e,r)=>`<input type="time" class="craft-time-picker" value="${e.value||""}">`}},
|
|
950
|
+
</div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(e,r)=>{let a=e.content||"",i=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${a}" data-position="${i}">${r}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections","spaces","selectedSpace"],render:j},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:H},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:V},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:W},pagination:{nativeType:"craft-pagination",fallbackTag:"nav",fallbackClasses:"craft-pagination",nativeProps:["total","page","pageSize"]},"code-editor":{nativeType:"craft-code-editor",fallbackTag:"textarea",fallbackClasses:"craft-code-editor",nativeProps:["value","language","theme","readonly","lineNumbers"]},"file-browser":{nativeType:"craft-file-browser",fallbackTag:"div",fallbackClasses:"craft-file-browser",nativeProps:["path","showHidden","selectable"]},"color-picker":{nativeType:"craft-color-picker",fallbackTag:"input",fallbackClasses:"craft-color-picker",nativeProps:["value","format"],render:(e,r)=>`<input type="color" class="craft-color-picker" value="${e.value||"#000000"}">`},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(e,r)=>{let a=e.value||"",i=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${a}" min="${i}" max="${s}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(e,r)=>`<input type="time" class="craft-time-picker" value="${e.value||""}">`}},ui=`
|
|
951
951
|
<style id="craft-component-styles">
|
|
952
952
|
/* Craft Component Base Styles */
|
|
953
953
|
.craft-button {
|
|
@@ -1365,7 +1365,7 @@ ${a}`);return a+e}var Fr={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
1367
|
</style>
|
|
1368
|
-
`,
|
|
1368
|
+
`,ru=`
|
|
1369
1369
|
<script id="craft-component-runtime">
|
|
1370
1370
|
(function() {
|
|
1371
1371
|
if (window.__stxCraftComponentRuntime) return;
|
|
@@ -1469,7 +1469,7 @@ ${a}`);return a+e}var Fr={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
1469
1469
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
1470
1470
|
})();
|
|
1471
1471
|
</script>
|
|
1472
|
-
`;function
|
|
1472
|
+
`;function di(e,r={}){let{classPrefix:a="craft"}=r;if(!e.includes("craft-component-styles"))if(e.includes("</head>"))e=e.replace("</head>",`${`
|
|
1473
1473
|
<style id="craft-component-styles">
|
|
1474
1474
|
/* Craft Component Base Styles */
|
|
1475
1475
|
.craft-button {
|
|
@@ -2934,7 +2934,7 @@ ${a}`);return a+e}var Fr={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
2934
2934
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
2935
2935
|
})();
|
|
2936
2936
|
</script>
|
|
2937
|
-
`;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(i,s,t)=>R("sidebar",s,t.trim(),r,a)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(i,s)=>R("sidebar",s,"",r,a)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(i,s,t)=>R(s,t,"",r,a)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(i,s,t,n)=>R(s,t,n.trim(),r,a)),e}function R(e,r,a,i,s){let t=i.components?.[e]||
|
|
2937
|
+
`;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(i,s,t)=>R("sidebar",s,t.trim(),r,a)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(i,s)=>R("sidebar",s,"",r,a)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(i,s,t)=>R(s,t,"",r,a)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(i,s,t,n)=>R(s,t,n.trim(),r,a)),e}function R(e,r,a,i,s){let t=i.components?.[e]||Pr[e];if(!t)return console.warn(`[stx] Unknown Craft component: @craft-${e}`),`<div class="${s}-unknown" data-component="${e}">${a}</div>`;let n=A(r),c=[t.fallbackClasses||`${s}-${e}`];if(n.class)c.push(n.class),delete n.class;if(t.render)return n.__fallbackClasses=c.join(" "),t.render(n,a);let d=ee(n,t,c);if(["input","hr","br","img"].includes(t.fallbackTag))return`<${t.fallbackTag} ${d}>`;return`<${t.fallbackTag} ${d}>${a}</${t.fallbackTag}>`}function A(e){let r={},a=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,i;while((i=a.exec(e))!==null){let[s,t,n,c]=i,d=n??c;if(s.startsWith(":"))r[t]=d;else if(s.startsWith("@"))r[`on${t.charAt(0).toUpperCase()}${t.slice(1)}`]=d;else if(d===void 0)r[t]=!0;else r[t]=d}return r}function j(e,r){let a=I(String(e.id||`craft-sidebar-${K(r||JSON.stringify(e))}`)),i=Q(e.spaces)||Y(r),s=i.length?[]:X(e.sections)||F(r),t=String(e.selectedSpace||i[0]?.id||""),n=i.find((g)=>g.id===t)||i[0],c=String(e.selectedItem||e.selected||(i.length?n?.sections[0]?.items[0]?.id:s[0]?.items[0]?.id)||""),d={id:a,variant:String(e.variant||"desktop"),material:String(e.material||"sidebar"),backgroundEffect:String(e.backgroundEffect||"shimmer"),allowsVibrancy:e.allowsVibrancy!==!1&&e.allowsVibrancy!=="false",materialOpacity:Number(e.materialOpacity??0.68),materialDarkOpacity:e.materialDarkOpacity===void 0?void 0:Number(e.materialDarkOpacity),minWidth:e.minWidth===void 0?240:Number(e.minWidth),maxWidth:e.maxWidth===void 0?340:Number(e.maxWidth),canCollapse:e.canCollapse!==!1&&e.canCollapse!=="false",searchPlaceholder:e.searchPlaceholder?String(e.searchPlaceholder):void 0,selectedItem:c,sections:s,spaces:i,selectedSpace:t||void 0},l=String(e.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),p=Number(e.width||e.sidebarWidth||286),f=e.native===!1||e.native==="false"?"false":"true",x=d.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${C(d.searchPlaceholder)}"></div>`:"",b;if(i.length)b=G(i,t,c);else if(s.length)b=s.map((g)=>D(g,c)).join("");else b=r;return`<aside class="${h(l)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${h(a)}" data-native="${f}" style="--craft-sidebar-width:${p}px">
|
|
2938
2938
|
${x}
|
|
2939
2939
|
${b}
|
|
2940
2940
|
</aside>
|
|
@@ -2955,7 +2955,7 @@ ${a}`);return a+e}var Fr={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
2955
2955
|
${e.icon?`<span class="craft-sidebar-item-icon" data-icon="${h(e.icon)}"${a}></span>`:""}
|
|
2956
2956
|
<span class="craft-sidebar-item-label">${C(e.label)}</span>
|
|
2957
2957
|
${e.badge?`<span class="craft-sidebar-item-badge">${C(e.badge)}</span>`:""}
|
|
2958
|
-
</button>`}function I(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function K(e){let r=5381;for(let a=0;a<e.length;a++)r=r*33^e.charCodeAt(a);return(r>>>0).toString(36)}function C(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return C(e).replace(/`/g,"`")}function Z(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ee(e,r,a){let i=[];i.push(`class="${a.join(" ")}"`),i.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)i.push(s);else if(t!==!1&&t!==void 0&&t!==null){let n=String(t).replace(/"/g,""");i.push(`${s}="${n}"`)}return i.join(" ")}function
|
|
2958
|
+
</button>`}function I(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function K(e){let r=5381;for(let a=0;a<e.length;a++)r=r*33^e.charCodeAt(a);return(r>>>0).toString(36)}function C(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return C(e).replace(/`/g,"`")}function Z(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ee(e,r,a){let i=[];i.push(`class="${a.join(" ")}"`),i.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)i.push(s);else if(t!==!1&&t!==void 0&&t!==null){let n=String(t).replace(/"/g,""");i.push(`${s}="${n}"`)}return i.join(" ")}function su(e,r){Pr[e]=r}function iu(){return{...Pr}}async function pi(e){let r=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||P(),format:e.format||"app",error:`Input file not found: ${e.input}`};let a=e.target||P(),i=e.format||ue(a),s=e.output||o(process.cwd(),"dist","native");if(!z(s))v(s,{recursive:!0});let t=await yi(e.input,{context:e.context,options:{isDev:!1}});if(t=li(t,{debug:e.verbose}),t=di(t),!t.includes("craft-component-styles")){if(t.includes("</head>"))t=t.replace("</head>",`${ui}
|
|
2959
2959
|
</head>`)}let n=e.name||te(e.input,".stx"),c=e.version||"1.0.0",d=e.craftPath||await fe();if(!d)return{success:!1,target:a,format:i,error:"Craft binary not found. Please install Craft or specify craftPath."};if(e.verbose)console.log(`\uD83D\uDCE6 Building native app for ${a}...`),console.log(` Input: ${e.input}`),console.log(` Output: ${s}`),console.log(` Craft: ${d}`);let l;switch(a){case"macos":l=await ie(t,n,c,s,i,e,d);break;case"windows":l=await oe(t,n,c,s,i,e,d);break;case"linux":l=await ce(t,n,c,s,i,e,d);break;case"ios":l=await de(t,n,c,s,e,d);break;case"android":l=await le(t,n,c,s,e,d);break;default:l={success:!1,target:a,format:i,error:`Unsupported target: ${a}`}}return l.duration=Date.now()-r,l}catch(a){return{success:!1,target:e.target||P(),format:e.format||"app",error:a.message,duration:Date.now()-r}}}async function ie(e,r,a,i,s,t,n){let c=t.bundleId||`com.stx.${r.toLowerCase().replace(/[^a-z0-9]/g,"")}`,d=o(i,`${r}.app`),l=o(d,"Contents"),p=o(l,"MacOS"),f=o(l,"Resources");v(p,{recursive:!0}),v(f,{recursive:!0});let x=o(f,"index.html");await Bun.write(x,e);let b="";if(t.sidebar?.enabled&&t.sidebar?.config)b=o(f,"sidebar-config.json"),await Bun.write(b,JSON.stringify(t.sidebar.config));let g=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",m=t.menubarOnly??t.systemTray;if((t.bundleStyle||(await se(n)?"executable":"launcher"))==="executable"){let S=o(p,r);k(n,S),T(S,493);let w={html:"index.html",title:t.window?.title||r,width:t.window?.width||1200,height:t.window?.height||800,devTools:Boolean(t.devTools)};if(m)w.menubarOnly=!0;else if(t.systemTray)w.systemTray=!0;if(t.window?.frameless)w.frameless=!0;if(t.window?.transparent)w.transparent=!0;if(t.window?.alwaysOnTop)w.alwaysOnTop=!0;if(t.window?.resizable===!1)w.resizable=!1;await Bun.write(o(f,"craft.json"),`${JSON.stringify(w,null,2)}
|
|
2960
2960
|
`)}else{let S=o(p,"craft");k(n,S),T(S,493);let w=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",U=`#!/bin/bash
|
|
2961
2961
|
set -euo pipefail
|
|
@@ -3018,5 +3018,5 @@ Exec=${a.toLowerCase()}
|
|
|
3018
3018
|
Terminal=false
|
|
3019
3019
|
Categories=Utility;
|
|
3020
3020
|
Icon=${a.toLowerCase()}
|
|
3021
|
-
`;u("fs").writeFileSync(o(n,`${a.toLowerCase()}.desktop`),b);let g=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(u("fs").writeFileSync(o(n,`${a.toLowerCase()}.png`),g),i.icon&&z(i.icon))k(i.icon,o(n,`${a.toLowerCase()}.png`));let m=E("appimagetool",[n,r],{env:{...process.env,ARCH:"x86_64"}});m.on("close",(y)=>{if(u("fs").rmSync(t,{recursive:!0,force:!0}),y===0)T(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${y}. Install from https://appimage.github.io/appimagetool/`})}),m.on("error",(y)=>{u("fs").rmSync(t,{recursive:!0,force:!0}),s({success:!1,error:`appimagetool not found: ${y.message}`})})}catch(t){s({success:!1,error:t.message})}})}function
|
|
3022
|
-
export{
|
|
3021
|
+
`;u("fs").writeFileSync(o(n,`${a.toLowerCase()}.desktop`),b);let g=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(u("fs").writeFileSync(o(n,`${a.toLowerCase()}.png`),g),i.icon&&z(i.icon))k(i.icon,o(n,`${a.toLowerCase()}.png`));let m=E("appimagetool",[n,r],{env:{...process.env,ARCH:"x86_64"}});m.on("close",(y)=>{if(u("fs").rmSync(t,{recursive:!0,force:!0}),y===0)T(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${y}. Install from https://appimage.github.io/appimagetool/`})}),m.on("error",(y)=>{u("fs").rmSync(t,{recursive:!0,force:!0}),s({success:!1,error:`appimagetool not found: ${y.message}`})})}catch(t){s({success:!1,error:t.message})}})}function fi(){return[P()]}function gi(e){switch(e){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var he={buildNative:pi,getAvailableTargets:fi,getAvailableFormats:gi,detectPlatform:P},ou=he;
|
|
3022
|
+
export{eu,ci,tu,nu,li,Pr,ui,ru,di,su,iu,pi,fi,gi,ou};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{createHash as g}from"crypto";import{readFile as v,stat as y}from"fs/promises";async function E(e){try{let t=await v(e);return g("sha256").update(t).digest("hex").slice(0,16)}catch{return""}}function l(e){return g("sha256").update(e).digest("hex").slice(0,16)}function m(e,t){let r=JSON.stringify(t,Object.keys(t).sort());return`${l(e)}-${l(r)}`}async function h(e){try{return(await y(e)).mtimeMs}catch{return 0}}async function x(e){try{return await y(e),!0}catch{return!1}}import{mkdir as A,readFile as P,writeFile as k,readdir as H,rm as D,stat as O}from"fs/promises";import{join as w,dirname as S}from"path";var c=new Map,d={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function M(e){try{await A(e,{recursive:!0})}catch{}}function p(e,t,r){return w(e,r,`${t}.json`)}async function C(e,t,r){if((Date.now()-e.createdAt)/86400000>r)return!1;if(await h(t)!==e.srcMtime)return!1;return!0}async function
|
|
3
|
-
export{E,x,
|
|
2
|
+
import{createHash as g}from"crypto";import{readFile as v,stat as y}from"fs/promises";async function E(e){try{let t=await v(e);return g("sha256").update(t).digest("hex").slice(0,16)}catch{return""}}function l(e){return g("sha256").update(e).digest("hex").slice(0,16)}function m(e,t){let r=JSON.stringify(t,Object.keys(t).sort());return`${l(e)}-${l(r)}`}async function h(e){try{return(await y(e)).mtimeMs}catch{return 0}}async function x(e){try{return await y(e),!0}catch{return!1}}import{mkdir as A,readFile as P,writeFile as k,readdir as H,rm as D,stat as O}from"fs/promises";import{join as w,dirname as S}from"path";var c=new Map,d={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function M(e){try{await A(e,{recursive:!0})}catch{}}function p(e,t,r){return w(e,r,`${t}.json`)}async function C(e,t,r){if((Date.now()-e.createdAt)/86400000>r)return!1;if(await h(t)!==e.srcMtime)return!1;return!0}async function Lt(e,t,r,a=d){if(!a.enabled)return null;let n=m(e,t),i=c.get(n);if(i){if(await C(i,e,a.maxAge))return i.lastAccessedAt=Date.now(),i.data;c.delete(n)}let o=p(a.directory,n,r);if(await x(o))try{let u=await P(o,"utf-8"),s=JSON.parse(u);if(await C(s,e,a.maxAge))return s.lastAccessedAt=Date.now(),c.set(n,s),s.data}catch{}return null}async function jt(e,t,r,a,n=d){if(!n.enabled)return;let i=m(e,t),o=await E(e),u=await h(e),s={key:i,src:e,srcHash:o,srcMtime:u,optionsHash:m("",t),data:r,createdAt:Date.now(),lastAccessedAt:Date.now()};c.set(i,s);let f=p(n.directory,i,a);try{await M(S(f)),await k(f,JSON.stringify(s,null,2))}catch(b){console.warn(`[stx-media] Failed to write cache: ${b}`)}}async function Bt(e,t=d){if(e==="all")c.clear();else c.clear();let r=e==="all"?["image","video"]:[e];for(let a of r){let n=w(t.directory,a);try{await D(n,{recursive:!0,force:!0})}catch{}}}
|
|
3
|
+
export{E,x,Lt,jt,Bt};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ae}from"./chunk-pb0fgdvn.js";function Tn(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Ae(e),i=`
|
|
3
3
|
<!-- stx PWA Meta Tags -->
|
|
4
4
|
<link rel="manifest" href="/manifest.json">
|
|
5
5
|
<meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
|
|
@@ -43,12 +43,12 @@ if ('serviceWorker' in navigator) {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
</script>
|
|
46
|
-
<!-- End stx PWA -->`,i}function
|
|
47
|
-
`+e.slice(o)}return e+
|
|
48
|
-
</head>`)}function
|
|
46
|
+
<!-- End stx PWA -->`,i}function Dr(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=e.lastIndexOf("</body>");if(o!==-1){let i=Tn(n);return e.slice(0,o)+i+`
|
|
47
|
+
`+e.slice(o)}return e+Tn(n)}let t=Tn(n);return e.replace("</head>",`${t}
|
|
48
|
+
</head>`)}function ka(e){if(!e.pwa?.enabled)return"";return`<script>
|
|
49
49
|
if ('serviceWorker' in navigator) {
|
|
50
50
|
window.addEventListener('load', function() {
|
|
51
|
-
navigator.serviceWorker.register('/${
|
|
51
|
+
navigator.serviceWorker.register('/${Ae(e)}')
|
|
52
52
|
.then(function(registration) {
|
|
53
53
|
console.log('[PWA] Service Worker registered:', registration.scope);
|
|
54
54
|
})
|
|
@@ -57,5 +57,5 @@ if ('serviceWorker' in navigator) {
|
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
</script>`}function
|
|
61
|
-
export{
|
|
60
|
+
</script>`}function Ca(){return'<link rel="manifest" href="/manifest.json">'}function $a(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
61
|
+
export{Tn,Dr,ka,Ca,$a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Qc}from"./chunk-yrbzsrde.js";import"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{Qc as buildApp};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{De,Fa,hu,yu,bu,vu,za,Ha,wu,xu,Di,Su,Jt,Yt,In}from"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{vu as __setSignalsGeneratorsForTest,De as cacheEngineFingerprint,Yt as cacheTemplate,Jt as checkCache,Su as clearDevCaches,Ha as getCachedRouterScript,za as getCachedSignalsRuntime,wu as getServeClientAsset,Di as getServeModuleBundle,In as hashFilePath,yu as invalidateFileCache,bu as invalidateFileCacheByDir,hu as readFileCached,xu as registerServeModuleBundle,Fa as templateCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{W,r}from"./chunk-1680nbq4.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
|
|
3
3
|
${e.bold}${t[0]}${e.reset} - ${n.description}`),console.log(` Usage: ${e.cyan}${n.usage}${e.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${e.bold}Available Commands:${e.reset}
|
|
@@ -8,7 +8,7 @@ ${e.dim}Type 'help <command>' for more details${e.reset}
|
|
|
8
8
|
`)}}},render:{description:"Render a template file",usage:"render <file> [--raw]",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file to render${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!await Bun.file(n).exists()){console.log(`${e.red}Error: File not found: ${n}${e.reset}`);return}try{let s=await Bun.file(n).text(),l=t.includes("--raw");console.log(`
|
|
9
9
|
${e.dim}Rendering ${n}...${e.reset}
|
|
10
10
|
`);let c=await r(s,o.context,n,{},new Set);if(o.lastResult=c,l)console.log(c);else c.split(`
|
|
11
|
-
`).forEach((d,i)=>{let f=String(i+1).padStart(3," ");console.log(`${e.dim}${f}${e.reset} ${d}`)});console.log()}catch(s){console.log(`${e.red}Error rendering template:${e.reset}`,s)}}},eval:{description:"Evaluate an expression",usage:"eval <expression>",handler:async(t,o)=>{if(!t.length){console.log(`${e.red}Error: Please provide an expression to evaluate${e.reset}`);return}let n=t.join(" ");try{let s=`{{ ${n} }}`,c=(await
|
|
11
|
+
`).forEach((d,i)=>{let f=String(i+1).padStart(3," ");console.log(`${e.dim}${f}${e.reset} ${d}`)});console.log()}catch(s){console.log(`${e.red}Error rendering template:${e.reset}`,s)}}},eval:{description:"Evaluate an expression",usage:"eval <expression>",handler:async(t,o)=>{if(!t.length){console.log(`${e.red}Error: Please provide an expression to evaluate${e.reset}`);return}let n=t.join(" ");try{let s=`{{ ${n} }}`,c=(await W(s,o.context,"eval")).trim();o.lastResult=c,console.log(`${e.green}\u2192${e.reset} ${c}`)}catch(s){console.log(`${e.red}Error:${e.reset}`,s)}}},set:{description:"Set a context variable",usage:"set <key> <value>",handler:async(t,o)=>{if(t.length<2){console.log(`${e.red}Error: Usage: set <key> <value>${e.reset}`);return}let n=t[0],s=t.slice(1).join(" "),l;try{l=JSON.parse(s)}catch{l=s}o.context[n]=l,console.log(`${e.green}\u2713${e.reset} ${n} = ${JSON.stringify(l)}`)}},unset:{description:"Remove a context variable",usage:"unset <key>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a variable to remove${e.reset}`);return}if(t[0]in o.context)delete o.context[t[0]],console.log(`${e.green}\u2713${e.reset} Removed ${t[0]}`);else console.log(`${e.yellow}Variable not found: ${t[0]}${e.reset}`)}},context:{description:"Show current context variables",usage:"context",handler:async(t,o)=>{let n=Object.keys(o.context);if(n.length===0){console.log(`${e.dim}Context is empty${e.reset}`);return}console.log(`
|
|
12
12
|
${e.bold}Context Variables:${e.reset}
|
|
13
13
|
`);for(let s of n){let l=o.context[s],c=Array.isArray(l)?"array":typeof l,a=JSON.stringify(l).slice(0,50);console.log(` ${e.cyan}${s}${e.reset} ${e.dim}(${c})${e.reset}: ${a}${a.length>=50?"...":""}`)}console.log()}},clear:{description:"Clear context or screen",usage:"clear [context|screen]",handler:async(t,o)=>{if(t[0]==="context"||!t[0])o.context={},console.log(`${e.green}\u2713${e.reset} Context cleared`);if(t[0]==="screen"||!t[0])console.clear()}},cd:{description:"Change working directory",usage:"cd <directory>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.cyan}${o.cwd}${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!p.existsSync(n)){console.log(`${e.red}Error: Directory not found: ${n}${e.reset}`);return}if(!p.statSync(n).isDirectory()){console.log(`${e.red}Error: Not a directory: ${n}${e.reset}`);return}o.cwd=n,console.log(`${e.green}\u2713${e.reset} ${n}`)}},ls:{description:"List files in current directory",usage:"ls [pattern]",handler:async(t,o)=>{let n=t[0]||"*",s=new Bun.Glob(n),l=[];for await(let i of s.scan({cwd:o.cwd,onlyFiles:!1}))l.push(i);if(l.length===0){console.log(`${e.dim}No files found${e.reset}`);return}l.sort();let c=l.filter((i)=>i.endsWith(".stx")),a=l.filter((i)=>i.endsWith(".md")),d=l.filter((i)=>!i.endsWith(".stx")&&!i.endsWith(".md"));if(c.length>0)console.log(`
|
|
14
14
|
${e.bold}Templates:${e.reset}`),c.forEach((i)=>console.log(` ${e.green}${i}${e.reset}`));if(a.length>0)console.log(`
|
|
@@ -16,9 +16,9 @@ ${e.bold}Markdown:${e.reset}`),a.forEach((i)=>console.log(` ${e.blue}${i}${e.re
|
|
|
16
16
|
${e.bold}Other:${e.reset}`),d.forEach((i)=>console.log(` ${e.dim}${i}${e.reset}`));console.log()}},cat:{description:"Show file contents",usage:"cat <file>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!await Bun.file(n).exists()){console.log(`${e.red}Error: File not found: ${n}${e.reset}`);return}let l=(await Bun.file(n).text()).split(`
|
|
17
17
|
`);console.log(),l.forEach((c,a)=>{let d=String(a+1).padStart(3," ");console.log(`${e.dim}${d}${e.reset} ${c}`)}),console.log()}},load:{description:"Load context from JSON file",usage:"load <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a JSON file${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!await Bun.file(n).exists()){console.log(`${e.red}Error: File not found: ${n}${e.reset}`);return}try{let s=await Bun.file(n).text(),l=JSON.parse(s);o.context={...o.context,...l},console.log(`${e.green}\u2713${e.reset} Loaded ${Object.keys(l).length} variables from ${t[0]}`)}catch(s){console.log(`${e.red}Error parsing JSON:${e.reset}`,s)}}},save:{description:"Save context to JSON file",usage:"save <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file name${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);try{await Bun.write(n,JSON.stringify(o.context,null,2)),console.log(`${e.green}\u2713${e.reset} Context saved to ${t[0]}`)}catch(s){console.log(`${e.red}Error saving file:${e.reset}`,s)}}},history:{description:"Show command history",usage:"history [count]",handler:async(t,o)=>{let n=t[0]?Number.parseInt(t[0],10):20,s=o.history.slice(-n);if(s.length===0){console.log(`${e.dim}No history${e.reset}`);return}console.log(),s.forEach((l,c)=>{let a=String(o.history.length-s.length+c+1).padStart(3," ");console.log(`${e.dim}${a}${e.reset} ${l}`)}),console.log()}},exit:{description:"Exit interactive mode",usage:"exit",handler:async(t,o)=>{o.running=!1,console.log(`
|
|
18
18
|
${e.dim}Goodbye!${e.reset}
|
|
19
|
-
`)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let n=t.split(" "),s=n[0];if(n.length===1)return Object.keys(u).filter((l)=>l.startsWith(s));if(["render","cat","load","cd"].includes(s)){let l=n.slice(1).join(" "),c=g.dirname(l)||".",a=g.basename(l),d=g.resolve(o.cwd,c);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${s} ${c==="."?"":`${c}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(s)){let l=n[1]||"";return Object.keys(o.context).filter((c)=>c.startsWith(l)).map((c)=>`${s} ${c}`)}return[]}async function
|
|
19
|
+
`)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let n=t.split(" "),s=n[0];if(n.length===1)return Object.keys(u).filter((l)=>l.startsWith(s));if(["render","cat","load","cd"].includes(s)){let l=n.slice(1).join(" "),c=g.dirname(l)||".",a=g.basename(l),d=g.resolve(o.cwd,c);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${s} ${c==="."?"":`${c}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(s)){let l=n[1]||"";return Object.keys(o.context).filter((c)=>c.startsWith(l)).map((c)=>`${s} ${c}`)}return[]}async function Fc(t={}){let o={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},n=y.createInterface({input:process.stdin,output:process.stdout,completer:(l)=>[h(l,o),l],historySize:t.maxHistory||100});console.log(`
|
|
20
20
|
${e.bold}${e.blue}stx Interactive Mode${e.reset}
|
|
21
21
|
${e.dim}Type 'help' for available commands, 'exit' to quit${e.reset}
|
|
22
|
-
`);let s=()=>{let l=o.cwd.replace(process.env.HOME||"","~");n.question(`${e.cyan}stx${e.reset} ${e.dim}${l}${e.reset} ${e.green}>${e.reset} `,async(c)=>{let a=c.trim();if(!a){if(o.running)s();return}o.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],i=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(i&&u[i])try{await u[i].handler(f,o)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(i)if(a.includes("{{")||a.includes("}}"))try{let m=await
|
|
22
|
+
`);let s=()=>{let l=o.cwd.replace(process.env.HOME||"","~");n.question(`${e.cyan}stx${e.reset} ${e.dim}${l}${e.reset} ${e.green}>${e.reset} `,async(c)=>{let a=c.trim();if(!a){if(o.running)s();return}o.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],i=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(i&&u[i])try{await u[i].handler(f,o)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(i)if(a.includes("{{")||a.includes("}}"))try{let m=await W(a,o.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(o.running)s();else n.close()})};n.on("SIGINT",()=>{console.log(`
|
|
23
23
|
${e.dim}(Use 'exit' to quit)${e.reset}`),s()}),s()}
|
|
24
|
-
export{
|
|
24
|
+
export{Fc};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{y,De,I,Gt,i,T}from"./chunk-1680nbq4.js";import{jr}from"./chunk-mj6fme15.js";import{s,ye}from"./chunk-e83j8xe9.js";import{a}from"./chunk-mcqn70v8.js";import f from"path";import b from"fs";function de(e){if(!e||typeof e!=="object")return!1;let t=e;return typeof t.message==="string"&&(t.name==="BuildMessage"||t.name==="ResolveMessage"||("position"in t))}function pe(e){if(e&&typeof e==="object"&&Array.isArray(e.errors))return e.errors;return[e]}function z(e,t){let r=[];for(let l of pe(e)){if(de(l)){let u=l.position||void 0;r.push({file:t||u?.file,line:u?.line,column:u?.column,message:l.message??"",lineText:u?.lineText});continue}r.push({file:t,message:l instanceof Error?l.message:String(l)})}return r}function Pe(e,t){return z(e,t).map((r)=>{let l=r.file?`${r.file}${r.line?`:${r.line}${r.column?`:${r.column}`:""}`:""}`:"",u=r.lineText?`
|
|
3
|
+
${r.lineText.trim()}`:"";return l?`${l}: ${r.message}${u}`:`${r.message}${u}`}).join(`
|
|
4
|
+
`)}var me=9;function J(e,t,r){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(f.basename(e))||jr(e,t,r)}var re=1,se=new Map,P=600,fe=100,V=new Map;async function ge(e){let t=V.get(e)??0;if(t>0&&t<fe){V.set(e,t+1);return}V.set(e,1);try{let r=(await b.promises.readdir(e)).filter((p)=>p.endsWith(".js"));if(r.length<=P)return;let u=(await Promise.all(r.map(async(p)=>{try{return{name:p,at:(await b.promises.stat(f.join(e,p))).mtimeMs}}catch{return null}}))).filter((p)=>p!==null);u.sort((p,d)=>d.at-p.at);for(let p of u.slice(P)){let d=p.name.slice(0,-3);await b.promises.rm(f.join(e,`${d}.js`),{force:!0}),await b.promises.rm(f.join(e,`${d}.deps.json`),{force:!0})}F("pruned bundle cache to",P,"entries")}catch{}}function oe(e){return se.get(e)??[]}function G(e,t){if(e)se.set(e,t)}function Ta(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function F(...e){if(Ta())console.log("[stx:bundler]",...e)}var q=[];function $i(e,t,r){q.push({filePath:e||"<inline>",message:t,details:r})}function dt(){return q.slice()}function pt(){q.length=0}var X;function cu(e){X=e}function Ei(){if(X)return X;try{let e=T.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var ee=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function ft(e){let t=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,r;while((r=t.exec(e))!==null){let u=r[1];if(!ee.some((d)=>d.test(u)))return F("detected user import:",u),!0}let l=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while((r=l.exec(e))!==null){let u=r[1];if(/\.css(?:\?.*)?$/.test(u))continue;if(!ee.some((d)=>d.test(u)))return F("detected side-effect import:",u),!0}return!1}var Kt="stx-module:",he=/\.(?:[cm]?[jt]sx?|json)$/i;function _a(e,t){return f.relative(e,t).split(f.sep).join("/")}function Ra(e,t){if(t.size===0)return e;return e.replace(/^([ \t]*import\s+(?:[^;"']*?\s+from\s+)?)(["'])([^"']+)\2/gm,(r,l,u,p)=>{let d=t.get(p);return d&&!p.startsWith(Kt)?`${l}${u}${d}${u}`:r})}function Aa(e,t){let r=0,l=(p)=>{let d=`__stxMod${r++}`,x=JSON.stringify(p);return t.push(`var ${d} = globalThis.__stxModules && globalThis.__stxModules[${x}];`,`if (${d} === undefined) throw new Error("[stx] module " + ${JSON.stringify(x)} + " is not registered on this page (#1957)");`),d},u=(p,d)=>{for(let x of p.split(",")){let v=x.trim();if(!v)continue;let c=v.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!c)continue;let n=c[1].startsWith('"')?JSON.parse(c[1]):c[1],o=c[2]??n;t.push(`var ${o} = ${d}[${JSON.stringify(n)}];`)}};return e=e.replace(/^[ \t]*import\s+([^;"']*?)\s+from\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,d,x)=>{let v=x.slice(Kt.length),c=l(v),n=d.trim(),o=n.match(/^([\w$]+)\s*(?:,\s*|$)/);if(o&&!n.startsWith("{")&&!n.startsWith("*"))t.push(`var ${o[1]} = ${c}.default;`),n=n.slice(o[0].length).trim();let m=n.match(/^\*\s*as\s+([\w$]+)$/);if(m)t.push(`var ${m[1]} = ${c};`);else if(n.startsWith("{"))u(n.replace(/^\{|\}$/g,""),c);return""}),e=e.replace(/^[ \t]*import\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,d)=>(l(d.slice(Kt.length)),"")),e}function te(e){let t=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,f.join(e,"index.ts"),f.join(e,"index.tsx"),f.join(e,"index.js"),f.join(e,"index.mjs")];for(let r of t)try{if(b.existsSync(r)&&b.statSync(r,{throwIfNoEntry:!1})?.isFile())return r}catch{}return}function xe(e,t,r,l,u,p=new Map,d){let x=(c,n,o)=>{if(J(n,e,d))return null;if(!u||c!==r||!he.test(n))return null;try{if(!b.statSync(n,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(n);let m=`${Kt}${_a(process.cwd(),n)}`;return p.set(o,m),{path:m,external:!0}},v=(c,n)=>{let o=c===r?t:f.dirname(c),m=f.resolve(o,n);return te(m)??m};return{name:"stx-client-bundle",setup(c){if(c.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(n)=>({path:n.path,external:!0})),c.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(n)=>({path:n.path,external:!0})),c.onResolve({filter:/^\//},(n)=>{let o=te(n.path);if(o){let m=x(n.importer,o,n.path);if(m)return m;if(o!==r)l.add(o);return{path:o}}return{path:n.path,external:!0}}),c.onResolve({filter:/^\.\.?\//},(n)=>{let o=v(n.importer,n.path),m=x(n.importer,o,n.path);if(m)return m;return l.add(o),{path:o}}),c.onResolve({filter:/^[@~]\//},(n)=>{let o=f.resolve(e,n.path.slice(2)),m=[o,`${o}.ts`,`${o}.tsx`,`${o}.js`,`${o}.mjs`,`${o}.jsx`,f.join(o,"index.ts"),f.join(o,"index.tsx"),f.join(o,"index.js"),f.join(o,"index.mjs")];for(let w of m)if(b.existsSync(w)&&b.statSync(w,{throwIfNoEntry:!1})?.isFile()){let N=x(n.importer,w,n.path);if(N)return N;return F(`resolved ${n.path[0]}/ import:`,n.path,"\u2192",w),l.add(w),{path:w}}return console.warn(`[stx:bundler] could not resolve ${n.path[0]}/ import:`,n.path),{path:o}}),u)c.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(n)=>{if(n.importer!==r)return;let o=`${Kt}npm:${n.path}`;return p.set(n.path,o),{path:o,external:!0}});c.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(n)=>{if(J(n.path,e,d))throw Error(`Server-only API source cannot be imported by a client script: ${n.path}`);let o=f.extname(n.path).toLowerCase(),m=o===".json"?"json":o===".tsx"?"tsx":o===".jsx"?"jsx":o===".ts"||o===".mts"||o===".cts"?"ts":"js";if(n.path!==r)l.add(n.path);return{contents:b.readFileSync(n.path,"utf8"),loader:m}})}}}var W=new Map,O=I(64),ne=Symbol.for("stx.client-bundle-build-queue");function Pa(e){let t=globalThis,l=(t[ne]??Promise.resolve()).then(e,e);return t[ne]=l.then(()=>{return},()=>{return}),l}async function gt(e,t,r={}){let l=r.projectRoot||process.cwd(),u=(await i(l)).serverApi,p=r.minify??!1,d=r.externalizeUserModules??!0,x=r.cacheDir||a(l,"bundle-cache"),v=new Bun.CryptoHasher("md5");v.update(`${me}\x00${De()}\x00${JSON.stringify(u??!1)}\x00${d?"registry":"inline"}\x00${e}\x00${t}`);let c=v.digest("hex").slice(0,12),n=f.join(x,`${c}.js`),o=O.get(n);if(o){if(Gt(o.files)&&o.files.every((E)=>!J(E.path,l,u))){F("memo hit:",c);let E=o.files.map((S)=>S.path);return G(t,E),r.collectInputs?.push(...E),o.code}O.delete(n),F("memo invalidated by dep change:",c)}let m=f.join(x,`${c}.deps.json`),w=Bun.file(n);if(await w.exists()){let E=Bun.file(m),S=!1,B=null;if(await E.exists())try{let D=JSON.parse(await E.text());if(D.metadataVersion!==re||!Array.isArray(D.files))S=!1;else B=D.files,S=!0;if(B&&(!Gt(B)||B.some((k)=>J(k.path,l,u))))S=!1}catch{S=!1}if(S){if(F("cache hit:",c),B)G(t,B.map((k)=>k.path)),r.collectInputs?.push(...B.map((k)=>k.path));let D=await w.text();if(B)O.set(n,{code:D,files:B});return D}F("cache invalidated by dep change:",c)}let N=W.get(c);if(N){let E=await N;if(r.collectInputs)r.collectInputs.push(...(O.get(n)?.files??[]).map((S)=>S.path));return E}let _=Pa(()=>be(e,t,{projectRoot:l,minify:p,cacheDir:x,hash:c,cachePath:n,depsPath:m,collectInputs:r.collectInputs,externalizeUserModules:d,serverApi:u}));W.set(c,_);try{return await _}finally{W.delete(c)}}var $e=0;function Ia(e){return`${e}-${process.pid}-${++$e}`}async function be(e,t,r){let{projectRoot:l,minify:u,cacheDir:p,hash:d,cachePath:x,depsPath:v,externalizeUserModules:c}=r,n=a(l,"bundle-tmp"),o=Ia(d),m=f.join(n,`${o}.ts`),w=f.join(n,"out",o);b.mkdirSync(n,{recursive:!0}),b.mkdirSync(w,{recursive:!0});let N=f.dirname(t),_=new Set,E=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,S=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,B=s(e),{depths:D,balanced:k}=ye(B),H=(j)=>!k||D[j]===0,M;while((M=E.exec(B))!==null){if(M[1])continue;if(!H(M.index))continue;if(M[2])M[2].split(",").forEach((j)=>{let h=we(j);if(h)_.add(h)});else if(M[3])_.add(M[3])}while((M=S.exec(B))!==null){if(M[1])continue;if(!H(M.index))continue;_.add(M[2])}let ie=_.size>0?`
|
|
5
|
+
export { ${[..._].join(", ")} }`:"";await Bun.write(m,e+ie),F("bundling:",d,"from:",f.basename(t));let Z=new Set,Y=new Map;try{let j=await Bun.build({entrypoints:[m],outdir:w,target:"browser",format:"esm",minify:u,plugins:[xe(l,N,m,Z,c,Y,r.serverApi)],define:{"process.env.NODE_ENV":u?'"production"':'"development"',...y()},root:l});if(!j.success){let R=j.logs.filter((C)=>C.level==="error").map((C)=>C.message).join(", ")||`Unable to bundle ${f.basename(t)}`,L=z(j.logs,t||void 0);if(console.warn("[stx:bundler] build failed:",R),$i(t||"",R,L),Ei()==="error")throw Error(R);return e}let h="";for(let g of j.outputs){h=await g.text();break}let A=[];for(let g of h.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let R of g[1].split(",")){let L=R.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(L){A.push([L[2],L[1]]);continue}let C=R.trim();if(/^[A-Za-z_$][\w$]*$/.test(C))A.push([C,C])}let Q=[];h=Aa(Ra(h,Y),Q);let ae=h.match(/^\s*import\s+[^;]+;?\s*$/gm)||[];h=h.replace(/^\s*import\s+[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim();let K=`__stxBundle_${d}`,le=A.map(([g,R])=>`${JSON.stringify(g)}: ${R}`).join(", "),ce=A.map(([g])=>`var ${g} = undefined;`).join(`
|
|
6
|
+
`),ue=A.map(([g])=>`${g} = ${K}[${JSON.stringify(g)}];`).join(`
|
|
7
|
+
`);if(h=`${ae.join(`
|
|
8
|
+
`)}
|
|
9
|
+
${ce}
|
|
10
|
+
var ${K} = (function() {
|
|
11
|
+
${Q.join(`
|
|
12
|
+
`)}
|
|
13
|
+
${h}
|
|
14
|
+
return { ${le} };
|
|
15
|
+
})();
|
|
16
|
+
${ue}`.trim(),F("bundled:",d,"output:",h.length,"bytes"),_.size>0&&A.length===0)return console.warn(`[stx:bundler] dropped every binding for ${f.basename(t)} (${d}); serving the unbundled source and not caching this result`),e;b.mkdirSync(p,{recursive:!0}),await Bun.write(x,h);let U=Array.from(Z).map((g)=>{try{return{path:g,mtimeMs:b.statSync(g).mtimeMs}}catch{return null}}).filter((g)=>g!==null);return await Bun.write(v,JSON.stringify({metadataVersion:re,files:U})),G(t,U.map((g)=>g.path)),r.collectInputs?.push(...U.map((g)=>g.path)),O.set(x,{code:h,files:U}),await ge(p),h}catch(j){let h=z(j,t||void 0),A=Pe(j,t||void 0);if(console.warn(`[stx:bundler] error: ${A}`),$i(t||"",A,h),Ei()==="error")throw j;return e}finally{try{b.rmSync(m,{force:!0}),b.rmSync(w,{recursive:!0,force:!0})}catch{}}}function we(e){let t=e.trim();if(!t)return null;let r=t.indexOf("=");if(r!==-1)t=t.slice(0,r).trim();let l=t.indexOf(":");if(l!==-1)t=t.slice(l+1).trim();if(t.startsWith("..."))t=t.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(t)?t:null}
|
|
17
|
+
export{Pe,oe,Ta,$i,dt,pt,cu,Ei,ft,Kt,_a,Ra,Aa,Pa,gt,Ia};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Rn,Ie,Oe,ge,Ni,Dn,Z,q,en,d,r,A}from"./chunk-1680nbq4.js";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function _(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let n=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,n);function m(s,p){let u;while((u=s.exec(o))!==null){let t=u.index,i=t+u[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:n,content:m}=Rn(o),c=await(e.renderer??((s)=>Ie(s)))(m);return{html:_(c),frontmatter:n??{}}}import{dirname as C,resolve as R}from"path";function k(o){let e=o,n=Z(o);if(n)e=n.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),u;while((u=m.exec(o))!==null){let i=u[1],l=u[2],f=u[0],g=i.includes("server");if(p(l))s.push(f);else if(g)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let g=l.index+l[0].length,x=t.indexOf("</script>",g);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let g=f.length-1;g>=0;g--)t=t.substring(0,f[g].start)+t.substring(f[g].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function v(o,e){return`<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>${(e||"stx").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
${o}
|
|
11
|
+
</body>
|
|
12
|
+
</html>`}async function yi(o,e={}){let n=R(o),m=Bun.file(n);if(!await m.exists())throw Error(`Template file not found: ${n}`);let a=await m.text(),c=null;if(h(n)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=R(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:u,injectCSS:t,...i}=e,l={...e.context||{}};en(l);let f=await S(a,n,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),g=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(g,s,w)}return S(a,n,e)}async function S(o,e,n={}){let{templateContent:m,serverScripts:a,clientScripts:c}=k(o),s={...A,...n.options},p={__filename:e,__dirname:C(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:n.injectCSS===!0,__stxServeContext:void 0,...Dn(n.context??{}),definePageMeta:()=>{},...n.context||{}};for(let i of a)await d(i,p,e);let u=new Set,t=m;if(t=await r(t,p,e,s,u),Ni(p,n.context),n.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
|
|
13
|
+
${c.join(`
|
|
14
|
+
`)}`}else{if(n.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=Oe(p),g=(await Promise.all(c.map(async(w)=>{let y=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!y)return w;return await ge(y[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})}))).join(`
|
|
15
|
+
`);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${g}
|
|
16
|
+
$1`);else t+=`
|
|
17
|
+
${g}`}t=await q(t)}if(n.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=v(t,n.title)}if(n.injectCSS)try{let{injectCss:i}=await import("./chunk-w6h63b48.js");t=await i(t)}catch{}return t}
|
|
18
|
+
export{yi};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{m}from"./chunk-
|
|
2
|
+
import{m}from"./chunk-bk5ndwv3.js";import{H,wt,Fe,as,cs,qi,Xi,Ki,Gi,Bn,ls,Ji,Yi,Zi,i}from"./chunk-1680nbq4.js";import{Tr}from"./chunk-5vzamjf6.js";import{a}from"./chunk-mcqn70v8.js";import{existsSync as M,readFileSync as K}from"fs";import b from"path";var me=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),te=wt.filter((e)=>!me.has(e)).sort(),ne=[...m].sort(),he=[...new Set([...te,...ne])].sort(),be=new Set(te),ye=new Set(ne),xe=new Set(he),ee=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Se(e,t){if(t==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function ie(e,t){let r=[];for(let u of t){if(u.offset===void 0)continue;let s=u.kind==="server"?be:ye;ee.lastIndex=0;for(let l of u.code.matchAll(ee)){let g=l.index+l[0].indexOf("{")+1;for(let h of l[1].matchAll(/[^,]+/g)){let S=h[0];if(/^\s*type\s/.test(S))continue;let x=/^\s*([A-Za-z_$][\w$]*)/.exec(S);if(!x)continue;let o=x[1];if(!xe.has(o)||s.has(o))continue;let f=u.offset+g+h.index+x[0].length-o.length,p=e.slice(0,f),w=p.split(`
|
|
3
3
|
`).length;r.push({line:w,column:f-(p.lastIndexOf(`
|
|
4
|
-
`)+1)+1,offset:f,length:
|
|
5
|
-
`.repeat(e.startLine-1):"",s=
|
|
4
|
+
`)+1)+1,offset:f,length:o.length,name:o,kind:u.kind,message:Se(o,u.kind)})}}}return r}import T from"path";var ke="@stacksjs/stx-typescript-plugin";function we(e,t){let r=T.resolve(e);for(;;){let u=T.join(r,"tsconfig.json");if(t(u))return u;let s=T.dirname(r);if(s===r)return;r=s}}function se(e,t,r){let u=we(e,r);if(!u)return;let s=new Set,l=(g)=>{if(s.has(g))return;s.add(g);let h=t(g);if(!h)return;let S=h.compilerOptions?.plugins;if(Array.isArray(S)){let o=S.find((p)=>p?.name===ke),f=Array.isArray(o?.libs)?o.libs.filter((p)=>typeof p==="string"):[];return o?{configPath:g,libs:f.map((p)=>T.resolve(T.dirname(g),p))}:null}let x=typeof h.extends==="string"?[h.extends]:Array.isArray(h.extends)?h.extends:[];for(let o of[...x].reverse()){if(typeof o!=="string"||!o.startsWith("."))continue;let f=T.resolve(T.dirname(g),o.endsWith(".json")?o:`${o}.json`),p=l(f);if(p!==void 0)return p}return};return l(u)??void 0}function Mo(e,t="",r=""){let u=e.startLine>1?`
|
|
5
|
+
`.repeat(e.startLine-1):"",s=ls(e)+cs(as(e.code)),l=e.kind==="client"||e.kind==="plain"?Ki(t,e.code):"";return Bn(`${u+s}
|
|
6
6
|
${l}
|
|
7
7
|
export {}
|
|
8
8
|
`,r)}var $e=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function ve(e){if(e.length===0)return"";let t=["// Generated \u2014 the composables the runtime publishes as bare globals."],r=new Set(m),u=[];for(let{file:s,names:l}of e){let g=JSON.stringify(s.replace(/\\/g,"/").replace(/\.ts$/,""));u.push(` export * from ${g}`);for(let h of l){if(r.has(h)||$e.has(h))continue;r.add(h),t.push(`declare const ${h}: typeof import(${g})[${JSON.stringify(h)}]`)}}return t.push("declare module '@composables' {",...u,"}"),t.join(`
|
|
9
|
-
`)}function
|
|
9
|
+
`)}function Ws(e,t,r){return`${e}.__stx_${t}${r}.ts`}function Nc(e){return e.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function No(){return re("stx.d.ts")}function Lo(){return re("stx-module.d.ts")}function re(e){for(let t of[b.resolve(import.meta.dir,"..",e),b.resolve(import.meta.dir,"..","..",e)])if(M(t))return t;return null}var Te=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function De(e){return e>=1000&&e<2000}function oe(e){let t="",r=!1,u=!1;for(let s=0;s<e.length;s++){let l=e[s];if(r){if(t+=l,u)u=!1;else if(l==="\\")u=!0;else if(l==='"')r=!1;continue}if(l==='"'){r=!0,t+=l;continue}if(l==="/"&&e[s+1]==="/"){while(s<e.length&&e[s]!==`
|
|
10
10
|
`)s++;t+=`
|
|
11
|
-
`;continue}if(l==="/"&&e[s+1]==="*"){s+=2;while(s<e.length&&!(e[s]==="*"&&e[s+1]==="/"))s++;s++;continue}t+=l}return t.replace(/,(\s*[}\]])/g,"$1")}function Ee(e){try{return JSON.parse(oe(K(e,"utf8")))}catch{return}}function Oe(e){let t=b.resolve(e),r;for(;;){let
|
|
12
|
-
`);for(let d of ie(
|
|
13
|
-
`),ve(await
|
|
14
|
-
`),_=`${
|
|
15
|
-
`)){let y=
|
|
11
|
+
`;continue}if(l==="/"&&e[s+1]==="*"){s+=2;while(s<e.length&&!(e[s]==="*"&&e[s+1]==="/"))s++;s++;continue}t+=l}return t.replace(/,(\s*[}\]])/g,"$1")}function Ee(e){try{return JSON.parse(oe(K(e,"utf8")))}catch{return}}function Oe(e){let t=b.resolve(e),r;for(;;){let o=b.join(t,"tsconfig.json");if(M(o)){r=o;break}let f=b.dirname(t);if(f===t)break;t=f}if(!r)return{};let u=new Set,s=r,l,g,h=r;while(s&&!u.has(s)){u.add(s);let o;try{o=JSON.parse(oe(K(s,"utf8")))}catch{break}let f=o?.compilerOptions??{};if(!l&&f.paths&&typeof f.paths==="object")l=f.paths,h=s;if(!g&&typeof f.baseUrl==="string")g=b.resolve(b.dirname(s),f.baseUrl);if(l&&g)break;s=typeof o?.extends==="string"?b.resolve(b.dirname(s),o.extends.endsWith(".json")?o.extends:`${o.extends}.json`):void 0}if(!l)return{};let S=g??b.dirname(h),x={};for(let[o,f]of Object.entries(l)){if(!Array.isArray(f))continue;x[o]=f.map((p)=>typeof p==="string"&&!b.isAbsolute(p)?b.resolve(S,p):p)}return{paths:x}}async function Lc(e,t={}){let r=t.client!==!1,u=t.server!==!1,s=t.templates!==!1,l=t.componentsDir??(s?(await i()).componentsDir:void 0),g=new Map,h=new Map,S=[],x=[],o=0,f=0,p=No();for(let n of e){let c=await Bun.file(n).text(),y=Fe(c).filter((d)=>{if(d.kind==="server")return u;return r}),k=Fe(c).filter((d)=>d.kind==="server").map((d)=>d.code).join(`
|
|
12
|
+
`);for(let d of ie(c,y))S.push({file:n,line:d.line,column:d.column,code:0,message:d.message,category:"error",blockKind:d.kind});if(r&&k){let d=y.filter((O)=>O.kind!=="server"),E=[...new Set(d.flatMap((O)=>Gi(k,O.code)))];if(E.length>0)h.set(n,{names:E,line:d[0].startLine,kind:d[0].kind})}let D=b.dirname(b.resolve(n)),v=s?Ji(c,{runtimeGlobals:!p,originDir:D,filePath:b.resolve(n),componentsDir:l}):null,R=v?[...v.lineMap.values()].filter((d)=>d.expression).length:0;if(y.length===0&&R===0)continue;if(x.push(n),o+=y.length,f+=R,y.forEach((d,E)=>{g.set(Ws(n,d.kind,E),{source:Mo(d,k,D),origin:n,kind:d.kind})}),v&&R>0)g.set(Ws(n,"template",0),{source:v.text,origin:n,kind:"template",virtual:v})}if(g.size===0)return{diagnostics:S,checkedFiles:x,blockCount:0,expressionCount:0};let w=(t.extraLibs??[]).map((n)=>b.resolve(n)),ce=se(e.length>0?b.dirname(b.resolve(e[0])):process.cwd(),Ee,M);for(let n of ce?.libs??[])if(!w.includes(n)&&M(n))w.push(n);if(p)w.push(p);let G=p?Lo():null;if(G)w.push(G);let X=`${a()}/typecheck/__stx_globals.d.ts`,ae=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",qi(p?Xi(K(p,"utf8")):void 0),...p?[]:["declare const window: any",...m.map((n)=>`declare const ${n}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...H.map((n)=>`declare const ${n}: any`)].join(`
|
|
13
|
+
`),ve(await Tr())].filter(Boolean).join(`
|
|
14
|
+
`),_=`${a()}/typecheck`;await Bun.$`rm -rf ${_}`.quiet().nothrow(),await Bun.$`mkdir -p ${_}`.quiet().nothrow(),await Bun.write(X,ae);let N=new Map,le=0;for(let[n,c]of g){let y=`${le++}_${n.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${_}/${y}`,c.source),N.set(y,c)}let ue={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...Oe(e.length>0?b.dirname(b.resolve(e[0])):process.cwd()),...t.compilerOptions??{}},F=async(n,c)=>{let y=`${_}/tsconfig${c===1?"":`.${c}`}.json`;await Bun.write(y,JSON.stringify({compilerOptions:ue,files:n.map((D)=>`${_}/${D}`).concat(X,...w)},null,2));let k=Bun.spawnSync(["bun","x","tsc","-p",y,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(k.stdout)+new TextDecoder().decode(k.stderr),exitCode:k.exitCode??0}},V=await F([...N.keys()],1),J=V.output,I=[],U=V.exitCode,W=0,pe=new Set(w.map((n)=>n.split("/").pop())),z=0,B=new Set,q=(n)=>{for(let c of n.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
|
|
15
|
+
`)){let y=c.match(Te);if(!y)continue;if(W++,pe.has(y[1].split("/").pop()))z++;let[,k,D,v,R,d,E]=y,O=k.split("/").pop(),C=N.get(O);if(!C)continue;if(De(Number(d)))B.add(O);let A=Number(D),L=Number(v),Y;if(C.virtual){let P=Zi(C.virtual,A,L);if(!P?.expression)continue;if(Yi(P,Number(d)))continue;A=P.line,L=P.column,Y=P.expression.code.trim()}I.push({file:C.origin,line:A,column:L,code:Number(d),message:E,category:R==="error"?"error":"warning",blockKind:C.kind,expression:Y})}};q(J);let de=W,fe=z;if(B.size>0&&B.size<N.size){let n=[...N.keys()].filter((c)=>!B.has(c));q((await F(n,2)).output)}if(r)for(let[n,c]of h){if(c.names.length===0)continue;I.push({file:n,line:c.line,column:1,code:0,message:`${c.names.length===1?"1 value reaches":`${c.names.length} values reach`} this block on the implicit bridge and ${c.names.length===1?"is":"are"} untyped: ${c.names.join(", ")}. Declare them with defineClientPayload({ ${c.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:c.kind})}I.push(...S);let Z=new Set,j=I.filter((n)=>{let c=`${n.file}:${n.line}:${n.column}:${n.code}:${n.message}`;if(Z.has(c))return!1;return Z.add(c),!0});j.sort((n,c)=>n.file.localeCompare(c.file)||n.line-c.line||n.column-c.column);let Q=fe>0&&j.length===0,ge=Q||U!==0&&de===0?`${Q?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${U} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
|
|
16
16
|
${J.trim().split(`
|
|
17
17
|
`).slice(0,12).join(`
|
|
18
|
-
`)||"(no output)"}`:void 0;return{diagnostics:j,checkedFiles:x,blockCount:
|
|
18
|
+
`)||"(no output)"}`:void 0;return{diagnostics:j,checkedFiles:x,blockCount:o,expressionCount:f,failure:ge}}function jc(e){return e.map((t)=>{let r=t.blockKind==="template"?`[template: ${t.expression??""}]`:`[${t.blockKind==="plain"?"<script>":`<script ${t.blockKind}>`}]`;return`${t.file}:${t.line}:${t.column} ${t.category} TS${t.code} ${t.message} ${r}`}).join(`
|
|
19
19
|
`)}
|
|
20
|
-
export{
|
|
20
|
+
export{Mo,Ws,Nc,No,Lo,Lc,jc};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ke,Ce,$e}from"./chunk-ayd5r3se.js";import{rt,st,Se,Ps,it,ot}from"./chunk-dw961rvn.js";import o from"fs";import i from"path";var c=[];function m(a){c=[];for(let e of a.storyFiles)if(c.push({text:e.fileName.toLowerCase(),original:e.fileName,type:"story",storyId:e.id}),c.push({text:e.relativePath.toLowerCase(),original:e.relativePath,type:"story",storyId:e.id}),e.story)for(let t of e.story.variants)c.push({text:t.title.toLowerCase(),original:t.title,type:"story",storyId:e.id,variantId:t.id})}function f(){return JSON.stringify(c)}async function F(a={}){let e=Date.now();rt();let t=await ke({mode:"build"});if(!t.config.enabled){Se("Story feature is disabled in config.");return}let n=await it(t);Ce(t,n);let l=ot(t.config,n);$e(t,l),st(n.length);let d=a.outDir??t.config.outDir,s=i.resolve(t.root,d);await o.promises.mkdir(s,{recursive:!0}),console.log(` Building to ${d}...`);let g=v(t);await o.promises.writeFile(i.join(s,"index.html"),g);let y={files:n.map((r)=>({id:r.id,fileName:r.fileName,relativePath:r.relativePath,treePath:r.treePath})),tree:l};await o.promises.writeFile(i.join(s,"stories.json"),JSON.stringify(y,null,2));let u={theme:t.config.theme,responsivePresets:t.config.responsivePresets,backgroundPresets:t.config.backgroundPresets};await o.promises.writeFile(i.join(s,"config.json"),JSON.stringify(u,null,2));let p=i.join(s,"stories");await o.promises.mkdir(p,{recursive:!0});for(let r of n){let b=await o.promises.readFile(r.path,"utf-8");await o.promises.writeFile(i.join(p,`${r.id}.stx`),b)}m(t);let h=f();await o.promises.writeFile(i.join(s,"search-index.json"),h);let x=Date.now()-e;Ps(n.length,d,x)}function v(a){let{theme:e}=a.config,t=e.title||"STX Story";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import i from"path";var St=".stx",o="STX_DIR",e=null;function uo(t){e=t?.trim()||null}function nn(){return process.env[o]?.trim()||e||St}function a(t=process.cwd(),...n){let r=nn();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function rn(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==St&&!n.startsWith(`${St}/`))return t;let r=n.slice(St.length+1);return r?i.join(nn(),r):nn()}
|
|
3
|
+
export{St,uo,nn,a,rn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{oe,Ta,$i,dt,pt,cu,Ei,ft,Kt,_a,Ra,Aa,Pa,gt,Ia}from"./chunk-jgsgd6rt.js";import"./chunk-mj6fme15.js";import"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{Kt as MODULE_SPECIFIER_PREFIX,gt as bundleClientScript,pt as clearBundleFailures,oe as clientBundleDependencies,dt as getBundleFailures,ft as hasUserImports,Ra as normalizeRegistrySpecifiers,Pa as queueClientBundleBuild,$i as recordBundleFailure,_a as registryIdForPath,Ei as resolveBundlerFallback,Aa as rewriteRegistryImports,cu as setBundlerFallbackMode,Ta as shouldLogBundlerDiagnostics,Ia as tempBuildName};
|