@stacksjs/stx 0.2.897 → 0.2.899
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-qe0t0m38.js → chunk-0b57fgpn.js} +4 -4
- package/dist/chunk-0f2d61b3.js +2 -0
- package/dist/{chunk-pjj54ddk.js → chunk-0gc1hez6.js} +3 -3
- package/dist/chunk-0ht6exrv.js +2 -0
- package/dist/{chunk-t3zmfh8w.js → chunk-150cz8qq.js} +7 -7
- package/dist/chunk-1pbghytr.js +2 -0
- package/dist/chunk-1tb18a92.js +2 -0
- package/dist/{chunk-dvjv4c3a.js → chunk-2sz1kh9m.js} +1 -1
- package/dist/chunk-2vqamyay.js +2 -0
- package/dist/chunk-36mz0nwv.js +2 -0
- package/dist/{chunk-3fnb12nh.js → chunk-3k4rteax.js} +13 -13
- package/dist/chunk-3m37fzvh.js +2 -0
- package/dist/chunk-3my2eef2.js +2 -0
- package/dist/{chunk-5qv5v8kc.js → chunk-40fpt0r6.js} +10 -10
- package/dist/{chunk-khm56bfm.js → chunk-46khhke2.js} +1 -1
- package/dist/{chunk-6g5z6r27.js → chunk-472w7t7p.js} +2 -2
- package/dist/{chunk-mjj36awr.js → chunk-4e28p8vf.js} +6 -6
- package/dist/{chunk-bgfs3mbg.js → chunk-4hk1mjtv.js} +5 -5
- package/dist/chunk-4jtewn1v.js +2 -0
- package/dist/chunk-4s6w89m2.js +2 -0
- package/dist/{chunk-dtpxzcrw.js → chunk-4wd5sn16.js} +7 -7
- package/dist/{chunk-1bft48gk.js → chunk-50wjk5ap.js} +2 -2
- package/dist/{chunk-ch9028z3.js → chunk-54x7h3sb.js} +1 -1
- package/dist/chunk-5astk182.js +2 -0
- package/dist/{chunk-3b3mkgpj.js → chunk-5g5khx0m.js} +2 -2
- package/dist/{chunk-zf68afyh.js → chunk-5gnt3qtn.js} +3 -3
- package/dist/{chunk-80ky40mm.js → chunk-5jrpzepc.js} +2 -2
- package/dist/{chunk-q0y8gv18.js → chunk-5mrt1enm.js} +2 -2
- package/dist/{chunk-wg6fmren.js → chunk-5tm1pvt3.js} +2 -2
- package/dist/chunk-5tvse0vw.js +2 -0
- package/dist/{chunk-ytjn0gq2.js → chunk-5yvgzh6n.js} +2 -2
- package/dist/{chunk-n6q1d66k.js → chunk-65g78sge.js} +1 -1
- package/dist/chunk-65rx54n6.js +2 -0
- package/dist/{chunk-x5bn2svk.js → chunk-67pq803s.js} +2 -2
- package/dist/{chunk-neg6ckjg.js → chunk-68r2zs20.js} +4 -4
- package/dist/{chunk-h0stypkf.js → chunk-6hjcqaqr.js} +2 -2
- package/dist/chunk-70ez3njv.js +2 -0
- package/dist/chunk-726w7fm2.js +2 -0
- package/dist/{chunk-xy8smv5e.js → chunk-73ebyhqq.js} +2 -2
- package/dist/chunk-73nazfe5.js +2 -0
- package/dist/{chunk-vk2jy6mn.js → chunk-7b3dqeyr.js} +2 -2
- package/dist/{chunk-whcrca58.js → chunk-7nn5s0c3.js} +30 -30
- package/dist/{chunk-062qfv99.js → chunk-7pfhr4nk.js} +2 -2
- package/dist/chunk-7r294vc9.js +2 -0
- package/dist/chunk-7rn7w53f.js +2 -0
- package/dist/{chunk-qnz406aa.js → chunk-7z1hqp86.js} +4 -4
- package/dist/chunk-81qvg3yd.js +2 -0
- package/dist/{chunk-e16ef18k.js → chunk-83hs9905.js} +2 -2
- package/dist/chunk-8a9gmbxa.js +2 -0
- package/dist/chunk-8jvwapq3.js +2 -0
- package/dist/{chunk-jdpzwv1t.js → chunk-8rgy17fj.js} +8 -8
- package/dist/{chunk-2g7cs1n8.js → chunk-8v2hsn4d.js} +3 -3
- package/dist/{chunk-y1d3j2j7.js → chunk-8xb09hnn.js} +4 -4
- package/dist/{chunk-xmg6bmh6.js → chunk-945zygwa.js} +13 -13
- package/dist/{chunk-pvm48tse.js → chunk-9ejk9mwk.js} +2 -2
- package/dist/{chunk-bw2m1e7g.js → chunk-9hwg13ec.js} +5 -5
- package/dist/{chunk-b8zrn7k4.js → chunk-9jpsxqaf.js} +1 -1
- package/dist/{chunk-d6ghx785.js → chunk-9m45t60c.js} +80 -80
- package/dist/{chunk-hj98d829.js → chunk-9n5san33.js} +14 -14
- package/dist/chunk-9vafweyd.js +3 -0
- package/dist/{chunk-zwqkbk2m.js → chunk-9w7whtbx.js} +2 -2
- package/dist/{chunk-1ph2yhfn.js → chunk-arfpzf17.js} +2 -2
- package/dist/chunk-avqxkbrd.js +2 -0
- package/dist/{chunk-htx5yezj.js → chunk-ayady5ws.js} +2 -2
- package/dist/{chunk-3xkrnf5m.js → chunk-b6ctdvdf.js} +6 -6
- package/dist/{chunk-tkjjyh6k.js → chunk-becs8132.js} +5 -5
- package/dist/chunk-bmwcgmev.js +2 -0
- package/dist/{chunk-67j2m620.js → chunk-bzd387yx.js} +4 -4
- package/dist/{chunk-mhrnjaka.js → chunk-c0x9wyj7.js} +4 -4
- package/dist/chunk-cgqpn3e2.js +2 -0
- package/dist/chunk-cp82351f.js +2 -0
- package/dist/chunk-cvxg2rc1.js +2 -0
- package/dist/{chunk-jxydtkdw.js → chunk-d1bwb2kz.js} +3 -3
- package/dist/{chunk-05x1rd86.js → chunk-de61k0ab.js} +2 -2
- package/dist/chunk-dj8fyaea.js +2 -0
- package/dist/chunk-dmc91qke.js +2 -0
- package/dist/{chunk-gdyjd163.js → chunk-e0bwzxfd.js} +6 -6
- package/dist/{chunk-2hpkr84c.js → chunk-e4xd1ca7.js} +1 -1
- package/dist/{chunk-j1npj5xc.js → chunk-e5q1ammf.js} +3 -3
- package/dist/{chunk-xvncq3m5.js → chunk-eb5cma4b.js} +2 -2
- package/dist/{chunk-3bsz7zj3.js → chunk-eb5v9npc.js} +2 -2
- package/dist/{chunk-aj5tsksz.js → chunk-edpsk4bg.js} +5 -5
- package/dist/{chunk-xqb0rzk1.js → chunk-eka2e4cm.js} +4 -4
- package/dist/{chunk-pnmafbv5.js → chunk-ern5hyvr.js} +1 -1
- package/dist/{chunk-41z7f41b.js → chunk-esm0pnpz.js} +2 -2
- package/dist/chunk-fe1wmmr5.js +2 -0
- package/dist/{chunk-r5ecgcx2.js → chunk-ffytbb4x.js} +5 -5
- package/dist/{chunk-vf4ejngv.js → chunk-fksmr50h.js} +6 -6
- package/dist/{chunk-dt80hbq8.js → chunk-fsxk5fsh.js} +8 -8
- package/dist/{chunk-2bnsxgfe.js → chunk-ft9h5qbs.js} +4 -4
- package/dist/chunk-fznzn35q.js +2 -0
- package/dist/{chunk-6xaeq730.js → chunk-g065d7p7.js} +2 -2
- package/dist/{chunk-rf0smj4c.js → chunk-g32hc78c.js} +2 -2
- package/dist/{chunk-nq60tjkz.js → chunk-gnf1e5q7.js} +2 -2
- package/dist/{chunk-x89k2af8.js → chunk-gq3gttt5.js} +21 -21
- package/dist/chunk-h2gnz7ja.js +2 -0
- package/dist/chunk-hc8ks7y3.js +2 -0
- package/dist/{chunk-cphc60zw.js → chunk-hdfhaddy.js} +2 -2
- package/dist/{chunk-t0ttxayz.js → chunk-hnjeqxqy.js} +2 -2
- package/dist/chunk-hpqvq1r9.js +2 -0
- package/dist/chunk-hs2a040z.js +2 -0
- package/dist/{chunk-9d578fvc.js → chunk-javb4e3b.js} +5 -5
- package/dist/chunk-jq49238b.js +2 -0
- package/dist/chunk-jr3fmkq7.js +2 -0
- package/dist/chunk-k2fw6paw.js +2 -0
- package/dist/chunk-k352spys.js +2 -0
- package/dist/{chunk-1knk403z.js → chunk-k3566kgd.js} +2 -2
- package/dist/{chunk-cmg9x1ka.js → chunk-k3ytyhkr.js} +3 -3
- package/dist/chunk-k79dvx67.js +2 -0
- package/dist/chunk-km1k3c4e.js +2 -0
- package/dist/chunk-kvjbpbmw.js +2 -0
- package/dist/chunk-mhv84p0x.js +2 -0
- package/dist/{chunk-vx1s055y.js → chunk-mjqsz20a.js} +2 -2
- package/dist/chunk-mmtyp5z4.js +2 -0
- package/dist/{chunk-8hwfdwgn.js → chunk-mry67rsk.js} +6 -6
- package/dist/{chunk-ksmn19qw.js → chunk-n3fgrsva.js} +2 -2
- package/dist/{chunk-bzpxjvcq.js → chunk-n8xjqsze.js} +3 -3
- package/dist/{chunk-p3hbsrk9.js → chunk-nc5d3a5r.js} +5 -5
- package/dist/chunk-p4hm5srd.js +2 -0
- package/dist/{chunk-0jkj8thz.js → chunk-p89rpak1.js} +1 -1
- package/dist/{chunk-hxws025y.js → chunk-p92272k0.js} +2 -2
- package/dist/{chunk-at8dv8dn.js → chunk-pd31ge72.js} +6 -6
- package/dist/chunk-pjpy86c3.js +3 -0
- package/dist/chunk-psyqrxg0.js +2 -0
- package/dist/chunk-q4yq72wh.js +2 -0
- package/dist/{chunk-s557tht3.js → chunk-q6p96qq7.js} +7 -7
- package/dist/{chunk-115bb91s.js → chunk-qs0zk04y.js} +2 -2
- package/dist/{chunk-ta07gj66.js → chunk-qt2mr3f0.js} +31 -16
- package/dist/{chunk-a0aqs5a8.js → chunk-qykbjg3z.js} +2 -2
- package/dist/chunk-qzx6h6af.js +2 -0
- package/dist/{chunk-g5nfqzfh.js → chunk-r0az4z6d.js} +2 -2
- package/dist/{chunk-txegy370.js → chunk-r9n86na1.js} +41 -41
- package/dist/{chunk-bgggjcwt.js → chunk-rapr0m13.js} +3 -3
- package/dist/{chunk-gm48z1nk.js → chunk-rrpfn9rr.js} +1 -1
- package/dist/chunk-ryp47rwp.js +2 -0
- package/dist/{chunk-3qk8vf9m.js → chunk-t14bn66j.js} +3 -3
- package/dist/chunk-t9j000tb.js +2 -0
- package/dist/{chunk-yfqrwazc.js → chunk-tga3nrn6.js} +5 -5
- package/dist/chunk-tgwwa872.js +2 -0
- package/dist/chunk-v0r6zb87.js +2 -0
- package/dist/{chunk-18dv485d.js → chunk-v5v6w6rn.js} +2 -2
- package/dist/{chunk-9rjgq8k4.js → chunk-vbmvft7g.js} +1 -1
- package/dist/{chunk-kk2p2tgv.js → chunk-vfctk20v.js} +3 -3
- package/dist/{chunk-8jb5fsnf.js → chunk-vgvxs1ag.js} +2 -2
- package/dist/{chunk-rb2zbdqd.js → chunk-vw7crz0z.js} +4 -4
- package/dist/chunk-vxtna1b1.js +2 -0
- package/dist/chunk-x43x2c6v.js +2 -0
- package/dist/chunk-xqx8t9w5.js +2 -0
- package/dist/{chunk-sh7a0g09.js → chunk-xr1s56k5.js} +3 -3
- package/dist/chunk-y10eaxgc.js +2 -0
- package/dist/chunk-ytk4f2j9.js +2 -0
- package/dist/chunk-z33r3pzy.js +2 -0
- package/dist/chunk-zcys6b06.js +2 -0
- package/dist/chunk-zkr42285.js +2 -0
- package/dist/chunk-zpwh9bpc.js +2 -0
- package/dist/chunk-zrs22j09.js +2 -0
- package/dist/chunk-zw6tgr0s.js +2 -0
- package/dist/cli.js +19 -19
- package/dist/client/signals-scope-disposal-runtime.js +18 -3
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dynamic-components.js +47 -25
- package/dist/offline/app-service-worker.js +2 -2
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +4 -4
- package/package.json +5 -5
- package/dist/chunk-02qhay07.js +0 -2
- package/dist/chunk-04x7mp45.js +0 -2
- package/dist/chunk-0k437z3q.js +0 -2
- package/dist/chunk-1a7a8cjs.js +0 -2
- package/dist/chunk-1p4q6t48.js +0 -2
- package/dist/chunk-1z6pqvmf.js +0 -2
- package/dist/chunk-2nqmw4dv.js +0 -2
- package/dist/chunk-35j7gaj5.js +0 -2
- package/dist/chunk-4akw3bym.js +0 -2
- package/dist/chunk-4azhfxrm.js +0 -2
- package/dist/chunk-4d85str1.js +0 -2
- package/dist/chunk-4s2x5p6r.js +0 -2
- package/dist/chunk-53kcqdjj.js +0 -2
- package/dist/chunk-5eq2e6p3.js +0 -2
- package/dist/chunk-5y4q7k3j.js +0 -2
- package/dist/chunk-690518hw.js +0 -2
- package/dist/chunk-732gb689.js +0 -2
- package/dist/chunk-7wj6yx6f.js +0 -2
- package/dist/chunk-80xzjxah.js +0 -2
- package/dist/chunk-87tmvvvp.js +0 -2
- package/dist/chunk-9afkttvz.js +0 -2
- package/dist/chunk-a27xsdp6.js +0 -2
- package/dist/chunk-ah8az9vv.js +0 -2
- package/dist/chunk-arr79m90.js +0 -2
- package/dist/chunk-at843zxh.js +0 -2
- package/dist/chunk-awb046ct.js +0 -2
- package/dist/chunk-b5njp1ef.js +0 -2
- package/dist/chunk-cjxfc5j5.js +0 -2
- package/dist/chunk-cp5x6kx1.js +0 -2
- package/dist/chunk-d2whsv81.js +0 -2
- package/dist/chunk-dr6fqa3x.js +0 -2
- package/dist/chunk-e28czxw3.js +0 -2
- package/dist/chunk-e8szp5wa.js +0 -2
- package/dist/chunk-essd43ad.js +0 -2
- package/dist/chunk-f60k8j9m.js +0 -2
- package/dist/chunk-ffkhg23t.js +0 -2
- package/dist/chunk-fsk3rk2x.js +0 -2
- package/dist/chunk-gz7egees.js +0 -2
- package/dist/chunk-hk241gt2.js +0 -2
- package/dist/chunk-j9kejcrx.js +0 -2
- package/dist/chunk-jc3zrmpz.js +0 -2
- package/dist/chunk-jhbz5w30.js +0 -2
- package/dist/chunk-jk6yg125.js +0 -2
- package/dist/chunk-k4x680e3.js +0 -2
- package/dist/chunk-kfdmm240.js +0 -2
- package/dist/chunk-n5ypn9nh.js +0 -2
- package/dist/chunk-pyqacq37.js +0 -2
- package/dist/chunk-rc12m1j7.js +0 -2
- package/dist/chunk-ry7nh392.js +0 -2
- package/dist/chunk-sccjcyb9.js +0 -2
- package/dist/chunk-sezkn93y.js +0 -2
- package/dist/chunk-snkbn5y8.js +0 -2
- package/dist/chunk-sw0gme6q.js +0 -2
- package/dist/chunk-tbh7r1wh.js +0 -2
- package/dist/chunk-v3jyb8k6.js +0 -2
- package/dist/chunk-w6r18he3.js +0 -2
- package/dist/chunk-wg2n94gf.js +0 -3
- package/dist/chunk-wkk0gska.js +0 -2
- package/dist/chunk-x6565mhk.js +0 -2
- package/dist/chunk-xfjezd96.js +0 -2
- package/dist/chunk-xwgdcc7w.js +0 -2
- package/dist/chunk-z4tdnfxd.js +0 -2
- package/dist/chunk-zn5dcfhc.js +0 -2
- package/dist/chunk-zxjdfgdx.js +0 -3
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ie,ht,qt,
|
|
2
|
+
import{Ie,ht,qt,to,no,_e,Ii,Tn,il,al,Oi,cl,ll,so,Mi,Di,ul,Li}from"./chunk-9m45t60c.js";import{C}from"./chunk-hdfhaddy.js";import{a}from"./chunk-40fpt0r6.js";import{zo}from"./chunk-e5q1ammf.js";import{l}from"./chunk-pjpy86c3.js";import{existsSync as G,readFileSync as U}from"fs";import h from"path";var we=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),oe=ht.filter((e)=>!we.has(e)).sort(),ce=[...C].sort(),ke=[...new Set([...oe,...ce])].sort(),ve=new Set(oe),$e=new Set(ce),De=new Set(ke),re=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Te(e,t){if(t==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function ae(e,t){let o=[];for(let d of t){if(d.offset===void 0)continue;let i=d.kind==="server"?ve:$e;re.lastIndex=0;for(let c of d.code.matchAll(re)){let m=c.index+c[0].indexOf("{")+1;for(let f of c[1].matchAll(/[^,]+/g)){let k=f[0];if(/^\s*type\s/.test(k))continue;let S=/^\s*([A-Za-z_$][\w$]*)/.exec(k);if(!S)continue;let s=S[1];if(!De.has(s)||i.has(s))continue;let u=d.offset+m+f.index+S[0].length-s.length,g=e.slice(0,u),v=g.split(`
|
|
3
3
|
`).length;o.push({line:v,column:u-(g.lastIndexOf(`
|
|
4
|
-
`)+1)+1,offset:u,length:s.length,name:s,kind:d.kind,message:Te(s,d.kind)})}}}return o}import M from"path";var Ce="@stacksjs/stx-typescript-plugin";function Ee(e,t){let o=M.resolve(e);for(;;){let d=M.join(o,"tsconfig.json");if(t(d))return d;let i=M.dirname(o);if(i===o)return;o=i}}function le(e,t,o){let d=Ee(e,o);if(!d)return;let i=new Set,c=(m)=>{if(i.has(m))return;i.add(m);let f=t(m);if(!f)return;let k=f.compilerOptions?.plugins;if(Array.isArray(k)){let s=k.find((g)=>g?.name===Ce),u=Array.isArray(s?.libs)?s.libs.filter((g)=>typeof g==="string"):[];return s?{configPath:m,libs:u.map((g)=>M.resolve(M.dirname(m),g))}:null}let S=typeof f.extends==="string"?[f.extends]:Array.isArray(f.extends)?f.extends:[];for(let s of[...S].reverse()){if(typeof s!=="string"||!s.startsWith("."))continue;let u=M.resolve(M.dirname(m),s.endsWith(".json")?s:`${s}.json`),g=c(u);if(g!==void 0)return g}return};return c(d)??void 0}function
|
|
5
|
-
`.repeat(e.startLine-1):"",m=
|
|
4
|
+
`)+1)+1,offset:u,length:s.length,name:s,kind:d.kind,message:Te(s,d.kind)})}}}return o}import M from"path";var Ce="@stacksjs/stx-typescript-plugin";function Ee(e,t){let o=M.resolve(e);for(;;){let d=M.join(o,"tsconfig.json");if(t(d))return d;let i=M.dirname(o);if(i===o)return;o=i}}function le(e,t,o){let d=Ee(e,o);if(!d)return;let i=new Set,c=(m)=>{if(i.has(m))return;i.add(m);let f=t(m);if(!f)return;let k=f.compilerOptions?.plugins;if(Array.isArray(k)){let s=k.find((g)=>g?.name===Ce),u=Array.isArray(s?.libs)?s.libs.filter((g)=>typeof g==="string"):[];return s?{configPath:m,libs:u.map((g)=>M.resolve(M.dirname(m),g))}:null}let S=typeof f.extends==="string"?[f.extends]:Array.isArray(f.extends)?f.extends:[];for(let s of[...S].reverse()){if(typeof s!=="string"||!s.startsWith("."))continue;let u=M.resolve(M.dirname(m),s.endsWith(".json")?s:`${s}.json`),g=c(u);if(g!==void 0)return g}return};return c(d)??void 0}function Ia(e,t="",o="",d=t,i){let c=e.startLine>1?`
|
|
5
|
+
`.repeat(e.startLine-1):"",m=Ii(Mi(e)+e.code,d),f=e.kind==="client"&&i?i.project(m.code):void 0,k=Tn(f?.code??m.code),S=e.kind==="client"||e.kind==="plain"?cl(t,e.code):"",s=(c+k).split(`
|
|
6
6
|
`),u=s.length,g=new Map;for(let y of m.declarations)for(let[w,D]of y.text.split(`
|
|
7
7
|
`).entries())if(s.push(D),y.origin)g.set(s.length,{...y.origin,line:e.startLine+y.origin.line-1+w,column:w===0?y.origin.column:1});s.push(...S.split(`
|
|
8
8
|
`),...(i?.declarations??"").split(`
|
|
9
|
-
`),...(e.kind==="server"?
|
|
9
|
+
`),...(e.kind==="server"?to(e.code):"").split(`
|
|
10
10
|
`));let v=e.kind==="server"?qt(e.code):void 0;if(v?.unsupported){let y=e.code.slice(0,v.offset),w=e.startLine+y.split(`
|
|
11
11
|
`).length-1,D=v.offset-e.code.lastIndexOf(`
|
|
12
|
-
`,v.offset-1)+(w===e.startLine?(e.startColumn??1)-1:0);s.push(`;({})[${JSON.stringify(v.unsupported)}];`),g.set(s.length,{line:w,column:D,anchor:!0})}s.push("export {}","");let R=
|
|
13
|
-
`),o);return{text:R.code,sourceLineCount:u,lineMap:g,scriptColumns:new Map([...m.columns].map(([y,w])=>[y+e.startLine-1,w])),importColumns:R.columns,componentColumns:f?new Map([...f.columns].map(([y,w])=>[y+e.startLine-1,w])):void 0}}function
|
|
14
|
-
`)}function
|
|
12
|
+
`,v.offset-1)+(w===e.startLine?(e.startColumn??1)-1:0);s.push(`;({})[${JSON.stringify(v.unsupported)}];`),g.set(s.length,{line:w,column:D,anchor:!0})}s.push("export {}","");let R=so(s.join(`
|
|
13
|
+
`),o);return{text:R.code,sourceLineCount:u,lineMap:g,scriptColumns:new Map([...m.columns].map(([y,w])=>[y+e.startLine-1,w])),importColumns:R.columns,componentColumns:f?new Map([...f.columns].map(([y,w])=>[y+e.startLine-1,w])):void 0}}function Am(e,t="",o=""){return Ia(e,t,o).text}var Oe=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function Ne(e){if(e.length===0)return"";let t=["// Generated \u2014 the composables the runtime publishes as bare globals."],o=new Set(C),d=[];for(let{file:i,names:c}of e){let m=JSON.stringify(i.replace(/\\/g,"/").replace(/\.ts$/,""));d.push(` export * from ${m}`);for(let f of c){if(o.has(f)||Oe.has(f))continue;o.add(f),t.push(`declare const ${f}: typeof import(${m})[${JSON.stringify(f)}]`)}}return t.push("declare module '@composables' {",...d,"}"),t.join(`
|
|
14
|
+
`)}function Do(e,t,o){return`${e}.__stx_${t}${o}.ts`}function Pm(e){return e.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function fu(){return ue("stx.d.ts")}function gu(){return ue("stx-module.d.ts")}function ue(e){for(let t of[h.resolve(import.meta.dir,"..",e),h.resolve(import.meta.dir,"..","..",e)])if(G(t))return t;return null}var Me=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function pe(e){return e>=1000&&e<2000}function de(e){let t="",o=!1,d=!1;for(let i=0;i<e.length;i++){let c=e[i];if(o){if(t+=c,d)d=!1;else if(c==="\\")d=!0;else if(c==='"')o=!1;continue}if(c==='"'){o=!0,t+=c;continue}if(c==="/"&&e[i+1]==="/"){while(i<e.length&&e[i]!==`
|
|
15
15
|
`)i++;t+=`
|
|
16
|
-
`;continue}if(c==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&!(e[i]==="*"&&e[i+1]==="/"))i++;i++;continue}t+=c}return t.replace(/,(\s*[}\]])/g,"$1")}function Re(e){try{return JSON.parse(de(U(e,"utf8")))}catch{return}}function je(e){let t=h.resolve(e),o;for(;;){let s=h.join(t,"tsconfig.json");if(G(s)){o=s;break}let u=h.dirname(t);if(u===t)break;t=u}if(!o)return{};let d=new Set,i=o,c,m,f=o;while(i&&!d.has(i)){d.add(i);let s;try{s=JSON.parse(de(U(i,"utf8")))}catch{break}let u=s?.compilerOptions??{};if(!c&&u.paths&&typeof u.paths==="object")c=u.paths,f=i;if(!m&&typeof u.baseUrl==="string")m=h.resolve(h.dirname(i),u.baseUrl);if(c&&m)break;i=typeof s?.extends==="string"?h.resolve(h.dirname(i),s.extends.endsWith(".json")?s.extends:`${s.extends}.json`):void 0}if(!c)return{};let k=m??h.dirname(f),S={};for(let[s,u]of Object.entries(c)){if(!Array.isArray(u))continue;S[s]=u.map((g)=>typeof g==="string"&&!h.isAbsolute(g)?h.resolve(k,g):g)}return{paths:S}}async function
|
|
17
|
-
`))),u=new Map,g=new Map,v=[],R=[],y=0,w=0,D=
|
|
18
|
-
`),B=
|
|
19
|
-
`),Ne(await
|
|
16
|
+
`;continue}if(c==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&!(e[i]==="*"&&e[i+1]==="/"))i++;i++;continue}t+=c}return t.replace(/,(\s*[}\]])/g,"$1")}function Re(e){try{return JSON.parse(de(U(e,"utf8")))}catch{return}}function je(e){let t=h.resolve(e),o;for(;;){let s=h.join(t,"tsconfig.json");if(G(s)){o=s;break}let u=h.dirname(t);if(u===t)break;t=u}if(!o)return{};let d=new Set,i=o,c,m,f=o;while(i&&!d.has(i)){d.add(i);let s;try{s=JSON.parse(de(U(i,"utf8")))}catch{break}let u=s?.compilerOptions??{};if(!c&&u.paths&&typeof u.paths==="object")c=u.paths,f=i;if(!m&&typeof u.baseUrl==="string")m=h.resolve(h.dirname(i),u.baseUrl);if(c&&m)break;i=typeof s?.extends==="string"?h.resolve(h.dirname(i),s.extends.endsWith(".json")?s.extends:`${s.extends}.json`):void 0}if(!c)return{};let k=m??h.dirname(f),S={};for(let[s,u]of Object.entries(c)){if(!Array.isArray(u))continue;S[s]=u.map((g)=>typeof g==="string"&&!h.isAbsolute(g)?h.resolve(k,g):g)}return{paths:S}}async function Im(e,t={}){let o=t.client!==!1,d=t.server!==!1,i=t.templates!==!1,c=i?await a():void 0,m=t.componentsDir??c?.componentsDir,f=t.partialsDir??c?.partialsDir,k=t.layoutsDir??c?.layoutsDir,S=new Map(await Promise.all(e.map(async(n)=>[n,await Bun.file(n).text()]))),s=[...S.values()].some((n)=>qt(_e(n).filter((r)=>r.kind==="server").map((r)=>r.code).join(`
|
|
17
|
+
`))),u=new Map,g=new Map,v=[],R=[],y=0,w=0,D=fu();for(let n of e){let r=S.get(n),x=_e(r).filter((p)=>{if(p.kind==="server")return d;return o}),O=_e(r).filter((p)=>p.kind==="server").map((p)=>p.code).join(`
|
|
18
|
+
`),B=Oi(_e(r)),_=no(r);for(let p of ae(r,x))v.push({file:n,line:p.line,column:p.column,code:0,message:p.message,category:"error",blockKind:p.kind});if(o&&O){let p=x.filter((E)=>E.kind!=="server"),b=[...new Set(p.flatMap((E)=>ll(O,E.code)))];if(b.length>0)g.set(n,{names:b,line:p[0].startLine,kind:p[0].kind})}let I=h.dirname(h.resolve(n)),T=i?Di(r,{runtimeGlobals:!D,originDir:I,filePath:h.resolve(n),componentsDir:m,partialsDir:f,layoutsDir:k,inheritedContractsKnown:s}):null,A=T?[...T.lineMap.values()].filter((p)=>p.expression).length:0;if(x.length===0&&A===0&&!_?.checks.length)continue;if(R.push(n),y+=x.length,w+=A,_&&o&&(x.some((p)=>p.kind!=="server")||!i&&_.checks.length)){let p=Di(r,{runtimeGlobals:!1,globals:!1,originDir:I,templateExpressions:!1,scriptKinds:["client","plain"],nativeChecks:!i});u.set(Do(n,"client",0),{virtual:p,source:p.text,origin:n,kind:"client"})}if(x.forEach((p,b)=>{if(_&&p.kind!=="server")return;let E=Ia(p,O,I,B);u.set(Do(n,p.kind,b),{virtual:E,source:E.text,origin:n,kind:p.kind})}),T&&(A>0||_?.checks.length))u.set(Do(n,"template",0),{source:T.text,origin:n,kind:"template",virtual:T})}if(u.size===0)return{diagnostics:v,checkedFiles:R,blockCount:0,expressionCount:0};let j=(t.extraLibs??[]).map((n)=>h.resolve(n)),fe=le(e.length>0?h.dirname(h.resolve(e[0])):process.cwd(),Re,G);for(let n of fe?.libs??[])if(!j.includes(n)&&G(n))j.push(n);if(D)j.push(D);let W=D?gu():null;if(W)j.push(W);let z=`${l()}/typecheck/__stx_globals.d.ts`,me=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",il(D?al(U(D,"utf8")):void 0),...D?[]:["declare const window: any",...C.map((n)=>`declare const ${n}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...Ie.map((n)=>`declare const ${n}: any`)].join(`
|
|
19
|
+
`),Ne(await zo())].filter(Boolean).join(`
|
|
20
20
|
`),L=`${l()}/typecheck`;await Bun.$`rm -rf ${L}`.quiet().nothrow(),await Bun.$`mkdir -p ${L}`.quiet().nothrow(),await Bun.write(z,me);let P=new Map,ge=0;for(let[n,r]of u){let x=`${ge++}_${n.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${L}/${x}`,r.source),P.set(x,r)}let he={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...je(e.length>0?h.dirname(h.resolve(e[0])):process.cwd()),...t.compilerOptions??{}},q=async(n,r)=>{let x=`${L}/tsconfig${r===1?"":`.${r}`}.json`;await Bun.write(x,JSON.stringify({compilerOptions:he,files:n.map((B)=>`${L}/${B}`).concat(z,...j)},null,2));let O=Bun.spawnSync(["bun","x","tsc","-p",x,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(O.stdout)+new TextDecoder().decode(O.stderr),exitCode:O.exitCode??0}},H=await q([...P.keys()],1),Z=H.output,K=[],Q=H.exitCode,Y=0,xe=new Set(j.map((n)=>n.split("/").pop())),ee=0,F=new Set,te=(n)=>{for(let r of n.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
|
|
21
|
-
`)){let x=r.match(Me);if(!x)continue;if(Y++,xe.has(x[1].split("/").pop()))ee++;let[,O,B,_,I,T,A]=x,p=O.split("/").pop(),b=P.get(p);if(!b)continue;if(pe(Number(T)))F.add(p);let E=Number(B),X=Number(_),se,J=b.kind;if(b.virtual){let N=
|
|
21
|
+
`)){let x=r.match(Me);if(!x)continue;if(Y++,xe.has(x[1].split("/").pop()))ee++;let[,O,B,_,I,T,A]=x,p=O.split("/").pop(),b=P.get(p);if(!b)continue;if(pe(Number(T)))F.add(p);let E=Number(B),X=Number(_),se,J=b.kind;if(b.virtual){let N=Li(b.virtual,E,X)??(b.kind!=="template"&&pe(Number(T))?Li(b.virtual,b.virtual.sourceLineCount,1):null);if(!N||b.kind==="template"&&!N.expression&&!N.diagnosticOrigin)continue;if(ul(N,Number(T)))continue;E=N.line,X=N.column,se=N.expression?.code.trim(),J=N.diagnosticOrigin??J}K.push({file:b.origin,line:E,column:X,code:Number(T),message:A,category:I==="error"?"error":"warning",blockKind:J,expression:se})}};te(Z);let ye=Y,be=ee;if(F.size>0&&F.size<P.size){let n=[...P.keys()].filter((r)=>!F.has(r));te((await q(n,2)).output)}if(o)for(let[n,r]of g){if(r.names.length===0)continue;K.push({file:n,line:r.line,column:1,code:0,message:`${r.names.length===1?"1 value reaches":`${r.names.length} values reach`} this block on the implicit bridge and ${r.names.length===1?"is":"are"} untyped: ${r.names.join(", ")}. Declare them with defineClientPayload({ ${r.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:r.kind})}K.push(...v);let ne=new Set,V=K.filter((n)=>{let r=`${n.file}:${n.line}:${n.column}:${n.code}:${n.message}`;if(ne.has(r))return!1;return ne.add(r),!0});V.sort((n,r)=>n.file.localeCompare(r.file)||n.line-r.line||n.column-r.column);let ie=be>0&&V.length===0,Se=ie||Q!==0&&ye===0?`${ie?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${Q} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
|
|
22
22
|
${Z.trim().split(`
|
|
23
23
|
`).slice(0,12).join(`
|
|
24
|
-
`)||"(no output)"}`:void 0;return{diagnostics:V,checkedFiles:R,blockCount:y,expressionCount:w,failure:Se}}function
|
|
24
|
+
`)||"(no output)"}`:void 0;return{diagnostics:V,checkedFiles:R,blockCount:y,expressionCount:w,failure:Se}}function Om(e){return e.map((t)=>{let o=t.blockKind==="template"?`[template: ${t.expression??""}]`:`[${t.blockKind==="plain"?"<script>":`<script ${t.blockKind}>`}]`;return`${t.file}:${t.line}:${t.column} ${t.category} TS${t.code} ${t.message} ${o}`}).join(`
|
|
25
25
|
`)}
|
|
26
|
-
export{
|
|
26
|
+
export{Ia,Am,Do,Pm,fu,gu,Im,Om};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{I}from"./chunk-
|
|
2
|
+
import{I}from"./chunk-qykbjg3z.js";import{nt,Vn}from"./chunk-xr1s56k5.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
|
|
3
3
|
maxEntries: ${o},
|
|
4
4
|
${u?`maxAgeSeconds: ${u},`:""}
|
|
5
5
|
purgeOnQuotaError: true,
|
|
@@ -17,7 +17,7 @@ registerRoute(
|
|
|
17
17
|
],`:""}
|
|
18
18
|
})
|
|
19
19
|
);`)}return c.join(`
|
|
20
|
-
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?nt(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?nt(t,e):null,l=s?
|
|
20
|
+
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?nt(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?nt(t,e):null,l=s?Vn(s):"[]",o=k(n.modules),u=d(e);return`/**
|
|
21
21
|
* Service Worker - Generated by stx with Workbox
|
|
22
22
|
* Cache Version: ${n.cacheVersion}
|
|
23
23
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import t from"fs";import r from"path";var fn="resources/assets",
|
|
3
|
-
export{fn,
|
|
2
|
+
import t from"fs";import r from"path";var fn="resources/assets",fr="assets";function gr(o=process.cwd()){let s=r.resolve(o,fn);return t.existsSync(s)&&t.statSync(s).isDirectory()?s:null}
|
|
3
|
+
export{fn,fr,gr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ay,ug,ct,Oc,cy,Cs,Es,Ts}from"./chunk-q6p96qq7.js";import"./chunk-eka2e4cm.js";import"./chunk-9vafweyd.js";import"./chunk-5jrpzepc.js";import"./chunk-vbmvft7g.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{cy as clearOnceStore,Oc as onceStore,ct as partialsCache,Cs as processIncludes,Es as processStackPushDirectives,Ts as processStackReplacements,ay as resetUnscopedSignalWarnings,ug as topLevelElements};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`),f=`${r}\x00${JSON.stringify(n)}`,o=g.get(f);if(o&&o.signature===d)return o.standIns;let a=new Map;for(let[e,t]of l){let c=s.relative(r,e);if(!m(e))throw Error(`webModules: ${c} does not exist`);if(!m(t))throw Error(`webModules: ${s.relative(r,t)}, the stand-in for ${c}, does not exist`);if(e===t)throw Error(`webModules: ${c} stands in for itself`);let p=await Bun.file(t).text(),u=new Bun.Transpiler({loader:M(t),target:"browser"});if(s.dirname(t)!==s.dirname(e)){let i=u.scanImports(p).find((h)=>/^\.\.?\//.test(h.path));if(i)throw Error(`webModules: ${s.relative(r,t)} imports ${i.path}, which would resolve from ${s.relative(r,s.dirname(e))||"."}; a stand-in imports relatively only from the directory of the module it replaces`)}let w=u.transformSync(p);for(let i of
|
|
2
|
+
import{rs}from"./chunk-0gc1hez6.js";import{existsSync as m,statSync as x}from"fs";import s from"path";var g=new Map;function M(r){let n=s.extname(r);if(n===".tsx")return"tsx";if(n===".jsx")return"jsx";if(n===".ts"||n===".mts"||n===".cts")return"ts";return"js"}async function j(r,n){let l=Object.entries(n).map(([e,t])=>[s.resolve(r,e),s.resolve(r,t)]),d=l.map(([e,t])=>{try{return`${e}\x00${t}\x00${x(t).mtimeMs}`}catch{return`${e}\x00${t}\x00-`}}).join(`
|
|
3
|
+
`),f=`${r}\x00${JSON.stringify(n)}`,o=g.get(f);if(o&&o.signature===d)return o.standIns;let a=new Map;for(let[e,t]of l){let c=s.relative(r,e);if(!m(e))throw Error(`webModules: ${c} does not exist`);if(!m(t))throw Error(`webModules: ${s.relative(r,t)}, the stand-in for ${c}, does not exist`);if(e===t)throw Error(`webModules: ${c} stands in for itself`);let p=await Bun.file(t).text(),u=new Bun.Transpiler({loader:M(t),target:"browser"});if(s.dirname(t)!==s.dirname(e)){let i=u.scanImports(p).find((h)=>/^\.\.?\//.test(h.path));if(i)throw Error(`webModules: ${s.relative(r,t)} imports ${i.path}, which would resolve from ${s.relative(r,s.dirname(e))||"."}; a stand-in imports relatively only from the directory of the module it replaces`)}let w=u.transformSync(p);for(let i of rs(e))a.set(i,w)}return g.set(f,{signature:d,standIns:a}),a}export{j as loadWebModules};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Z}from"./chunk-
|
|
3
|
-
`)}async function
|
|
2
|
+
import{Z}from"./chunk-65g78sge.js";import R from"path";var B=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function ts(...d){let g=new Set;for(let l of d){if(!l||!l.includes("__stxModules["))continue;for(let e of l.matchAll(B))try{g.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...g].sort()}function Eo(...d){let g=new Map,l=(e,n)=>{let o=g.get(e);if(o===null)return;if(n===null){g.set(e,null);return}let s=o??new Set;for(let i of n)s.add(i);g.set(e,s)};for(let e of d){if(!e||!e.includes("__stxModules["))continue;let n=[];for(let s of e.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${s[2]}"`)}catch{continue}n.push({variable:s[1],id:i,start:s.index+s[0].length,end:e.length})}let o=e.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(n.length===0||o!==n.length){for(let s of ts(e))l(s,null);continue}for(let[s,i]of n.entries()){let p=n.slice(s+1).find((h)=>h.variable===i.variable);i.end=p?p.start:e.length}for(let s of n){let i=new Set,p=!1,h=s.variable.replace(/[$]/g,"\\$&"),r=e.slice(s.start,s.end);for(let a of r.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=r.slice(a.index+s.variable.length,a.index+s.variable.length+200),c=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(c){i.add(c[c.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}l(s.id,p?null:i)}}return g}function k(d,g,l){let e=[],n=[];return d.forEach((o,s)=>{let i=o.startsWith("npm:")?o.slice(4):R.resolve(g,o),p=`__stxRegistered${s}`,h=JSON.stringify(o),r=l?.get(o);if(r&&[...r].every((a)=>/^[A-Za-z_$][\w$]*$/.test(a))){let a=[...r].sort(),f=a.map((m,_)=>`${m} as ${p}_${_}`);e.push(a.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let c=a.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");n.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${c} };`);return}e.push(`import * as ${p} from ${JSON.stringify(i)};`),n.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...n].join(`
|
|
3
|
+
`)}async function ym(d,g={}){if(d.length===0)return null;let l=process.cwd(),e=k(d,l,g.names),n;try{let{bundleClientScript:f}=await import("./chunk-2vqamyay.js"),c=()=>f(e,R.join(l,".stx-module-registry.ts"),{projectRoot:l,minify:g.minify,externalizeUserModules:!1,collectInputs:g.collectInputs,throwOnFailure:!0});try{n=await c()}catch(m){if(!g.names)throw m;e=k(d,l,void 0),n=await c()}}catch(f){let{formatBuildFailure:c}=await import("./chunk-5astk182.js"),m=c(f);console.warn(`[stx] could not build the page module registry (#1957): ${m}`);let _=`[stx] the page module registry did not build, so ${d.join(", ")} cannot load (#1957): ${m}`;return`;console.error(${JSON.stringify(_)});`}let{transformAutoImports:o,generateAutoImportDestructuring:s}=await import("./chunk-q4yq72wh.js"),i=o(n),p=s(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-0ht6exrv.js");n=h(i.code);let r=JSON.stringify(new Bun.CryptoHasher("md5").update(e).digest("hex").slice(0,12)),a=Z(n);return[a?";await (async function() {":";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${r}]) { ${a?"await __stxBundles["+r+"];":""} return; }`,a?`var __resolveBundle, __rejectBundle;
|
|
4
4
|
__stxBundles[${r}]=new Promise(function(resolve,reject){__resolveBundle=resolve;__rejectBundle=reject;});
|
|
5
5
|
__stxBundles[${r}].catch(function(){});
|
|
6
6
|
try {`:`__stxBundles[${r}] = true;`,p,n,a?`__resolveBundle();
|
|
7
7
|
} catch(error) { delete __stxBundles[${r}]; __rejectBundle(error); throw error; }`:"","})();"].join(`
|
|
8
8
|
`)}var j=/^import(?:[ \t]*(\{[^}]*\})[ \t]*from|[ \t]*\*[ \t]*as[ \t]+([\w$]+)[ \t]+from)?[ \t]*["']\.\/(chunk-[\w-]+)\.js["'][ \t]*;?[ \t]*$/gm,O=/^export\s*\{([^}]*)\}\s*;?[ \t]*$/gm,I=new Set(["__preload","__chunks"]),N=/^("[^"]*"|[\w$]+)(?:\s+as\s+("[^"]*"|[\w$]+))?$/;function P(d){let g=[],l=[],e=!0,o=d.replace(/^var __chunkGraphs;[\s\S]*?^var __chunks = [\s\S]*?^\};[ \t]*\n?/m,"").replace(/^__chunks\(import\.meta\.url,[^\n]*\);[ \t]*\n?/gm,"").replace(j,(h,r,a,f)=>{let c=`__stxChunkExports${g.length}`;if(g.push(f),l.push(`var ${c} = __stxChunk(${JSON.stringify(f)});`),a)l.push(`var ${a} = ${c};`);else if(r)for(let m of r.slice(1,-1).split(",")){let _=m.trim();if(!_)continue;let w=N.exec(_);if(!w){e=!1;continue}if(I.has(w[1]))continue;let M=w[1].startsWith('"')?JSON.parse(w[1]):w[1],t=w[2]??w[1];if(t.startsWith('"')){e=!1;continue}l.push(`var ${t} = ${c}[${JSON.stringify(M)}];`)}return""});if(!e)throw Error("an import it does not read");let s=[];o=o.replace(/\(\s*__preload\([^)]*\)\s*,\s*import\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)\s*\)|\bimport\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)/g,(h,r,a)=>{let f=r??a;return s.push(f),`Promise.resolve().then(function () { return __stxChunk(${JSON.stringify(f)}); })`});let i=[];o=o.replace(O,(h,r)=>{for(let a of r.split(",")){let f=a.trim();if(!f)continue;let c=N.exec(f);if(!c||c[1].startsWith('"')){e=!1;continue}if(I.has(c[1]))continue;let m=c[2]??c[1];i.push([c[1],m.startsWith('"')?JSON.parse(m):m])}return""});let p=[/\bimport\.meta\b/,/\b__chunks\b/,/\b__preload\b/,/^\s*export\s+(?:default\b|const\b|let\b|var\b|function\b|class\b|async\b|\*|\{)/m,/\bfrom\s*["']\.\/chunk-/,/^\s*import\s*["']\.\/chunk-/m].find((h)=>h.test(o));if(!e||p)throw Error(`${p?`${p.source} is left in it`:"an export it does not read"}`);return{reads:l.join(`
|
|
9
|
-
`),chunks:g,lazy:s,body:o,exports:i}}function
|
|
10
|
-
`).length)>200)return!1;for(let g of d.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let l of g[1].split(",")){let e=l.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(e))continue;let n=e.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${n}(?![\\w$])`,"g").test(d))continue;let s=new RegExp(`(?<![\\w$.])${n}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${n}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${n}\\s*=`,"g");if((d.match(s)?.length??0)>(d.match(i)?.length??0))return!0}return!1}async function
|
|
9
|
+
`),chunks:g,lazy:s,body:o,exports:i}}function tu(d){if(/\bexport\s+(?:let|var)\b/.test(d))return!0;if(d.length/Math.max(1,d.split(`
|
|
10
|
+
`).length)>200)return!1;for(let g of d.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let l of g[1].split(",")){let e=l.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(e))continue;let n=e.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${n}(?![\\w$])`,"g").test(d))continue;let s=new RegExp(`(?<![\\w$.])${n}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${n}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${n}\\s*=`,"g");if((d.match(s)?.length??0)>(d.match(i)?.length??0))return!0}return!1}async function To(d,g={}){let l=d.filter((n)=>n.ids.length>0);if(l.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let e=process.cwd();try{let{bundleClientEntriesSplit:n}=await import("./chunk-2vqamyay.js"),o=[],s=await n(new Map(l.map((t)=>[t.name,k(t.ids,e,t.names)])),{projectRoot:e,filePath:R.join(e,".stx-module-registry.ts"),collectInputs:o});g.collectInputs?.push(...o);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-q4yq72wh.js"),{transformStoreImports:h}=await import("./chunk-0ht6exrv.js"),r=new Map;for(let[t,u]of[...s.chunks,...s.entries])try{r.set(t,P(u))}catch(x){throw Error(`cannot read ${t}: ${x instanceof Error?x.message:String(x)}`)}for(let[t,u]of[...s.chunks,...s.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of o)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&tu(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let a=new Set,f=new Set,c=(t)=>{if(f.has(t))return;if(a.has(t))throw Error(`the chunks import each other (${t})`);a.add(t);for(let u of r.get(t)?.chunks??[]){if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);c(u)}for(let u of r.get(t)?.lazy??[])if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);a.delete(t),f.add(t)};for(let t of r.keys())c(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of s.chunks.keys()){let u=r.get(t),{prelude:x,body:v}=m(u),b=u.exports.map(([S,y])=>`get ${JSON.stringify(y)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
|
|
11
11
|
${x}
|
|
12
12
|
${u.reads}
|
|
13
13
|
${v}
|
|
@@ -17,5 +17,5 @@ var __stxChunk = function (name) { return globalThis.__stxNativeRuntime.chunk(na
|
|
|
17
17
|
${x}
|
|
18
18
|
${u.reads}
|
|
19
19
|
${v}
|
|
20
|
-
})();`);let b=new Set,S=(y)=>{if(b.has(y))return;b.add(y);let E=r.get(y);for(let A of[...E.chunks,...E.lazy])S(A)};for(let y of[...u.chunks,...u.lazy])S(y);M.set(t,[...b].sort())}return{chunks:_,routes:w,reads:M}}catch(n){let{formatBuildFailure:o}=await import("./chunk-
|
|
21
|
-
export{
|
|
20
|
+
})();`);let b=new Set,S=(y)=>{if(b.has(y))return;b.add(y);let E=r.get(y);for(let A of[...E.chunks,...E.lazy])S(A)};for(let y of[...u.chunks,...u.lazy])S(y);M.set(t,[...b].sort())}return{chunks:_,routes:w,reads:M}}catch(n){let{formatBuildFailure:o}=await import("./chunk-5astk182.js");return console.warn(`[stx] could not share the native routes' modules, building each route's alone: ${o(n)}`),null}}
|
|
21
|
+
export{ts,Eo,ym,tu,To};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Se}from"./chunk-
|
|
3
|
-
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function
|
|
4
|
-
`)}`);let a=e.outputs.find((u)=>u.kind==="entry-point");if(!a)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await a.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(c,n),a),f.push({...t,filePath:n})}return f}function E(s,c){let o=s.map((i)=>({route:i,...Se(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,a=(r)=>r.replace(/:\w+/g,":param"),p=t.filter((r)=>a(r.route.pattern)===a(e)),n=i.method,u=p.find((r)=>r.route.method===n)??(n==="HEAD"?p.find((r)=>r.route.method==="GET"):void 0);if(!u){let r=new Set(p.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=u.regex.exec(f),g=Object.create(null);try{u.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await c(u.route);if(typeof r!=="function")throw Error(`API endpoint ${u.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function
|
|
5
|
-
`));let u=n.outputs.find((d)=>d.kind==="entry-point");if(!u||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${p.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await u.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function
|
|
6
|
-
export{vn,
|
|
2
|
+
import{Se}from"./chunk-0b57fgpn.js";import{Ze,z}from"./chunk-esm0pnpz.js";import{Gc}from"./chunk-vw7crz0z.js";import{l}from"./chunk-pjpy86c3.js";import v from"fs";import m from"path";import{pathToFileURL as I}from"url";var P=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],R=new Set;function vn(s,c={}){let o=m.resolve(s,c.dir??"server/api"),i=[],f=new Map;if(!v.existsSync(o))return i;let t=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:o})).sort();for(let e of t){if(e.endsWith(".d.ts"))continue;let p=e.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),n=p.pop(),u=n.lastIndexOf("."),d=u>=0?n.slice(u+1):"get",g=d.toUpperCase();if(!P.includes(g)||d!==d.toLowerCase())throw Error(`Unsupported API method suffix in ${e}; use ${P.map((A)=>A.toLowerCase()).join(", ")}`);if(u>=0)n=n.slice(0,u);if(n!=="index")p.push(n);let r=new Set,h=p.map((A,j)=>{let y=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(A);if(y){if(r.has(y[2])||y[1]&&j!==p.length-1)throw Error(`Invalid API parameter in ${e}`);return r.add(y[2]),`:${y[2]}${y[1]?"*":""}`}if(!/^[\w-]+$/.test(A))throw Error(`Unsupported API path segment ${A} in ${e}`);return A}),w=`/api${h.length?`/${h.join("/")}`:""}`,S=`${g} ${w.replace(/:\w+/g,":param")}`;if(f.has(S))throw Error(`Ambiguous API route ${g} ${w}: ${f.get(S)} and ${e}`);f.set(S,e);let x=m.join(o,e);R.add(m.resolve(x)),R.add(v.realpathSync(x)),i.push({pattern:w,method:g,filePath:x})}return i.sort((e,a)=>{let p=e.pattern.split("/"),n=a.pattern.split("/"),u=(d)=>d?.endsWith("*")?0:d?.startsWith(":")?1:2;for(let d=0;d<Math.max(p.length,n.length);d++){let g=u(n[d])-u(p[d]);if(g)return g}return e.pattern.localeCompare(a.pattern)||e.method.localeCompare(a.method)})}async function Zo(s,c){let o=l(s,"api-types.d.ts"),i=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let t of c){let e=`./${m.relative(m.dirname(o),t.filePath).replace(/\\/g,"/")}`,{params:a}=Se(t.pattern);i.push(` ${JSON.stringify(`${t.method} ${t.pattern}`)}: { params: { ${a.map((p)=>`${JSON.stringify(p)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(e)}).default>> }`)}i.push(" }","}","export {}","");let f=i.join(`
|
|
3
|
+
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function Qo(s,c,o={}){let i=vn(s,o);await Zo(s,i);let f=[];for(let t of i){let e=await Bun.build({entrypoints:[t.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!e.success)throw Error(`API build failed for ${t.filePath}: ${e.logs.join(`
|
|
4
|
+
`)}`);let a=e.outputs.find((u)=>u.kind==="entry-point");if(!a)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await a.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(c,n),a),f.push({...t,filePath:n})}return f}function E(s,c){let o=s.map((i)=>({route:i,...Se(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,a=(r)=>r.replace(/:\w+/g,":param"),p=t.filter((r)=>a(r.route.pattern)===a(e)),n=i.method,u=p.find((r)=>r.route.method===n)??(n==="HEAD"?p.find((r)=>r.route.method==="GET"):void 0);if(!u){let r=new Set(p.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=u.regex.exec(f),g=Object.create(null);try{u.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await c(u.route);if(typeof r!=="function")throw Error(`API endpoint ${u.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function ei(s,c){return E(c,async(o)=>(await import(I(m.resolve(s,o.filePath)).href)).default)}async function ry(s,c){if(!c)return async()=>null;let o=c===!0?{}:c,i=vn(s,o);return await Zo(s,i),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=vn(s,o);await Zo(s,t);let{loadStxConfig:e}=await import("./chunk-cgqpn3e2.js"),a=z((await e(s)).runtimeConfig);return await Ze(a,()=>E(t,async(p)=>{let n=await Bun.build({entrypoints:[p.filePath],target:"bun",format:"esm",splitting:!1});if(!n.success)throw Error(n.logs.join(`
|
|
5
|
+
`));let u=n.outputs.find((d)=>d.kind==="entry-point");if(!u||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${p.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await u.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function ti(s,c,o){if(Gc(s))return!0;let i=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(i.test(m.basename(s)))return!0;try{if(i.test(m.basename(v.realpathSync(s))))return!0}catch{}if(R.has(m.resolve(s)))return!0;if(!o)return!1;let f=m.resolve(c,typeof o==="object"?o.dir??"server/api":"server/api"),t=(a)=>{try{return v.realpathSync(a)}catch{return m.resolve(a)}},e=t(s);return[f,m.resolve(c,"server"),m.resolve(c,".output/server")].some((a)=>{let p=t(a);return e===p||e.startsWith(`${p}${m.sep}`)})}
|
|
6
|
+
export{vn,Zo,Qo,ei,ry,ti};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{As,pg,ci,fg}from"./chunk-8v2hsn4d.js";import"./chunk-5jrpzepc.js";import"./chunk-8rgy17fj.js";import"./chunk-e0bwzxfd.js";import"./chunk-vbmvft7g.js";import"./chunk-40fpt0r6.js";import"./chunk-rapr0m13.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import{Wt}from"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{fg as declareBareLoopHead,Wt as parseLoopBinding,pg as processLoops,ci as processLoopsAsync,As as reportDeferredLoopWarnings};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{nt,
|
|
2
|
+
import{nt,Vn,oa}from"./chunk-xr1s56k5.js";function So(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?nt(a,e):null,h=u?Vn(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
|
|
3
3
|
* Service Worker - Auto-generated by stx
|
|
4
4
|
* Cache Version: ${i}
|
|
5
5
|
*
|
|
@@ -13,7 +13,7 @@ import{nt,Hn,sa}from"./chunk-sh7a0g09.js";function xo(e,a){let t=e.pwa;if(!t?.en
|
|
|
13
13
|
* Additional features:
|
|
14
14
|
* - Push notifications: ${r?.enabled?"enabled":"disabled"}
|
|
15
15
|
* - Background sync: ${s?.enabled?"enabled":"disabled"}
|
|
16
|
-
* - Cache limits: ${n?.maxSize?`${
|
|
16
|
+
* - Cache limits: ${n?.maxSize?`${oa(n.maxSize*1024*1024)}`:"unlimited"}
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
const CACHE_VERSION = '${i}';
|
|
@@ -825,5 +825,5 @@ self.addEventListener('message', (event) => {
|
|
|
825
825
|
event.waitUntil(registerFormSync(event.data.payload));
|
|
826
826
|
}
|
|
827
827
|
});
|
|
828
|
-
`}function tn(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function
|
|
829
|
-
export{
|
|
828
|
+
`}function tn(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function Zl(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function sm(e,a){if(!e.pwa?.enabled)return"";if(Zl(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-9w7whtbx.js");return t(e,a)}return So(e,a)}
|
|
829
|
+
export{So,tn,Zl,sm};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{le,ue,de,
|
|
2
|
+
import{le,ue,de,Jn,Ee,Fe,$t,ln,Yn,Zn,Qn,pe,er,tr}from"./chunk-7pfhr4nk.js";import{Mt}from"./chunk-bvqgq18r.js";function ou(s,r={}){let{src:e,alt:t,width:n,height:a,sizes:i="100vw",loading:m="lazy",priority:o=!1,quality:u=de,placeholder:l="none",formats:f=ue,widths:y=le,decoding:c="async",fetchpriority:h,objectFit:d,objectPosition:g}=s,{class:p,style:v}=s,{processedImage:w,variants:I,optimize:b=!0,isDev:A=!1}=r;if(I&&I.length>0)return J(s,I,w);if(A||!b)return K(s);return Z(s)}function J(s,r,e){let{src:t,alt:n,width:a,height:i,sizes:m="100vw",loading:o="lazy",priority:u=!1,decoding:l="async",fetchpriority:f,objectFit:y,objectPosition:c,placeholder:h="none"}=s,{class:d,style:g}=s,p=Zn(r),v=Yn(r),w=typeof m==="object"?ln(m):m,I=e?e.aspectRatio:a&&i?Number(a)/Number(i):void 0,b=[];if(I)b.push(`aspect-ratio: ${I}`);if(y)b.push(`object-fit: ${y}`);if(c)b.push(`object-position: ${c}`);if(g)b.push(g);let A=b.length>0?` style="${b.join("; ")}"`:"",S=d?` class="${d}"`:"",F=u?"":` loading="${o}"`,R=` decoding="${l}"`,C=f?` fetchpriority="${f}"`:u?' fetchpriority="high"':"",E=["avif","webp","jpeg","png"],M=[];for(let k of E){let z=p.get(k);if(z&&z.length>0){let O=$t(z),Y=pe(k);M.push(` <source type="${Y}" srcset="${O}" sizes="${w}" />`)}}let U="",L="",T;if(h!=="none"&&e?.placeholder){let k=`img-${Math.random().toString(36).slice(2,8)}`;if(U=`<div class="stx-image-wrapper" id="${k}">`,L="</div>",h==="blur")T=`
|
|
3
3
|
#${k} {
|
|
4
4
|
position: relative;
|
|
5
5
|
background-image: url('${e.placeholder}');
|
|
@@ -30,7 +30,7 @@ ${M.join(`
|
|
|
30
30
|
data-quality="${o}"
|
|
31
31
|
data-formats="${u.join(",")}"
|
|
32
32
|
data-widths="${l.join(",")}"
|
|
33
|
-
`.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${B(e)}"${I}${b}${w}${v}${A}${S}${F} ${C} />`}}function
|
|
33
|
+
`.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${B(e)}"${I}${b}${w}${v}${A}${S}${F} ${C} />`}}function Ra(s){let r=s.match(/<Image\s+([^>]*?)\/?>/);if(!r)return null;let e=r[1],t={},n=/(\w+)(?:=(?:"([^"]*)"|'([^']*)'|(\{[^}]+\})))?/g,a;while((a=n.exec(e))!==null){let[,i,m,o,u]=a,l=m??o??u??!0;switch(i){case"src":t.src=String(l);break;case"alt":t.alt=String(l);break;case"width":t.width=Number(l)||l;break;case"height":t.height=Number(l)||l;break;case"sizes":t.sizes=String(l);break;case"loading":t.loading=l;break;case"priority":t.priority=l===!0||l==="true";break;case"quality":t.quality=Number(l);break;case"placeholder":t.placeholder=l;break;case"class":t.class=String(l);break;case"style":t.style=String(l);break;case"decoding":t.decoding=l;break;case"fetchpriority":t.fetchpriority=l;break;case"objectFit":t.objectFit=l;break;case"objectPosition":t.objectPosition=String(l);break}}if(!t.src||!t.alt)return null;return t}async function iu(s,r){let e=/<Image\s+[^>]*?\/?>/g,t=[],n=[],a=s,i,m=[];while((i=e.exec(s))!==null)m.push({match:i[0],index:i.index});for(let o=m.length-1;o>=0;o--){let{match:u}=m[o],l=Ra(u);if(l){let f=await r(l);if(a=a.replace(u,f.html),f.preloadLink)t.push(f.preloadLink);if(f.placeholderCss)n.push(f.placeholderCss)}}return{html:a,preloadLinks:t,styles:n}}function B(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var D=new Map;function au(){D.clear()}async function G(s,r){let e=`${s}:${JSON.stringify(r)}`;if(D.has(e))return D.get(e);try{let t=await Fe(s,r);return D.set(e,t),t}catch{return null}}function Aa(){return Mt({name:"image",hasEndTag:!1,description:"Render an optimized image with responsive variants",transform:async(s,r,e)=>{let{src:t,alt:n,options:a}=X(s,r,e);if(!t)return console.warn("@image directive: missing src argument"),"<!-- @image: missing src -->";let i={widths:a.widths||(a.width?[a.width]:le),formats:a.formats||ue,quality:a.quality||de,placeholder:(a.placeholder==="color"?"dominant-color":a.placeholder)||"none"};if(!await Ee())return q(t,n||"",a);let o=await G(t,i);if(!o)return q(t,n||"",a);return te(o,n||"",a)}})}function X(s,r,e){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let n=s.trim();if(n.startsWith("@image(")||n.startsWith("("))n=n.replace(/^@image\(/,"").replace(/^\(/,"").replace(/\)$/,"");let a=ee(n),i=a[0]||"",m=a[1]||"",o={};if(i&&!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")){let u=e[i];if(typeof u==="string")i=u}if(a[2])try{if(typeof a[2]==="string")o=JSON.parse(a[2]);else o=a[2]}catch{}return{src:i,alt:m,options:o}}function ee(s){let r=[],e="",t=!1,n="",a=0,i=0;for(let m=0;m<s.length;m++){let o=s[m],u=m>0?s[m-1]:"";if((o==='"'||o==="'")&&u!=="\\"){if(!t)t=!0,n=o;else if(o===n)t=!1,n="";else e+=o;continue}if(!t){if(o==="{")a++;if(o==="}")a--;if(o==="[")i++;if(o==="]")i--;if(o===","&&a===0&&i===0){r.push(e.trim()),e="";continue}}e+=o}if(e.trim())r.push(e.trim());return r}function q(s,r,e){let t=[`src="${x(s)}"`];if(r)t.push(`alt="${x(r)}"`);if(e.width)t.push(`width="${e.width}"`);if(e.height)t.push(`height="${e.height}"`);if(e.class)t.push(`class="${x(e.class)}"`);if(e.style)t.push(`style="${x(e.style)}"`);if(e.lazy!==!1)t.push('loading="lazy"');return t.push('decoding="async"'),`<img ${t.join(" ")} />`}function te(s,r,e){let{variants:t,placeholder:n,width:a,height:i,aspectRatio:m}=s,o=new Map;for(let g of t){let p=o.get(g.format)||[];p.push(g),o.set(g.format,p)}let u=["avif","webp","jpeg","png"],l=[];for(let g of u){let p=o.get(g);if(p&&p.length>0){let v=$t(p),w=pe(g),I=e.sizes||"100vw";l.push(` <source type="${w}" srcset="${x(v)}" sizes="${x(I)}" />`)}}let f=o.get("jpeg")||[],y=f.length>0?f[Math.floor(f.length/2)]:t[Math.floor(t.length/2)],c=[`src="${y?.url||s.src}"`,`alt="${x(r)}"`];if(e.width||a)c.push(`width="${e.width||a}"`);if(e.height||i)c.push(`height="${e.height||i}"`);if(e.class)c.push(`class="${x(e.class)}"`);let h=[];if(m)h.push(`aspect-ratio: ${m.toFixed(4)}`);if(e.style)h.push(e.style);if(h.length>0)c.push(`style="${h.join("; ")}"`);if(e.lazy!==!1&&!e.priority)c.push('loading="lazy"');if(c.push('decoding="async"'),e.priority)c.push('fetchpriority="high"');let d=`<picture>
|
|
34
34
|
`;if(d+=l.join(`
|
|
35
35
|
`)+`
|
|
36
36
|
`,d+=` <img ${c.join(" ")} />
|
|
@@ -39,5 +39,5 @@ ${d}
|
|
|
39
39
|
</div>`}else if(e.placeholder==="color"){let p=n.replace(/[^a-zA-Z0-9#(),.\s%-]/g,"");d=`<div id="${g}" class="stx-image-placeholder" style="background-color: ${p};">
|
|
40
40
|
${d}
|
|
41
41
|
</div>`}}if(e.priority&&y){let g=pe(y.format);d=`<link rel="preload" as="image" href="${x(y.url)}" type="${g}" />
|
|
42
|
-
`+d}return d}function x(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var
|
|
43
|
-
export{
|
|
42
|
+
`+d}return d}function x(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var cu=Aa();import P from"fs";import j from"path";function lu(s={}){let{inputDirs:r=["public","src/assets","assets"],outputDir:e="dist/images",baseUrl:t="/images",formats:n=ue,widths:a=le,quality:i=de,placeholder:m="none",concurrency:o=4,cache:u=!0,cacheDir:l=".stx/image-cache",referencedOnly:f=!1,verbose:y=!1}=s,c={imageReferences:new Set,processedImages:new Map,stats:{totalImages:0,optimizedImages:0,savedBytes:0,variants:0}};return{name:"stx-image-optimization",async setup(h){if(!await Ee()){console.warn("[stx-images] no image backend available, optimization disabled");return}if(u)await P.promises.mkdir(l,{recursive:!0});if(y){let g=await Jn();console.log("[stx-images] Plugin initialized"),console.log(` Backend: ${g?"sharp (native fast path) + ts-images":"ts-images (pure TS)"}`),console.log(` Input dirs: ${r.join(", ")}`),console.log(` Output dir: ${e}`),console.log(` Formats: ${n.join(", ")}`),console.log(` Widths: ${a.join(", ")}`)}},async buildStart(){c.imageReferences.clear(),c.processedImages.clear(),c.stats={totalImages:0,optimizedImages:0,savedBytes:0,variants:0}},async transform(h,d){if(d.endsWith(".html")||d.endsWith(".stx")){let g=se(h);for(let p of g)c.imageReferences.add(p)}if(h.includes("<Image")||h.includes("@image"))return await ae(h,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t,processedImages:c.processedImages});return h},async buildEnd(h){if(!await Ee())return;await P.promises.mkdir(e,{recursive:!0});let g=[];for(let w of r){if(!P.existsSync(w))continue;let I=await N(w);g.push(...I)}let p=f?g.filter((w)=>re(w,c.imageReferences)):g;if(c.stats.totalImages=p.length,y)console.log(`[stx-images] Processing ${p.length} images...`);let v=W(p,o);for(let w of v)await Promise.all(w.map(async(I)=>{try{let b=await Fe(I,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t});c.processedImages.set(I,b),c.stats.optimizedImages++,c.stats.variants+=b.variants.length;let A=P.statSync(I).size,S=er(b.variants);if(c.stats.savedBytes+=Math.max(0,A-S/b.variants.length),y)console.log(` \u2713 ${j.basename(I)} \u2192 ${b.variants.length} variants`)}catch(b){console.error(`[stx-images] Error processing ${I}:`,b)}}));if(console.log("[stx-images] Optimization complete:"),console.log(` Images: ${c.stats.optimizedImages}/${c.stats.totalImages}`),console.log(` Variants: ${c.stats.variants}`),c.stats.savedBytes>0)console.log(` Saved: ~${tr(c.stats.savedBytes)}`)}}}function se(s){let r=[],e=/src=["']([^"']+\.(jpg|jpeg|png|webp|avif|gif))["']/gi,t;while((t=e.exec(s))!==null)r.push(t[1]);let n=/<Image[^>]+src=["']([^"']+)["']/gi;while((t=n.exec(s))!==null)r.push(t[1]);let a=/@image\s*\(\s*['"]([^'"]+)['"]/gi;while((t=a.exec(s))!==null)r.push(t[1]);let i=/background(?:-image)?:\s*url\(["']?([^"')]+\.(jpg|jpeg|png|webp|avif|gif))["']?\)/gi;while((t=i.exec(s))!==null)r.push(t[1]);return r}function re(s,r){let e=j.basename(s);for(let t of r)if(t.endsWith(e)||t.includes(e))return!0;return!1}async function ae(s,r){return s}async function N(s){let r=[];async function e(t){let n=await P.promises.readdir(t,{withFileTypes:!0});for(let a of n){let i=j.join(t,a.name);if(a.isDirectory())await e(i);else if(a.isFile()&&Qn(i))r.push(i)}}return await e(s),r}function W(s,r){let e=[];for(let t=0;t<s.length;t+=r)e.push(s.slice(t,t+r));return e}async function uu(s,r,e={}){if(!await Ee())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");return Fe(s,{...e,outputDir:r})}async function du(s,r,e={}){let{formats:t=ue,widths:n=le,quality:a=de,placeholder:i="none",concurrency:m=4,verbose:o=!1}=e;if(!await Ee())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");await P.promises.mkdir(r,{recursive:!0});let l=await N(s),f=[],y={totalImages:l.length,optimizedImages:0,savedBytes:0,variants:0},c=W(l,m);for(let h of c){let d=await Promise.all(h.map(async(g)=>{try{let p=await Fe(g,{formats:t,widths:n,quality:a,placeholder:i,outputDir:r,baseUrl:"/"});if(y.optimizedImages++,y.variants+=p.variants.length,o)console.log(` \u2713 ${j.basename(g)}`);return p}catch(p){return console.error(`Error processing ${g}:`,p),null}}));f.push(...d.filter((g)=>g!==null))}return{processed:f,stats:y}}function Pa(s){let r={};for(let e of s)r[e.src]={variants:e.variants,placeholder:e.placeholder};return r}async function pu(s,r){let e=Pa(s);await Bun.write(r,JSON.stringify(e,null,2))}var Rm={enabled:!0,widths:[320,640,768,1024,1280,1536,1920],formats:["webp","jpeg"],quality:80,devOptimize:!1,cacheDir:".stx/image-cache",placeholder:"none",inputDirs:["public","src/assets","assets"],outputDir:"dist/images",baseUrl:"/images"};
|
|
43
|
+
export{ou,Ra,iu,au,Aa,cu,lu,uu,du,Pa,pu,Rm};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{q,wg,bi,Hc,a,j,xy,Sy}from"./chunk-40fpt0r6.js";import"./chunk-rapr0m13.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{j as config,q as defaultConfig,xy as defineStxConfig,bi as discoverConfig,a as loadStxConfig,Hc as resolveInstalledPackage,wg as resolveStxDirectories,Sy as validateConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Mm,Dm,Lm,jm,mu,Bm,Fm,zm,Hm,Vm,Um,Wm}from"./chunk-hnjeqxqy.js";export{Um as Broadcast,Wm as BroadcastServer,mu as broadcast,Hm as broadcastPresence,zm as broadcastPrivate,Vm as channel,Mm as getBroadcastServer,jm as loadChannels,Dm as startBroadcasting,Lm as stopBroadcasting,Bm as toUser,Fm as toUsers};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{P}from"./chunk-
|
|
2
|
+
import{P}from"./chunk-9m45t60c.js";import{i}from"./chunk-r9n86na1.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
|
|
3
3
|
${e.bold}${t[0]}${e.reset} - ${n.description}`),console.log(` Usage: ${e.cyan}${n.usage}${e.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${e.bold}Available Commands:${e.reset}
|
|
@@ -16,9 +16,9 @@ ${e.bold}Markdown:${e.reset}`),a.forEach((c)=>console.log(` ${e.blue}${c}${e.re
|
|
|
16
16
|
${e.bold}Other:${e.reset}`),d.forEach((c)=>console.log(` ${e.dim}${c}${e.reset}`));console.log()}},cat:{description:"Show file contents",usage:"cat <file>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!await Bun.file(n).exists()){console.log(`${e.red}Error: File not found: ${n}${e.reset}`);return}let s=(await Bun.file(n).text()).split(`
|
|
17
17
|
`);console.log(),s.forEach((l,a)=>{let d=String(a+1).padStart(3," ");console.log(`${e.dim}${d}${e.reset} ${l}`)}),console.log()}},load:{description:"Load context from JSON file",usage:"load <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a JSON file${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!await Bun.file(n).exists()){console.log(`${e.red}Error: File not found: ${n}${e.reset}`);return}try{let r=await Bun.file(n).text(),s=JSON.parse(r);o.context={...o.context,...s},console.log(`${e.green}\u2713${e.reset} Loaded ${Object.keys(s).length} variables from ${t[0]}`)}catch(r){console.log(`${e.red}Error parsing JSON:${e.reset}`,r)}}},save:{description:"Save context to JSON file",usage:"save <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file name${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);try{await Bun.write(n,JSON.stringify(o.context,null,2)),console.log(`${e.green}\u2713${e.reset} Context saved to ${t[0]}`)}catch(r){console.log(`${e.red}Error saving file:${e.reset}`,r)}}},history:{description:"Show command history",usage:"history [count]",handler:async(t,o)=>{let n=t[0]?Number.parseInt(t[0],10):20,r=o.history.slice(-n);if(r.length===0){console.log(`${e.dim}No history${e.reset}`);return}console.log(),r.forEach((s,l)=>{let a=String(o.history.length-r.length+l+1).padStart(3," ");console.log(`${e.dim}${a}${e.reset} ${s}`)}),console.log()}},exit:{description:"Exit interactive mode",usage:"exit",handler:async(t,o)=>{o.running=!1,console.log(`
|
|
18
18
|
${e.dim}Goodbye!${e.reset}
|
|
19
|
-
`)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let n=t.split(" "),r=n[0];if(n.length===1)return Object.keys(u).filter((s)=>s.startsWith(r));if(["render","cat","load","cd"].includes(r)){let s=n.slice(1).join(" "),l=g.dirname(s)||".",a=g.basename(s),d=g.resolve(o.cwd,l);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${r} ${l==="."?"":`${l}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(r)){let s=n[1]||"";return Object.keys(o.context).filter((l)=>l.startsWith(s)).map((l)=>`${r} ${l}`)}return[]}async function
|
|
19
|
+
`)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let n=t.split(" "),r=n[0];if(n.length===1)return Object.keys(u).filter((s)=>s.startsWith(r));if(["render","cat","load","cd"].includes(r)){let s=n.slice(1).join(" "),l=g.dirname(s)||".",a=g.basename(s),d=g.resolve(o.cwd,l);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${r} ${l==="."?"":`${l}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(r)){let s=n[1]||"";return Object.keys(o.context).filter((l)=>l.startsWith(s)).map((l)=>`${r} ${l}`)}return[]}async function _m(t={}){let o={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},n=y.createInterface({input:process.stdin,output:process.stdout,completer:(s)=>[h(s,o),s],historySize:t.maxHistory||100});console.log(`
|
|
20
20
|
${e.bold}${e.blue}stx Interactive Mode${e.reset}
|
|
21
21
|
${e.dim}Type 'help' for available commands, 'exit' to quit${e.reset}
|
|
22
22
|
`);let r=()=>{let s=o.cwd.replace(process.env.HOME||"","~");n.question(`${e.cyan}stx${e.reset} ${e.dim}${s}${e.reset} ${e.green}>${e.reset} `,async(l)=>{let a=l.trim();if(!a){if(o.running)r();return}o.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],c=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(c&&u[c])try{await u[c].handler(f,o)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(c)if(a.includes("{{")||a.includes("}}"))try{let m=await P(a,o.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${c}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${c}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(o.running)r();else n.close()})};n.on("SIGINT",()=>{console.log(`
|
|
23
23
|
${e.dim}(Use 'exit' to quit)${e.reset}`),r()}),r()}
|
|
24
|
-
export{
|
|
24
|
+
export{_m};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var f=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),b=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);function l(i){return i.replace(/[^\n]/g," ")}function w(i){let o=i.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,l).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,l).replace(/<!--[\s\S]*?-->/g,l).replace(/\{\{\{[\s\S]*?\}\}\}/g,l).replace(/\{\{[\s\S]*?\}\}/g,l).replace(/\{!![\s\S]*?!!\}/g,l),s=new Map,r=new Map,p=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,t;while((t=p.exec(o))!==null){let e=t[1]==="/",n=t[2],a=t[3]==="/";if(f.has(n.toLowerCase()))continue;if(a)continue;if(e)r.set(n,(r.get(n)??0)+1);else{let g=s.get(n);if(g)g.count++;else{let d=o.slice(0,t.index).split(`
|
|
3
|
-
`).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function
|
|
4
|
-
export{
|
|
3
|
+
`).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function si(i,o){let s;try{s=w(i)}catch{return}if(s.length===0)return;let r=`${o}:${i.length}`;if(u.has(r))return;u.add(r);let p=o?o.split(/[/\\]/).pop()||o:"template";for(let{tag:t,opened:c,closed:e,firstOpenLine:n}of s)if(c>e){let a=n?` (first opened at line ${n})`:"";console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 an unclosed <${t}>${a} may swallow the content that follows it.`)}else console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 ${e-c} stray </${t}>.`)}
|
|
4
|
+
export{si};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Va,Du,nr,uh,Lu,ju,Bu,dh}from"./chunk-n8xjqsze.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{nr as Validator,Du as defineForm,Lu as processErrorDirective,ju as processErrorsDirective,dh as processFormValidationDirectives,Bu as processHasErrorsDirective,Va as useForm,uh as v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Uu,qo,lr,Wu,qu,Ku,Gu,Xu,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,dn,tc,Dd,Ld,jd,nc,Bd,Fd,zd,Hd,Vd,Ud,rc,Wd,qd,Kd,Gd,Xd,Jd,Yd,Zd,Qd,ur,ep,tp,np,rp,sp,op,ip,ap,cp,lp,up,dp,Ko,pp,fp,gp,mp,hp,bs,ws,yp,bp,wp,vp,xp,sc,Sp,kp,_p,oc,Go,Cp,Ep,ic,ac,vs,cc,Tp,pn,$p,lc,uc,Xo,Rp,Jo,Ap,Pp,Ip,Op,Np,Mp,Dp,dc,Lp,jp,pc,Bp,Fp,zp,Hp,Vp,Up,Wp,qp,Kp,Gp,Xp,Jp,Yp,Zp,Qp,ef,tf,nf,rf,sf,of,af,cf,lf,fc,uf,df,pf,ff,gf,mf,hf,yf,bf,wf,vf,dr,gc,mc,xf,pr,Sf,kf,_f,hc,yc,xs,Ss,Cf,Yo,Ef,Tf,$f,Rf,Af,Pf,If,Of,Nf,Mf,Df,Lf,jf,Bf,Ff,zf,Hf,Vf,Uf,Wf,bc,qf,Kf,wc,vc,Gf,Xf}from"./chunk-7nn5s0c3.js";export{Nd as AVAILABLE_COMPONENTS,sc as AutoUpdater,Md as COMPONENT_STYLES,xs as DEFAULT_WATCH_INTERVAL_MS,yc as MAX_WATCH_INTERVAL_MS,hc as MIN_WATCH_INTERVAL_MS,Ud as MODAL_STYLES,Qu as TOAST_STYLES,Yd as TRAY_MENU_STYLES,ic as UPDATE_MANIFEST_ASSET,Fd as alert,of as appInfo,Pf as appleScript,Xf as applicationDataDirectory,Af as audio,Kf as backgroundDelay,tf as battery,Rf as biometric,wf as bluetooth,Df as bonjour,pn as bundlePathForExecutable,Rp as caffeinate,Sp as canReplaceBundle,kp as clearQuarantine,qp as clipboard,Vd as closeAllModals,dp as closeAllWindows,Bd as confirm,lf as contextMenu,Hf as continuityCamera,zf as coreml,vp as craftBinaryNotFoundMessage,Ko as craftWindowArguments,dr as crashReporter,Sd as createAccordion,md as createAutocomplete,id as createAvatar,od as createBadge,ed as createButton,ad as createCard,Rd as createChart,nd as createCheckbox,bd as createChip,Ad as createCodeEditor,pd as createColorPicker,$d as createDataGrid,fd as createDatePicker,ws as createDiskImage,ld as createDropdown,Id as createFileExplorer,Tp as createGitHubUpdateManifest,cc as createGitHubUpdater,yd as createImageView,Hp as createInterval,hd as createLabel,Cd as createListView,Pd as createMediaPlayer,Wd as createMenubar,_d as createModalComponent,Gf as createNativeUpdateApi,vc as createPantrySelfUpdater,Np as createPreferences,sd as createProgressBar,dd as createRadioButton,ud as createRating,vd as createScrollView,Xo as createSelfUpdater,rd as createSlider,xd as createSplitView,kd as createStepper,rc as createSystemTray,Ed as createTable,cd as createTabs,td as createTextInput,gd as createTimePicker,zp as createTimer,wd as createTooltip,Td as createTreeView,Od as createWebView,pp as createWindow,gp as createWindowWithHTML,Jo as decaffeinate,ef as deepLinks,Vp as delay,Ju as dismissAlertById,Yu as dismissAllAlerts,Zp as dragOut,_p as extractBundle,If as fileAssociations,Yo as focus,Tf as focusShortcutsReady,Wp as formatCompact,Op as formatDuration,Ip as formatRemainingTime,Lp as formatShortcut,Up as formatTime,Gp as fs,oc as generateUpdateManifest,Zu as getActiveAlertCount,Hd as getActiveModalCount,qd as getActiveTrayInstances,lp as getActiveWindowIds,Pp as getCaffeinateStatus,Wf as getCapabilities,bc as getCapability,ap as getDesktopConfig,op as getDialogBridgeScript,Fp as getRegisteredHotkeys,Xd as getSimulatedTrayHTML,Jd as getTrayBridgeScript,Kd as getTrayInstance,up as getWindow,hp as getWindowBridgeScript,ac as githubLatestAssetUrl,vs as githubReleaseAssetUrl,Jp as globalShortcuts,pr as handoff,Ef as hasFocusShortcuts,xf as iap,Dp as isAutoLaunchEnabled,qf as isAvailable,Ap as isCaffeinated,Qp as isDragOutAvailable,mp as isWebviewAvailable,pf as keychain,Sf as liveActivities,$f as localServer,kf as location,Mf as log,yp as macOSRuntimeExecutablePath,cf as menu,Ff as midi,mf as nativeAutoLaunch,hf as nativeTray,yf as nativeWindow,nf as network,Kp as notifications,Xu as notify,fp as openDevWindow,bp as pack,wp as packageApp,wc as parsePantryUpdateManifest,dc as parseShortcut,Nf as pdf,ff as permissions,gf as printing,zd as prompt,lc as quitLauncher,Go as readBundleIdentity,gc as redactPII,jp as registerHotkey,uc as relaunchBundle,Uu as requestNotificationPermission,cp as resetDesktopConfig,xp as resolveCraftBinary,bs as resolveCraftExecutablePath,$p as runningBundleTeamId,df as screen,_f as screenCapture,Ss as screenSharing,Uf as serial,Vf as serviceMenu,Mp as setAutoLaunch,ip as setDesktopConfig,Xp as shell,qo as showAlert,tp as showAlertDialog,ep as showColorPicker,np as showConfirmDialog,rp as showErrorDialog,Ld as showErrorModal,Gu as showErrorToast,tc as showInfoModal,Wu as showInfoToast,ur as showMessageBox,dn as showModal,Zd as showOpenDialog,nc as showQuestionModal,Qd as showSaveDialog,jd as showSuccessModal,qu as showSuccessToast,lr as showToast,sp as showWarningDialog,Dd as showWarningModal,Ku as showWarningToast,fc as sidebar,mc as signPayload,vf as speech,jf as speechRecognition,Lf as spotlight,af as standardMenus,Cp as swapBundle,uf as system,Of as tags,Yp as theme,bf as touchbar,Gd as triggerTrayAction,Bp as unregisterAllHotkeys,pc as unregisterHotkey,rf as updater,Ep as verifyBundleTrust,Bf as vision,Cf as watchScreenSharing,sf as windowEvents};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`+e.slice(t);let n=
|
|
2
|
+
import{Rr}from"./chunk-0b57fgpn.js";import{Ur}from"./chunk-945zygwa.js";import{a}from"./chunk-40fpt0r6.js";import{W,lt}from"./chunk-a7bqrjm5.js";import{jc}from"./chunk-67pq803s.js";import{L,c}from"./chunk-p92272k0.js";var x=/<style\b[^>]*>/iy,R=/<\/style>/gi,b=/<script\b[^>]*>/iy,S=/<template(?=[\s>/])[^>]*>/iy,w=/<\/template\s*>/iy;function kr(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let g=e.indexOf("-->",n+4);r=g===-1?e.length:g+3;continue}x.lastIndex=n;let u=x.exec(e);if(u){R.lastIndex=n+u[0].length;let g=R.exec(e);r=g===null?e.length:g.index+8;continue}S.lastIndex=n;let o=S.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}w.lastIndex=n;let d=w.exec(e);if(d){if(t>0)t--;r=n+d[0].length;continue}if(b.lastIndex=n,b.test(e))return t>0?s:n;r=n+1}return-1}function re(e,r={}){return new Rr(e,r).routes}import y from"path";var T=new Map;async function h(e,r){let t=e,s=r;if(!t||!s)try{let d=await a();t||=d?.pagesDir||"pages",s||=d?.root||"."}catch{t||="pages",s||="."}let n=y.isAbsolute(t)?t:y.join(s,t),u=T.get(n);if(u)return u;let o=[];try{o=re(".",{pagesDir:n,emit:!1}).map((d)=>d.regex.source).filter(Boolean)}catch{o=[]}return T.set(n,o),o}function E(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function l(e){return E(JSON.stringify(e))}function Re(e){return e.includes("data-stx-runtime")}function Dc(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function p(e,r){let t=kr(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
|
|
3
|
+
`+e.slice(t);let n=Ur(e);if(n!==null)return`${e.slice(0,n)}
|
|
4
4
|
${r}${e.slice(n)}`;if(e.includes("</head>")){let o=L(e);return e.slice(0,o)+r+`
|
|
5
5
|
`+e.slice(o)}if(W(e))return lt(e,(o)=>`${o}
|
|
6
6
|
${r}`);return`${r}
|
|
7
|
-
${e}`}async function
|
|
7
|
+
${e}`}async function _r(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-0f2d61b3.js"),{url:u}=await n("runtime",r.debug===!0);return p(e,`<script data-stx-runtime src="${u}"></script>`)}if(r.buildMode==="compile")return p(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-0f2d61b3.js"),s=await t(r.debug);return p(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function O(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function Lc(e){if(e.includes("data-stx-tooltip-runtime")||!O(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${jc()}</script>`,t=c(e);if(t===-1)return`${e}
|
|
8
8
|
${r}`;return`${e.slice(0,t)}${r}
|
|
9
|
-
${e.slice(t)}`}var C=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function M(e){return C.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function Ae(e,r){if(!e.includes("</body>"))return e;if(M(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:_}=await import("./chunk-
|
|
9
|
+
${e.slice(t)}`}var C=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function M(e){return C.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function Ae(e,r){if(!e.includes("</body>"))return e;if(M(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:_}=await import("./chunk-0f2d61b3.js");n=`<script data-stx-owned-routes src="${_(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${l(f)};
|
|
10
10
|
`)}"></script>
|
|
11
11
|
`}else i.ownedRoutes=f}catch{}if(Object.keys(i).length>0)s=`<script>window.__stxRouterConfig=${l(i)};</script>
|
|
12
|
-
`}let{getCachedRouterScript:u,getServeClientAsset:o}=await import("./chunk-
|
|
12
|
+
`}let{getCachedRouterScript:u,getServeClientAsset:o}=await import("./chunk-0f2d61b3.js"),d=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await u()}</script>`,g=c(e);return e.slice(0,g)+s+n+d+`
|
|
13
13
|
</body>`+e.slice(g+7)}
|
|
14
|
-
export{
|
|
14
|
+
export{kr,re,Re,Dc,_r,Lc,Ae};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-0jdz31q1.js";import"./chunk-
|
|
2
|
+
import"./chunk-0jdz31q1.js";import"./chunk-945zygwa.js";import"./chunk-hdfhaddy.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-9m45t60c.js";import"./chunk-esm0pnpz.js";import"./chunk-472w7t7p.js";import"./chunk-5mrt1enm.js";import"./chunk-rapr0m13.js";import{l}from"./chunk-pjpy86c3.js";import u from"fs";import m from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||l(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=m.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),c=JSON.parse(p);if(c.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(c.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
|
|
3
3
|
`)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{k,E,A,ee,O,
|
|
2
|
+
import{k,E,A,ee,O,ro,ie}from"./chunk-9m45t60c.js";import{Le}from"./chunk-5g5khx0m.js";import{C}from"./chunk-hdfhaddy.js";import{D,Fn}from"./chunk-7b3dqeyr.js";import{a}from"./chunk-40fpt0r6.js";import{Te,yn,bn,wn}from"./chunk-7z1hqp86.js";import{Ot}from"./chunk-8rgy17fj.js";import{Rt,rr,un,ve}from"./chunk-5tm1pvt3.js";import{Z}from"./chunk-65g78sge.js";import{I,tt}from"./chunk-qykbjg3z.js";import w from"path";var x=new Map,P=new Map,R=k(64),T=new Map,ne=["composables","functions"];function W(e){let s=w.basename(e,".ts");return s==="index"||s==="types"||e.endsWith(".d.ts")}async function se(e){if(e)return w.resolve(e);let s=`<default>:${process.cwd()}`,i=T.get(s);if(i!==void 0)return i;let t=await oe();if(t!==null)T.set(s,t);return t}async function oe(){let e=await a(),s=e.root||process.cwd(),i=e.composablesDir;if(i)return w.resolve(s,i);for(let t of ne){let n=w.resolve(s,t);try{let c=new Bun.Glob("**/*.ts");for await(let r of c.scan({cwd:n,absolute:!0}))if(!W(r))return n}catch{}}return null}async function X(e){let s=Array.isArray(e)?e:e?[w.resolve(e)]:(await a())._layerComposableDirs??[await se()].filter((t)=>!!t),i=new Map;for(let t of s){let n=new Bun.Glob("**/*.ts");try{for await(let c of n.scan({cwd:t,absolute:!0})){let r=w.relative(t,c);if(!W(c)&&!i.has(r))i.set(r,c)}}catch{}}return{key:s.join("\x00"),files:[...i.values()].sort()}}async function zo(e){let{files:s}=await X(e),i=ie({loader:"ts",target:"browser",define:A()}),t=[];for(let n of s)try{let c=await Bun.file(n).text(),r=i.scan(c).exports.filter((d)=>d!=="default");if(r.length>0)t.push({file:n,names:r})}catch{}return t}function re(e,s){return new RegExp(`\\b${s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(e)}function Q(e,s){let i=new Set(e.match(/\w+/g)),t=new Set;for(let n of s)if(/^\w+$/.test(n)?i.has(n):re(e,n))t.add(n);return t}var H=k(64);function U(e,s){let i=E(e,s.size),t=H.get(i);if(t)return t;let n;try{n=Le(e,s)}catch{n=Q(e,s)}let c=[...e.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...e.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let r of c)for(let d of r[1].split(",")){let f=d.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(f&&s.has(f))n.add(f)}return H.set(i,n),n}function ae(e){return!e||/^(?:module|(?:text|application)\/(?:java|ecma)script|application\/stx-[\w-]+)$/i.test(e)}var q=k(256);function ce(e,s){let i=new Set(s),t="",n=0,c=new Set;for(let r of ee(e)){t+=e.slice(n,r.start),n=r.end;let d=O(r.attrs),f=e.slice(r.bodyStart,r.bodyEnd),u=d.get("type"),m=typeof u==="string"?u.trim():void 0;if(!ae(m)){if(!/json/i.test(m??""))t+=` ${f} `;continue}let h=Q(f,i);if(h.size===0)continue;let _=E(f,[...h].sort().join(",")),b=q.get(_);if(!b)b=U(f,h),q.set(_,b);for(let v of b)c.add(v)}t+=e.slice(n);for(let r of ro(t))for(let d of U(r.code,i))c.add(d);return c}function le(e,s,i){let t=new Map;for(let{file:f,names:u}of e)for(let m of u)if(!t.has(m))t.set(m,f);let n=new Set(t.keys()),c=(f)=>{let u=[];for(let m of U(f,n))u.push(t.get(m));return u},r=new Set,d=i.flatMap((f,u)=>u===0?[...ce(f,t.keys())].map((m)=>t.get(m)):c(f));while(d.length>0){let f=[];for(let u of d){if(r.has(u))continue;r.add(u);for(let m of c(s.get(u)??""))if(!r.has(m))f.push(m)}d=f}return r}async function zh(e,s,i,t){let{key:n,files:c}=await X(e);if(!n)return null;let r=()=>[...new Set([...c,...c.flatMap((o)=>Te(o))])],d=Rt(r());if(c.length===0)return ve(x,n,d,""),null;c.sort();let f=ie({loader:"ts",target:"browser",define:A()}),u=un(P,n,d);if(!u){let o=new Map,l=[];for(let p of c)try{let S=await Bun.file(p).text();o.set(p,S);let g=f.scan(S).exports.filter((te)=>te!=="default");if(g.length>0)l.push({file:p,names:g})}catch{o.set(p,"")}u=ve(P,n,d,{codeByFile:o,modules:l})}let{codeByFile:m,modules:h}=u,_;if(s===void 0)_=new Set(c);else{let o=i?[s,...i]:[s],l=E(o.join("\x00"),n,o.length,d),p=R.get(l);if(_=p??le(h,m,o),!p)R.set(l,_)}if(_.size===0)return null;let b=c.filter((o)=>_.has(o)),v=()=>{if(!t)return;for(let o of b)t.push(o,...Te(o))},N=`${n}\x00${b.join("\x00")}\x00${bn()}`,z=un(x,N,d);if(z!==void 0)return v(),z||null;let F=[],B=new Set,K=new Set;for(let o of b)try{let l=m.get(o)??await Bun.file(o).text(),p=w.basename(o,".ts");for(let g of l.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(g[1])K.add(g[1]);let S=[];try{for(let g of f.scan(l).exports)if(g!=="default")B.add(g),S.push(g)}catch{}if(l=D(l),yn(l))l=await wn(l,o,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:S}),l=Ot(l);l=Fn(l),l=l.replace(/^export\s+(default\s+)?/gm,""),l=f.transformSync(l),F.push(`// Composable: ${p}
|
|
3
3
|
${l.trim()}`)}catch(l){console.warn(`[stx] Failed to load composable ${o}:`,l)}if(F.length===0||B.size===0)return ve(x,N,d,""),null;let V=[...B].map((o)=>` try { if (!(${JSON.stringify(o)} in __c)) __c[${JSON.stringify(o)}] = ${o}; } catch (e) {}`).join(`
|
|
4
4
|
`),G=JSON.stringify([...B]),M=F.join(`
|
|
5
5
|
|
|
@@ -34,5 +34,5 @@ ${V}
|
|
|
34
34
|
}
|
|
35
35
|
${j?`__resolveBundle();
|
|
36
36
|
} catch(error) { delete __bundles[${y}]; __rejectBundle(error); throw error; }`:""}
|
|
37
|
-
})();`,L=I()?tt(J):J;return d=Rt(r()),ve(x,N,d,L),v(),L}function
|
|
38
|
-
export{
|
|
37
|
+
})();`,L=I()?tt(J):J;return d=Rt(r()),ve(x,N,d,L),v(),L}function Hh(){x.clear(),rr(),P.clear(),R.clear(),T.clear()}
|
|
38
|
+
export{zo,zh,Hh};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function
|
|
3
|
-
export{
|
|
2
|
+
import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function xu(e,r){let a=r.formats??d;if(!r.publicDir)return e;let i=y(e),o=[],m=/<img\b[^>]*?>/gi,c=[],u;while((u=m.exec(e))!==null){let t=u[0],n=t.match(/\bsrc=["']([^"']+)["']/i);if(!n)continue;if(A(u.index,i))continue;c.push({idx:u.index,length:t.length,src:n[1],raw:t})}if(c.length===0)return e;let f=await Promise.all(c.map(async(t)=>{let n=await S(t.src,r.publicDir,a);return{match:t,sources:n}}));for(let{match:t,sources:n}of f){if(n.length===0)continue;let x=`<picture>${n.map((p)=>`<source type="${p.mime}" srcset="${P(p.url)}">`).join("")}${t.raw}</picture>`;o.push({start:t.idx,end:t.idx+t.length,replacement:x})}if(o.length===0)return e;let l="",g=0;for(let t of o)l+=e.slice(g,t.start),l+=t.replacement,g=t.end;return l+=e.slice(g),l}async function S(e,r,a){if(!w(e))return[];let i=s.extname(e).toLowerCase();if(!h.has(i))return[];if(!e.startsWith("/"))return[];let o=s.join(r,e.slice(1)),m=s.dirname(o),c=s.basename(o,i),u=s.resolve(m),f=s.resolve(r);if(!u.startsWith(f))return[];let l=s.posix.dirname(e),g=a.map(async(n)=>{let b=s.join(m,`${c}${n.ext}`);if(!await Bun.file(b).exists())return null;return{url:s.posix.join(l,`${c}${n.ext}`),mime:n.mime}});return(await Promise.all(g)).filter((n)=>n!==null)}function w(e){if(!e)return!1;if(e.startsWith("http://")||e.startsWith("https://"))return!1;if(e.startsWith("//"))return!1;if(e.startsWith("data:"))return!1;return!0}function y(e){let r=[],a=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,i;while((i=a.exec(e))!==null)r.push([i.index,i.index+i[0].length]);return r}function A(e,r){for(let[a,i]of r)if(e>=a&&e<i)return!0;return!1}function P(e){return e.replace(/&/g,"&").replace(/"/g,""")}
|
|
3
|
+
export{xu};
|