@stacksjs/stx 0.2.915 → 0.2.919
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/app-shell.js +3 -2
- package/dist/{chunk-frpsrv1e.js → chunk-09xqy448.js} +2 -2
- package/dist/chunk-0ebaf0pr.js +2 -0
- package/dist/chunk-0jjq552g.js +2 -0
- package/dist/chunk-0wctbtad.js +7 -0
- package/dist/{chunk-r7y1196g.js → chunk-0xyfs691.js} +4 -4
- package/dist/{chunk-w98yt4d4.js → chunk-14df2jzs.js} +2 -2
- package/dist/chunk-15rc8t28.js +2 -0
- package/dist/chunk-1a2c4pv8.js +54 -0
- package/dist/{chunk-1jakr6f2.js → chunk-1baxccfq.js} +18 -18
- package/dist/{chunk-0vyytd9v.js → chunk-1bf0grbf.js} +3 -3
- package/dist/chunk-1jrhjn2b.js +2 -0
- package/dist/chunk-1svffhzq.js +2 -0
- package/dist/{chunk-1hx6dyy9.js → chunk-1ts1pg90.js} +2 -2
- package/dist/{chunk-88fx8xc1.js → chunk-1vsjmwr1.js} +2 -2
- package/dist/{chunk-cxsc37fg.js → chunk-2f46pcg0.js} +2 -2
- package/dist/{chunk-pcwq66w3.js → chunk-2jm7map2.js} +2 -2
- package/dist/chunk-2m4ydym0.js +33 -0
- package/dist/chunk-2mv29s6w.js +9 -0
- package/dist/{chunk-d1ka4dvr.js → chunk-2szhk8mh.js} +5 -5
- package/dist/{chunk-gg715pj6.js → chunk-2zb642qr.js} +6 -6
- package/dist/chunk-3aayrnbh.js +21 -0
- package/dist/chunk-3br07y64.js +20 -0
- package/dist/{chunk-2f5jjxcj.js → chunk-3efpqm1f.js} +2 -2
- package/dist/chunk-3ftrv1f7.js +182 -0
- package/dist/{chunk-barb4gka.js → chunk-3hfv217t.js} +6 -6
- package/dist/{chunk-eptzpvn0.js → chunk-3kpxkjgm.js} +3 -3
- package/dist/{chunk-4w8t0a9e.js → chunk-3tcy9r6r.js} +27 -27
- package/dist/{chunk-zv3rn0ch.js → chunk-40j2pmnb.js} +6 -6
- package/dist/chunk-426gq0g5.js +2 -0
- package/dist/chunk-4ge80k8j.js +2 -0
- package/dist/chunk-4vdfqr64.js +2 -0
- package/dist/chunk-4yz33vzb.js +2 -0
- package/dist/chunk-4zcswx6x.js +2 -0
- package/dist/{chunk-smnt37jq.js → chunk-50zzar2c.js} +3 -3
- package/dist/{chunk-vayzmvf5.js → chunk-514yg4dr.js} +6 -6
- package/dist/{chunk-vnk582z7.js → chunk-5fdc8pej.js} +102 -36
- package/dist/chunk-5ht628zp.js +2 -0
- package/dist/chunk-67zy5p7x.js +2 -0
- package/dist/chunk-6bm7t0hm.js +3 -0
- package/dist/{chunk-7qzanp9y.js → chunk-6n6kndk0.js} +1 -1
- package/dist/chunk-6x5a2w5a.js +3 -0
- package/dist/{chunk-xc5esqcb.js → chunk-6ybq9pfh.js} +2 -2
- package/dist/{chunk-23x3k751.js → chunk-7axtwg1f.js} +2 -2
- package/dist/chunk-8153bfpx.js +2 -0
- package/dist/{chunk-16sfjkc4.js → chunk-858p3hkz.js} +2 -2
- package/dist/chunk-86p0m920.js +2 -0
- package/dist/chunk-88texeh4.js +2 -0
- package/dist/chunk-8mye65n9.js +2 -0
- package/dist/chunk-8ycgk8w6.js +2 -0
- package/dist/{chunk-npj20tj9.js → chunk-9707zz6v.js} +2 -2
- package/dist/{chunk-pyyda92j.js → chunk-9gr7m3tb.js} +1 -1
- package/dist/{chunk-952dfmcb.js → chunk-9mack1g8.js} +3 -3
- package/dist/chunk-9xcsn4pb.js +2 -0
- package/dist/{chunk-3jc6yb02.js → chunk-9zwmfkfg.js} +9 -9
- package/dist/chunk-a5tg553d.js +2 -0
- package/dist/chunk-agxxqjjt.js +2 -0
- package/dist/{chunk-phzhmnnm.js → chunk-ayrd026n.js} +3 -3
- package/dist/chunk-b44pvac7.js +2 -0
- package/dist/chunk-b4yp16a2.js +2 -0
- package/dist/{chunk-95j8660f.js → chunk-cbqe84g3.js} +2 -2
- package/dist/{chunk-qsexsrw2.js → chunk-d4xjwebv.js} +5 -5
- package/dist/{chunk-pmn9kynz.js → chunk-d69k67bn.js} +11 -11
- package/dist/chunk-ex6dne7e.js +3 -0
- package/dist/chunk-fb63xppz.js +2 -0
- package/dist/chunk-ffqqkeye.js +2 -0
- package/dist/chunk-fjpt8arw.js +3 -0
- package/dist/{chunk-mgj074y2.js → chunk-fn0y9z1t.js} +5 -5
- package/dist/{chunk-ar6jeqmm.js → chunk-ft34x0h1.js} +4 -4
- package/dist/{chunk-7x3tt27s.js → chunk-fwxgzktt.js} +2 -2
- package/dist/chunk-g1v12bjm.js +2 -0
- package/dist/chunk-gg0kkn2e.js +2 -0
- package/dist/chunk-ggg8b8n1.js +2 -0
- package/dist/chunk-ggrcg7k7.js +2 -0
- package/dist/{chunk-11c7xg1z.js → chunk-gjyz5ma7.js} +1 -1
- package/dist/chunk-gmn9ba8f.js +3 -0
- package/dist/chunk-gqe574d9.js +2 -0
- package/dist/chunk-h4nqjks2.js +2 -0
- package/dist/chunk-hajamm16.js +2 -0
- package/dist/chunk-hg2n2264.js +2 -0
- package/dist/{chunk-6t8ce21j.js → chunk-hht7n4zd.js} +2 -2
- package/dist/chunk-hxabvt31.js +2 -0
- package/dist/chunk-j3sat6vn.js +2 -0
- package/dist/chunk-j9gbnqxq.js +2 -0
- package/dist/{chunk-1hbf5e1h.js → chunk-jgtn9t5n.js} +2 -2
- package/dist/chunk-jj2z4nxa.js +2 -0
- package/dist/{chunk-0jdz31q1.js → chunk-jjq7c8s2.js} +3 -3
- package/dist/chunk-k289127j.js +2 -0
- package/dist/{chunk-p3fepzt9.js → chunk-kk9h53xg.js} +3 -3
- package/dist/{chunk-xnp031ba.js → chunk-ktv65e3n.js} +7 -7
- package/dist/chunk-m1hfh2t4.js +2 -0
- package/dist/{chunk-9b2wdkbq.js → chunk-m390z8w8.js} +11 -11
- package/dist/chunk-m3qwqhxp.js +2 -0
- package/dist/{chunk-t85zac4y.js → chunk-m6hrb7rm.js} +58 -58
- package/dist/{chunk-7gwysmrs.js → chunk-m86sjbx7.js} +3 -3
- package/dist/chunk-m9smh7fs.js +2 -0
- package/dist/{chunk-1jvt9t3r.js → chunk-m9ta0640.js} +2 -2
- package/dist/chunk-mhnjtc42.js +2 -0
- package/dist/{chunk-hhspwfva.js → chunk-mn9t5fnv.js} +2 -2
- package/dist/{chunk-36cz2v8k.js → chunk-mnpfvxpa.js} +31 -31
- package/dist/{chunk-2vx2ben8.js → chunk-mr9pp5cf.js} +2 -2
- package/dist/{chunk-1jxkc6d0.js → chunk-mztjpp7m.js} +2 -2
- package/dist/chunk-n4bxb2hx.js +2 -0
- package/dist/chunk-n958bxm6.js +2 -0
- package/dist/{chunk-8wqhzzkn.js → chunk-neymp1bb.js} +3 -3
- package/dist/chunk-nkbnsbb0.js +3 -0
- package/dist/chunk-nkr1aa5z.js +2 -0
- package/dist/{chunk-nhyv3w4r.js → chunk-p0xqm2ne.js} +1 -1
- package/dist/chunk-p3vswt0f.js +2 -0
- package/dist/{chunk-z110bf2c.js → chunk-p3x7kwb5.js} +7 -7
- package/dist/chunk-p4twxjfs.js +6 -0
- package/dist/chunk-p8wnp4p1.js +2 -0
- package/dist/{chunk-bvqgq18r.js → chunk-p97h91zx.js} +2 -2
- package/dist/chunk-pjv4dskp.js +2 -0
- package/dist/{chunk-5jc9hmwg.js → chunk-pwg544dw.js} +2 -2
- package/dist/chunk-pxvp0cc9.js +3 -0
- package/dist/chunk-q3z252d9.js +2 -0
- package/dist/{chunk-q9gbdzw0.js → chunk-qda8tmk9.js} +2 -2
- package/dist/chunk-qfkak3jb.js +2 -0
- package/dist/chunk-qnytvyy0.js +2 -0
- package/dist/{chunk-fznjm7qt.js → chunk-qsnw0qyp.js} +2 -2
- package/dist/{chunk-ftvpz1j4.js → chunk-qtzfbv7e.js} +5 -5
- package/dist/{chunk-9xmx8hc7.js → chunk-qzqqzraq.js} +8 -8
- package/dist/{chunk-47z0m17p.js → chunk-rk16391e.js} +3 -3
- package/dist/chunk-rt7xy537.js +2 -0
- package/dist/chunk-rwjye578.js +2 -0
- package/dist/{chunk-cwcmmgvz.js → chunk-s1x2pc9b.js} +2 -2
- package/dist/{chunk-zbpvmgjn.js → chunk-sbr3wg75.js} +65 -65
- package/dist/chunk-sftznswb.js +2 -0
- package/dist/{chunk-cq4cwfqf.js → chunk-sxrcac01.js} +2 -2
- package/dist/{chunk-fzcqw147.js → chunk-tb4be5ct.js} +3 -3
- package/dist/{chunk-m8n14s3z.js → chunk-tnbzg7fd.js} +2 -2
- package/dist/{chunk-jr2r2nh5.js → chunk-txk2z7v0.js} +4 -4
- package/dist/chunk-tz5ktd6d.js +2 -0
- package/dist/{chunk-302nw40c.js → chunk-v060015m.js} +1 -1
- package/dist/chunk-v1a5h1tc.js +38 -0
- package/dist/{chunk-7anbc757.js → chunk-v1x96kjr.js} +8 -8
- package/dist/chunk-vb609vbj.js +1323 -0
- package/dist/chunk-vf7tpgqz.js +70 -0
- package/dist/chunk-vtcyber4.js +2 -0
- package/dist/chunk-vtj3dwhh.js +4 -0
- package/dist/{chunk-p9fyn5k4.js → chunk-whnzf9hn.js} +5 -5
- package/dist/chunk-wq2bpt0w.js +2 -0
- package/dist/{chunk-sdmq09jw.js → chunk-wv0wsavj.js} +2 -2
- package/dist/chunk-wv8zt78c.js +2 -0
- package/dist/{chunk-whc4jptx.js → chunk-wxqay5c2.js} +1 -1
- package/dist/{chunk-gfp39bzr.js → chunk-x40j67z1.js} +2 -2
- package/dist/chunk-xakqpa4z.js +3 -0
- package/dist/{chunk-dgt9kfkp.js → chunk-xap1f1bw.js} +2 -2
- package/dist/{chunk-zk5g49p5.js → chunk-xk7hdpq5.js} +3 -3
- package/dist/{chunk-zkwkhesc.js → chunk-xmy75h5v.js} +2 -2
- package/dist/{chunk-dp6r6gtb.js → chunk-xpsg91dh.js} +5 -5
- package/dist/{chunk-va4xam1q.js → chunk-xq5s4vc1.js} +1 -1
- package/dist/chunk-xy3ex6ht.js +2 -0
- package/dist/chunk-y899wtm8.js +2 -0
- package/dist/chunk-ye45znz5.js +2 -0
- package/dist/chunk-yegp50jb.js +2 -0
- package/dist/chunk-yq9aqpk8.js +2 -0
- package/dist/{chunk-5xbx0r3k.js → chunk-yvaqgdv1.js} +2 -2
- package/dist/{chunk-etmq1qny.js → chunk-yye2pec5.js} +14 -14
- package/dist/{chunk-47nzpbvm.js → chunk-yzqb7y45.js} +6 -6
- package/dist/{chunk-n0nf8n0h.js → chunk-z6nyyt3n.js} +6 -6
- package/dist/{chunk-fs43342z.js → chunk-zaj3nnvv.js} +2 -2
- package/dist/{chunk-2qk2ppgm.js → chunk-zb6my502.js} +1 -1
- package/dist/{chunk-ra2tzsvz.js → chunk-zrxvj3zf.js} +5 -5
- package/dist/chunk-zt45dqfx.js +2 -0
- package/dist/cli.js +38 -38
- package/dist/color-mode-boot.d.ts +1 -8
- package/dist/color-mode-boot.js +46 -2
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/ts-css.d.ts +1 -1
- package/dist/dev-server/ts-css.js +2 -2
- package/dist/document-shell.d.ts +2 -0
- package/dist/document-shell.js +15 -3
- package/dist/document-tags.d.ts +2 -0
- package/dist/document-tags.js +9 -0
- package/dist/head-injection.d.ts +2 -0
- package/dist/head-injection.js +1 -0
- package/dist/head.d.ts +2 -0
- package/dist/head.js +2 -2
- package/dist/native/compiler/html-to-ir.d.ts +3 -1
- package/dist/native/compiler/html-to-ir.js +31 -0
- package/dist/native/compiler/ir.d.ts +1 -0
- package/dist/native/components/primitives.d.ts +1 -0
- package/dist/native/event-names.js +2 -0
- package/dist/native/runtime/browser-renderer.d.ts +1 -0
- package/dist/native/runtime/browser-renderer.js +23 -6
- package/dist/native/testing.d.ts +1 -0
- package/dist/native/testing.js +33 -0
- package/dist/page-head.js +1 -9
- package/dist/process.js +1 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +13 -13
- package/dist/types/config-types.d.ts +2 -1
- package/dist/variable-extractor.js +6 -1
- package/package.json +5 -5
- package/dist/chunk-0adc8x2h.js +0 -9
- package/dist/chunk-1gj46s0g.js +0 -2
- package/dist/chunk-1mx3j280.js +0 -2
- package/dist/chunk-1p6gaaf3.js +0 -3
- package/dist/chunk-1rfzs48h.js +0 -2
- package/dist/chunk-20hy5p3p.js +0 -2
- package/dist/chunk-29v3b5ks.js +0 -2
- package/dist/chunk-2cay3heb.js +0 -2
- package/dist/chunk-33fnbw33.js +0 -2
- package/dist/chunk-357qjcj1.js +0 -3
- package/dist/chunk-38y11q8x.js +0 -2
- package/dist/chunk-3q80f7mt.js +0 -2
- package/dist/chunk-43kz6rx9.js +0 -2
- package/dist/chunk-490rrkrp.js +0 -2
- package/dist/chunk-49980am3.js +0 -2
- package/dist/chunk-4a9bqc8f.js +0 -33
- package/dist/chunk-4e18r89n.js +0 -3
- package/dist/chunk-4r0028av.js +0 -1323
- package/dist/chunk-4vz17ytv.js +0 -68
- package/dist/chunk-4w9pvpfd.js +0 -2
- package/dist/chunk-5afnyvw5.js +0 -2
- package/dist/chunk-5pb1x7x6.js +0 -2
- package/dist/chunk-6n50b07t.js +0 -2
- package/dist/chunk-76mn123c.js +0 -2
- package/dist/chunk-8egbh6z1.js +0 -2
- package/dist/chunk-8n9jd8cz.js +0 -2
- package/dist/chunk-8tfpv6zf.js +0 -6
- package/dist/chunk-94qc4zwb.js +0 -2
- package/dist/chunk-9928zdej.js +0 -3
- package/dist/chunk-9ay18k46.js +0 -2
- package/dist/chunk-9tv0tw7f.js +0 -3
- package/dist/chunk-a5h9bwrc.js +0 -2
- package/dist/chunk-am7xmh9p.js +0 -2
- package/dist/chunk-bdkst2wp.js +0 -2
- package/dist/chunk-bej9kz05.js +0 -2
- package/dist/chunk-ccgabq3a.js +0 -2
- package/dist/chunk-cv6d4zr5.js +0 -2
- package/dist/chunk-e5rag6rh.js +0 -3
- package/dist/chunk-eqdg72re.js +0 -2
- package/dist/chunk-fvr3h2fr.js +0 -7
- package/dist/chunk-g0hkknzm.js +0 -2
- package/dist/chunk-g44932zc.js +0 -2
- package/dist/chunk-g4w3wms2.js +0 -2
- package/dist/chunk-gmmqz698.js +0 -2
- package/dist/chunk-hxftzw0x.js +0 -2
- package/dist/chunk-j3d3q3g7.js +0 -2
- package/dist/chunk-jmggm1ep.js +0 -3
- package/dist/chunk-jz37h2z0.js +0 -4
- package/dist/chunk-k8s3hyh2.js +0 -2
- package/dist/chunk-m8mmasgc.js +0 -2
- package/dist/chunk-man5ap64.js +0 -54
- package/dist/chunk-mdgcjzcn.js +0 -38
- package/dist/chunk-mjny8x91.js +0 -2
- package/dist/chunk-mjr5fkc2.js +0 -2
- package/dist/chunk-n1y82svg.js +0 -2
- package/dist/chunk-na0e3s88.js +0 -2
- package/dist/chunk-new89wh2.js +0 -2
- package/dist/chunk-nrap20qt.js +0 -2
- package/dist/chunk-q85wy43m.js +0 -2
- package/dist/chunk-q9yahsww.js +0 -2
- package/dist/chunk-qdwtemy1.js +0 -2
- package/dist/chunk-qp0ndbk6.js +0 -2
- package/dist/chunk-r1fhahnn.js +0 -2
- package/dist/chunk-r4e17p2x.js +0 -2
- package/dist/chunk-rnsa5zz5.js +0 -2
- package/dist/chunk-rzsvxjse.js +0 -2
- package/dist/chunk-senrtnx2.js +0 -2
- package/dist/chunk-sw5g5mbd.js +0 -2
- package/dist/chunk-t63y6qd5.js +0 -2
- package/dist/chunk-v1wr2vdx.js +0 -2
- package/dist/chunk-v6gkjg5f.js +0 -3
- package/dist/chunk-vq7m7xcz.js +0 -182
- package/dist/chunk-wsfqb5jk.js +0 -2
- package/dist/chunk-wvc6eayq.js +0 -2
- package/dist/chunk-wz44vmgn.js +0 -21
- package/dist/chunk-x1kzqxj5.js +0 -2
- package/dist/chunk-xa98a901.js +0 -2
- package/dist/chunk-xj95sk0y.js +0 -2
- package/dist/chunk-xtf3sab5.js +0 -2
- package/dist/chunk-yga49yw3.js +0 -2
- package/dist/chunk-yn02d599.js +0 -2
- package/dist/chunk-z5nx021e.js +0 -20
- package/dist/chunk-z9wwa50p.js +0 -2
package/dist/ssg.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
3
|
-
`)}function J(e){return async()=>({paths:await e(),fallback:!1})}var
|
|
2
|
+
import"./chunk-jjq7c8s2.js";import"./chunk-ex6dne7e.js";import"./chunk-2mv29s6w.js";import"./chunk-s1x2pc9b.js";import{_,Dl}from"./chunk-vf7tpgqz.js";import"./chunk-858p3hkz.js";import"./chunk-ayrd026n.js";import{Vt}from"./chunk-vb609vbj.js";import"./chunk-14df2jzs.js";import"./chunk-qda8tmk9.js";import"./chunk-mr9pp5cf.js";import{jt,Bt,Ft,zt,Ht,Ut}from"./chunk-5fdc8pej.js";import{a}from"./chunk-3tcy9r6r.js";import{Ks}from"./chunk-ktv65e3n.js";import"./chunk-txk2z7v0.js";import"./chunk-xpsg91dh.js";import{$e,bn,wn}from"./chunk-3br07y64.js";import"./chunk-fwxgzktt.js";import{S}from"./chunk-m390z8w8.js";import{It,i}from"./chunk-sbr3wg75.js";import"./chunk-d69k67bn.js";import"./chunk-1a2c4pv8.js";import{Ns}from"./chunk-3aayrnbh.js";import"./chunk-whnzf9hn.js";import"./chunk-zaj3nnvv.js";import{$c,Rc,Ac,Pc,Ic}from"./chunk-xk7hdpq5.js";import{hn,br,wr}from"./chunk-pxvp0cc9.js";import{yn}from"./chunk-yvaqgdv1.js";import"./chunk-xakqpa4z.js";import"./chunk-fjpt8arw.js";import{se,Pe}from"./chunk-v1x96kjr.js";import"./chunk-p0xqm2ne.js";import"./chunk-50zzar2c.js";import{l}from"./chunk-6x5a2w5a.js";import{st}from"./chunk-gmn9ba8f.js";import{t,y}from"./chunk-0wctbtad.js";import{f}from"./chunk-p4twxjfs.js";import v from"fs";import p from"path";var xt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(e){let n=e.trim();if(!n)return null;let s=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function bt(e){for(let n of xt){let s=e[n];if(!s)continue;let o=X(s);if(o)return{url:o,source:"env",via:n}}return null}function ct(e){if(!e||typeof e!=="object")return null;let n=e,s=n.site?.url??n.url??n.app?.url;return typeof s==="string"?X(s):null}async function vt(e){let{existsSync:n}=await import("fs"),s=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(e,o);if(!n(c))continue;try{let r=await import(c),u=ct(r.default??r);if(u)return u}catch{}}return null}async function lt(e={}){let n=e.cwd??process.cwd(),s=e.env??process.env;if(e.explicit){let u=X(e.explicit);if(u)return{url:u,source:"option"}}let o=ct(e.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let c=await vt(n);if(c)return{url:c,source:"site.config",via:"url"};let r=bt(s);if(r)return r;return{url:"http://localhost",source:"fallback"}}function ut(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
|
|
3
|
+
`)}function J(e){return async()=>({paths:await e(),fallback:!1})}var Pt;function Dt(e){let n=t(e),{depths:s}=y(n),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,c;while((c=o.exec(n))!==null){if(s[c.index]!==0)continue;let u=_(n,"(",")",o.lastIndex-1),w=n.indexOf("{",u+1),P=_(n,"{","}",w);if(u<0||w<0||P<0)break;return e.slice(c.index,P+1)}let r=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((c=r.exec(n))!==null){if(s[c.index]!==0)continue;let u=Dl(n,r.lastIndex).endPos;return e.slice(r.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function dt(e){let n="read";try{let s=await Bun.file(e).text();n="parse";let o=yn(s),c=[...o.server,...o.client,...o.signals].filter((r)=>/(?:^|\s)server(?:\s|=|$)/i.test(t(r.attrs))).sort((r,u)=>s.indexOf(r.fullTag)-s.indexOf(u.fullTag));for(let r of c){if(!/\bgetStaticPaths\b/.test(t(r.content)))continue;let u=(Pt??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(r.content);if(!/\bgetStaticPaths\b/.test(t(u)))continue;let w=Dt(u);if(/\bdefineStaticPaths\b/.test(t(w))&&Vt(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");n="execute";let P=Function("defineStaticPaths",`return (${w})`)(J);if(typeof P!=="function")throw TypeError("getStaticPaths must be a function");let k=await P();n="result";let x=Array.isArray(k)?{paths:k}:k;if(!x||typeof x!=="object"||!("paths"in x)||!Array.isArray(x.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let D of x.paths)if(!D||typeof D!=="object"||!D.params||typeof D.params!=="object"||Array.isArray(D.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:x}}return{kind:"absent"}}catch(s){return{kind:"error",phase:n,error:s instanceof Error?s:Error(String(s))}}}class gt{cacheDir;cache=new Map;loaded=!1;salt;constructor(e,n=""){this.cacheDir=e,this.salt=n}async load(){if(this.loaded)return;let e=p.join(this.cacheDir,"build-cache.json");if(await Bun.file(e).exists())try{let n=JSON.parse(await Bun.file(e).text());for(let[s,o]of Object.entries(n))this.cache.set(s,o)}catch{}this.loaded=!0}async save(){await v.promises.mkdir(this.cacheDir,{recursive:!0});let e=p.join(this.cacheDir,"build-cache.json"),n={};for(let[s,o]of this.cache)n[s]=o;await Bun.write(e,JSON.stringify(n))}getHash(e,n){let s=v.statSync(e),o=`${this.salt}|${e}:${s.mtimeMs}`;for(let r of n)if(v.existsSync(r)){let u=v.statSync(r);o+=`:${r}:${u.mtimeMs}`}let c=0;for(let r=0;r<o.length;r++){let u=o.charCodeAt(r);c=(c<<5)-c+u,c=c&c}return Math.abs(c).toString(36)}get(e,n){let s=this.cache.get(e);if(!s)return null;let o=ft(n).some((u)=>v.existsSync(u)),c=[n,...s.dependencies??[]].some((u)=>u.endsWith(".stx")&&v.existsSync(u)&&Ns(v.readFileSync(u,"utf8")).some((w)=>/\bserver\b/.test(w.attrs)));if(o||c)return this.cache.delete(e),null;let r=this.getHash(n,s.dependencies??[]);if(s.hash!==r)return this.cache.delete(e),null;return s.html}set(e,n,s,o){let c=this.getHash(n,s);this.cache.set(e,{hash:c,html:o,generatedAt:Date.now(),dependencies:s})}}class pt{cacheDir;constructor(e){this.cacheDir=e}getFilePath(e){let n=e.replace(/[^a-zA-Z0-9]/g,"_")+".json";return p.join(this.cacheDir,"isr",n)}async get(e){let n=this.getFilePath(e);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(e,n){let s=this.getFilePath(e);await v.promises.mkdir(p.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(n))}async invalidate(e){let n=this.getFilePath(e);if(await Bun.file(n).exists())await v.promises.unlink(n)}async invalidatePattern(e){let n=p.join(this.cacheDir,"isr");if(!v.existsSync(n))return;let s=await v.promises.readdir(n);for(let o of s){let c=o.replace(/_/g,"/").replace(".json","");if(e.test(c))await v.promises.unlink(p.join(n,o))}}async needsRevalidation(e){let n=await this.get(e);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function $t(e){let n=[];if(!e.isDynamic)n.push({url:e.pattern,params:{}});else{let s=await dt(e.filePath);if(s.kind==="error")throw Error(`getStaticPaths ${s.phase} failed for ${e.pattern} (${e.filePath}): ${s.error.message}`,{cause:s.error});if(s.kind==="absent")return console.warn(`Warning: Dynamic route ${e.pattern} (${e.filePath}) has no getStaticPaths`),n;let o=s.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${e.pattern} (${e.filePath})`),n;for(let c of o.paths){let r=e.pattern;for(let[u,w]of Object.entries(c.params))r=r.replace(`:${u}`,w).replace(`:${u}*`,w);n.push({url:r,params:c.params,props:c.props,revalidate:c.revalidate})}}return n}function ft(e){return[e.replace(/\.stx$/,".data.ts"),e.replace(/\.stx$/,".data.js"),e+".data.ts",e+".data.js"]}async function kt(e){for(let n of ft(e))if(await Bun.file(n).exists())try{let s=await import(n);if(typeof s.default==="function")return await s.default();else if(typeof s.default==="object")return s.default;else if(typeof s.getData==="function")return await s.getData();else{let{default:o,...c}=s;return c}}catch(s){console.error(`Error loading data file ${n}:`,s)}return null}async function Rt(e,n,s){let o=e.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let c=o[1];if(!c.includes("getStaticProps"))return null;try{let r=c.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!r)return null;return await Function("params",`
|
|
4
4
|
return (async function getStaticProps() {
|
|
5
5
|
${r[1]}
|
|
6
6
|
})()
|
|
7
|
-
`)(n)}catch(r){return console.error(`Error executing getStaticProps in ${s}:`,r),null}}function
|
|
8
|
-
resolved against partialsDir: ${R.partialsDir}`)},onServerScriptError:(R)=>{D.push(`${p.relative(process.cwd(),R.sourcePath)} (${R.kind}): ${R.message}`)}};if(
|
|
9
|
-
${
|
|
7
|
+
`)(n)}catch(r){return console.error(`Error executing getStaticProps in ${s}:`,r),null}}function Et(e){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(e)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(e)}async function ht(e,n,s={},o,c){let r=await Bun.file(e.filePath).text(),u=await kt(e.filePath),w=await Rt(r,n,e.filePath),P={...u||{},...w||{},...s,params:n,$route:{path:e.pattern,params:n}},k=new Set,x=[],D=[],E={...c,minifyClient:!0,...o.partialsDir?{partialsDir:o.partialsDir}:{},...o.componentsDir?{componentsDir:o.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(R)=>{x.push(`${p.relative(process.cwd(),R.templatePath)}: ${R.message}
|
|
8
|
+
resolved against partialsDir: ${R.partialsDir}`)},onServerScriptError:(R)=>{D.push(`${p.relative(process.cwd(),R.sourcePath)} (${R.kind}): ${R.message}`)}};if(Et(r))console.warn(`Warning: ${e.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let m=await i(r,P,e.filePath,E,k);for(let R of[e.filePath,...k])for(let O of $e(R))k.add(O);if(Object.keys(n).length>0){let R=`<script>if(window.stx)window.stx._rp=${JSON.stringify(n)};else window.__stx_rp=${JSON.stringify(n)};</script>`;if(m.includes("</head>"))m=f(m,R);else m=`${R}
|
|
9
|
+
${m}`}if(m=await Pe(m,{router:o.router}),m=await S(m),o.minify!==!1)return{html:Ct(m),dependencies:Array.from(k),includeFailures:x,serverScriptFailures:D};return{html:m,dependencies:Array.from(k),includeFailures:x,serverScriptFailures:D}}function Ct(e){let n=[],s=0,o=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,c;while((c=o.exec(e))!==null){let u=e.slice(s,c.index);n.push(u.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let w=c[1],P=c[2],k=c[3];P=st(P).replace(/<\/script/gi,"<\\/script"),n.push(w+P+k),s=c.index+c[0].length}let r=e.slice(s);return n.push(r.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),n.join("").trim()}function Tt(e){let n=0;for(let s=0;s<e.length;s++){let o=e.charCodeAt(s);n=(n<<5)-n+o,n=n&n}return`"${Math.abs(n).toString(36)}"`}function Ot(e,n,s,o){if(s?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(n))return!0;return o.some((c)=>{if(c instanceof RegExp)return c.test(e);return c.endsWith("/")?e===c.slice(0,-1)||e.startsWith(c):e===c})}function At(e,n){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
10
10
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
11
11
|
${e.map((o)=>{let c=new URL(o.loc,n).href,r=` <url>
|
|
12
12
|
<loc>${F(c)}</loc>`;if(o.lastmod)r+=`
|
|
@@ -15,7 +15,7 @@ ${e.map((o)=>{let c=new URL(o.loc,n).href,r=` <url>
|
|
|
15
15
|
<priority>${o.priority}</priority>`;return r+=`
|
|
16
16
|
</url>`,r}).join(`
|
|
17
17
|
`)}
|
|
18
|
-
</urlset>`}function F(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function
|
|
18
|
+
</urlset>`}function F(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Lt(e,n){let s=n.map((o)=>{let c=" <item>";if(c+=`
|
|
19
19
|
<title>${F(o.title)}</title>`,c+=`
|
|
20
20
|
<link>${F(o.link)}</link>`,o.description)c+=`
|
|
21
21
|
<description>${F(o.description)}</description>`;if(o.pubDate)c+=`
|
|
@@ -36,15 +36,15 @@ ${e.map((o)=>{let c=new URL(o.loc,n).href,r=` <url>
|
|
|
36
36
|
${s.join(`
|
|
37
37
|
`)}
|
|
38
38
|
</channel>
|
|
39
|
-
</rss>`}async function
|
|
39
|
+
</rss>`}async function Mt(e={}){let n=Date.now();wn();let s=await a(process.cwd()),o=s.build||{},c=await lt({explicit:e.domain||o.domain,stxConfig:s});if(c.source==="fallback"&&(e.sitemap??o.sitemap??!0))console.warn(ut());let r={router:e.router??s?.router??{},pagesDir:e.pagesDir||o.pagesDir||"pages",outputDir:e.outputDir||o.outputDir||"dist",baseUrl:e.baseUrl||o.baseUrl||"/",domain:c.url,revalidate:e.revalidate??o.revalidate??!1,sitemap:e.sitemap??o.sitemap??!0,sitemapExclude:e.sitemapExclude||o.sitemapExclude||[],robots:e.robots??o.robots??!0,rss:e.rss??o.rss??!1,concurrency:e.concurrency||o.concurrency||10,cache:e.cache??o.cache??!0,cacheDir:e.cacheDir||o.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:e.contentLoaders||[],hooks:e.hooks||{},minify:e.minify??o.minify??!0,generate404:e.generate404??o.generate404??!0,publicDir:e.publicDir||o.publicDir||"public",trailingSlash:e.trailingSlash??o.trailingSlash??!1,cleanOutput:e.cleanOutput??o.cleanOutput??!0,cacheSalt:e.cacheSalt??"",partialsDir:e.partialsDir||s?.partialsDir||"",componentsDir:e.componentsDir||s?.componentsDir||"",failOnIncludeError:e.failOnIncludeError??!0,failOnServerScriptError:e.failOnServerScriptError??!0,chunkIslands:e.chunkIslands===!0,prefetchIslands:e.prefetchIslands===!0,integrityIslands:e.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,P=0,k={},x={};await r.hooks.onBuildStart?.();try{if(r.cleanOutput&&v.existsSync(r.outputDir))await v.promises.rm(r.outputDir,{recursive:!0});await v.promises.mkdir(r.outputDir,{recursive:!0});let E=r.cacheSalt;if(!E){let{resolveUserCssConfig:d,fingerprintConfig:h}=await import("./chunk-86p0m920.js");try{E=h(await d(process.cwd()))}catch{}}let{prepareImageDelivery:m}=await import("./chunk-0ebaf0pr.js"),R=await m(r.publicDir,r.outputDir);if(R.count>0)console.log(`Optimized ${R.count} image(s) for responsive delivery`),E=[E,R.fingerprint].filter(Boolean).join(":");let O=new gt(r.cacheDir,E);if(r.cache)await O.load();try{let{generateCss:d}=await import("./chunk-86p0m920.js");await d('<div class="bg-black"></div>')}catch{}jt();let mt=s?.routeMiddleware?.dir||"middleware";await Ft(process.cwd(),mt);let V=Bt();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let wt=s?.routeMiddleware?.global||[];Ic(s?.layoutsDir,l(process.cwd()));let Z=se(".",{pagesDir:r.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${Z.length} routes`);let L=[];for(let d of Z)try{let h=await $t(d);for(let b of h)L.push({route:d,url:b.url,params:b.params,props:b.props,revalidate:b.revalidate??r.revalidate})}catch(h){let b=h instanceof Error?h:Error(String(h));u.failedCount++,u.errors.push({route:d.pattern,error:b}),await r.hooks.onError?.(b,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,b)}u.totalPages=L.length+u.failedCount,console.log(`Generating ${L.length} pages...`);let U=[],Q=[];for(let d=0;d<L.length;d+=r.concurrency)Q.push(L.slice(d,d+r.concurrency));for(let d of Q)await Promise.all(d.map(async(h)=>{let{route:b,url:g,params:M,props:yt,revalidate:rt}=h;try{await r.hooks.onPageStart?.(g);let G=await Bun.file(b.filePath).text(),T=Nt(G),St=T?.middleware?Array.isArray(T.middleware)?T.middleware:[T.middleware]:[],nt=[...wt,...St];if(nt.length>0){let j=zt(g,M,T||{}),z=Ht(j,null,void 0,{isServer:!0}),I=await Ut(nt,z);if(I.redirect){let C=typeof I.redirect==="string"?I.redirect:I.redirect.path||I.redirect,H=Wt(String(C),g),A=qt(g,r);await v.promises.mkdir(p.dirname(A),{recursive:!0}),await Bun.write(A,H),u.successCount++,u.pages.push({route:g,outputPath:A,size:Buffer.byteLength(H),cached:!1}),U.push({loc:g,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${g} \u2192 redirect to ${C}`);return}if(I.abort){let C=typeof I.abort==="string"?I.abort:I.abort?.error?.message||"aborted";console.warn(` \u21B3 ${g} \u2014 middleware aborted: ${C}`);return}}let it=T?.validate;if(typeof it==="function")try{if(!await it({params:M})){console.warn(`Validation failed for ${g}, skipping...`);return}}catch{}let B=null,at=!1;if(r.cache){if(B=O.get(g,b.filePath),B)at=!0,u.cachedCount++}if(!B){let j=await ht(b,M,yt,r,s);if(B=j.html,r.failOnIncludeError&&j.includeFailures.length>0)throw Error(`${j.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
|
40
40
|
${j.includeFailures.join(`
|
|
41
41
|
`)}
|
|
42
42
|
Set ssg.failOnIncludeError to false to build anyway.`);if(r.failOnServerScriptError&&j.serverScriptFailures.length>0)throw Error(`${j.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
|
|
43
43
|
${j.serverScriptFailures.join(`
|
|
44
44
|
`)}
|
|
45
|
-
Set ssg.failOnServerScriptError to false to build anyway.`);if(r.cache)O.set(g,b.filePath,j.dependencies,B)}let N;if(r.trailingSlash)N=p.join(r.outputDir,g,"index.html");else N=g==="/"?p.join(r.outputDir,"index.html"):p.join(r.outputDir,`${g}.html`);if(r.chunkIslands){let{html:j,chunks:z}
|
|
45
|
+
Set ssg.failOnServerScriptError to false to build anyway.`);if(r.cache)O.set(g,b.filePath,j.dependencies,B)}let N;if(r.trailingSlash)N=p.join(r.outputDir,g,"index.html");else N=g==="/"?p.join(r.outputDir,"index.html"):p.join(r.outputDir,`${g}.html`);if(r.chunkIslands){let{html:j,chunks:z}=$c(B,{integrity:r.integrityIslands,minify:r.minify});if(z.length>0){let I=p.join(r.outputDir,"_stx","islands");await v.promises.mkdir(I,{recursive:!0});for(let C of z){let H=p.join(I,`${C.hash}.js`);if(!await Bun.file(H).exists())await Bun.write(H,C.code);if(!w.has(C.hash)){w.add(C.hash);let A=Buffer.byteLength(C.code,"utf8");P+=A,k[C.hash]={bytes:A,file:`/_stx/islands/${C.hash}.js`}}}if(x[g]=z.map((C)=>C.hash),B=j,r.prefetchIslands)B=Rc(B)}}if(await v.promises.mkdir(p.dirname(N),{recursive:!0}),await Bun.write(N,B),!Ot(g,B,T,r.sitemapExclude))U.push({loc:g,lastmod:new Date().toISOString().split("T")[0],priority:g==="/"?1:0.8});let ot={route:g,outputPath:N,size:Buffer.byteLength(B,"utf8"),cached:at};if(rt!==!1)ot.revalidateAt=Date.now()+rt*1000;u.pages.push(ot),u.successCount++,await r.hooks.onPageEnd?.(g,B)}catch(G){u.failedCount++,u.errors.push({route:g,error:G}),await r.hooks.onError?.(G,g),console.error(`Error generating ${g}:`,G)}}));let tt=bn();if(tt.length>0){let d=tt.map((h)=>`${h.filePath}: ${h.message}`).join(`
|
|
46
46
|
`);throw Error(`Client script bundling failed:
|
|
47
|
-
${d}`)}if(r.cache)await O.save();if(r.generate404){let d=p.join(r.pagesDir,"404.stx");if(await Bun.file(d).exists()){let
|
|
47
|
+
${d}`)}if(r.cache)await O.save();if(r.generate404){let d=p.join(r.pagesDir,"404.stx");if(await Bun.file(d).exists()){let h=new Set,b={...s,minifyClient:!0,debug:!1,cache:!1},g=await i(await Bun.file(d).text(),{},d,b,h);await Bun.write(p.join(r.outputDir,"404.html"),g)}else await Bun.write(p.join(r.outputDir,"404.html"),`<!DOCTYPE html>
|
|
48
48
|
<html lang="en">
|
|
49
49
|
<head>
|
|
50
50
|
<meta charset="UTF-8">
|
|
@@ -65,7 +65,7 @@ ${d}`)}if(r.cache)await O.save();if(r.generate404){let d=p.join(r.pagesDir,"404.
|
|
|
65
65
|
<a href="/">Go home</a>
|
|
66
66
|
</div>
|
|
67
67
|
</body>
|
|
68
|
-
</html>`)}for(let d of[500]){let
|
|
68
|
+
</html>`)}for(let d of[500]){let h=p.join(r.pagesDir,`${d}.stx`);if(await Bun.file(h).exists()){let b=new Set,g={...s,minifyClient:!0,debug:!1,cache:!1},M=await i(await Bun.file(h).text(),{},h,g,b);await Bun.write(p.join(r.outputDir,`${d}.html`),M)}}let K=p.join(r.pagesDir,"error.stx");if(await Bun.file(K).exists()){let d=new Set,h={...s,minifyClient:!0,debug:!1,cache:!1},b=await i(await Bun.file(K).text(),{},K,h,d);await Bun.write(p.join(r.outputDir,"error.html"),b)}if(r.sitemap&&U.length>0){let d=At(U,r.domain),h=p.join(r.outputDir,"sitemap.xml");await Bun.write(h,d),u.sitemapPath=h,console.log(`Generated sitemap.xml with ${U.length} URLs`)}if(r.robots!==!1){let d=typeof r.robots==="object"?r.robots:{},h=[...r.sitemapExclude.filter((g)=>typeof g==="string"),...d.disallow||[]],b=Ks({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...h.length>0?{disallow:h}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",r.domain).href}:{}});await Bun.write(p.join(r.outputDir,"robots.txt"),b),console.log("Generated robots.txt")}if(r.rss){let d=typeof r.rss==="object"?r.rss:{title:"Site Feed",description:"Latest updates",link:r.domain},h=[];if(d.getItems)h=await d.getItems();let b=Lt(d,h),g=p.join(r.outputDir,"rss.xml");await Bun.write(g,b),u.rssPath=g,console.log(`Generated rss.xml with ${h.length} items`)}let W=Ac(r.outputDir);if(W.assets>0)console.log(`Externalized ${W.assets} asset(s) from ${W.pages} page(s) (${(W.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let q=Pc(r.outputDir);if(q.assets>0)console.log(`Externalized ${q.assets} repeated asset(s) from ${q.pages} page(s) (${(q.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(r.publicDir&&v.existsSync(r.publicDir))await Y(r.publicDir,r.outputDir),console.log(`Copied public assets from ${r.publicDir}`);let et=wr();if(et)await Y(et,p.join(r.outputDir,br)),console.log(`Copied assets from ${hn}`)}catch(E){throw await r.hooks.onError?.(E),E}if(u.buildTime=Date.now()-n,w.size>0){u.islandChunks={count:w.size,totalBytes:P};let E={generatedChunks:w.size,totalBytes:P,chunks:k,pages:x};await Bun.write(p.join(r.outputDir,"_stx","islands-manifest.json"),JSON.stringify(E,null,2))}await r.hooks.onBuildEnd?.(u);let D=u.islandChunks?`
|
|
69
69
|
Island chunks: ${u.islandChunks.count} (${(u.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
|
|
70
70
|
Build complete!
|
|
71
71
|
Total: ${u.totalPages} pages
|
|
@@ -73,8 +73,8 @@ Build complete!
|
|
|
73
73
|
Cached: ${u.cachedCount}
|
|
74
74
|
Failed: ${u.failedCount}
|
|
75
75
|
Time: ${u.buildTime}ms${D}
|
|
76
|
-
`),u}async function Y(e,n){await v.promises.mkdir(n,{recursive:!0});let s=await v.promises.readdir(e,{withFileTypes:!0});for(let o of s){let c=p.join(e,o.name),r=p.join(n,o.name);if(o.isDirectory())await v.promises.mkdir(r,{recursive:!0}),await Y(c,r);else await v.promises.copyFile(c,r)}}function
|
|
77
|
-
`)){let D=x.indexOf(":");if(D>0){let E=x.slice(0,D).trim(),
|
|
76
|
+
`),u}async function Y(e,n){await v.promises.mkdir(n,{recursive:!0});let s=await v.promises.readdir(e,{withFileTypes:!0});for(let o of s){let c=p.join(e,o.name),r=p.join(n,o.name);if(o.isDirectory())await v.promises.mkdir(r,{recursive:!0}),await Y(c,r);else await v.promises.copyFile(c,r)}}function _t(e={}){let n=e.cacheDir||l(process.cwd(),"ssg-cache"),s=new pt(n),o=e.revalidate||3600;return{async get(c){let r=await s.get(c);if(!r)return null;if(Date.now()>r.revalidateAfter)this.revalidate(c).catch(console.error);return{html:r.html,headers:{"Cache-Control":`public, max-age=${o}, stale-while-revalidate=${o*2}`,ETag:r.etag,"X-ISR-Generated":new Date(r.generatedAt).toISOString(),...r.headers}}},async revalidate(c){let u=se(".",{pagesDir:e.pagesDir||"pages"}).find((D)=>c.match(D.regex)!==null);if(!u){console.warn(`Route not found for revalidation: ${c}`);return}let w=c.match(u.regex),P={};if(w)u.params.forEach((D,E)=>{P[D]=w[E+1]});let k=await a(),{html:x}=await ht(u,P,{},e,k);await s.set(c,{html:x,generatedAt:Date.now(),revalidateAfter:Date.now()+o*1000,etag:Tt(x)}),console.log(`Revalidated: ${c}`)},async invalidate(c){if(typeof c==="string")await s.invalidate(c);else await s.invalidatePattern(c)}}}function Gt(){return{name:"markdown",extensions:[".md",".mdx"],async load(e){let n=await Bun.file(e).text(),s=n.match(/^---\n([\s\S]*?)\n---/),o={},c=n;if(s){let k=s[1];c=n.slice(s[0].length).trim();for(let x of k.split(`
|
|
77
|
+
`)){let D=x.indexOf(":");if(D>0){let E=x.slice(0,D).trim(),m=x.slice(D+1).trim();if(m==="true")m=!0;else if(m==="false")m=!1;else if(/^\d+$/.test(m))m=parseInt(m,10);else if(/^\d+\.\d+$/.test(m))m=parseFloat(m);else if(m.startsWith("[")&&m.endsWith("]"))m=m.slice(1,-1).split(",").map((R)=>R.trim().replace(/^['"]|['"]$/g,""));o[E]=m}}}let r=c.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),u=[],w=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,P;while((P=w.exec(r))!==null){let k=parseInt(P[1],10),x=P[2],D=x.toLowerCase().replace(/[^a-z0-9]+/g,"-");u.push({id:D,text:x,level:k})}return{content:r,data:o,toc:u}}}}function Nt(e){return It(e)}function Wt(e,n){return`<!DOCTYPE html>
|
|
78
78
|
<html>
|
|
79
79
|
<head>
|
|
80
80
|
<meta charset="utf-8">
|
|
@@ -86,4 +86,4 @@ Build complete!
|
|
|
86
86
|
<p>Redirecting to <a href="${e}">${e}</a>...</p>
|
|
87
87
|
<script>window.location.replace('${e}')</script>
|
|
88
88
|
</body>
|
|
89
|
-
</html>`}function
|
|
89
|
+
</html>`}function qt(e,n){if(e==="/"||e==="")return p.join(n.outputDir,"index.html");let s=e.replace(/^\/|\/$/g,"");if(n.trailingSlash)return p.join(n.outputDir,s,"index.html");return p.join(n.outputDir,`${s}.html`)}var De={generateStaticSite:Mt,createISRHandler:_t,defineStaticPaths:J,createMarkdownLoader:Gt};export{_t as createISRHandler,Gt as createMarkdownLoader,Et as declaresPageAction,De as default,J as defineStaticPaths,Mt as generateStaticSite,Ot as isExcludedFromSitemap};
|
|
@@ -254,7 +254,7 @@ export declare interface AppHeadConfig {
|
|
|
254
254
|
lang?: string
|
|
255
255
|
meta?: Array<Record<string, string>>
|
|
256
256
|
link?: Array<Record<string, string>>
|
|
257
|
-
script?: Array<{ src?: string, content?: string, [key: string]: any }>
|
|
257
|
+
script?: Array<{ src?: string, content?: string, beforeRuntime?: boolean, [key: string]: any }>
|
|
258
258
|
headRaw?: string
|
|
259
259
|
htmlAttrs?: Record<string, string>
|
|
260
260
|
bodyClass?: string
|
|
@@ -369,6 +369,7 @@ export declare interface StxConfig {
|
|
|
369
369
|
media?: Partial<MediaConfig>
|
|
370
370
|
strict?: boolean | StrictModeConfig
|
|
371
371
|
buildMode?: 'compile' | 'serve' | 'spa'
|
|
372
|
+
inlineGeneratedCssBytes?: number
|
|
372
373
|
minifyClient?: boolean
|
|
373
374
|
autoShell?: boolean
|
|
374
375
|
outputDir?: string
|
|
@@ -379,6 +379,8 @@ export async function extractVariables(scriptContent, context, filePath, options
|
|
|
379
379
|
}, effect = (_fn) => {}, batch = (fn) => fn(), onMount = (_fn) => {}, onDestroy = (_fn) => {}, responseApi = responseBindings(context);
|
|
380
380
|
function definePageMeta(meta) {
|
|
381
381
|
const config = meta || {};
|
|
382
|
+
if (config.cache === !1)
|
|
383
|
+
context.__stx_skip_cache = !0;
|
|
382
384
|
if (config.title !== void 0 || config.description !== void 0)
|
|
383
385
|
useSeoMeta({ title: config.title, description: config.description });
|
|
384
386
|
}
|
|
@@ -659,7 +661,10 @@ export function convertToCommonJS(scriptContent, filePath) {
|
|
|
659
661
|
if (!done)
|
|
660
662
|
i = lines.length;
|
|
661
663
|
const callText = lines.slice(callStart, i).join(`
|
|
662
|
-
`)
|
|
664
|
+
`);
|
|
665
|
+
if (/\bcache\s*:\s*false\s*[,}]/.test(callText))
|
|
666
|
+
convertedLines.push("definePageMeta({ cache: false });");
|
|
667
|
+
const lifted = [];
|
|
663
668
|
for (const key of ["title", "description"]) {
|
|
664
669
|
const match = new RegExp(`\\b${key}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(callText);
|
|
665
670
|
if (match)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.919",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -127,14 +127,14 @@
|
|
|
127
127
|
},
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@stacksjs/clapp": "^0.2.17",
|
|
130
|
-
"@stacksjs/desktop": "0.2.
|
|
131
|
-
"@stacksjs/sanitizer": "0.2.
|
|
130
|
+
"@stacksjs/desktop": "0.2.919",
|
|
131
|
+
"@stacksjs/sanitizer": "0.2.919",
|
|
132
132
|
"@stacksjs/ts-css": "^0.3.21",
|
|
133
133
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
134
134
|
"@types/dom-speech-recognition": "^0.0.12",
|
|
135
|
-
"bun-plugin-stx": "0.2.
|
|
135
|
+
"bun-plugin-stx": "0.2.919",
|
|
136
136
|
"bunfig": "^0.15.21",
|
|
137
|
-
"stx-router": "0.2.
|
|
137
|
+
"stx-router": "0.2.919",
|
|
138
138
|
"ts-broadcasting": "^0.0.13",
|
|
139
139
|
"ts-images": "^0.2.22",
|
|
140
140
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-0adc8x2h.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{T}from"./chunk-0jdz31q1.js";import{Ul}from"./chunk-9928zdej.js";var t=new T(256,{maxBytes:16777216,sizeOf:(n)=>n.source.length*2});function Z(n){let r=t.get(n);if(r)return r.asynchronous;let s=o(n);return t.set(n,{source:n,asynchronous:s}),s}function o(n){let r=new Bun.Transpiler({loader:"js"});if(Ul(n))return r.transformSync(`(async function(){
|
|
3
|
-
${n}
|
|
4
|
-
})()`),!0;try{return r.transformSync(`(function(){
|
|
5
|
-
${n}
|
|
6
|
-
})()`),!1}catch{return r.transformSync(`(async function(){
|
|
7
|
-
${n}
|
|
8
|
-
})()`),!0}}
|
|
9
|
-
export{Z};
|
package/dist/chunk-1gj46s0g.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{tg,ng,$e,rg,Pc,mn,hn,iy,Ic,yn,hr,sg,og,ig,Cs,ag,cg,Oc,bn,lg,wn,Nc,ay}from"./chunk-z5nx021e.js";import"./chunk-dp6r6gtb.js";import"./chunk-cwcmmgvz.js";import"./chunk-0adc8x2h.js";import"./chunk-4w8t0a9e.js";import"./chunk-smnt37jq.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-vnk582z7.js";import"./chunk-4r0028av.js";import"./chunk-q9gbdzw0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{hr as MODULE_SPECIFIER_PREFIX,Oc as assertBundleBuildCanSettle,tg as bundleCacheDir,ng as bundleCacheEntryLimit,ay as bundleClientEntriesSplit,wn as bundleClientScript,hn as clearBundleFailures,$e as clientBundleDependencies,mn as getBundleFailures,yn as hasUserImports,cg as isWithinBundlerCallback,bn as moduleSubstitutionKey,og as normalizeRegistrySpecifiers,lg as queueClientBundleBuild,Pc as recordBundleFailure,sg as registryIdForPath,Ic as resolveBundlerFallback,ig as rewriteRegistryImports,iy as setBundlerFallbackMode,rg as shouldLogBundlerDiagnostics,Nc as tempBuildName,Cs as withModuleSubstitutes,ag as withinBundlerCallback};
|
package/dist/chunk-1mx3j280.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ra,Fy,zy,zl,nt,rm,vo,Hy,Uy,Vy,Wy,qy,Ky,Xy,Gy,Jy}from"./chunk-4vz17ytv.js";import"./chunk-0jdz31q1.js";export{Ky as applyHead,Hy as definePageMeta,ra as getHead,Fy as getPageMeta,nt as mergeHeadConfigs,Xy as processHeadDirective,Jy as processMetaDirective,Gy as processTitleDirective,qy as renderBodyAttrs,Vy as renderHead,Wy as renderHtmlAttrs,zy as resetHead,vo as seoMetaToHeadConfig,zl as useHead,Uy as usePageTitle,rm as useSeoMeta,Uy as useTitle};
|
package/dist/chunk-1p6gaaf3.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{et,z,Jt}from"./chunk-w98yt4d4.js";import{T}from"./chunk-0jdz31q1.js";import{Et,Be,V,ds,Tt,Fe,Fa,Fo,za,Gn}from"./chunk-4a9bqc8f.js";import{Dt,Se,We,Ai,Pi}from"./chunk-vnk582z7.js";import{ni}from"./chunk-dp6r6gtb.js";import{Jn}from"./chunk-fznjm7qt.js";import{Ae}from"./chunk-7anbc757.js";import ae from"fs";import P from"path";var{serve:ge}=globalThis.Bun;import k from"zlib";import{promisify as re}from"util";var ce=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ue=["text/event-stream","multipart/x-mixed-replace"],pe=1024;function le(t){if(!t)return!1;let e=t.toLowerCase();if(ue.some((o)=>e.startsWith(o)))return!1;return ce.some((o)=>e.startsWith(o))}function me(t){let e=new Map;for(let o of t.split(",")){let[r,...c]=o.trim().split(";"),m=r.trim().toLowerCase();if(!m)continue;let v=1;for(let d of c){let u=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(d);if(!u)continue;let l=Number.parseFloat(u[1]);if(Number.isFinite(l))v=l}e.set(m,v)}return e}function fe(t){if(!t)return null;let e=me(t),o=e.get("*"),r=(c)=>e.get(c)??o??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var se=33554432,F=new Map,W=0;function de(t,e){if(e.length>se/8)return;F.set(t,e),W+=e.length;for(let[o,r]of F){if(W<=se)break;F.delete(o),W-=r.length}}async function Wn(t,e,o={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!le(e.headers.get("content-type")))return e;let r=fe(t.headers.get("accept-encoding"));if(!r)return e;let c;try{c=new Uint8Array(await e.arrayBuffer())}catch{return e}let m=()=>new Response(c,{status:e.status,statusText:e.statusText,headers:oe(e.headers)});if(c.length<(o.threshold??pe))return m();try{let v=o.quality??5,d=`${r}:${v}:${c.length}:${Bun.hash(c)}`,u=F.get(d);if(!u)u=r==="br"?await re(k.brotliCompress)(c,{params:{[k.constants.BROTLI_PARAM_QUALITY]:v,[k.constants.BROTLI_PARAM_SIZE_HINT]:c.length}}):await re(k.gzip)(c),de(d,u);if(u.length>=c.length)return m();let l=oe(e.headers);return l.set("Content-Encoding",r),l.set("Content-Length",String(u.length)),new Response(u,{status:e.status,statusText:e.statusText,headers:l})}catch{return m()}}function oe(t){let e=new Headers(t),o=e.get("Vary");if(!o)return e.set("Vary","Accept-Encoding"),e;if(!o.split(",").some((c)=>c.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${o}, Accept-Encoding`);return e}var he=new Set(["x-stx-router","accept-encoding",...ds.map((t)=>t.toLowerCase())]);class J{now;entries=new T(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,o){let r,c=async()=>{let a=r??await o();return a.headers.set("Cache-Control","private, no-store"),a.headers.set("Vary",V(a.headers.get("Vary")).Vary),a};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return c();let m=new URL(t.url),v=Be(t)?`fragment|${ds.map((a)=>t.headers.get(a)??"").join("|")}`:"document",d=`${m.origin}${m.pathname}${m.search}|${v}`,u=this.entries.get(d),l=(a)=>{let S=new Headers(a.headers);return S.set("Cache-Control","private, no-store"),S.set("Age",String(Math.max(0,Math.floor((this.now()-a.created)/1000)))),new Response(a.body.slice(0),{headers:S})},b=u?(this.now()-u.created)/1000:1/0;if(u&&b<e.maxAge)return l(u);let N=this.generation,X=async()=>{let a=await o();r=a;let S=(a.headers.get("Vary")??"").toLowerCase().split(",").map((s)=>s.trim()).filter(Boolean);if(a.status!==200||a.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(a.headers.get("Cache-Control")??"")||S.some((s)=>!he.has(s)))return null;let n=await a.clone().arrayBuffer();if(n.byteLength>1048576)return null;a.headers.set("Vary",V(a.headers.get("Vary")).Vary);let A={body:n,headers:Array.from(a.headers.entries()),created:this.now(),path:m.pathname};if(this.generation===N)this.entries.set(d,A);return A},w=this.pending.get(d);if(!w){if(this.pending.size>=1000)return c();w=X().finally(()=>{if(this.pending.get(d)===w)this.pending.delete(d)}),this.pending.set(d,w)}if(u&&b<e.maxAge+(e.swr??0))return w.catch(()=>{}),l(u);let E=await w;return E?l(E):c()}}var Re={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};function q(t,e){if(!e)return null;let o=Pi(t.headers);return o&&Ai(o,e)?e:null}function K(t){return t?{"X-STX-Layout":t.layout,"X-STX-Layout-Group":t.group}:{}}async function Pm(t={}){let e=P.resolve(t.outputDir||".output"),o=t.port??3000,r=Fa(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let c=Jn(r.routeRules),m=new J,v=ni(e,r.apiRoutes??[]),d=Bun.file(P.join(e,"server/runtime-config.json")),u=t.runtimeConfig??(await d.exists()?await d.json():void 0),l=u?z(u):void 0,b=new Map,N=new Map,X=new Map,w=new Map;for(let n of r.routes)try{let A=P.join(e,n.compiledPath),s=JSON.parse(await Bun.file(A).text());if(l)s.html=Jt(s.html,l);b.set(n.pattern,s),X.set(n.pattern,We(s.html)),w.set(n.pattern,Ae(s.html));let j=P.join(e,n.fragmentPath);if(Tt(s.html,r.routerContainer||"main")&&await Bun.file(j).exists()){let M=await Bun.file(j).text();N.set(n.pattern,l?Jt(M,l):M)}}catch(A){console.warn(`[stx] Failed to load route ${n.pattern}:`,A)}let E=new Map,a=[];for(let n of r.routes)if(n.hasParams){let{regex:A,params:s}=Se(n.pattern,{page:!0});a.push({regex:A,route:n,paramNames:s})}else E.set(n.pattern,n);let S=ge({port:o,async fetch(n){return Wn(n,await et(l??z(),async()=>{let s=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[s])return t.apiRoutes[s](n);let j=await v(n);if(j)return j;if((n.method==="GET"||n.method==="HEAD")&&s!=="/"){let p=P.resolve(e,"public"),y;try{y=decodeURIComponent(s)}catch{y=s}if(!y.includes("\x00")){let f=P.resolve(p,`.${y}`);if(f===p||f.startsWith(`${p}${P.sep}`))try{if(ae.existsSync(f)&&ae.statSync(f).isFile()){let i=P.extname(f).toLowerCase(),g=Re[i]||"application/octet-stream",H=s.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(s);return new Response(Bun.file(f),{headers:{"Content-Type":g,"Cache-Control":H?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let M=Be(n),R=null,Q={};if(R=E.get(s)||null,!R)for(let{regex:p,route:y,paramNames:f}of a){let h=s.match(p);if(h){R=y,f.forEach((i,g)=>{Q[i]=h[g+1]});break}}if(!R){let p=Dt(s)?null:E.get("/404")||null;if(p){let y=b.get(p.pattern);if(y)return new Response(y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let O=c(s),Z=Object.keys(O).length>0;return m.respond(n,O.cache,async()=>{let p=b.get(R.pattern),y=M?q(n,X.get(R.pattern)):null;if(M&&!y&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let i=N.get(R.pattern);if(i){let g=X.get(R.pattern);return new Response(i,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...w.has(R.pattern)?{"X-STX-Runtime":w.get(R.pattern)?"true":"false"}:{},...g?{"X-STX-Layout":g.layout,"X-STX-Layout-Group":g.group}:{},...V(),...O.cache?{}:{"Cache-Control":Et}}})}}let f=Fo(n.method),h=b.get(R.pattern);if(!h){let i=E.get("/500")||null;if(i){let g=b.get(i.pattern);if(g)return new Response(g.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(R.prerendered&&f)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!f&&!h.hasServerScripts&&Object.keys(h.placeholders).length===0)return new Response(h.html,{status:h.status??200,headers:{"Content-Type":"text/html",...V(),"Cache-Control":"public, max-age=60",...K(y)}});try{let{html:i,boundaries:g,redirect:H,cookies:I,status:D,headers:U}=await Gn(h,{params:Q,request:n,method:n.method,__stx_strict_hydration:Z,__stx_runtime_config:l});if(H)return za(H,I,U);if(g&&g.length>0){let{renderStreamingPage:x,streamToResponse:B}=await import("./chunk-6n50b07t.js"),L=new Headers({...V(),...U,"Cache-Control":"private, no-store"});for(let Y of I??[])L.append("Set-Cookie",Y);let _=M&&!f?We(i):null,te=_?q(n,_):null,ne=M&&!f&&!te&&Tt(i,r.routerContainer||"main");if(ne&&_)L.set("X-STX-Fragment","true"),L.set("X-STX-Runtime",Ae(i)?"true":"false"),L.set("X-STX-Layout",_.layout),L.set("X-STX-Layout-Group",_.group);for(let[Y,ie]of Object.entries(K(te)))L.set(Y,ie);return B(x(ne?Fe(i,r.routerContainer||"main",!0):i,g,{timeoutMs:30000}),{status:D??h.status??200,headers:L})}let C=new Headers({"Content-Type":"text/html",...V(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let x of I??[])C.append("Set-Cookie",x);for(let[x,B]of Object.entries(U??{}))C.set(x,B);C.set("Vary",V(C.get("Vary")).Vary);let G=M&&!f?We(i):null,ee=G?q(n,G):null;for(let[x,B]of Object.entries(K(ee)))C.set(x,B);if(M&&!f&&!ee&&Tt(i,r.routerContainer||"main")){let x=G??We(i);return C.set("X-STX-Fragment","true"),C.set("X-STX-Runtime",Ae(i)?"true":"false"),C.set("X-STX-Layout",x.layout),C.set("X-STX-Layout-Group",x.group),new Response(Fe(i,r.routerContainer||"main",!0),{status:D??h.status??200,headers:C})}return new Response(i,{status:D??h.status??200,headers:C})}catch(i){if(console.error(`[stx] Hydration error for ${s}:`,i),Z)return new Response("Internal Server Error",{status:500});return new Response(h.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${S.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${b.size} pre-loaded)`),{port:S.port,stop:()=>{m.invalidate(),S.stop()},invalidate:(n)=>m.invalidate(n)}}
|
|
3
|
-
export{Wn,Pm};
|
package/dist/chunk-1rfzs48h.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{zh,Ho,Hh,Uh,Vh,Wh}from"./chunk-barb4gka.js";import"./chunk-z5nx021e.js";import"./chunk-dp6r6gtb.js";import"./chunk-cwcmmgvz.js";import"./chunk-wz44vmgn.js";import"./chunk-7anbc757.js";import"./chunk-nhyv3w4r.js";import"./chunk-0adc8x2h.js";import"./chunk-4w8t0a9e.js";import"./chunk-smnt37jq.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-vnk582z7.js";import"./chunk-4r0028av.js";import"./chunk-q9gbdzw0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{Wh as clearStoreCache,zh as getStoreScript,Vh as getStoreScriptFor,Uh as pageStoresAll,Ho as storesRead,Hh as storesReadInFiles};
|
package/dist/chunk-20hy5p3p.js
DELETED
package/dist/chunk-29v3b5ks.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Gu,Xo,ur,Ju,Yu,Zu,Qu,ed,td,nd,rd,sd,od,id,ad,cd,ld,ud,dd,pd,fd,gd,md,hd,yd,bd,wd,vd,xd,Sd,kd,_d,Cd,Ed,Td,$d,Rd,Ad,Pd,Id,Od,Nd,Md,Dd,Ld,jd,Bd,Fd,dn,sc,zd,Hd,Ud,oc,Vd,Wd,qd,Kd,Xd,Gd,ic,Jd,Yd,Zd,Qd,ep,tp,np,rp,sp,dr,op,ip,ap,cp,lp,up,dp,pp,fp,gp,mp,hp,Go,yp,bp,wp,vp,xp,vs,xs,Sp,kp,_p,Cp,Ep,ac,Tp,$p,Rp,cc,Jo,Ap,Pp,lc,uc,Ss,dc,Ip,pn,Op,pc,fc,Yo,Np,Zo,Mp,Dp,Lp,jp,Bp,Fp,zp,gc,Hp,Up,mc,Vp,Wp,qp,Kp,Xp,Gp,Jp,Yp,Zp,Qp,ef,tf,nf,rf,sf,of,af,cf,lf,uf,df,pf,ff,gf,hc,mf,hf,yf,bf,wf,vf,xf,Sf,kf,_f,Cf,pr,yc,bc,Ef,fr,Tf,$f,Rf,wc,vc,ks,_s,Af,Qo,Pf,If,Of,Nf,Mf,Df,Lf,jf,Bf,Ff,zf,Hf,Uf,Vf,Wf,qf,Kf,Xf,Gf,Jf,xc,Yf,Zf,Sc,kc,Qf,eg}from"./chunk-36cz2v8k.js";export{Bd as AVAILABLE_COMPONENTS,ac as AutoUpdater,Fd as COMPONENT_STYLES,ks as DEFAULT_WATCH_INTERVAL_MS,vc as MAX_WATCH_INTERVAL_MS,wc as MIN_WATCH_INTERVAL_MS,Gd as MODAL_STYLES,sd as TOAST_STYLES,np as TRAY_MENU_STYLES,lc as UPDATE_MANIFEST_ASSET,Wd as alert,df as appInfo,Df as appleScript,eg as applicationDataDirectory,Mf as audio,Zf as backgroundDelay,af as battery,Nf as biometric,_f as bluetooth,zf as bonjour,pn as bundlePathForExecutable,Np as caffeinate,Tp as canReplaceBundle,$p as clearQuarantine,Yp as clipboard,Xd as closeAllModals,hp as closeAllWindows,Vd as confirm,gf as contextMenu,Kf as continuityCamera,qf as coreml,Cp as craftBinaryNotFoundMessage,Go as craftWindowArguments,pr as crashReporter,Td as createAccordion,vd as createAutocomplete,dd as createAvatar,ud as createBadge,od as createButton,pd as createCard,Nd as createChart,ad as createCheckbox,kd as createChip,Md as createCodeEditor,yd as createColorPicker,Od as createDataGrid,bd as createDatePicker,xs as createDiskImage,gd as createDropdown,Ld as createFileExplorer,Ip as createGitHubUpdateManifest,dc as createGitHubUpdater,Sd as createImageView,Kp as createInterval,xd as createLabel,Ad as createListView,Dd as createMediaPlayer,Jd as createMenubar,Rd as createModalComponent,Qf as createNativeUpdateApi,kc as createPantrySelfUpdater,Bp as createPreferences,ld as createProgressBar,hd as createRadioButton,md as createRating,Cd as createScrollView,Yo as createSelfUpdater,cd as createSlider,Ed as createSplitView,$d as createStepper,ic as createSystemTray,Pd as createTable,fd as createTabs,id as createTextInput,wd as createTimePicker,qp as createTimer,_d as createTooltip,Id as createTreeView,jd as createWebView,yp as createWindow,wp as createWindowWithHTML,Zo as decaffeinate,of as deepLinks,Xp as delay,td as dismissAlertById,nd as dismissAllAlerts,rf as dragOut,Rp as extractBundle,Lf as fileAssociations,Qo as focus,If as focusShortcutsReady,Jp as formatCompact,jp as formatDuration,Lp as formatRemainingTime,Hp as formatShortcut,Gp as formatTime,Qp as fs,cc as generateUpdateManifest,rd as getActiveAlertCount,Kd as getActiveModalCount,Yd as getActiveTrayInstances,gp as getActiveWindowIds,Dp as getCaffeinateStatus,Jf as getCapabilities,xc as getCapability,pp as getDesktopConfig,up as getDialogBridgeScript,Wp as getRegisteredHotkeys,ep as getSimulatedTrayHTML,tp as getTrayBridgeScript,Zd as getTrayInstance,mp as getWindow,xp as getWindowBridgeScript,uc as githubLatestAssetUrl,Ss as githubReleaseAssetUrl,tf as globalShortcuts,fr as handoff,Pf as hasFocusShortcuts,Ef as iap,zp as isAutoLaunchEnabled,Yf as isAvailable,Mp as isCaffeinated,sf as isDragOutAvailable,vp as isWebviewAvailable,yf as keychain,Tf as liveActivities,Of as localServer,$f as location,Ff as log,Sp as macOSRuntimeExecutablePath,ff as menu,Wf as midi,vf as nativeAutoLaunch,xf as nativeTray,Sf as nativeWindow,cf as network,Zp as notifications,ed as notify,bp as openDevWindow,kp as pack,_p as packageApp,Sc as parsePantryUpdateManifest,gc as parseShortcut,Bf as pdf,bf as permissions,wf as printing,qd as prompt,pc as quitLauncher,Jo as readBundleIdentity,yc as redactPII,Up as registerHotkey,fc as relaunchBundle,Gu as requestNotificationPermission,fp as resetDesktopConfig,Ep as resolveCraftBinary,vs as resolveCraftExecutablePath,Op as runningBundleTeamId,hf as screen,Rf as screenCapture,_s as screenSharing,Gf as serial,Xf as serviceMenu,Fp as setAutoLaunch,dp as setDesktopConfig,ef as shell,Xo as showAlert,ip as showAlertDialog,op as showColorPicker,ap as showConfirmDialog,cp as showErrorDialog,Hd as showErrorModal,Qu as showErrorToast,sc as showInfoModal,Ju as showInfoToast,dr as showMessageBox,dn as showModal,rp as showOpenDialog,oc as showQuestionModal,sp as showSaveDialog,Ud as showSuccessModal,Yu as showSuccessToast,ur as showToast,lp as showWarningDialog,zd as showWarningModal,Zu as showWarningToast,hc as sidebar,bc as signPayload,Cf as speech,Uf as speechRecognition,Hf as spotlight,pf as standardMenus,Ap as swapBundle,mf as system,jf as tags,nf as theme,kf as touchbar,Qd as triggerTrayAction,Vp as unregisterAllHotkeys,mc as unregisterHotkey,lf as updater,Pp as verifyBundleTrust,Vf as vision,Af as watchScreenSharing,uf as windowEvents};
|
package/dist/chunk-2cay3heb.js
DELETED
package/dist/chunk-33fnbw33.js
DELETED
package/dist/chunk-357qjcj1.js
DELETED
package/dist/chunk-38y11q8x.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Fm,zm,Hm,Um,vu,Vm,Wm,qm,Km,Xm,Gm,Jm}from"./chunk-2f5jjxcj.js";export{Gm as Broadcast,Jm as BroadcastServer,vu as broadcast,Km as broadcastPresence,qm as broadcastPrivate,Xm as channel,Fm as getBroadcastServer,Um as loadChannels,zm as startBroadcasting,Hm as stopBroadcasting,Vm as toUser,Wm as toUsers};
|
package/dist/chunk-3q80f7mt.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{uu,Ia,du,pu,Oa,fu,gu,mu,hu,Na,yu,Nm}from"./chunk-ra2tzsvz.js";import{Ha,xu}from"./chunk-1jvt9t3r.js";import{le,ue,de,Yn,Te,ze,gs,$t,ln,Zn,Qn,er,pe,tr,nr,ms}from"./chunk-88fx8xc1.js";import{Eu}from"./chunk-frpsrv1e.js";import"./chunk-0vyytd9v.js";export{ue as DEFAULT_FORMATS,de as DEFAULT_QUALITY,le as DEFAULT_WIDTHS,ms as ImageProcessingError,pu as clearImageCache,Oa as createImageDirective,xu as createImageHandler,gu as createImagePlugin,Nm as defaultImageConfig,nr as formatSize,Na as generateImageManifest,ln as generateSizes,$t as generateSrcSet,Zn as getFallbackVariant,gs as getImageMetadata,pe as getMimeType,tr as getTotalSize,Qn as groupVariantsByFormat,Ha as handleImageRequest,fu as imageDirective,Te as isImageBackendAvailable,er as isImageFile,Yn as isSharpAvailable,hu as optimizeDirectory,mu as optimizeImage,Ia as parseImageComponent,ze as processImage,du as processImageComponents,uu as renderImageComponent,Eu as rewriteImagesWithSiblings,yu as writeImageManifest};
|
package/dist/chunk-43kz6rx9.js
DELETED
package/dist/chunk-490rrkrp.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Uo,qh,Kh}from"./chunk-mdgcjzcn.js";import"./chunk-z5nx021e.js";import"./chunk-dp6r6gtb.js";import"./chunk-cwcmmgvz.js";import"./chunk-wz44vmgn.js";import"./chunk-7anbc757.js";import"./chunk-nhyv3w4r.js";import"./chunk-0adc8x2h.js";import"./chunk-4w8t0a9e.js";import"./chunk-smnt37jq.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-vnk582z7.js";import"./chunk-4r0028av.js";import"./chunk-q9gbdzw0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{Kh as clearComposableCache,qh as getComposableScript,Uo as listComposableModules};
|
package/dist/chunk-49980am3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ti,$i,Dt,Se,Rr,Ks,Ar,Xs,Gs,Eg,Tg,$g,Pr,Rg,Ag,Pg,Ig,nl,rl,sl,Ri,ol,Og,Lt,jt,Bt,Ft,zt,Ht,ft,Ng}from"./chunk-vnk582z7.js";export{Ar as Router,Pg as abortNavigation,Ks as bracketPathToRegex,Lt as clearMiddleware,rl as createClientCookieManager,zt as createMiddlewareContext,Ft as createRouteLocation,nl as createServerCookieManager,sl as createStorageManager,Ig as defineMiddleware,Tg as defineRoute,$g as defineRoutes,Xs as findErrorPage,Gs as formatRoutes,$i as generateRouteManifest,Ti as generateRouteTypes,ol as getMiddleware,jt as getMiddlewareNames,ft as getRouterScript,Ng as getRouterScriptDev,Og as hasMiddleware,Dt as isFileRequestPath,Bt as loadMiddlewareFromDirectory,Rr as matchRoute,Ag as navigateTo,Se as patternToRegex,Ri as registerMiddleware,Rg as resetRoutes,Pr as route,Ht as runMiddleware,Eg as setAppUrl};
|
package/dist/chunk-4a9bqc8f.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Bn}from"./chunk-4vz17ytv.js";import{B,Q,x,Kt,Xt,zr,y,Ol,Ki,Y,N}from"./chunk-4r0028av.js";import{gn}from"./chunk-5xbx0r3k.js";import{r}from"./chunk-jmggm1ep.js";import{ne}from"./chunk-e5rag6rh.js";import{L,c}from"./chunk-8tfpv6zf.js";var J=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function K(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,n;while((n=e.exec(t))!==null)s.push({start:n.index,end:n.index+n[0].length});return s}function I(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function Z(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},n=s,i=n.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),n=n.slice(i[0].length);while(n.length>0){let o=n.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];n=n.slice(o[0].length);continue}let l=n.match(/^#([\w-]+)/);if(l){e.id=l[1],n=n.slice(l[0].length);continue}let a=n.match(/^\.([\w-]+)/);if(a){e.className=a[1],n=n.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function tt(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function T(t,s="main"){let e=Z(s);if(!e)return null;let n=/<([a-z][\w-]*)\b([^>]*)>/gi,i=K(t),o;while((o=n.exec(t))!==null){if(I(o.index,i))continue;let l=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||J.has(l))continue;if(e.tag&&e.tag!==l)continue;if(!tt(a,e))continue;let u=o[0],g=o.index+u.length,f=new RegExp(`<(/?)${l}\\b([^>]*)>`,"gi");f.lastIndex=g;let d=1,h;while((h=f.exec(t))!==null){if(I(h.index,i))continue;let b=h[1]==="/";if(!b&&(h[2]||"").trimEnd().endsWith("/"))continue;if(d+=b?-1:1,d===0)return{openTag:u,openIndex:o.index,start:g,end:h.index,tagName:l}}return null}return null}var Et="private, no-store";function cn(t){return t.replace(/&#(\d+);/g,(s,e)=>D(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>D(Number.parseInt(e,16),s)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function D(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function Be(t){return t.headers.get("X-STX-Router")==="true"}function H(t,s){if(!t)return s;return t.split(",").some((n)=>n.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function V(t){let s=H(t,"X-STX-Router");for(let e of ds)s=H(s,e);return{Vary:s}}var ds=["X-STX-Have-Layout","X-STX-Have-Layout-Group"];function k(t){return t.replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function F(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return x(s,(n,i)=>(e.lastIndex=i,e.exec(n)?e.lastIndex:-1)).map(({token:n})=>n)}function q(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let n of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=n[1].toLowerCase();if(!(i in s))s[i]=n[2]??n[3]??n[4]??""}return s}function Kn(t){let s=[];for(let e of F(t)){if(/^<title\b/i.test(e)){s.push(`<title>${k(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let n=q(e);if(/^<meta\b/i.test(e)){let i=n.property?"property":"name",o=cn(n[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${r(o)}" content="${k(n.content??"")}">`)}else{let i=cn(n.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&n.hreflang)s.push(`<link rel="${i}" href="${k(n.href??"")}"${i==="alternate"?` hreflang="${k(n.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
|
|
3
|
-
`}var et=["media","crossorigin","integrity"];function Xn(t){let s=[];for(let e of F(t)){if(!/^<link\b/i.test(e))continue;let n=q(e);if(cn(n.rel??"").trim().toLowerCase()!=="stylesheet")continue;if(!n.href||"data-css"in n||"disabled"in n)continue;let i=et.filter((o)=>(o in n)).map((o)=>` ${o}="${k(n[o])}"`).join("");s.push(`<link rel="stylesheet" href="${k(n.href)}"${i}>`)}return s.length?`<template data-stx-page-css="1">${s.join("")}</template>
|
|
4
|
-
`:""}import P from"path";var nt="stx-page-head:",rt=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function st(){let t=ne()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-49980am3.js"),n=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${n()}</script>`}catch{_[t]=""}return _[t]}async function Da(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let n=P.resolve(t,s);if(await Bun.file(n).exists())return n;return null}let e=P.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Bo(t,s){try{let e=await Bun.file(t).text(),n=e,i=B(e);if(i)n=i.content.trim();let o=gn(e),l=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],u=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,g;while((g=u.exec(e))!==null)a.push(g[0]);let f=n;for(let p of o.server)f=f.replace(p.fullTag,"");for(let p of o.client)f=f.replace(p.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!f.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:b,defaultConfig:w,loadStxConfig:R}=await import("./chunk-t63y6qd5.js"),E=await R(),m={__filename:t,__dirname:P.dirname(t)};for(let p of l){let C=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!p.includes("client")&&!p.includes('type="module"'))await b(C[1],m,t)}let S=await h(f,m,t,{...w,...E,...s},new Set),A=S.indexOf(d);if(A===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:S.substring(0,A),afterSlot:S.substring(A+d.length),filePath:t,shellScripts:l,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function ps(t,s,e){let n,i="",o=s.match(rt);if(o){s=s.replace(o[0],"");try{let f=Buffer.from(o[1],"base64").toString("utf8"),d=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)n=d[1].trim();i=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let l=e||n||"stx App",a=st(),u="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
5
|
-
<html lang="en">
|
|
6
|
-
<head>
|
|
7
|
-
<meta charset="UTF-8">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
-
<title>${l}</title>
|
|
10
|
-
${i?` ${i}
|
|
11
|
-
`:""} ${t.shellStyles.join(`
|
|
12
|
-
`)}
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
${t.beforeSlot}
|
|
16
|
-
<div data-stx-content>${s}</div>
|
|
17
|
-
${t.afterSlot}
|
|
18
|
-
${t.shellScripts.filter((f)=>!f.includes("server")).join(`
|
|
19
|
-
`)}
|
|
20
|
-
${u}
|
|
21
|
-
${a}
|
|
22
|
-
</body>
|
|
23
|
-
</html>`}function ot(t,s={}){let e=t.trim();if(!Bn(e))return t;let n=[],i=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(i){let u=i[1],g=/<style\b[^>]*>[\s\S]*?<\/style>/gi,f;while((f=g.exec(u))!==null)n.push(f[0]);let d=u.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(d)n.push(d[0]);let h=u.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(h)n.push(h[0])}if(s.preserveHead&&i){let u=[],g=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,f;while((f=g.exec(i[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(f[0]))continue;u.push(f[0])}if(u.length>0)n.unshift(`<!--${nt}${Buffer.from(u.join(`
|
|
24
|
-
`),"utf8").toString("base64")}-->`)}let o=e.match(/<body\b[^>]*>/i),l=c(e);if(o&&l!==-1){let u=o.index+o[0].length,g=e.slice(u,l).trim();if(n.length>0)return n.join(`
|
|
25
|
-
`)+`
|
|
26
|
-
`+g;return g}let a=e;if(a=a.replace(/<!DOCTYPE\b[^>]*>/i,""),a=a.replace(/<html\b[^>]*>/i,""),a=a.replace(/<\/html\s*>/i,""),i)a=a.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,n.join(`
|
|
27
|
-
`));return a=a.replace(/<body\b[^>]*>/i,""),a=a.replace(/<\/body\s*>/i,""),a.trim()}var U=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function G(t,s,e,n){if(!U.test(s))return!1;let i=s.slice(0,s.indexOf(">")+1),o=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!o)return!0;let l=`data-stx-scope="${o}"`;for(let a=t.indexOf(l);a!==-1;a=t.indexOf(l,a+l.length))if(a>=e&&a<n)return!1;return!0}function La(t){return Be(t)}function it(t,s){let e=[],n=new Set;for(let i of x(t,Q)){if(i.start>=s.start&&i.start<s.end)continue;let o=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",l=new Map;for(let g of o.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))l.set(g[1].toLowerCase(),g[2]??g[3]??g[4]??"");let a=l.get("src")?.trim(),u=l.get("type")?.trim().toLowerCase();if(!a||l.has("server")||u&&!["module","text/javascript","application/javascript"].includes(u))continue;if(l.has("data-stx-runtime")||l.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(a))continue;if(G(t,i.token,s.start,s.end)||n.has(i.token))continue;n.add(i.token),e.push(i.token)}return e}function Tt(t,s="main"){return!!T(t.trim(),s)}function Fe(t,s="main",e=!1){let n=t.trim(),i=[],o=[],l=n.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(l){let S=l[1],A=/<style\b[^>]*>[\s\S]*?<\/style>/gi,p;while((p=A.exec(S))!==null)i.push(p[0]);let C=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((p=C.exec(S))!==null){if(U.test(p[0])||p[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(p[0]))continue;o.push(p[0])}}let a=T(n,s);if(!a)return(e?Kn(t)+Xn(t):"")+ot(t);let u=it(n,a),g=new Set(u),{tagName:f,start:d,end:h}=a,b=n.slice(d,h).trim(),w=[],R=n.match(/<body\b[^>]*>/i),E=c(n);if(R&&R.index!==void 0&&E!==-1){let A=[[R.index+R[0].length,a.openIndex],[h+`</${f}>`.length,E]],p=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[C,j]of A){if(C>=j)continue;let W=n.slice(C,j),v;p.lastIndex=0;while((v=p.exec(W))!==null){if(G(n,v[0],d,h))continue;w.push(v[0])}}}let m=[];if(e)m.push(Kn(t)+Xn(t));if(i.length>0)m.push(i.join(`
|
|
28
|
-
`));if(u.length>0)m.push(u.join(`
|
|
29
|
-
`));if(o.length>0)m.push(o.filter((S)=>!g.has(S)).join(`
|
|
30
|
-
`));if(w.length>0)m.push(w.filter((S)=>!g.has(S)).join(`
|
|
31
|
-
`));return m.push(b),m.join(`
|
|
32
|
-
`)}import O from"fs";import X from"path";function ja(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function Ba(t,s){let e=X.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function Fa(t){let s=X.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),n=JSON.parse(e);if(n.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${n.version}`),null;return n}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let n=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)n+=`; Max-Age=${e.maxAge}`;if(e.expires)n+=`; Expires=${e.expires.toUTCString()}`;if(e.path)n+=`; Path=${e.path}`;if(e.domain)n+=`; Domain=${e.domain}`;if(e.secure)n+="; Secure";if(e.httpOnly)n+="; HttpOnly";if(e.sameSite)n+=`; SameSite=${e.sameSite}`;return n}async function at(t){let s=t.headers.get("content-type")||"",e={},n=(i,o)=>{let l=e[i];if(l===void 0)e[i]=o;else if(Array.isArray(l))l.push(o);else e[i]=[l,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,l]of i.entries())if(typeof l==="string")n(o,l);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())n(i,o);return e}return e}function Fo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function z(t,s={}){let e=s.request,n=s.method??e?.method;if(!e||!Fo(n))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await at(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let l=o,a=ct(l.cookies),u=l.redirect;if(typeof u==="string"&&u)return{redirect:u,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:g,redirect:f,...d}=l;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function ct(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,n]of Object.entries(t)){if(!e)continue;if(typeof n==="string"){s.push(M(e,n));continue}if(n&&typeof n==="object"){let i=n;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function za(t,s=[],e){let n=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)n.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")n.set(i,o);return new Response(null,{status:303,headers:n})}async function Gn(t,s={}){let{html:e,context:n,redirect:i,cookies:o}=await lt(t,s),l=Kt(n),a=Xt(n);if(i)return{html:e,redirect:i,cookies:o,status:l,headers:a};let{extractStreamBoundaries:u}=await import("./chunk-6n50b07t.js"),g=u(n),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:d}=await import("./chunk-mjny8x91.js"),{defaultConfig:h}=await import("./chunk-x1kzqxj5.js"),b=n.streamBoundaries||{},w={...h,autoShell:!1},R=Object.keys(f).map((m)=>({id:m,render:async()=>{let S=typeof b[m]==="function"?await b[m]():void 0;return d(f[m],{...n,$boundary:S},t.sourceFile,w,new Set)}})),E=new Set(R.map((m)=>m.id));g=[...(g||[]).filter((m)=>!E.has(m.id)),...R]}return{html:e,boundaries:g&&g.length>0?g:void 0,cookies:o,status:l,headers:a}}async function lt(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!Ki(t.html))return{html:t.html,context:e};for(let l of t.serverScriptContent)try{await y(l,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let n=await z(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(l)=>{let a=l.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),u=zr(e);if(!u)return a;let g=L(a);return g<0?u+a:a.slice(0,g)+u+a.slice(g)};if(n.redirect)return{html:t.html,context:e,redirect:n.redirect,cookies:n.cookies};if(!Ki(t.html))return{html:i(t.html),context:e,cookies:n.cookies};let o=new Map;for(let[l,a]of Object.entries(t.placeholders))if(a.expression)try{let u=N(a.expression,e);if(a.type==="raw")o.set(l,u!==void 0&&u!==null?String(u):"");else o.set(l,u!==void 0&&u!==null?Y(String(u)):"")}catch(u){if(s.__stx_strict_hydration)throw u;o.set(l,"")}return{html:i(Ol(t.html,o)),context:e,cookies:n.cookies}}
|
|
33
|
-
export{Et,cn,Be,V,ds,Kn,Xn,Da,Bo,ps,ot,La,Tt,Fe,ja,Ba,Fa,Fo,za,Gn};
|
package/dist/chunk-4e18r89n.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import i from"path";var En=".stx",o="STX_DIR",e=null;function il(t){e=t?.trim()||null}function Ir(){return process.env[o]?.trim()||e||En}function l(t=process.cwd(),...n){let r=Ir();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function Or(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==En&&!n.startsWith(`${En}/`))return t;let r=n.slice(En.length+1);return r?i.join(Ir(),r):Ir()}
|
|
3
|
-
export{En,il,Ir,l,Or};
|