@stacksjs/stx 0.2.672 → 0.2.674
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-0jwdcqj8.js +2 -0
- package/dist/chunk-0mwdq478.js +2 -0
- package/dist/{chunk-npa7gze7.js → chunk-0nfqgv4n.js} +2 -2
- package/dist/chunk-1y6egkty.js +2 -0
- package/dist/{chunk-1sr6c0nk.js → chunk-25zmy8q6.js} +2 -2
- package/dist/chunk-2881tcqt.js +2 -0
- package/dist/chunk-2a775q7x.js +2 -0
- package/dist/chunk-2asdbd5e.js +2 -0
- package/dist/chunk-34yj93hh.js +2 -0
- package/dist/{chunk-30nes8ne.js → chunk-35ezh7de.js} +2 -2
- package/dist/{chunk-sjcqxfq1.js → chunk-40tswfe7.js} +8 -8
- package/dist/chunk-41de209e.js +2 -0
- package/dist/{chunk-6xe8rnfv.js → chunk-4b9s7wgy.js} +2 -2
- package/dist/{chunk-ttbn287w.js → chunk-4bgjrrvz.js} +1 -1
- package/dist/{chunk-365vg0eg.js → chunk-4s8zacxg.js} +4 -4
- package/dist/chunk-4w6baw62.js +3 -0
- package/dist/{chunk-fbtv2k1p.js → chunk-506mv7hb.js} +2 -2
- package/dist/{chunk-fzqj1mjz.js → chunk-5qtthtg3.js} +7 -7
- package/dist/chunk-5s1ay9mv.js +2 -0
- package/dist/{chunk-kenbxxbn.js → chunk-5vt48yce.js} +6 -6
- package/dist/{chunk-qv6axke4.js → chunk-5zhp87wv.js} +2 -2
- package/dist/{chunk-hvf2e7pr.js → chunk-6s7tvmqp.js} +1 -1
- package/dist/{chunk-ecqrkyg8.js → chunk-6sjtyd0k.js} +4 -4
- package/dist/{chunk-a3d0g4mr.js → chunk-7adznted.js} +2 -2
- package/dist/chunk-7j1zgrnf.js +42 -0
- package/dist/chunk-7kznee1g.js +2 -0
- package/dist/{chunk-qjtpxsyx.js → chunk-7mvz972c.js} +3 -3
- package/dist/chunk-80zgyaqe.js +2 -0
- package/dist/chunk-84tqb1rn.js +2 -0
- package/dist/chunk-8azm7nha.js +2 -0
- package/dist/chunk-902qnyg0.js +2 -0
- package/dist/{chunk-3y41efsf.js → chunk-9dtbvjpp.js} +8 -8
- package/dist/chunk-9n6jwcpb.js +2 -0
- package/dist/{chunk-yfvm7q6t.js → chunk-a4p18ybc.js} +3 -3
- package/dist/chunk-a6y8td0d.js +2 -0
- package/dist/chunk-a7kt1ts4.js +2 -0
- package/dist/chunk-a81y8g40.js +2 -0
- package/dist/{chunk-mjm3tyfj.js → chunk-aet1pgw7.js} +36 -36
- package/dist/chunk-aft1zc84.js +2 -0
- package/dist/{chunk-04kg16qs.js → chunk-am2w363p.js} +4 -4
- package/dist/{chunk-ym41ybz2.js → chunk-asezs2n3.js} +6 -6
- package/dist/{chunk-7kk2m44a.js → chunk-bawq4fqy.js} +4 -4
- package/dist/chunk-bdp2r0v4.js +2 -0
- package/dist/{chunk-1mj9crcg.js → chunk-bkkpq8dx.js} +9 -9
- package/dist/chunk-brtvm8mb.js +2 -0
- package/dist/{chunk-2dp7hyv7.js → chunk-bsajk82t.js} +14 -14
- package/dist/chunk-bvzr9zqt.js +2 -0
- package/dist/{chunk-t9yqq483.js → chunk-cbjabv1w.js} +4 -4
- package/dist/chunk-cbvgtf3m.js +2 -0
- package/dist/chunk-cfydbaeq.js +2 -0
- package/dist/{chunk-t2pzy3x1.js → chunk-ck2e3e47.js} +3 -3
- package/dist/{chunk-wpmrz872.js → chunk-d09q93yf.js} +2 -2
- package/dist/{chunk-a91atghh.js → chunk-d1a86qx8.js} +1 -1
- package/dist/{chunk-xqp4hstk.js → chunk-dgc1a3yt.js} +6 -6
- package/dist/chunk-dq8c3h4n.js +2 -0
- package/dist/chunk-e36pne7n.js +2 -0
- package/dist/chunk-e62qfexp.js +2 -0
- package/dist/chunk-eq5jzaj5.js +2 -0
- package/dist/{chunk-kwek8xdt.js → chunk-f9zyf9n6.js} +65 -65
- package/dist/{chunk-dgb4z4kw.js → chunk-faakv1p6.js} +2 -2
- package/dist/{chunk-yqz01qvy.js → chunk-fb7t1nn9.js} +3 -3
- package/dist/{chunk-06b8btkv.js → chunk-fbmth6xv.js} +10 -10
- package/dist/{chunk-7met6yva.js → chunk-fd49fahd.js} +5 -5
- package/dist/chunk-fr39emcz.js +2 -0
- package/dist/chunk-fsq13amm.js +2 -0
- package/dist/chunk-fw413k9q.js +3 -0
- package/dist/chunk-fxh12vqd.js +2 -0
- package/dist/chunk-gcc9fa33.js +2 -0
- package/dist/chunk-h6t2ney6.js +2 -0
- package/dist/{chunk-kgfgb971.js → chunk-ham5x7ts.js} +4 -4
- package/dist/{chunk-n38yb274.js → chunk-hb3edeq9.js} +6 -6
- package/dist/{chunk-fvtwec1r.js → chunk-hegfgw27.js} +1 -1
- package/dist/{chunk-p472crv1.js → chunk-hgry3mjd.js} +1 -1
- package/dist/{chunk-t961jbzc.js → chunk-hsmcbh0p.js} +7 -7
- package/dist/{chunk-wz2zb53w.js → chunk-hz4x7h0n.js} +5 -5
- package/dist/{chunk-jxda11cg.js → chunk-j6m8xqh3.js} +2 -2
- package/dist/chunk-j8g5cvvm.js +2 -0
- package/dist/chunk-jzjpyyw2.js +2 -0
- package/dist/chunk-k1b8x73j.js +2 -0
- package/dist/{chunk-8k3rwv8r.js → chunk-kdebh22m.js} +7 -7
- package/dist/{chunk-pvb48ehs.js → chunk-mwnhdsbp.js} +2 -2
- package/dist/{chunk-s20h5gmr.js → chunk-nj343mw2.js} +5 -5
- package/dist/chunk-nw9bdk2n.js +2 -0
- package/dist/chunk-p4jkswz8.js +2 -0
- package/dist/chunk-p4r90vqf.js +2 -0
- package/dist/{chunk-bnn7pd62.js → chunk-p6qd7ad0.js} +2 -2
- package/dist/chunk-p8bgy5tt.js +2 -0
- package/dist/{chunk-aprhqxky.js → chunk-pb6erpj3.js} +5 -5
- package/dist/{chunk-r3e6x87d.js → chunk-pg2v1pb5.js} +3 -3
- package/dist/{chunk-dw81nc5v.js → chunk-pqqe2b6m.js} +4 -4
- package/dist/chunk-q6nwcav4.js +2 -0
- package/dist/chunk-qmqavdz2.js +2 -0
- package/dist/chunk-qpw72bty.js +2 -0
- package/dist/chunk-qwnh1kj6.js +2 -0
- package/dist/chunk-qy9m6qdn.js +2 -0
- package/dist/chunk-qychcdsm.js +2 -0
- package/dist/{chunk-7d4z944r.js → chunk-qz5b8ed4.js} +7 -7
- package/dist/{chunk-6ajahb2x.js → chunk-r7fdw2v5.js} +3 -3
- package/dist/{chunk-mmwedr93.js → chunk-rdr09efy.js} +5 -5
- package/dist/chunk-rj3w1ama.js +2 -0
- package/dist/{chunk-prf164ct.js → chunk-rr527jt6.js} +2 -2
- package/dist/{chunk-x68etmdg.js → chunk-rv39s5az.js} +4 -4
- package/dist/{chunk-a5zqqgx2.js → chunk-rym0309c.js} +3 -3
- package/dist/{chunk-sqayfat9.js → chunk-s0vtjyyj.js} +1 -1
- package/dist/{chunk-vqc4h16r.js → chunk-s2wptfm1.js} +2 -2
- package/dist/chunk-sf0r963g.js +2 -0
- package/dist/{chunk-a3yte051.js → chunk-sqn3y9qt.js} +2 -2
- package/dist/{chunk-9gfffs28.js → chunk-srq9fqq8.js} +10 -10
- package/dist/chunk-ss820yys.js +2 -0
- package/dist/{chunk-pn1ehs6a.js → chunk-szevd7d5.js} +2 -2
- package/dist/{chunk-wbzmr6a4.js → chunk-t0k16vqv.js} +2 -2
- package/dist/chunk-t4j9g2vh.js +2 -0
- package/dist/chunk-t79jfpv6.js +3 -0
- package/dist/{chunk-rcadtv3x.js → chunk-t9kxhe46.js} +1 -1
- package/dist/{chunk-zqtbtqbq.js → chunk-tddnb5bv.js} +2 -2
- package/dist/{chunk-hvzzhkhr.js → chunk-thceyzj6.js} +2 -2
- package/dist/{chunk-n3m7fkv1.js → chunk-trh7s6k3.js} +5 -5
- package/dist/{chunk-3349573p.js → chunk-trz8z4j4.js} +18 -18
- package/dist/chunk-ttemwrbx.js +2 -0
- package/dist/{chunk-wankp78x.js → chunk-twqzn21x.js} +7 -7
- package/dist/chunk-v14rq8b4.js +3 -0
- package/dist/{chunk-b4pcw34n.js → chunk-v21bhhjb.js} +1 -1
- package/dist/{chunk-ka8befem.js → chunk-v6peecfp.js} +2 -2
- package/dist/{chunk-g8r0km7g.js → chunk-vayhx642.js} +2 -2
- package/dist/{chunk-5pgk3w2c.js → chunk-vdxg7e1y.js} +2 -2
- package/dist/chunk-vq513cxx.js +2 -0
- package/dist/chunk-vvq8xe3n.js +2 -0
- package/dist/{chunk-tre98h62.js → chunk-w3d98907.js} +2 -2
- package/dist/{chunk-p3x21vp7.js → chunk-w7t2cfgy.js} +42 -42
- package/dist/chunk-w8t31bn9.js +2 -0
- package/dist/chunk-x1kz4d7j.js +2 -0
- package/dist/chunk-xcsyqwxf.js +25 -0
- package/dist/{chunk-9p6efb17.js → chunk-xghcsg3f.js} +1 -1
- package/dist/chunk-xn9jrjzh.js +2 -0
- package/dist/{chunk-nrvwejdw.js → chunk-y1pcdeg9.js} +5 -5
- package/dist/{chunk-qffbkvfn.js → chunk-yx3dpdwc.js} +3 -3
- package/dist/{chunk-f9hrpwsw.js → chunk-z22zy22p.js} +2 -2
- package/dist/chunk-z97bwx8m.js +2 -0
- package/dist/{chunk-120ze5ms.js → chunk-zmg1peyg.js} +3 -3
- package/dist/{chunk-pxdww4rb.js → chunk-zp79zkkd.js} +2 -2
- package/dist/cli.js +20 -20
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/loops.js +19 -3
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.d.ts +12 -0
- package/dist/signal-processing.js +1 -1
- package/dist/ssg.js +6 -6
- package/package.json +5 -5
- package/dist/chunk-028ee6q5.js +0 -2
- package/dist/chunk-02ymqwmj.js +0 -2
- package/dist/chunk-0dcrd58z.js +0 -2
- package/dist/chunk-0f33ssaq.js +0 -2
- package/dist/chunk-17yfcd5s.js +0 -2
- package/dist/chunk-1pnp91wx.js +0 -2
- package/dist/chunk-23b0khvh.js +0 -3
- package/dist/chunk-2f17h17f.js +0 -2
- package/dist/chunk-4c183zem.js +0 -2
- package/dist/chunk-4ve8vsw5.js +0 -2
- package/dist/chunk-4yt8tg4j.js +0 -2
- package/dist/chunk-52gp2xxk.js +0 -2
- package/dist/chunk-5w1c7x22.js +0 -2
- package/dist/chunk-5zgrvj4b.js +0 -2
- package/dist/chunk-67kj14at.js +0 -2
- package/dist/chunk-6vzktvyw.js +0 -2
- package/dist/chunk-7a3g26kk.js +0 -2
- package/dist/chunk-7d2fab0z.js +0 -2
- package/dist/chunk-7dtpszqq.js +0 -2
- package/dist/chunk-7spxdz5k.js +0 -2
- package/dist/chunk-864qtx7y.js +0 -2
- package/dist/chunk-89jbdtgw.js +0 -3
- package/dist/chunk-96mm4q2g.js +0 -2
- package/dist/chunk-9szxxgv5.js +0 -2
- package/dist/chunk-9yxgdy4z.js +0 -42
- package/dist/chunk-a95r5nmq.js +0 -25
- package/dist/chunk-am246nf3.js +0 -2
- package/dist/chunk-avnhsjq0.js +0 -2
- package/dist/chunk-aw3meb8t.js +0 -2
- package/dist/chunk-b4fd2dtk.js +0 -2
- package/dist/chunk-b823zxq6.js +0 -3
- package/dist/chunk-bdg0fydw.js +0 -2
- package/dist/chunk-d6en3vz7.js +0 -2
- package/dist/chunk-dnw3knxq.js +0 -2
- package/dist/chunk-dpvxe52r.js +0 -2
- package/dist/chunk-e1fetwbr.js +0 -2
- package/dist/chunk-e44z03s5.js +0 -2
- package/dist/chunk-e4vpr36s.js +0 -2
- package/dist/chunk-f8dkq3ta.js +0 -2
- package/dist/chunk-fcn71bq1.js +0 -2
- package/dist/chunk-g2jmwh7p.js +0 -2
- package/dist/chunk-j0v970k3.js +0 -2
- package/dist/chunk-jk41jwsc.js +0 -2
- package/dist/chunk-k2pa44rf.js +0 -2
- package/dist/chunk-qq1k3364.js +0 -2
- package/dist/chunk-qxmyaajq.js +0 -2
- package/dist/chunk-sc7hszsx.js +0 -2
- package/dist/chunk-sf0wsq74.js +0 -2
- package/dist/chunk-shpc1ttk.js +0 -2
- package/dist/chunk-sj6mhjdq.js +0 -2
- package/dist/chunk-sqhmkvwd.js +0 -2
- package/dist/chunk-sw6p5176.js +0 -2
- package/dist/chunk-tb6vacgp.js +0 -2
- package/dist/chunk-we8ptx6w.js +0 -2
- package/dist/chunk-weqc0ssb.js +0 -2
- package/dist/chunk-wq712sw1.js +0 -2
- package/dist/chunk-wyq0c4wy.js +0 -2
- package/dist/chunk-wz6368p4.js +0 -2
- package/dist/chunk-yscr04dv.js +0 -2
- package/dist/chunk-z8j2sbnb.js +0 -2
- package/dist/chunk-z8p6tk5z.js +0 -2
- package/dist/chunk-zhf01af3.js +0 -3
- package/dist/chunk-zp9k5pha.js +0 -2
package/dist/pwa.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-
|
|
2
|
+
import{Ts,jt,vc,mu}from"./chunk-6sjtyd0k.js";import{Es,Jo,pu,fu,gu}from"./chunk-dgc1a3yt.js";import{hc,yc,bc,uu,du}from"./chunk-d09q93yf.js";import{ze,wn,Yo}from"./chunk-35ezh7de.js";import{hu,yu,bu,vu,$s,Gp}from"./chunk-5zhp87wv.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
|
|
3
|
+
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-jzjpyyw2.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
|
|
4
4
|
<html lang="en">
|
|
5
5
|
<head>
|
|
6
6
|
<meta charset="UTF-8">
|
|
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
|
|
|
233
233
|
}, 5000);
|
|
234
234
|
</script>
|
|
235
235
|
</body>
|
|
236
|
-
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=ze(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=
|
|
236
|
+
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=ze(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=Ts(n,t);if(a){let s=jt(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Jo(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,yc as auditBuildOutput,hc as auditConfig,re as buildPwaAssets,bc as calculateAuditResult,du as formatAuditResult,Yo as formatSize,j as generateManifest,_ as generateManifestJson,fu as generateManifestLink,F as generateOfflinePage,ze as generatePrecacheManifest,wn as generatePrecacheManifestJs,M as generatePwaIcons,Es as generatePwaTags,Ts as generateServiceWorker,mu as generateServiceWorkerAuto,pu as generateSwRegistrationScript,gu as generateThemeColorMeta,N as getExpectedIconPaths,jt as getServiceWorkerFileName,Jo as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,vc as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,$s as pwaDirectives,hu as pwaInstallDirective,bu as pwaOfflineDirective,vu as pwaPushDirective,yu as pwaUpdateDirective,Gp as registerPwaDirectives,uu as runPwaAudit,D as validateManifest};
|
|
@@ -42,6 +42,18 @@ export declare function parseLoopExpression(expr: string): ParsedLoopExpression;
|
|
|
42
42
|
* Remaining directives with reactive values are handled by the client runtime.
|
|
43
43
|
*/
|
|
44
44
|
export declare function hasSignalsSyntax(template: string, filePath?: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Collect the names of signals declared locally in a template's client `<script>`
|
|
47
|
+
* blocks — `const open = state(false)`, `let count = derived(...)`, etc. Used to
|
|
48
|
+
* decide whether an `@if`/`@elseif`/`@else` chain is driven by client signals (so
|
|
49
|
+
* it should become a reactive attribute chain) or by server/loop data (so it must
|
|
50
|
+
* stay a textual directive for `processConditionals` to evaluate server-side).
|
|
51
|
+
*
|
|
52
|
+
* Server-only loop variables (`@foreach(rows as b)` → `b.status`) are NOT declared
|
|
53
|
+
* via `state()`/etc., so they never land in this set — which is exactly why a
|
|
54
|
+
* server-loop `@if/@else` chain is left alone.
|
|
55
|
+
*/
|
|
56
|
+
export declare function extractClientSignalNames(template: string): Set<string>;
|
|
45
57
|
/**
|
|
46
58
|
* Convert @if(expr)...@endif directive blocks to attribute-style for signal templates.
|
|
47
59
|
*
|
|
@@ -101,7 +101,7 @@ function hasTopLevelElseBranch(content) {
|
|
|
101
101
|
}
|
|
102
102
|
return !1;
|
|
103
103
|
}
|
|
104
|
-
function extractClientSignalNames(template) {
|
|
104
|
+
export function extractClientSignalNames(template) {
|
|
105
105
|
const names = new Set, scriptRe = /<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi, declRe = /\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g;
|
|
106
106
|
let scriptMatch;
|
|
107
107
|
while ((scriptMatch = scriptRe.exec(template)) !== null) {
|
package/dist/ssg.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-md2jn67b.js";import"./chunk-
|
|
2
|
+
import"./chunk-md2jn67b.js";import"./chunk-bsajk82t.js";import"./chunk-zp79zkkd.js";import"./chunk-ce6zddpf.js";import"./chunk-f9zyf9n6.js";import"./chunk-25zmy8q6.js";import"./chunk-mwnhdsbp.js";import"./chunk-7adznted.js";import{wt,xt,St,kt,_t,Ct}from"./chunk-4s8zacxg.js";import{o}from"./chunk-srq9fqq8.js";import{Zr}from"./chunk-5qtthtg3.js";import"./chunk-am2w363p.js";import"./chunk-hz4x7h0n.js";import{Ce,Gt,Kt}from"./chunk-rv39s5az.js";import"./chunk-4b9s7wgy.js";import{h}from"./chunk-kdebh22m.js";import{gt,s}from"./chunk-aet1pgw7.js";import"./chunk-7j1zgrnf.js";import"./chunk-bkkpq8dx.js";import"./chunk-40tswfe7.js";import"./chunk-xcsyqwxf.js";import"./chunk-rr527jt6.js";import{Yi,Zi,Qi}from"./chunk-r7fdw2v5.js";import{qt,jn,Bn}from"./chunk-xaa36b0x.js";import"./chunk-v6peecfp.js";import{U,he}from"./chunk-twqzn21x.js";import"./chunk-hgry3mjd.js";import"./chunk-rym0309c.js";import{c}from"./chunk-v14rq8b4.js";import x from"fs";import g from"path";import{createHash as mt}from"crypto";function yt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var vt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function bt(t){return Bun.hash(t).toString(16)}function nt(t,n={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let i=new Map,r=t.replace(vt,(e,l,w,y)=>{let f=y.trim();if(!f)return e;if(/\bdata-stx-src=/.test(w))return e;if(n.minify)f=yt(f);let S=bt(f);if(!i.has(S))i.set(S,f);let P=n.integrity?` data-stx-integrity="sha384-${mt("sha384").update(f).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),a=Array.from(i,([e,l])=>({hash:e,code:l}));return{html:r,chunks:a}}var Pt=new Set(["visible","idle"]);function it(t){if(!t.includes("data-stx-src="))return t;let n=new Map,i=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,r;while((r=i.exec(t))!==null)n.set(r[1],r[2]);let a=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(Pt.has(n.get(l[1])||""))a.add(l[2]);let w=t.lastIndexOf("</head>");if(a.size===0||w===-1)return t;let y=Array.from(a).filter((f)=>!t.includes(`rel="prefetch" href="${f}"`)).map((f)=>`<link rel="prefetch" href="${f}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var $t=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function q(t){let n=t.trim();if(!n)return null;let i=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(i).origin+new URL(i).pathname.replace(/\/$/,"")}catch{return null}}function Dt(t){for(let n of $t){let i=t[n];if(!i)continue;let r=q(i);if(r)return{url:r,source:"env",via:n}}return null}function st(t){if(!t||typeof t!=="object")return null;let n=t,i=n.site?.url??n.url??n.app?.url;return typeof i==="string"?q(i):null}async function Rt(t){let{existsSync:n}=await import("fs"),i=await import("path");for(let r of["site.config.ts","site.config.js",".config/site.config.ts"]){let a=i.resolve(t,r);if(!n(a))continue;try{let e=await import(a),l=st(e.default??e);if(l)return l}catch{}}return null}async function at(t={}){let n=t.cwd??process.cwd(),i=t.env??process.env;if(t.explicit){let l=q(t.explicit);if(l)return{url:l,source:"option"}}let r=st(t.stxConfig);if(r)return{url:r,source:"stx.config",via:"site.url"};let a=await Rt(n);if(a)return{url:a,source:"site.config",via:"url"};let e=Dt(i);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ot(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
|
|
3
3
|
`)}class ct{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,n=""){this.cacheDir=t,this.salt=n}async load(){if(this.loaded)return;let t=g.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let n=JSON.parse(await Bun.file(t).text());for(let[i,r]of Object.entries(n))this.cache.set(i,r)}catch{}this.loaded=!0}async save(){await x.promises.mkdir(this.cacheDir,{recursive:!0});let t=g.join(this.cacheDir,"build-cache.json"),n={};for(let[i,r]of this.cache)n[i]=r;await Bun.write(t,JSON.stringify(n))}getHash(t,n){let i=x.statSync(t),r=`${this.salt}|${t}:${i.mtimeMs}`;for(let e of n)if(x.existsSync(e)){let l=x.statSync(e);r+=`:${e}:${l.mtimeMs}`}let a=0;for(let e=0;e<r.length;e++){let l=r.charCodeAt(e);a=(a<<5)-a+l,a=a&a}return Math.abs(a).toString(36)}get(t,n){let i=this.cache.get(t);if(!i)return null;let r=this.getHash(n,i.dependencies??[]);if(i.hash!==r)return this.cache.delete(t),null;return i.html}set(t,n,i,r){let a=this.getHash(n,i);this.cache.set(t,{hash:a,html:r,generatedAt:Date.now(),dependencies:i})}}class lt{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let n=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return g.join(this.cacheDir,"isr",n)}async get(t){let n=this.getFilePath(t);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(t,n){let i=this.getFilePath(t);await x.promises.mkdir(g.dirname(i),{recursive:!0}),await Bun.write(i,JSON.stringify(n))}async invalidate(t){let n=this.getFilePath(t);if(await Bun.file(n).exists())await x.promises.unlink(n)}async invalidatePattern(t){let n=g.join(this.cacheDir,"isr");if(!x.existsSync(n))return;let i=await x.promises.readdir(n);for(let r of i){let a=r.replace(/_/g,"/").replace(".json","");if(t.test(a))await x.promises.unlink(g.join(n,r))}}async needsRevalidation(t){let n=await this.get(t);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function Et(t){try{let i=(await Bun.file(t).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!i)return null;let r=i[1];if(!r.includes("getStaticPaths"))return null;let a=r.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!a)return null;return await Function(`
|
|
4
4
|
return (async function getStaticPaths() {
|
|
5
5
|
${a[1]}
|
|
@@ -11,7 +11,7 @@ import"./chunk-md2jn67b.js";import"./chunk-2dp7hyv7.js";import"./chunk-pxdww4rb.
|
|
|
11
11
|
`)(n)}catch(e){return console.error(`Error executing getStaticProps in ${i}:`,e),null}}function Ft(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function ut(t,n,i={},r,a){let e=await Bun.file(t.filePath).text(),l=await Bt(t.filePath),w=await jt(e,n,t.filePath),y={...l||{},...w||{},...i,params:n,$route:{path:t.pattern,params:n}},f=new Set,S=[],P=[],D={...a,...r.partialsDir?{partialsDir:r.partialsDir}:{},...r.componentsDir?{componentsDir:r.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(b)=>{S.push(`${g.relative(process.cwd(),b.templatePath)}: ${b.message}
|
|
12
12
|
resolved against partialsDir: ${b.partialsDir}`)},onServerScriptError:(b)=>{P.push(`${g.relative(process.cwd(),b.sourcePath)} (${b.kind}): ${b.message}`)}};if(Ft(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let p=await s(e,y,t.filePath,D,f);for(let b of[t.filePath,...f])for(let B of Ce(b))f.add(B);if(Object.keys(n).length>0){let b=`<script>if(window.stx)window.stx._rp=${JSON.stringify(n)};else window.__stx_rp=${JSON.stringify(n)};</script>`;if(p.includes("</head>"))p=p.replace("</head>",`${b}
|
|
13
13
|
</head>`);else p=`${b}
|
|
14
|
-
${p}`}if(p=await
|
|
14
|
+
${p}`}if(p=await he(p,{router:r.router}),p=await h(p),r.minify!==!1)return{html:Ot(p),dependencies:Array.from(f),includeFailures:S,serverScriptFailures:P};return{html:p,dependencies:Array.from(f),includeFailures:S,serverScriptFailures:P}}function Ot(t){let n=[],i=0,r=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,a;while((a=r.exec(t))!==null){let l=t.slice(i,a.index);n.push(l.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let w=a[1],y=a[2],f=a[3];y=y.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),n.push(w+y+f),i=a.index+a[0].length}let e=t.slice(i);return n.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),n.join("").trim()}function Tt(t){let n=0;for(let i=0;i<t.length;i++){let r=t.charCodeAt(i);n=(n<<5)-n+r,n=n&n}return`"${Math.abs(n).toString(36)}"`}function At(t,n,i,r){if(i?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(n))return!0;return r.some((a)=>{if(a instanceof RegExp)return a.test(t);return a.endsWith("/")?t===a.slice(0,-1)||t.startsWith(a):t===a})}function Lt(t,n){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
15
15
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
16
16
|
${t.map((r)=>{let a=new URL(r.loc,n).href,e=` <url>
|
|
17
17
|
<loc>${I(a)}</loc>`;if(r.lastmod)e+=`
|
|
@@ -41,7 +41,7 @@ ${t.map((r)=>{let a=new URL(r.loc,n).href,e=` <url>
|
|
|
41
41
|
${i.join(`
|
|
42
42
|
`)}
|
|
43
43
|
</channel>
|
|
44
|
-
</rss>`}async function Ut(t={}){let n=Date.now();Kt();let i=await o(process.cwd()),r=i.build||{},a=await at({explicit:t.domain||r.domain,stxConfig:i});if(a.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ot());let e={router:t.router??i?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:a.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||i?.partialsDir||"",componentsDir:t.componentsDir||i?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,f={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-
|
|
44
|
+
</rss>`}async function Ut(t={}){let n=Date.now();Kt();let i=await o(process.cwd()),r=i.build||{},a=await at({explicit:t.domain||r.domain,stxConfig:i});if(a.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ot());let e={router:t.router??i?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:a.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||i?.partialsDir||"",componentsDir:t.componentsDir||i?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,f={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-5s1ay9mv.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-k1b8x73j.js"),b=await p(e.publicDir,e.outputDir);if(b.count>0)console.log(`Optimized ${b.count} image(s) for responsive delivery`),D=[D,b.fingerprint].filter(Boolean).join(":");let B=new ct(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-5s1ay9mv.js");await u('<div class="bg-black"></div>')}catch{}wt();let dt=i?.routeMiddleware?.dir||"middleware";await St(process.cwd(),dt);let H=xt();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let pt=i?.routeMiddleware?.global||[];Qi(i?.layoutsDir,c(process.cwd()));let V=U(".",{pagesDir:e.pagesDir,pagesDirs:i?._layerPageDirs});console.log(`Found ${V.length} routes`);let G=[];for(let u of V){let m=await It(u);for(let v of m)G.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=G.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],K=[];for(let u=0;u<G.length;u+=e.concurrency)K.push(G.slice(u,u+e.concurrency));for(let u of K)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:L,props:ht,revalidate:Z}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Wt(j),ft=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],Q=[...pt,...ft];if(Q.length>0){let C=kt(d,L,F||{}),O=_t(C,null,void 0,{isServer:!0}),E=await Ct(Q,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,_=Jt(String(R),d),T=Vt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,_),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(_),cached:!1}),A.push({loc:d,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${d} \u2192 redirect to ${R}`);return}if(E.abort){let R=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${d} \u2014 middleware aborted: ${R}`);return}}let tt=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(tt)try{if(!await Function("route",`
|
|
45
45
|
const validate = ${tt[1]};
|
|
46
46
|
return validate(route);
|
|
47
47
|
`)({params:L})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,et=!1;if(e.cache){if(k=B.get(d,v.filePath),k)et=!0,l.cachedCount++}if(!k){let C=await ut(v,L,ht,e,i);if(k=C.html,e.failOnIncludeError&&C.includeFailures.length>0)throw Error(`${C.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
|
@@ -50,7 +50,7 @@ ${i.join(`
|
|
|
50
50
|
Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&C.serverScriptFailures.length>0)throw Error(`${C.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
|
|
51
51
|
${C.serverScriptFailures.join(`
|
|
52
52
|
`)}
|
|
53
|
-
Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)B.set(d,v.filePath,C.dependencies,k)}let M;if(e.trailingSlash)M=g.join(e.outputDir,d,"index.html");else M=d==="/"?g.join(e.outputDir,"index.html"):g.join(e.outputDir,`${d}.html`);if(e.chunkIslands){let{html:C,chunks:O}=nt(k,{integrity:e.integrityIslands,minify:e.minify});if(O.length>0){let E=g.join(e.outputDir,"_stx","islands");await x.promises.mkdir(E,{recursive:!0});for(let R of O){let
|
|
53
|
+
Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)B.set(d,v.filePath,C.dependencies,k)}let M;if(e.trailingSlash)M=g.join(e.outputDir,d,"index.html");else M=d==="/"?g.join(e.outputDir,"index.html"):g.join(e.outputDir,`${d}.html`);if(e.chunkIslands){let{html:C,chunks:O}=nt(k,{integrity:e.integrityIslands,minify:e.minify});if(O.length>0){let E=g.join(e.outputDir,"_stx","islands");await x.promises.mkdir(E,{recursive:!0});for(let R of O){let _=g.join(E,`${R.hash}.js`);if(!await Bun.file(_).exists())await Bun.write(_,R.code);if(!w.has(R.hash)){w.add(R.hash);let T=Buffer.byteLength(R.code,"utf8");y+=T,f[R.hash]={bytes:T,file:`/_stx/islands/${R.hash}.js`}}}if(S[d]=O.map((R)=>R.hash),k=C,e.prefetchIslands)k=it(k)}}if(await x.promises.mkdir(g.dirname(M),{recursive:!0}),await Bun.write(M,k),!At(d,k,F,e.sitemapExclude))A.push({loc:d,lastmod:new Date().toISOString().split("T")[0],priority:d==="/"?1:0.8});let rt={route:d,outputPath:M,size:Buffer.byteLength(k,"utf8"),cached:et};if(Z!==!1)rt.revalidateAt=Date.now()+Z*1000;l.pages.push(rt),l.successCount++,await e.hooks.onPageEnd?.(d,k)}catch(j){l.failedCount++,l.errors.push({route:d,error:j}),await e.hooks.onError?.(j,d),console.error(`Error generating ${d}:`,j)}}));let X=Gt();if(X.length>0){let u=X.map((m)=>`${m.filePath}: ${m.message}`).join(`
|
|
54
54
|
`);throw Error(`Client script bundling failed:
|
|
55
55
|
${u}`)}if(e.cache)await B.save();if(e.generate404){let u=g.join(e.pagesDir,"404.stx");if(await Bun.file(u).exists()){let m=new Set,v={...i,debug:!1,cache:!1},d=await s(await Bun.file(u).text(),{},u,v,m);await Bun.write(g.join(e.outputDir,"404.html"),d)}else await Bun.write(g.join(e.outputDir,"404.html"),`<!DOCTYPE html>
|
|
56
56
|
<html lang="en">
|
|
@@ -73,7 +73,7 @@ ${u}`)}if(e.cache)await B.save();if(e.generate404){let u=g.join(e.pagesDir,"404.
|
|
|
73
73
|
<a href="/">Go home</a>
|
|
74
74
|
</div>
|
|
75
75
|
</body>
|
|
76
|
-
</html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...i,debug:!1,cache:!1},L=await s(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),L)}}let
|
|
76
|
+
</html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...i,debug:!1,cache:!1},L=await s(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),L)}}let W=g.join(e.pagesDir,"error.stx");if(await Bun.file(W).exists()){let u=new Set,m={...i,debug:!1,cache:!1},v=await s(await Bun.file(W).text(),{},W,m,u);await Bun.write(g.join(e.outputDir,"error.html"),v)}if(e.sitemap&&A.length>0){let u=Lt(A,e.domain),m=g.join(e.outputDir,"sitemap.xml");await Bun.write(m,u),l.sitemapPath=m,console.log(`Generated sitemap.xml with ${A.length} URLs`)}if(e.robots!==!1){let u=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((d)=>typeof d==="string"),...u.disallow||[]],v=Zr({rules:[{userAgent:u.userAgent||"*",allow:u.allow||["/"],...m.length>0?{disallow:m}:{}}],...u.sitemap!==!1&&l.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(g.join(e.outputDir,"robots.txt"),v),console.log("Generated robots.txt")}if(e.rss){let u=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(u.getItems)m=await u.getItems();let v=Mt(u,m),d=g.join(e.outputDir,"rss.xml");await Bun.write(d,v),l.rssPath=d,console.log(`Generated rss.xml with ${m.length} items`)}let N=Yi(e.outputDir);if(N.assets>0)console.log(`Externalized ${N.assets} asset(s) from ${N.pages} page(s) (${(N.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let z=Zi(e.outputDir);if(z.assets>0)console.log(`Externalized ${z.assets} repeated asset(s) from ${z.pages} page(s) (${(z.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&x.existsSync(e.publicDir))await J(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let Y=Bn();if(Y)await J(Y,g.join(e.outputDir,jn)),console.log(`Copied assets from ${qt}`)}catch(D){throw await e.hooks.onError?.(D),D}if(l.buildTime=Date.now()-n,w.size>0){l.islandChunks={count:w.size,totalBytes:y};let D={generatedChunks:w.size,totalBytes:y,chunks:f,pages:S};await Bun.write(g.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(D,null,2))}await e.hooks.onBuildEnd?.(l);let P=l.islandChunks?`
|
|
77
77
|
Island chunks: ${l.islandChunks.count} (${(l.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
|
|
78
78
|
Build complete!
|
|
79
79
|
Total: ${l.totalPages} pages
|
|
@@ -81,7 +81,7 @@ Build complete!
|
|
|
81
81
|
Cached: ${l.cachedCount}
|
|
82
82
|
Failed: ${l.failedCount}
|
|
83
83
|
Time: ${l.buildTime}ms${P}
|
|
84
|
-
`),l}async function
|
|
84
|
+
`),l}async function J(t,n){await x.promises.mkdir(n,{recursive:!0});let i=await x.promises.readdir(t,{withFileTypes:!0});for(let r of i){let a=g.join(t,r.name),e=g.join(n,r.name);if(r.isDirectory())await x.promises.mkdir(e,{recursive:!0}),await J(a,e);else await x.promises.copyFile(a,e)}}function Nt(t={}){let n=t.cacheDir||c(process.cwd(),"ssg-cache"),i=new lt(n),r=t.revalidate||3600;return{async get(a){let e=await i.get(a);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(a).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${r}, stale-while-revalidate=${r*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(a){let l=U(".",{pagesDir:t.pagesDir||"pages"}).find((P)=>a.match(P.regex)!==null);if(!l){console.warn(`Route not found for revalidation: ${a}`);return}let w=a.match(l.regex),y={};if(w)l.params.forEach((P,D)=>{y[P]=w[D+1]});let f=await o(),{html:S}=await ut(l,y,{},t,f);await i.set(a,{html:S,generatedAt:Date.now(),revalidateAfter:Date.now()+r*1000,etag:Tt(S)}),console.log(`Revalidated: ${a}`)},async invalidate(a){if(typeof a==="string")await i.invalidate(a);else await i.invalidatePattern(a)}}}function zt(t){return async()=>({paths:await t(),fallback:!1})}function Ht(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let n=await Bun.file(t).text(),i=n.match(/^---\n([\s\S]*?)\n---/),r={},a=n;if(i){let f=i[1];a=n.slice(i[0].length).trim();for(let S of f.split(`
|
|
85
85
|
`)){let P=S.indexOf(":");if(P>0){let D=S.slice(0,P).trim(),p=S.slice(P+1).trim();if(p==="true")p=!0;else if(p==="false")p=!1;else if(/^\d+$/.test(p))p=parseInt(p,10);else if(/^\d+\.\d+$/.test(p))p=parseFloat(p);else if(p.startsWith("[")&&p.endsWith("]"))p=p.slice(1,-1).split(",").map((b)=>b.trim().replace(/^['"]|['"]$/g,""));r[D]=p}}}let e=a.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),l=[],w=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,y;while((y=w.exec(e))!==null){let f=parseInt(y[1],10),S=y[2],P=S.toLowerCase().replace(/[^a-z0-9]+/g,"-");l.push({id:P,text:S,level:f})}return{content:e,data:r,toc:l}}}}function Wt(t){return gt(t)}function Jt(t,n){return`<!DOCTYPE html>
|
|
86
86
|
<html>
|
|
87
87
|
<head>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.674",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -128,12 +128,12 @@
|
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@stacksjs/ts-css": "^0.3.11",
|
|
130
130
|
"@stacksjs/clapp": "^0.2.16",
|
|
131
|
-
"@stacksjs/desktop": "0.2.
|
|
132
|
-
"@stacksjs/sanitizer": "0.2.
|
|
131
|
+
"@stacksjs/desktop": "0.2.674",
|
|
132
|
+
"@stacksjs/sanitizer": "0.2.674",
|
|
133
133
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
134
|
-
"bun-plugin-stx": "0.2.
|
|
134
|
+
"bun-plugin-stx": "0.2.674",
|
|
135
135
|
"bunfig": "^0.15.21",
|
|
136
|
-
"stx-router": "0.2.
|
|
136
|
+
"stx-router": "0.2.674",
|
|
137
137
|
"ts-broadcasting": "^0.0.11",
|
|
138
138
|
"ts-images": "^0.2.22",
|
|
139
139
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-028ee6q5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{vo,wo,vt,ie,Zn,Zr,Qn,Qr,es,Pl,Il,Ol,er,Nl,Dl,Ml,Ll,xa,Sa,ka,xo,_a,jl,wt,xt,St,kt,_t,Ct,Ye,Bl}from"./chunk-365vg0eg.js";export{Qn as Router,Ml as abortNavigation,Zr as bracketPathToRegex,wt as clearMiddleware,Sa as createClientCookieManager,_t as createMiddlewareContext,kt as createRouteLocation,xa as createServerCookieManager,ka as createStorageManager,Ll as defineMiddleware,Il as defineRoute,Ol as defineRoutes,Qr as findErrorPage,es as formatRoutes,wo as generateRouteManifest,vo as generateRouteTypes,_a as getMiddleware,xt as getMiddlewareNames,Ye as getRouterScript,Bl as getRouterScriptDev,jl as hasMiddleware,vt as isFileRequestPath,St as loadMiddlewareFromDirectory,Zn as matchRoute,Dl as navigateTo,ie as patternToRegex,xo as registerMiddleware,Nl as resetRoutes,er as route,Ct as runMiddleware,Pl as setAppUrl};
|
package/dist/chunk-02ymqwmj.js
DELETED
package/dist/chunk-0dcrd58z.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Tu}from"./chunk-yqz01qvy.js";import"./chunk-mjm3tyfj.js";import"./chunk-8k3rwv8r.js";import"./chunk-prf164ct.js";import"./chunk-a95r5nmq.js";import"./chunk-1mj9crcg.js";import"./chunk-9yxgdy4z.js";import"./chunk-ka8befem.js";import"./chunk-sjcqxfq1.js";import"./chunk-wankp78x.js";import"./chunk-p472crv1.js";import"./chunk-6xe8rnfv.js";import"./chunk-9gfffs28.js";import"./chunk-a5zqqgx2.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Tu as startInteractive};
|
package/dist/chunk-0f33ssaq.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{El,gp,mp,hp,yp,Tl,$l,bp,vp,uo,wp,Xn,Jn,Wr}from"./chunk-6xe8rnfv.js";import{Ze}from"./chunk-2zzc7006.js";import"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{yp as __setSignalsGeneratorsForTest,Ze as cacheEngineFingerprint,Jn as cacheTemplate,Xn as checkCache,wp as clearDevCaches,$l as getCachedRouterScript,Tl as getCachedSignalsRuntime,bp as getServeClientAsset,uo as getServeModuleBundle,Wr as hashFilePath,mp as invalidateFileCache,hp as invalidateFileCacheByDir,gp as readFileCached,vp as registerServeModuleBundle,El as templateCache};
|
package/dist/chunk-17yfcd5s.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Pc,ki,Iu,Ic,Oc,Ou,Nu}from"./chunk-06b8btkv.js";import"./chunk-t961jbzc.js";import"./chunk-x68etmdg.js";import"./chunk-wz2zb53w.js";import"./chunk-md2jn67b.js";import"./chunk-sjcqxfq1.js";import"./chunk-wankp78x.js";import"./chunk-p472crv1.js";import"./chunk-9gfffs28.js";import"./chunk-a5zqqgx2.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import{$t,Fl}from"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Pc as buildVirtualSource,$t as extractScriptBlocks,Fl as extractTemplateExpressions,Ic as findRuntimeTypeDeclarations,Oc as findStxModuleDeclarations,Nu as formatTypecheckDiagnostics,Iu as sourcePathFor,Ou as typecheckStxFiles,ki as virtualPathFor};
|
package/dist/chunk-1pnp91wx.js
DELETED
package/dist/chunk-23b0khvh.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{p,u}from"./chunk-2dp7hyv7.js";import{be,ue,d}from"./chunk-kwek8xdt.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function B(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=k(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),c=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function Z(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let c=f[2].toLowerCase();if(f[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),m=i.length===0?a.match(r):null;if(m){let l=m[1]||m[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!g&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let c=f[1]==="/",g=f[2].toLowerCase();if(c){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function Lc(t){let o={default:"",named:new Map},i=t,r=L(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=Z(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Ju(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function jc(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,f=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[m,l]=g.split(":").map((S)=>S.trim()),h=l||m;if(s[h]=o[m],o[m]!==void 0)f.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else f.add(n);e=j(e,s,a,f)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(ue(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!ue(s,r))return e;let a=_(s,o);if(a===void 0)return e;return d(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return u(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Bc(t,o,i,r){let e=t;e=await I(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,f,c,g)=>{let m=o.named.get(f),l=g?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=be(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=d(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${d(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${m.content}</template>`}return await jc(m,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,f,c)=>{if(/\bname\s*=/.test(f||""))return a;let g=c?.trim()||"";return o.default||g}),e}async function I(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let c=f[f.length-2];return e.push({match:a,index:c}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+f.length)}return s}function Yu(t){let o=Lc(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Zu(t,o,i,r,e){return await Bc(t,{default:o,named:i},r,e)}
|
|
3
|
-
export{Lc,Ju,jc,Bc,Yu,Zu};
|
package/dist/chunk-2f17h17f.js
DELETED
package/dist/chunk-4c183zem.js
DELETED
package/dist/chunk-4ve8vsw5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Hi,Vi,Ui,Wi,tp}from"./chunk-3349573p.js";import"./chunk-t9yqq483.js";import"./chunk-yfvm7q6t.js";import"./chunk-mjm3tyfj.js";import"./chunk-8k3rwv8r.js";import"./chunk-prf164ct.js";import"./chunk-a95r5nmq.js";import"./chunk-1mj9crcg.js";import"./chunk-9yxgdy4z.js";import"./chunk-ka8befem.js";import"./chunk-sjcqxfq1.js";import"./chunk-wankp78x.js";import"./chunk-p472crv1.js";import"./chunk-6xe8rnfv.js";import"./chunk-9gfffs28.js";import"./chunk-a5zqqgx2.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Hi as buildNative,tp as default,Vi as findCraftBinary,Wi as getAvailableFormats,Ui as getAvailableTargets};
|
package/dist/chunk-4yt8tg4j.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Yo,Zo,Qo,vu,wu,xu,vc,Su,ku}from"./chunk-9p6efb17.js";export{Yo as ImageProcessorCache,vc as applyTransformations,vu as clearImageCache,Su as generateResponsiveVariants,ku as generateSrcset,Zo as getCachedImageResult,xu as optimizeImage,wu as processImage,Qo as setCachedImageResult};
|
package/dist/chunk-52gp2xxk.js
DELETED
package/dist/chunk-5w1c7x22.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{op,na,ip,ra,yl,bl,en,Wn,ap,vl,wl,cp,h}from"./chunk-8k3rwv8r.js";import"./chunk-6xe8rnfv.js";import"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{en as buildCss,vl as extractClassNames,bl as fingerprintConfig,wl as generateCss,ap as getCachedCSS,op as getCssServeAsset,h as injectCss,na as loadCssEngine,ra as loadCssEngineConfig,Wn as rebuildCss,ip as resetCssCache,yl as resolveUserCssConfig,cp as withLinkedModuleBundles};
|
package/dist/chunk-5zgrvj4b.js
DELETED
package/dist/chunk-67kj14at.js
DELETED
package/dist/chunk-6vzktvyw.js
DELETED
package/dist/chunk-7a3g26kk.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Mu}from"./chunk-5pgk3w2c.js";import"./chunk-7kk2m44a.js";import"./chunk-3y41efsf.js";import"./chunk-wz2zb53w.js";import"./chunk-mjm3tyfj.js";import"./chunk-8k3rwv8r.js";import"./chunk-prf164ct.js";import"./chunk-a95r5nmq.js";import"./chunk-1mj9crcg.js";import"./chunk-9yxgdy4z.js";import"./chunk-ka8befem.js";import"./chunk-sjcqxfq1.js";import"./chunk-wankp78x.js";import"./chunk-p472crv1.js";import"./chunk-6xe8rnfv.js";import"./chunk-9gfffs28.js";import"./chunk-a5zqqgx2.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Mu as buildForProduction};
|
package/dist/chunk-7d2fab0z.js
DELETED
package/dist/chunk-7dtpszqq.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{rd,Li,il,sd,od,id,ad,cd,al,cl,ld,ud,dd,pd}from"./chunk-kenbxxbn.js";import"./chunk-mjm3tyfj.js";import"./chunk-8k3rwv8r.js";import"./chunk-prf164ct.js";import"./chunk-a95r5nmq.js";import"./chunk-1mj9crcg.js";import"./chunk-9yxgdy4z.js";import"./chunk-ka8befem.js";import"./chunk-sjcqxfq1.js";import"./chunk-wankp78x.js";import"./chunk-p472crv1.js";import"./chunk-6xe8rnfv.js";import"./chunk-9gfffs28.js";import"./chunk-a5zqqgx2.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{il as SUSPENSE_RESOLVER_RUNTIME,Li as buildSuspenseResolveScript,cd as createStreamRenderer,id as extractStreamBoundaries,pd as generateHydrationRuntime,cl as islandDirective,ud as processSectionDirectives,od as processStreamDirectives,ld as registerStreamingDirectives,sd as renderStreamingPage,rd as streamTemplate,ad as streamTemplateSimple,dd as streamToResponse,al as streamingSuspenseDirective};
|
package/dist/chunk-7spxdz5k.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{kl,Br}from"./chunk-9yxgdy4z.js";import"./chunk-ka8befem.js";import"./chunk-p472crv1.js";import{ar}from"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import{tt}from"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{tt as freeIdentifiers,Br as processComponents,kl as processESImports,ar as rendersAsElement};
|
package/dist/chunk-864qtx7y.js
DELETED
package/dist/chunk-89jbdtgw.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Z}from"./chunk-b823zxq6.js";import R from"fs";import g from"path";import C from"crypto";var S=new Set(["webp","avif","jpeg","png"]),T=new Set(["cover","contain","fill","inside","outside"]),q=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),k=4096,D=80,U="cover";async function Ii(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=A(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=R.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await R.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=C.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":Z(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await L(),F=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,F),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(F),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function Mc(e){return async(t)=>await Ii(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function A(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!q.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??k,l=t.maxHeight??k,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!S.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...S].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??D;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||U;if(!T.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...T].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function L(){return await import("./chunk-e4vpr36s.js")}
|
|
3
|
-
export{Ii,Mc};
|
package/dist/chunk-96mm4q2g.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{un,zl,Hl,Vl,Ul,Wl,g,ql,Po,Gl,Va,Ua}from"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{un as STX_ENGINE_BINDING_NAMES,Po as convertToCommonJS,Va as extractScriptFromTemplate,g as extractVariables,Ua as hasVariables,ql as isCompleteImport,Wl as isMissingBindingFailure,Vl as isModuleResolutionFailure,Ul as isSyntaxFailure,Gl as splitDeclaration,zl as stripTypeScript,Hl as withoutStxReferrer};
|
package/dist/chunk-9szxxgv5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Wc,qc,Gc,Kc,Xc,Jc,Yc,Zc,Qc,el,ed}from"./chunk-n38yb274.js";export{Wc as createIslandRegistry,ed as default,el as generateIslandManifest,Gc as generatePartialHydrationCSS,Jc as hydrateAll,Xc as hydrateByStrategy,Kc as hydrateIsland,Yc as isHydrated,Zc as onHydrated,qc as processPartialHydrationDirectives,Qc as processStaticDirectives};
|