@stacksjs/stx 0.2.917 → 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-ezqfrea9.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-ma5ptt4m.js → chunk-2jm7map2.js} +2 -2
- package/dist/chunk-2m4ydym0.js +33 -0
- package/dist/chunk-2mv29s6w.js +9 -0
- package/dist/{chunk-h0aw9hmc.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-fn1reean.js → chunk-3ftrv1f7.js} +7 -7
- package/dist/{chunk-yq2krsc9.js → chunk-3hfv217t.js} +6 -6
- package/dist/{chunk-eptzpvn0.js → chunk-3kpxkjgm.js} +3 -3
- package/dist/{chunk-mf5cqv1k.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-w6ydg43d.js → chunk-50zzar2c.js} +3 -3
- package/dist/{chunk-vayzmvf5.js → chunk-514yg4dr.js} +6 -6
- package/dist/{chunk-388xpdw5.js → chunk-5fdc8pej.js} +73 -33
- package/dist/chunk-5ht628zp.js +2 -0
- package/dist/chunk-67zy5p7x.js +2 -0
- package/dist/chunk-6bm7t0hm.js +3 -0
- package/dist/{chunk-wj9bqkc0.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-0v7555tr.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-t65f98qv.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-wm24jx3t.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-ngqb22wj.js → chunk-m390z8w8.js} +9 -9
- package/dist/chunk-m3qwqhxp.js +2 -0
- package/dist/{chunk-da05660m.js → chunk-m6hrb7rm.js} +58 -58
- package/dist/{chunk-789yp1tg.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-p3x84jj0.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-dwt2drzf.js → chunk-qzqqzraq.js} +8 -8
- package/dist/{chunk-v78hjbz0.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-n4m50dpk.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-8b8az19t.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-bm6y085n.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-nwef47nx.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-0asdv3hk.js → chunk-xap1f1bw.js} +2 -2
- package/dist/{chunk-ywrpmyzj.js → chunk-xk7hdpq5.js} +3 -3
- package/dist/{chunk-zkwkhesc.js → chunk-xmy75h5v.js} +2 -2
- package/dist/{chunk-0sj79ha5.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-f0sxbgbm.js → chunk-yvaqgdv1.js} +2 -2
- package/dist/{chunk-c13dv3wm.js → chunk-yye2pec5.js} +14 -14
- package/dist/{chunk-mt5ewkbg.js → chunk-yzqb7y45.js} +6 -6
- package/dist/{chunk-91p8p2cc.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/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.js +1 -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/pwa.js +3 -3
- package/dist/ssg.js +13 -13
- package/dist/types/config-types.d.ts +1 -1
- package/dist/variable-extractor.js +6 -1
- package/package.json +5 -5
- package/dist/chunk-0adc8x2h.js +0 -9
- package/dist/chunk-0atz8fjx.js +0 -20
- package/dist/chunk-0fm6avxt.js +0 -3
- package/dist/chunk-11rnqey0.js +0 -2
- package/dist/chunk-1mx3j280.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-31yx4sjh.js +0 -2
- package/dist/chunk-33fnbw33.js +0 -2
- package/dist/chunk-357qjcj1.js +0 -3
- package/dist/chunk-38kerh2r.js +0 -2
- package/dist/chunk-38y11q8x.js +0 -2
- package/dist/chunk-3h4db9yb.js +0 -33
- package/dist/chunk-3q80f7mt.js +0 -2
- package/dist/chunk-43kz6rx9.js +0 -2
- package/dist/chunk-43sgpy4e.js +0 -54
- package/dist/chunk-4e18r89n.js +0 -3
- package/dist/chunk-4pve3r5a.js +0 -2
- package/dist/chunk-4vz17ytv.js +0 -68
- package/dist/chunk-5afnyvw5.js +0 -2
- package/dist/chunk-5d5dxts6.js +0 -2
- package/dist/chunk-5fdsyyfe.js +0 -2
- package/dist/chunk-67yr4m5h.js +0 -2
- package/dist/chunk-6aqr0e6s.js +0 -2
- package/dist/chunk-6bw02d1t.js +0 -2
- package/dist/chunk-76mn123c.js +0 -2
- package/dist/chunk-7ar11ccn.js +0 -2
- package/dist/chunk-7fc0vrs5.js +0 -2
- package/dist/chunk-82fg5gp6.js +0 -2
- package/dist/chunk-89r7bbsk.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-8x3yaahc.js +0 -2
- package/dist/chunk-94qc4zwb.js +0 -2
- package/dist/chunk-9928zdej.js +0 -3
- package/dist/chunk-9ay18k46.js +0 -2
- package/dist/chunk-9kn81bmp.js +0 -2
- package/dist/chunk-9tv0tw7f.js +0 -3
- package/dist/chunk-9w9y84t5.js +0 -21
- package/dist/chunk-a5h9bwrc.js +0 -2
- package/dist/chunk-b5qzed8y.js +0 -1323
- package/dist/chunk-bej9kz05.js +0 -2
- package/dist/chunk-bh2khcet.js +0 -2
- package/dist/chunk-c6096ssb.js +0 -2
- package/dist/chunk-ccgabq3a.js +0 -2
- package/dist/chunk-e0tvd7jj.js +0 -2
- package/dist/chunk-e5rag6rh.js +0 -3
- package/dist/chunk-fvr3h2fr.js +0 -7
- package/dist/chunk-gmmqz698.js +0 -2
- package/dist/chunk-hxftzw0x.js +0 -2
- package/dist/chunk-js1wayhb.js +0 -2
- package/dist/chunk-jz37h2z0.js +0 -4
- package/dist/chunk-k2t0w8z1.js +0 -2
- package/dist/chunk-k8s3hyh2.js +0 -2
- package/dist/chunk-kcpxqsdj.js +0 -2
- package/dist/chunk-mjr5fkc2.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-p9bghe13.js +0 -2
- package/dist/chunk-q2cwzgd0.js +0 -2
- package/dist/chunk-q60afqr7.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-rzsvxjse.js +0 -2
- package/dist/chunk-s2c0ynn9.js +0 -2
- package/dist/chunk-senrtnx2.js +0 -2
- package/dist/chunk-v1wr2vdx.js +0 -2
- package/dist/chunk-v6gkjg5f.js +0 -3
- package/dist/chunk-wc10m4tp.js +0 -38
- package/dist/chunk-wcxa8xy2.js +0 -2
- package/dist/chunk-wgrj0cvs.js +0 -2
- package/dist/chunk-wpkwx3wq.js +0 -2
- package/dist/chunk-wq17dce6.js +0 -2
- package/dist/chunk-wvc6eayq.js +0 -2
- package/dist/chunk-xa98a901.js +0 -2
- package/dist/chunk-xjt5129x.js +0 -2
- package/dist/chunk-yc3frw0z.js +0 -3
- package/dist/chunk-yn02d599.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
|
|
@@ -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-0atz8fjx.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Z}from"./chunk-0adc8x2h.js";import{yr,He}from"./chunk-cwcmmgvz.js";import{G,k,Mr,to,A}from"./chunk-b5qzed8y.js";import{a,j}from"./chunk-mf5cqv1k.js";import{ri}from"./chunk-0sj79ha5.js";import{gt}from"./chunk-zkwkhesc.js";import{l}from"./chunk-4e18r89n.js";import{t,h}from"./chunk-fvr3h2fr.js";import d from"path";import E from"fs";import{AsyncLocalStorage as lt}from"async_hooks";import{randomUUID as St}from"crypto";var vt=12;function X(e,n,s){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(e))||ri(e,n,s)}var ct=2;function tg(e){let n=process.env.STX_BUNDLE_CACHE_DIR?.trim();return n?d.resolve(n):l(e,"bundle-cache")}function rt(e,n){let s=e;for(let i of Bt(n))if(i!==d.sep)s=s.split(i).join("\x00root");return s}var it=new Map;function Bt(e){let n=d.resolve(e),s=it.get(n);if(!s){let i=n;try{i=E.realpathSync(n)}catch{}s=[...new Set([n,i])].sort((c,p)=>p.length-c.length),it.set(n,s)}return s}function jt(e,n){try{let s=E.statSync(e),i=d.resolve(n),c=e.startsWith(`${i}${d.sep}`);return{path:c?d.relative(i,e):e,...c?{inRoot:!0}:{},mtimeMs:s.mtimeMs,size:s.size,hash:Bun.hash(E.readFileSync(e)).toString(36)}}catch{return null}}function ut(e,n){return e.inRoot?d.join(d.resolve(n),e.path):e.path}function Et(e,n){for(let s of e){let i=ut(s,n);try{let c=E.statSync(i);if(c.size!==s.size)return!1;if(c.mtimeMs!==s.mtimeMs&&Bun.hash(E.readFileSync(i)).toString(36)!==s.hash)return!1}catch{return!1}}return!0}var dt=new Map,_t=100;function ng(e=process.env){let n=Number(e.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(n)&&n>=1?Math.floor(n):2000}var q=new Map;async function Mt(e){let n=q.get(e)??0;if(n>0&&n<_t){q.set(e,n+1);return}q.set(e,1);try{let s=(await E.promises.readdir(e)).filter((o)=>o.endsWith(".js")),i=ng();if(s.length<=i)return;let p=(await Promise.all(s.map(async(o)=>{try{return{name:o,at:(await E.promises.stat(d.join(e,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);p.sort((o,w)=>w.at-o.at);for(let o of p.slice(i)){let w=o.name.slice(0,-3);await E.promises.rm(d.join(e,`${w}.js`),{force:!0}),await E.promises.rm(d.join(e,`${w}.deps.json`),{force:!0})}T("pruned bundle cache to",i,"entries")}catch{}}function $e(e){return dt.get(e)??[]}function Y(e,n){if(e)dt.set(e,n)}function rg(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function T(...e){if(rg())console.log("[stx:bundler]",...e)}var et=[];function Pc(e,n,s){et.push({filePath:e||"<inline>",message:n,details:s})}function mn(){return et.slice()}function hn(){et.length=0}var K;function iy(e){K=e}function Ic(){if(K)return K;try{let e=j.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var tt=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function yn(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,s;while((s=n.exec(e))!==null){let c=s[1];if(!tt.some((o)=>o.test(c)))return T("detected user import:",c),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((s=i.exec(e))!==null){let c=s[1];if(/\.css(?:\?.*)?$/.test(c))continue;if(!tt.some((o)=>o.test(c)))return T("detected side-effect import:",c),!0}return!1}var hr="stx-module:",Rt=/\.(?:[cm]?[jt]sx?|json)$/i;function sg(e,n){return d.relative(e,n).split(d.sep).join("/")}function og(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(s,i,c,p)=>{let o=n.get(p);return o&&!p.startsWith(hr)?`${i}${c}${o}${c}`:s})}function ig(e,n){let s=0,i=(p)=>{let o=`__stxMod${s++}`,w=JSON.stringify(p);return n.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${w}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(w)} + " is not registered on this page (#1957)");`),o},c=(p,o)=>{for(let w of p.split(",")){let C=w.trim();if(!C)continue;let R=C.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!R)continue;let S=R[1].startsWith('"')?JSON.parse(R[1]):R[1],f=R[2]??S;n.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o,w)=>{let C=w.slice(hr.length),R=i(C),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))n.push(`var ${f[1]} = ${R}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)n.push(`var ${v[1]} = ${R};`);else if(S.startsWith("{"))c(S.replace(/^\{|\}$/g,""),R);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o)=>(i(o.slice(hr.length)),"")),e}function ot(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,d.join(e,"index.ts"),d.join(e,"index.tsx"),d.join(e,"index.js"),d.join(e,"index.mjs")];for(let s of n)try{if(E.existsSync(s)&&E.statSync(s,{throwIfNoEntry:!1})?.isFile())return s}catch{}return}var H=new lt;function Cs(e,n){let s=new Bun.CryptoHasher("md5");for(let[i,c]of[...e].sort(([p],[o])=>p<o?-1:p>o?1:0))s.update(`${i}\x00${c}\x00`);return H.run({modules:e,key:s.digest("hex").slice(0,12)},n)}var pt=new lt;function ag(e){return pt.run(!0,e)}function cg(){return pt.getStore()===!0}function Oc(e){if(!cg())return;throw Error(`The client script of ${e} needs bundling, and it is being rendered inside a Bun.build loader, where Bun never finishes a second build. Make the page an entrypoint of the build (bun-plugin-stx renders entrypoints before the bundler starts), or render it once outside the build so its bundle is cached.`)}function bn(){return H.getStore()?.key??""}function ft(e,n,s,i,c,p,o=new Map,w,C,R){let S=new Map([[s,i],...R??[]]),f=(B)=>B!==void 0&&S.has(B),v=(B,r,u)=>{if(X(r,e,w))return null;if(!p||!f(B)||!Rt.test(r))return null;try{if(!E.statSync(r,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(r);let _=`${hr}${sg(process.cwd(),r)}`;return o.set(u,_),{path:_,external:!0}},b=(B,r)=>{let u=f(B)?n:d.dirname(B),_=d.resolve(u,r);return ot(_)??_};return{name:"stx-client-bundle",setup(B){if(B.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(r)=>({path:r.path,external:!0})),B.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(r)=>({path:r.path,external:!0})),B.onResolve({filter:/^\//},(r)=>{if(f(r.path))return{path:r.path};let u=ot(r.path);if(u){let _=v(r.importer,u,r.path);if(_)return _;if(!f(u))c.add(u);return{path:u}}return{path:r.path,external:!0}}),B.onResolve({filter:/^\.\.?\//},(r)=>{let u=b(r.importer,r.path),_=v(r.importer,u,r.path);if(_)return _;return c.add(u),{path:u}}),B.onResolve({filter:/^[@~]\//},(r)=>{let u=d.resolve(e,r.path.slice(2)),_=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,d.join(u,"index.ts"),d.join(u,"index.tsx"),d.join(u,"index.js"),d.join(u,"index.mjs")];for(let x of _)if(E.existsSync(x)&&E.statSync(x,{throwIfNoEntry:!1})?.isFile()){let D=v(r.importer,x,r.path);if(D)return D;return T(`resolved ${r.path[0]}/ import:`,r.path,"\u2192",x),c.add(x),{path:x}}return console.warn(`[stx:bundler] could not resolve ${r.path[0]}/ import:`,r.path),{path:u}}),p)B.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(r)=>{if(!f(r.importer))return;let u=`${hr}npm:${r.path}`;return o.set(r.path,u),{path:u,external:!0}});B.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(r)=>{if(S.has(r.path))return{contents:S.get(r.path),loader:"ts"};if(X(r.path,e,w))throw Error(`Server-only API source cannot be imported by a client script: ${r.path}`);let u=d.extname(r.path).toLowerCase(),_=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(r.path))c.add(r.path);let x=C?.get(r.path);if(x!==void 0)return{contents:x,loader:"js"};return{contents:E.readFileSync(r.path,"utf8"),loader:_}})}}}var Q=new Map,V=k(64),at=Symbol.for("stx.client-bundle-build-queue");function lg(e){let n=globalThis,i=(n[at]??Promise.resolve()).then(e,e);return n[at]=i.then(()=>{return},()=>{return}),i}async function wn(e,n,s={}){let i=s.projectRoot||process.cwd(),c=(await a(i)).serverApi,p=s.minify??!1,o=s.externalizeUserModules??!0,w=s.expose?.length?[...new Set(s.expose)].sort():void 0,C=s.cacheDir||tg(i),R=H.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${vt}\x00${gt()}\x00${JSON.stringify(c??!1)}\x00${o?"registry":"inline"}\x00${w?w.join(","):"*"}\x00${p?"minified":"readable"}\x00${R?.key??""}\x00${rt(e,i)}\x00${rt(n,i)}`);let f=S.digest("hex").slice(0,12),v=d.join(C,`${f}.js`),b=V.get(v);if(b){if(to(b.files)&&b.files.every((x)=>!X(x.path,i,c))){T("memo hit:",f);let x=b.files.map((D)=>D.path);return Y(n,x),s.collectInputs?.push(...x),b.code}V.delete(v),T("memo invalidated by dep change:",f)}let B=d.join(C,`${f}.deps.json`),r=Bun.file(v);if(await r.exists()){let x=Bun.file(B),D=!1,N=null;if(await x.exists())try{let O=JSON.parse(await x.text());if(O.metadataVersion===ct&&Array.isArray(O.files)&&Et(O.files,i))N=Mr(O.files.map((g)=>ut(g,i))),D=N.length===O.files.length&&!N.some((g)=>X(g.path,i,c))}catch{D=!1}if(D){if(T("cache hit:",f),N)Y(n,N.map((L)=>L.path)),s.collectInputs?.push(...N.map((L)=>L.path));let O=await r.text(),g=new Date;if(E.promises.utimes(v,g,g).catch(()=>{}),N)V.set(v,{code:O,files:N});return O}T("cache invalidated by dep change:",f)}let u=Q.get(f);if(u){let x=await u;if(s.collectInputs)s.collectInputs.push(...(V.get(v)?.files??[]).map((D)=>D.path));return x}Oc(n);let _=lg(()=>Ft(e,n,{projectRoot:i,minify:p,cacheDir:C,hash:f,cachePath:v,depsPath:B,collectInputs:s.collectInputs,externalizeUserModules:o,serverApi:c,expose:w,throwOnFailure:s.throwOnFailure,substitutes:R?.modules}));Q.set(f,_);try{return await _}finally{Q.delete(f)}}function Nc(e){return`${e}-${process.pid}-${St()}`}async function ay(e,n){let{projectRoot:s}=n,i=Nc(new Bun.CryptoHasher("md5").update([...e.keys()].join("\x00")).digest("hex").slice(0,12)),c=d.join(l(s,"bundle-tmp"),"out",i);E.mkdirSync(c,{recursive:!0});let p=new Map,o=new Map,w=0;for(let[f,v]of e){let b=d.join(s,`.stx-split-${i}-${w++}.ts`);p.set(b,v),o.set(d.basename(b).replace(/\.ts$/,""),f)}let[C,R]=[...p][0],S=new Set;Oc(n.filePath);try{let f=await Bun.build({entrypoints:[...p.keys()],outdir:c,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ft(s,d.dirname(n.filePath),C,R,S,!1,new Map,void 0,H.getStore()?.modules,p)],define:{"process.env.NODE_ENV":'"development"',...A()},root:s});if(!f.success)throw Error(f.logs.filter((b)=>b.level==="error").map((b)=>b.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let b of f.outputs){let B=d.basename(b.path);if(b.kind==="entry-point"){let r=o.get(B.replace(/\.js$/,""));if(r!==void 0)v.entries.set(r,await b.text())}else if(b.kind==="chunk")v.chunks.set(B.replace(/\.js$/,""),await b.text())}return n.collectInputs?.push(...S),v}finally{try{E.rmSync(c,{recursive:!0,force:!0})}catch{}}}async function Ft(e,n,s){let{projectRoot:i,minify:c,cacheDir:p,hash:o,cachePath:w,depsPath:C,externalizeUserModules:R}=s,S=l(i,"bundle-tmp"),f=Nc(o),v=d.join(i,`.stx-client-${f}.ts`),b=d.join(S,"out",f);E.mkdirSync(b,{recursive:!0});let B=d.dirname(n),r=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,_=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,x=t(e),{depths:D,balanced:N}=h(x),O=(F)=>!N||D[F]===0,g;while((g=u.exec(x))!==null){if(g[1])continue;if(!O(g.index))continue;if(g[2])g[2].split(",").forEach((F)=>{let m=It(F);if(m)r.add(m)});else if(g[3])r.add(g[3])}while((g=_.exec(x))!==null){if(g[1])continue;if(!O(g.index))continue;r.add(g[2])}let L=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=L.exec(x))!==null){if(!O(g.index))continue;let F=/^\s*['"]([^'"]+)['"]/.exec(e.slice(g.index+g[0].length))?.[1];if(F&&tt.some((m)=>m.test(F)))continue;if(g[1])r.add(g[1]);if(g[2])r.add(g[2]);for(let m of(g[3]??"").split(",")){let M=m.trim();if(!M||/^type\s/.test(M))continue;let P=/\bas\s+(\w+)\s*$/.exec(M)?.[1]??/^\w+$/.exec(M)?.[0];if(P)r.add(P)}}for(let F of x.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of F[1].split(",")){let M=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(M)r.delete(M)}let mt=r.size>0?`
|
|
3
|
-
export { ${[...r].join(", ")} }`:"";T("bundling:",o,"from:",d.basename(n));let nt=new Set,st=new Map;try{let F=await Bun.build({entrypoints:[v],outdir:b,target:"browser",format:"esm",minify:c?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[ft(i,B,v,e+mt,nt,R,st,s.serverApi,s.substitutes)],define:{"process.env.NODE_ENV":c?'"production"':'"development"',...A()},root:i});if(!F.success){let I=F.logs.filter((U)=>U.level==="error").map((U)=>U.message).join(", ")||`Unable to bundle ${d.basename(n)}`,z=yr(F.logs,n||void 0);if(console.warn("[stx:bundler] build failed:",I),Pc(n||"",I,z),s.throwOnFailure||Ic()==="error")throw Error(I);return e}let m="";for(let y of F.outputs){m=await y.text();break}let M=[];for(let y of m.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let I of y[1].split(",")){let z=I.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(z){M.push([z[2],z[1]]);continue}let U=I.trim();if(/^[A-Za-z_$][\w$]*$/.test(U))M.push([U,U])}if(s.expose){let y=new Set(s.expose);for(let I=M.length-1;I>=0;I--)if(!y.has(M[I][0]))M.splice(I,1)}let P=[];m=ig(og(m,st),P);let ht=m.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(m=m.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),c&&m)try{m=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(m)}catch{}let xt=Z(m),W=`__stxBundle_${o}`,yt=new Set(G(e,!0).split(",").map((y)=>y.trim())),$t=M.map(([y,I])=>`get ${JSON.stringify(y)}() { return ${I} }${yt.has(y)?`, set ${JSON.stringify(y)}(__stxValue_${I}) { ${I} = __stxValue_${I} }`:""}`).join(", "),bt=M.map(([y])=>`var ${y} = undefined;`).join(`
|
|
4
|
-
`),wt=M.map(([y])=>`${y} = ${W}[${JSON.stringify(y)}];`).join(`
|
|
5
|
-
`);if(m=`${ht.join(`
|
|
6
|
-
`)}
|
|
7
|
-
${bt}
|
|
8
|
-
var ${W} = ${xt?"await (async function":"(function"}() {
|
|
9
|
-
${P.join(`
|
|
10
|
-
`)}
|
|
11
|
-
${m}
|
|
12
|
-
return { ${$t} };
|
|
13
|
-
})();
|
|
14
|
-
${wt}
|
|
15
|
-
var __stxLiveBindings = typeof __stxLiveBindings === 'undefined' ? {} : __stxLiveBindings;
|
|
16
|
-
Object.keys(${W}).forEach(function(name) {
|
|
17
|
-
if (!Object.prototype.hasOwnProperty.call(__stxLiveBindings, name))
|
|
18
|
-
Object.defineProperty(__stxLiveBindings, name, Object.getOwnPropertyDescriptor(${W}, name));
|
|
19
|
-
});`.trim(),T("bundled:",o,"output:",m.length,"bytes"),r.size>0&&M.length===0)return console.warn(`[stx:bundler] dropped every binding for ${d.basename(n)} (${o}); serving the unbundled source and not caching this result`),e;E.mkdirSync(p,{recursive:!0}),await Bun.write(w,m);let J=Mr(nt);return await Bun.write(C,JSON.stringify({metadataVersion:ct,files:J.map((y)=>jt(y.path,i)).filter((y)=>y!==null)})),Y(n,J.map((y)=>y.path)),s.collectInputs?.push(...J.map((y)=>y.path)),V.set(w,{code:m,files:J}),await Mt(p),m}catch(F){let m=yr(F,n||void 0),M=He(F,n||void 0);if(console.warn(`[stx:bundler] error: ${M}`),Pc(n||"",M,m),s.throwOnFailure||Ic()==="error")throw F;return e}finally{try{E.rmSync(b,{recursive:!0,force:!0})}catch{}}}function It(e){let n=e.trim();if(!n)return null;let s=n.indexOf("=");if(s!==-1)n=n.slice(0,s).trim();let i=n.indexOf(":");if(i!==-1)n=n.slice(i+1).trim();if(n.startsWith("..."))n=n.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(n)?n:null}
|
|
20
|
-
export{tg,ng,$e,rg,Pc,mn,hn,iy,Ic,yn,hr,sg,og,ig,Cs,ag,cg,Oc,bn,lg,wn,Nc,ay};
|
package/dist/chunk-0fm6avxt.js
DELETED
package/dist/chunk-11rnqey0.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-388xpdw5.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-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-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-31yx4sjh.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{br,i}from"./chunk-n4m50dpk.js";import"./chunk-ngqb22wj.js";import"./chunk-43sgpy4e.js";import"./chunk-fs43342z.js";import"./chunk-0v7555tr.js";import"./chunk-0fm6avxt.js";import"./chunk-bm6y085n.js";import"./chunk-9tv0tw7f.js";import"./chunk-9w9y84t5.js";import{Pe}from"./chunk-8b8az19t.js";import"./chunk-nhyv3w4r.js";import"./chunk-t65f98qv.js";import"./chunk-0adc8x2h.js";import"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import{Ke,lo,uo}from"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.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{br as buildModulesTag,Pe as injectRouterScript,i as processDirectives,lo as processJsonDirective,uo as processOnceDirective,Ke as validateClientScript};
|
package/dist/chunk-33fnbw33.js
DELETED
package/dist/chunk-357qjcj1.js
DELETED
package/dist/chunk-38kerh2r.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Am}from"./chunk-0asdv3hk.js";import"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.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{Am as buildApp};
|
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-3h4db9yb.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-b5qzed8y.js";import{gn}from"./chunk-f0sxbgbm.js";import{r}from"./chunk-0fm6avxt.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-11rnqey0.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-k2t0w8z1.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-6aqr0e6s.js"),g=u(n),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:d}=await import("./chunk-31yx4sjh.js"),{defaultConfig:h}=await import("./chunk-82fg5gp6.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-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-43sgpy4e.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{d,m,M,p,te}from"./chunk-4vz17ytv.js";import{T}from"./chunk-0jdz31q1.js";import{G,Js,Ke,B,Vt,Fr,Ye,Ze,s,b,Me,P}from"./chunk-b5qzed8y.js";import{vt}from"./chunk-16sfjkc4.js";import{D}from"./chunk-phzhmnnm.js";import{ge}from"./chunk-9tv0tw7f.js";import{W,ut}from"./chunk-1jxkc6d0.js";import{I,Fn}from"./chunk-e5rag6rh.js";import A from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let S=c[r];if(S==="("||S==="["||S==="{")a++;else if(S===")"||S==="]"||S==="}")a--;else if(S===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,S=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=S.exec(r);while(n){let u=n.index,t=u+n[0].length-1,C=1,z=t+1;while(z<r.length&&C>0){if(r[z]==="(")C++;else if(r[z]===")")C--;z++}if(C!==0)break;let ie=r.substring(t+1,z-1),N=`${a}(${ie})`;r=r.substring(0,u)+N+r.substring(z),S.lastIndex=u+N.length,n=S.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,S=0,n=0,u=e.length,t=(N)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===N){n++;return}n++}},C=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let N=1;while(n<u&&N>0)if(e[n]==="{")N++,n++;else if(e[n]==="}")N--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")C();else n++;continue}n++}},z=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
|
|
3
|
-
`)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<u-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},ie=()=>{if(S!==0)return;let N=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(N){let H=N[2];if(!r.has(H))a.push(H),r.add(H);return}let se=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(se){let H=se[1];if(!r.has(H))a.push(H),r.add(H);return}let Y=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Y){let H=Y[1];if(!r.has(H))a.push(H),r.add(H)}};while(n<u){if(z())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){C();continue}if(e[n]==="{"){S++,n++;continue}if(e[n]==="}"){S--,n++;continue}if(S===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))ie();n++}return a.join(", ")}function ve(c,e=""){let a=he(c).split(",").map((r)=>r.trim()).filter(Boolean);return`
|
|
4
|
-
(function() {
|
|
5
|
-
${vt("var",a)}
|
|
6
|
-
var __destroyHooks = [];
|
|
7
|
-
var __origOnDestroy = onDestroy;
|
|
8
|
-
onDestroy = function(fn) { __origOnDestroy(fn); __destroyHooks.push(fn); };
|
|
9
|
-
|
|
10
|
-
${c}
|
|
11
|
-
${e}})();
|
|
12
|
-
`}function Re(c,e){let r=he(c).split(",").map((u)=>u.trim()).filter(Boolean),S=new Set(G(c,!0).split(",").map((u)=>u.trim())),n=r.map((u)=>S.has(u)?` try { ${u}; Object.defineProperty(__scopeRegistration, ${JSON.stringify(u)}, ${Js(u)}); } catch (e) { /* not actually top-level */ }`:` try { __scopeRegistration[${JSON.stringify(u)}] = ${u}; } catch (e) { /* not actually top-level */ }`).join(`
|
|
13
|
-
`);return`
|
|
14
|
-
// Register scope variables for STX runtime
|
|
15
|
-
if (!window.stx._scopes) window.stx._scopes = {};
|
|
16
|
-
var __scopeRegistration = window.stx._scopes['${e}'] || { __destroyCallbacks: __destroyHooks };
|
|
17
|
-
${n}
|
|
18
|
-
// #1767: when the bundler renamed a component const that collided with an
|
|
19
|
-
// inlined import (foo -> foo2), rebind the ORIGINAL template name to the
|
|
20
|
-
// renamed declaration so it resolves to the component's value, not the
|
|
21
|
-
// shadowing import. __stxScopeRenames is emitted by bundleClientScript.
|
|
22
|
-
try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
|
|
23
|
-
if (typeof __stxLiveBindings !== 'undefined') Object.defineProperties(__scopeRegistration, Object.getOwnPropertyDescriptors(__stxLiveBindings));
|
|
24
|
-
window.stx._scopes['${e}'] = __scopeRegistration;
|
|
25
|
-
`}function ke(c,e){return c.replace(/<script data-stx-scoped data-stx-run="always" data-stx-owner="([^"]*)"/g,(a,r)=>r===e?a:'<script data-stx-scoped data-stx-run="always"')}function ue(c,e){let a=Re(c,e);return Ie(ve(c,a),e)}function Ie(c,e){let a=`
|
|
26
|
-
(function() {
|
|
27
|
-
var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${e}"]') : null;
|
|
28
|
-
var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
|
|
29
|
-
if (__stxScopeEl && typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxScopeEl;
|
|
30
|
-
if (__stxScopeEl && typeof window !== 'undefined' && window.stx) {
|
|
31
|
-
if (!window.stx._scopes) window.stx._scopes = {};
|
|
32
|
-
window.stx._scopes['${e}'] = {};
|
|
33
|
-
}
|
|
34
|
-
var __stxEndEffects = (typeof window !== 'undefined' && window.stx && window.stx._beginEffects) ? window.stx._beginEffects() : null;
|
|
35
|
-
try {`,r=`
|
|
36
|
-
} finally {
|
|
37
|
-
// The body's effects end where its onDestroy callbacks run: with the scope
|
|
38
|
-
// when the partial has a root, with the page when it has none.
|
|
39
|
-
if (__stxEndEffects) {
|
|
40
|
-
var __stxDisposeEffects = __stxEndEffects();
|
|
41
|
-
var __stxRegistered = __stxScopeEl && window.stx._scopes && window.stx._scopes['${e}'];
|
|
42
|
-
if (__stxRegistered) __stxRegistered.__disposeEffects = __stxDisposeEffects;
|
|
43
|
-
else if (window.stx._destroyCallbacks) window.stx._destroyCallbacks.push(__stxDisposeEffects);
|
|
44
|
-
}
|
|
45
|
-
if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
|
|
46
|
-
}
|
|
47
|
-
})();`;return a+c+r}function Te(c,e){if(W(c)){let n=W(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:ut(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Vt(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let S=r[1]+r[2],n=r[1].slice(1),u=S.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),C=r[1],z=r[2];return{html:`${t}${C} data-stx-scope="${e}"${z}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Ae=0;function fe(c,e){let a=A.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Ae}`}var le=new Set,pe=new Set;function py(){le.clear(),pe.clear()}var Ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function mg(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],S=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",C=u[2],z=u[3]==="/"||Ce.has(C.toLowerCase());if(t){S=Math.max(0,S-1);continue}if(S===0)r.push(C);if(!z)S++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var lt=new T(500),jc=new Set;function fy(){jc.clear()}function De(c){if(c.__onceStore instanceof Set)return c.__onceStore;return jc}async function Ts(c,e,a,r,S,n=new Set){let u=r.partialsDir||A.join(A.dirname(a),"partials");if(u&&!A.isAbsolute(u))u=A.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),C=De(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(C.has(i))return"";return C.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let O=o[1],F=z(O,u,a),E="";if(F&&await Bun.file(F).exists())S.add(F),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let O=t.substring(x+1,o-1),F=ae(O,0);if(F===-1){h.lastIndex=o;continue}let E=O.substring(0,F).trim(),V=O.substring(F+1).trim(),U=V.match(/^\s*['"]([^'"]+)['"]/);if(!U){h.lastIndex=o;continue}let _=U[1],q=V.substring(U[0].length),j,R=ae(q,0);if(R!==-1)j=q.substring(R+1).trim();try{let k=`Boolean(${E})`,L;if(m(k)){let oe=p(k,Object.keys(e));L=Boolean(oe(...Object.values(e)))}else L=Boolean(d(k,e));let ee=v?!L:L,re="";if(ee){let oe=z(_,u,a);if(oe&&await Bun.file(oe).exists())S.add(oe);re=`@include('${_}'${j?`, ${j}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(k){let L=k instanceof Error?k.message:String(k),ee=b("Include",`Error evaluating ${f} condition: ${L}`,a,c,i);t=t.substring(0,i)+ee+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let[,F,E,V,U]=O;try{let _,q=E.trim();if(m(q))_=p(q,Object.keys(e))(...Object.values(e));else _=d(q,e);let j="";if(Array.isArray(_)&&_.length>0)for(let R of _){let k={...e,[V]:R},L=await se(F,k,c,h);j+=L}else if(U)j=await se(U,{},c,h);t=t.substring(0,h)+j+t.substring(x+1),f.lastIndex=0}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+b("Each",`Error in @each: ${q}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*(\[[^\]]+\])/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let F=O[1],E=l.slice(O[0].length),V,U=E.match(/^\s*,\s*\{/);if(U){E=E.slice(U[0].length-1);let j=1,R=1;while(R<E.length&&j>0){if(E[R]==="{")j++;else if(E[R]==="}"){if(j--,j===0)break}R++}V=E.substring(0,R+1),E=E.slice(R+1)}let _,q=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(q)_=q[1];try{let j=JSON.parse(F.replace(/'/g,'"')),R={};if(V)try{R=M(V,e)}catch(L){let ee=L instanceof Error?L.message:String(L);if(r.debug){let re=b("Include",`Error parsing includeFirst variables: ${ee}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let k=!1;for(let L of j){let ee=z(L,u,a);if(!ee)continue;if(await s(ee)){let re=await se(L,R,c,h);t=t.replace(o,()=>re),k=!0;break}}if(!k)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let L=b("Include",`None of the includeFirst paths exist: ${F}`,a,c,h,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(j){let R=j instanceof Error?j.message:String(j),k=b("Include",`Error processing @includeFirst: ${R}`,a,c,h,o);t=t.replace(o,()=>k)}f.lastIndex=0}}function z(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=A.resolve(v),x=A.resolve(A.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let U of r._layerPartialDirs??[]){let _=A.resolve(U,g);if(_.startsWith(`${A.resolve(U)}${A.sep}`)&&ye(_))return _}l=A.resolve(v,g)}else l=A.resolve(x,g);let o=A.normalize(l),O=o.startsWith(i+A.sep)||o===i,F=o.startsWith(x+A.sep)||o===x,E=!1,V=A.dirname(x);if(o.startsWith(V+A.sep)){if(!A.relative(V,o).split(A.sep).some((j)=>j.startsWith(".")&&j!=="."&&j!==".."))E=!0}if(!O&&!F&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=A.resolve(a);n.add(ie);function N(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),b("Include",v,a,h,g)}async function se(f,v={},h,g){let i=z(f,u,a);if(!i)return N(f,`Could not resolve path for include: ${f}`,h,g);let x=A.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>A.basename(o)).join(" -> ");return N(f,`Circular include detected: ${l}`,h,g)}try{S.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(y){let K=y instanceof Error?y.message:String(y);return N(f,`Error loading include file ${f}: ${K}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:y}=await import("./chunk-6aqr0e6s.js");l=y(l,e)}if(l&&(r.debug||!I()&&!Fn()))try{let{warnUnbalancedTags:y}=await import("./chunk-20hy5p3p.js");y(l,i)}catch{}try{let{processESImports:y}=await import("./chunk-7ar11ccn.js");l=await y(l,e,i,r,S)}catch(y){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,y instanceof Error?y.message:y)}let o=l,O=B(o);if(O)o=O.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),V="";if(E)V=`<style${E[1]}>${E[2]}</style>`;let U=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(y,K,w)=>{if(!me(K))return"";return U.push({attrs:K,body:w}),`__STX_DATA_BLOCK_${U.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Me(l,i);for(let[y,K]of Object.entries(v))_[y]=K;let q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,j=[...l.matchAll(q)].sort((y,K)=>{let w=(y[1]||"").includes("server"),X=(K[1]||"").includes("server");return Number(X)-Number(w)}),R="",k=null,L=!1,ee=!1;for(let y of j){let K=y[1]||"",w=y[2]||"";if(me(K))continue;let X=K.includes("server"),be=Ye(K);if(!X&&!/\bsrc\s*=/i.test(K))Ke(w,i,r.strict);if(!X&&w.trim()){let{interpolateScriptExpressions:Z}=await import("./chunk-kcpxqsdj.js");w=Z(w,_,f)}let ce="";try{let{extractAndStripCssImports:Z,renderVendorStyleTags:Q}=await import("./chunk-7fc0vrs5.js"),ne=Z(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(Z){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,Z instanceof Error?Z.message:Z)}if(be&&w.trim())w=Ze(w);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-7fc0vrs5.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-wq17dce6.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:Z}=await import("./chunk-8x3yaahc.js");w=Z(w)}let de=Ee(w);if(!X){let{extractBridgeData:Z,generateServerDataBridge:Q}=await import("./chunk-7fc0vrs5.js"),ne=Q(w,Z(_));if(ne)w=`${ne}
|
|
48
|
-
${w}`}if(de&&!X){L=!0,k=fe(i,e);let Z=D(w),Q=ue(Z,k);R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}">${Q}</script>
|
|
49
|
-
`;continue}if(X)try{let{extractVariables:Z}=await import("./chunk-4pve3r5a.js");await Z(w,_,i)}catch(Z){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,Z)}if(!X&&!de){let Z=K.replace(/\bclient\b/i,"").trim();k=fe(i,e);let Q=D(w),ne=ue(Q,k);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))ee=!0;R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}"${Z?` ${Z}`:""}>${ne}</script>
|
|
50
|
-
`}}if(U.length>0){let{interpolateScriptExpressions:y}=await import("./chunk-kcpxqsdj.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(K,w)=>{let X=U[Number(w)];return`<script${X.attrs}>${y(X.body,_,f)}</script>`})}if(k){let y=Te(o,k);if(o=y.html,y.mergedIntoExisting){let w=k,X=y.mergedIntoExisting;R=R.split(`'${w}'`).join(`'${X}'`).split(`"${w}"`).join(`"${X}"`),k=X}else if(!y.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(y.stamped&&y.root!=="body"&&(L||ee)&&!pe.has(i)){let w=mg(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let K=y.stamped&&y.root!==null&&Fr(y.root);R=ke(R,K?k:null)}if(o.includes("@include")||o.includes("@partial"))o=await Ts(o,_,i,r,S,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-s2c0ynn9.js"),J=re(o,_,i,void 0,!0);J=ge(J,_,i),J=oe(J);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-na0e3s88.js");if(J=xe(J,_,i,r),J=we(J,_,i),J=_e(J,_,i,r),J=P(J,_,i),V)J+=`
|
|
51
|
-
`+V;if(R)J+=`
|
|
52
|
-
`+R;return J}catch(l){if(l instanceof te)throw l;let o=l instanceof Error?l.message:String(l);return N(f,`Error processing include ${f}: ${o}`,h,g)}}let Y=/@include\s*\(/g,H;while((H=Y.exec(t))!==null){let f=H.index,v=f+H[0].length-1,h=1,g=v+1;while(g<t.length&&h>0){if(t[g]==="(")h++;else if(t[g]===")")h--;g++}if(h!==0)break;let i=t.substring(f,g),x=t.substring(v+1,g-1),l=x.match(/^\s*['"]([^'"]+)['"]/);if(!l){Y.lastIndex=g;continue}let o=l[1],O,F=x.substring(l[0].length),E=ae(F,0);if(E!==-1)O=F.substring(E+1).trim();let V={};if(O)try{V=M(O,e)}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.replace(i,b("Include",`Error parsing include variables for ${o}: ${q}`,a,c,f)),Y.lastIndex=0;continue}let U=await se(o,V,c,f);t=t.substring(0,f)+U+t.substring(g),Y.lastIndex=0}return t}function $s(c,e){let a=c;function r(S,n,u,t){let C=S,z=!0;while(z){z=!1;let ie=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),N=C.match(ie);if(!N||N.index===void 0)break;let se=N.index,Y=N[1],H=se+N[0].length,f=new RegExp(`@${n}\\(`),v=new RegExp(`@${u}(?![a-z])`),h=1,g=H,i=-1;while(h>0&&g<C.length){let l=C.slice(g),o=l.match(f),O=l.match(v),F=o?g+o.index:1/0,E=O?g+O.index:1/0;if(F<E)h++,g=F+(o[0].length||1);else if(E<1/0){if(h--,h===0){i=E;break}g=E+u.length+1}else break}if(i===-1)break;let x=C.slice(H,i);if(!e[Y])e[Y]=[];if(t)e[Y].unshift(x);else e[Y].push(x);C=C.substring(0,se)+C.substring(i+`@${u}`.length),z=!0}return C}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function Rs(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
|
|
53
|
-
`)})}
|
|
54
|
-
export{py,mg,lt,jc,fy,Ts,$s,Rs};
|
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};
|
package/dist/chunk-4pve3r5a.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ht,Mg,Dg,Lg,jg,Bg,y,Fg,Ui,zg,_l,Cl}from"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.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{ht as STX_ENGINE_BINDING_NAMES,Ui as convertToCommonJS,_l as extractScriptFromTemplate,y as extractVariables,Cl as hasVariables,Fg as isCompleteImport,Bg as isMissingBindingFailure,Lg as isModuleResolutionFailure,jg as isSyntaxFailure,zg as splitDeclaration,Mg as stripTypeScript,Dg as withoutStxReferrer};
|