@stacksjs/stx 0.2.466 → 0.2.468
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-2jbyks2t.js → chunk-01nx6zcw.js} +2 -2
- package/dist/{chunk-v3yqeh15.js → chunk-04qmr675.js} +2 -2
- package/dist/chunk-07mksefx.js +2 -0
- package/dist/chunk-129ernx4.js +2 -0
- package/dist/{chunk-f9c58ag8.js → chunk-151d1av1.js} +5 -5
- package/dist/{chunk-k9sbgax8.js → chunk-2542vq5p.js} +1 -1
- package/dist/{chunk-e15a8txv.js → chunk-27kb6nrb.js} +2 -2
- package/dist/{chunk-z80d9dd2.js → chunk-28s5x7wv.js} +2 -2
- package/dist/chunk-29pn79t5.js +3 -0
- package/dist/{chunk-5j5msbks.js → chunk-2gmbxp60.js} +3 -3
- package/dist/chunk-2njt4vbe.js +2 -0
- package/dist/{chunk-kax708d4.js → chunk-2swdrsrq.js} +2 -2
- package/dist/{chunk-tpvc8xnk.js → chunk-33gkx5z1.js} +7 -7
- package/dist/{chunk-d3mpxr3s.js → chunk-33h9ggbz.js} +4 -4
- package/dist/{chunk-bddjx2a2.js → chunk-3fjpg8kb.js} +3 -3
- package/dist/chunk-3gbjppvg.js +2 -0
- package/dist/{chunk-9fr19qe4.js → chunk-3pv6f998.js} +2 -2
- package/dist/chunk-3w22gpa9.js +2 -0
- package/dist/chunk-3ztpcnga.js +2 -0
- package/dist/chunk-4aw47rmg.js +2 -0
- package/dist/{chunk-90drf2ag.js → chunk-4ebwk9cw.js} +2 -2
- package/dist/chunk-50vq8k55.js +2 -0
- package/dist/chunk-549wm9qp.js +2 -0
- package/dist/chunk-5jak1hxp.js +2 -0
- package/dist/{chunk-bnemhyg2.js → chunk-5rvbpmzc.js} +3 -3
- package/dist/chunk-5sb7gw66.js +2 -0
- package/dist/{chunk-9pt8fd2n.js → chunk-5t5ahhjp.js} +3 -3
- package/dist/{chunk-a8q8m5pp.js → chunk-5x9ftmve.js} +2 -2
- package/dist/chunk-5y4qxmaw.js +2 -0
- package/dist/{chunk-pbh4smw3.js → chunk-7ejq9n1v.js} +4 -4
- package/dist/{chunk-r80km6mn.js → chunk-7grtpdw5.js} +2 -2
- package/dist/chunk-7mh0fnrq.js +2 -0
- package/dist/chunk-7ppykfx2.js +2 -0
- package/dist/{chunk-14vnnx44.js → chunk-80hpdc22.js} +2 -2
- package/dist/chunk-81nqrcn0.js +4 -0
- package/dist/chunk-82nw3942.js +2 -0
- package/dist/{chunk-d2zw2e5m.js → chunk-8adstrk5.js} +3 -3
- package/dist/chunk-8h2adg8c.js +2 -0
- package/dist/{chunk-ebp212na.js → chunk-8h8pf1cj.js} +5 -5
- package/dist/chunk-8mxjd1ge.js +2 -0
- package/dist/{chunk-0v5dpk7r.js → chunk-8rx2v7zj.js} +1 -1
- package/dist/chunk-8scw1bes.js +4 -0
- package/dist/{chunk-wfqnxb38.js → chunk-8xcg2dqy.js} +2 -2
- package/dist/{chunk-zydg3wgt.js → chunk-99kt56fn.js} +2 -2
- package/dist/chunk-9h1kq4hv.js +2 -0
- package/dist/chunk-9kzk7zyy.js +2 -0
- package/dist/chunk-9rpw3gqx.js +2 -0
- package/dist/{chunk-hra6t4ch.js → chunk-a0jyh65n.js} +5 -5
- package/dist/chunk-a6s6hvcd.js +2 -0
- package/dist/{chunk-ynvce0q6.js → chunk-ab7vh24b.js} +5 -5
- package/dist/{chunk-cmej3vrr.js → chunk-ah4qyrnn.js} +1 -1
- package/dist/{chunk-m08fk6ds.js → chunk-ak95401g.js} +4 -4
- package/dist/chunk-awsg50kd.js +2 -0
- package/dist/chunk-ax1xbz1k.js +2 -0
- package/dist/{chunk-ptek61ts.js → chunk-bqx3dqv1.js} +1 -1
- package/dist/{chunk-qxre7vw6.js → chunk-bvhr055w.js} +2 -2
- package/dist/chunk-bw0gkfb3.js +2 -0
- package/dist/{chunk-zr2trjex.js → chunk-c9fj7t9b.js} +1 -1
- package/dist/{chunk-fh1qrp68.js → chunk-cgf2a166.js} +5 -5
- package/dist/chunk-cjb46akr.js +2 -0
- package/dist/{chunk-na5evt2b.js → chunk-cnxf8e5p.js} +2 -2
- package/dist/{chunk-01zwbzyw.js → chunk-cwzkq9bs.js} +6 -6
- package/dist/{chunk-2cqymwe8.js → chunk-cxbp2m66.js} +4 -4
- package/dist/chunk-db2sy0f3.js +2 -0
- package/dist/chunk-dts9z53c.js +2 -0
- package/dist/chunk-eev60q15.js +2 -0
- package/dist/chunk-fe5xht52.js +2 -0
- package/dist/chunk-fqhewm3t.js +2 -0
- package/dist/chunk-g1562mcs.js +2 -0
- package/dist/chunk-g3xgcnh4.js +2 -0
- package/dist/chunk-g4dmjede.js +15 -0
- package/dist/{chunk-ars3cbs5.js → chunk-ggde5cqk.js} +34 -34
- package/dist/{chunk-rgwvqmhh.js → chunk-gkj42zq7.js} +2 -2
- package/dist/{chunk-sz1s3k89.js → chunk-gxbd7pwn.js} +3 -3
- package/dist/chunk-hgcvtfnz.js +2 -0
- package/dist/{chunk-v6qxmac5.js → chunk-hhy33p5v.js} +6 -6
- package/dist/{chunk-f4c39nfh.js → chunk-j2zgh5yk.js} +2 -2
- package/dist/chunk-j338fs8k.js +2 -0
- package/dist/{chunk-0trfbqa7.js → chunk-j4afmryj.js} +4 -4
- package/dist/{chunk-812sn7d5.js → chunk-jjebxeee.js} +5 -5
- package/dist/{chunk-t1py7rbg.js → chunk-k4shjm8n.js} +5 -5
- package/dist/chunk-k84qkm21.js +2 -0
- package/dist/chunk-kk5cyjfs.js +3 -0
- package/dist/{chunk-vg7wfkt5.js → chunk-kp5tv8jx.js} +2 -2
- package/dist/chunk-kyd15xqj.js +2 -0
- package/dist/chunk-m5asyydz.js +2 -0
- package/dist/chunk-m5dgc757.js +2 -0
- package/dist/chunk-m6cfxjyy.js +2 -0
- package/dist/chunk-m8w4hve0.js +2 -0
- package/dist/chunk-mmh37ywa.js +2 -0
- package/dist/{chunk-eanwntq4.js → chunk-mqdnfn4h.js} +3 -3
- package/dist/chunk-ms5aj58v.js +2 -0
- package/dist/chunk-n454sydr.js +2 -0
- package/dist/{chunk-y63bv55f.js → chunk-n8y0hp9b.js} +2 -2
- package/dist/chunk-nskfyvbv.js +2 -0
- package/dist/{chunk-jz7pvh7b.js → chunk-pcq6vphz.js} +2 -2
- package/dist/chunk-pt566gqb.js +2 -0
- package/dist/chunk-q0w6a9hv.js +2 -0
- package/dist/chunk-q9yhnqe5.js +2 -0
- package/dist/chunk-qtsymvxx.js +2 -0
- package/dist/chunk-rkzvmk04.js +2 -0
- package/dist/chunk-rx6a75yf.js +2 -0
- package/dist/{chunk-y36av1ac.js → chunk-s10r6hxp.js} +7 -7
- package/dist/{chunk-pyqh70k2.js → chunk-s23ka56m.js} +10 -10
- package/dist/{chunk-zasd9166.js → chunk-sarr8kz1.js} +6 -6
- package/dist/chunk-se4b8sjc.js +2 -0
- package/dist/{chunk-1k01h1zb.js → chunk-se55qe2x.js} +1 -1
- package/dist/{chunk-0adxpd3e.js → chunk-ss7wapbh.js} +246 -245
- package/dist/chunk-st1s30tn.js +2 -0
- package/dist/chunk-t4rgn046.js +2 -0
- package/dist/{chunk-t2hkwjvd.js → chunk-t794av8e.js} +2 -2
- package/dist/{chunk-2tn3dkcy.js → chunk-t7s0pdtw.js} +3 -3
- package/dist/{chunk-v83bpj84.js → chunk-tbef3yyk.js} +4 -4
- package/dist/{chunk-8bpyr4az.js → chunk-tdsajnjm.js} +3 -3
- package/dist/{chunk-ery19t9s.js → chunk-tr25zcf1.js} +9 -9
- package/dist/chunk-tr3e1qzf.js +2 -0
- package/dist/{chunk-amd6ey3t.js → chunk-v5rgebzz.js} +5 -5
- package/dist/chunk-v7ahbhbd.js +2 -0
- package/dist/chunk-vr4t7exr.js +2 -0
- package/dist/{chunk-2bdthb37.js → chunk-vvs75dse.js} +2 -2
- package/dist/chunk-w0vrmvh7.js +2 -0
- package/dist/{chunk-7h57dt0z.js → chunk-w6n2j62h.js} +3 -3
- package/dist/{chunk-2n5pjbw9.js → chunk-wkc34drs.js} +2 -2
- package/dist/{chunk-88px183j.js → chunk-x0mc2kv0.js} +4 -4
- package/dist/{chunk-8efg91ak.js → chunk-xnjcmhs5.js} +2 -2
- package/dist/chunk-yed9c66h.js +2 -0
- package/dist/{chunk-rdp06c4s.js → chunk-ykqq6cw0.js} +11 -11
- package/dist/chunk-zb5p05v4.js +2 -0
- package/dist/{chunk-544e2jvd.js → chunk-zkg0rbmp.js} +6 -6
- package/dist/{chunk-1sdtg9np.js → chunk-zpcxx4pp.js} +2 -2
- package/dist/cli.js +19 -19
- package/dist/client-module-registry.js +6 -3
- package/dist/client-script-bundler.d.ts +10 -0
- package/dist/client-script-bundler.js +3 -3
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +3 -3
- package/dist/theme-tokens.d.ts +83 -0
- package/dist/theme-tokens.js +57 -0
- package/dist/ts-css-config.js +6 -2
- package/package.json +5 -5
- package/dist/chunk-02e24cym.js +0 -2
- package/dist/chunk-1mfggkga.js +0 -2
- package/dist/chunk-1rbabtw0.js +0 -2
- package/dist/chunk-22972c8b.js +0 -2
- package/dist/chunk-24xhcqt9.js +0 -2
- package/dist/chunk-2hddf9pn.js +0 -2
- package/dist/chunk-3ar8gdyd.js +0 -2
- package/dist/chunk-3q2z7cts.js +0 -2
- package/dist/chunk-45ffx66n.js +0 -2
- package/dist/chunk-4qv9me8f.js +0 -2
- package/dist/chunk-4rnncksa.js +0 -2
- package/dist/chunk-5127n7rc.js +0 -2
- package/dist/chunk-5564cka1.js +0 -2
- package/dist/chunk-58n62bxb.js +0 -3
- package/dist/chunk-5xsd1dw1.js +0 -2
- package/dist/chunk-6876vczs.js +0 -2
- package/dist/chunk-6qsvh58v.js +0 -2
- package/dist/chunk-6xd9qbve.js +0 -2
- package/dist/chunk-7fjatz47.js +0 -2
- package/dist/chunk-7j1cpa9d.js +0 -2
- package/dist/chunk-7tt84v1y.js +0 -3
- package/dist/chunk-8bsz3ky4.js +0 -2
- package/dist/chunk-9zx4p42m.js +0 -2
- package/dist/chunk-a32kqsff.js +0 -2
- package/dist/chunk-cfk3skk4.js +0 -2
- package/dist/chunk-d78wbjkz.js +0 -2
- package/dist/chunk-fads0sap.js +0 -4
- package/dist/chunk-fmtyrdgg.js +0 -2
- package/dist/chunk-gmccacxc.js +0 -2
- package/dist/chunk-h074e6w3.js +0 -2
- package/dist/chunk-h6ayvmaj.js +0 -2
- package/dist/chunk-ha5z623e.js +0 -2
- package/dist/chunk-hqzq3a61.js +0 -2
- package/dist/chunk-hvx3pc13.js +0 -2
- package/dist/chunk-j9aberz0.js +0 -2
- package/dist/chunk-j9qcrwbg.js +0 -2
- package/dist/chunk-jkf5k215.js +0 -17
- package/dist/chunk-jmabeqfq.js +0 -2
- package/dist/chunk-k2vcwa7m.js +0 -2
- package/dist/chunk-k8smv0at.js +0 -2
- package/dist/chunk-kca543an.js +0 -2
- package/dist/chunk-kkrmhb5b.js +0 -2
- package/dist/chunk-mdkj4jj1.js +0 -2
- package/dist/chunk-mhfwdyeg.js +0 -2
- package/dist/chunk-n39zm07w.js +0 -2
- package/dist/chunk-pbfwbtg4.js +0 -2
- package/dist/chunk-q7bs39wj.js +0 -2
- package/dist/chunk-q7qchkvk.js +0 -2
- package/dist/chunk-qyq7j8hp.js +0 -2
- package/dist/chunk-rx3rxfrj.js +0 -2
- package/dist/chunk-tejeej39.js +0 -2
- package/dist/chunk-vcjfwjr8.js +0 -2
- package/dist/chunk-w7m1w5qt.js +0 -2
- package/dist/chunk-wsftz3vj.js +0 -2
- package/dist/chunk-wx25t40k.js +0 -2
- package/dist/chunk-xjb0yzvq.js +0 -2
- package/dist/chunk-xk3wf5sh.js +0 -2
- package/dist/chunk-xk5972g0.js +0 -2
- package/dist/chunk-xq4x3cy0.js +0 -2
- package/dist/chunk-ydjfar14.js +0 -2
- package/dist/chunk-ymk7eswy.js +0 -2
- package/dist/chunk-z990jtmx.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{In,De,Mo,Na}from"./chunk-33h9ggbz.js";import{Pn,zr,Da,Oa,Ma}from"./chunk-33gkx5z1.js";import{Io,Do,Oo,Pa,Ia}from"./chunk-04qmr675.js";import{oe,ft,Hr}from"./chunk-kp5tv8jx.js";import{Bc,Fc,zc,Hc,dr,id}from"./chunk-27kb6nrb.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-129ernx4.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=oe(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=oe(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=In(n,t);if(a){let s=De(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 zr(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,Do as auditBuildOutput,Io as auditConfig,re as buildPwaAssets,Oo as calculateAuditResult,Ia as formatAuditResult,Hr as formatSize,j as generateManifest,_ as generateManifestJson,Oa as generateManifestLink,F as generateOfflinePage,oe as generatePrecacheManifest,ft as generatePrecacheManifestJs,M as generatePwaIcons,Pn as generatePwaTags,In as generateServiceWorker,Na as generateServiceWorkerAuto,Da as generateSwRegistrationScript,Ma as generateThemeColorMeta,N as getExpectedIconPaths,De as getServiceWorkerFileName,zr as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,Mo as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,dr as pwaDirectives,Bc as pwaInstallDirective,zc as pwaOfflineDirective,Hc as pwaPushDirective,Fc as pwaUpdateDirective,id as registerPwaDirectives,Pa as runPwaAudit,D as validateManifest};
|
package/dist/ssg.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-8scw1bes.js";import"./chunk-ab7vh24b.js";import"./chunk-wkc34drs.js";import{Qe,et,tt,nt,rt,st}from"./chunk-x0mc2kv0.js";import"./chunk-01nx6zcw.js";import"./chunk-pf0d8y9n.js";import{f,je,N,K,n,o}from"./chunk-ss7wapbh.js";import"./chunk-tbef3yyk.js";import{er}from"./chunk-s10r6hxp.js";import"./chunk-99kt56fn.js";import"./chunk-8xcg2dqy.js";import"./chunk-pcq6vphz.js";import"./chunk-j4afmryj.js";import"./chunk-a0jyh65n.js";import{ie,gt,mt}from"./chunk-g4dmjede.js";import{Ro,Ao,Po}from"./chunk-2gmbxp60.js";import{pt,Gt,Jt}from"./chunk-5pjsc9zv.js";import"./chunk-8adstrk5.js";import{a}from"./chunk-kk5cyjfs.js";import x from"fs";import g from"path";import{createHash as $t}from"crypto";function Dt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Rt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function kt(t){return Bun.hash(t).toString(16)}function lt(t,i={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,r=t.replace(Rt,(e,l,w,y)=>{let h=y.trim();if(!h)return e;if(/\bdata-stx-src=/.test(w))return e;if(i.minify)h=Dt(h);let S=kt(h);if(!s.has(S))s.set(S,h);let P=i.integrity?` data-stx-integrity="sha384-${$t("sha384").update(h).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),c=Array.from(s,([e,l])=>({hash:e,code:l}));return{html:r,chunks:c}}var Ct=new Set(["visible","idle"]);function ut(t){if(!t.includes("data-stx-src="))return t;let i=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,r;while((r=s.exec(t))!==null)i.set(r[1],r[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(Ct.has(i.get(l[1])||""))c.add(l[2]);let w=t.lastIndexOf("</head>");if(c.size===0||w===-1)return t;let y=Array.from(c).filter((h)=>!t.includes(`rel="prefetch" href="${h}"`)).map((h)=>`<link rel="prefetch" href="${h}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var Et=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function q(t){let i=t.trim();if(!i)return null;let s=/^https?:\/\//i.test(i)?i:`https://${i}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function It(t){for(let i of Et){let s=t[i];if(!s)continue;let r=q(s);if(r)return{url:r,source:"env",via:i}}return null}function dt(t){if(!t||typeof t!=="object")return null;let i=t,s=i.site?.url??i.url??i.app?.url;return typeof s==="string"?q(s):null}async function Bt(t){let{existsSync:i}=await import("fs"),s=await import("path");for(let r of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,r);if(!i(c))continue;try{let e=await import(c),l=dt(e.default??e);if(l)return l}catch{}}return null}async function ht(t={}){let i=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let l=q(t.explicit);if(l)return{url:l,source:"option"}}let r=dt(t.stxConfig);if(r)return{url:r,source:"stx.config",via:"site.url"};let c=await Bt(i);if(c)return{url:c,source:"site.config",via:"url"};let e=It(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ft(){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 wt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,i=""){this.cacheDir=t,this.salt=i}async load(){if(this.loaded)return;let t=g.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let i=JSON.parse(await Bun.file(t).text());for(let[s,r]of Object.entries(i))this.cache.set(s,r)}catch{}this.loaded=!0}async save(){await x.promises.mkdir(this.cacheDir,{recursive:!0});let t=g.join(this.cacheDir,"build-cache.json"),i={};for(let[s,r]of this.cache)i[s]=r;await Bun.write(t,JSON.stringify(i))}getHash(t,i){let s=x.statSync(t),r=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of i)if(x.existsSync(e)){let l=x.statSync(e);r+=`:${e}:${l.mtimeMs}`}let c=0;for(let e=0;e<r.length;e++){let l=r.charCodeAt(e);c=(c<<5)-c+l,c=c&c}return Math.abs(c).toString(36)}get(t,i){let s=this.cache.get(t);if(!s)return null;let r=this.getHash(i,s.dependencies??[]);if(s.hash!==r)return this.cache.delete(t),null;return s.html}set(t,i,s,r){let c=this.getHash(i,s);this.cache.set(t,{hash:c,html:r,generatedAt:Date.now(),dependencies:s})}}class yt{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let i=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return g.join(this.cacheDir,"isr",i)}async get(t){let i=this.getFilePath(t);if(!await Bun.file(i).exists())return null;try{return JSON.parse(await Bun.file(i).text())}catch{return null}}async set(t,i){let s=this.getFilePath(t);await x.promises.mkdir(g.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(i))}async invalidate(t){let i=this.getFilePath(t);if(await Bun.file(i).exists())await x.promises.unlink(i)}async invalidatePattern(t){let i=g.join(this.cacheDir,"isr");if(!x.existsSync(i))return;let s=await x.promises.readdir(i);for(let r of s){let c=r.replace(/_/g,"/").replace(".json","");if(t.test(c))await x.promises.unlink(g.join(i,r))}}async needsRevalidation(t){let i=await this.get(t);if(!i)return!0;return Date.now()>i.revalidateAfter}}async function jt(t){try{let s=(await Bun.file(t).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!s)return null;let r=s[1];if(!r.includes("getStaticPaths"))return null;let c=r.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!c)return null;return await Function(`
|
|
4
4
|
return (async function getStaticPaths() {
|
|
5
5
|
${c[1]}
|
|
@@ -41,7 +41,7 @@ ${t.map((r)=>{let c=new URL(r.loc,i).href,e=` <url>
|
|
|
41
41
|
${s.join(`
|
|
42
42
|
`)}
|
|
43
43
|
</channel>
|
|
44
|
-
</rss>`}async function zt(t={}){let i=Date.now();mt();let s=await o(process.cwd()),r=s.build||{},c=await ht({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ft());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.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||a(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||s?.partialsDir||"",componentsDir:t.componentsDir||s?.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,h={},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 zt(t={}){let i=Date.now();mt();let s=await o(process.cwd()),r=s.build||{},c=await ht({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ft());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.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||a(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||s?.partialsDir||"",componentsDir:t.componentsDir||s?.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,h={},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-awsg50kd.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-t4rgn046.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 wt(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-awsg50kd.js");await u('<div class="bg-black"></div>')}catch{}Qe();let xt=s?.routeMiddleware?.dir||"middleware";await tt(process.cwd(),xt);let H=et();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let vt=s?.routeMiddleware?.global||[];Po(s?.layoutsDir,a(process.cwd()));let V=N(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${V.length} routes`);let _=[];for(let u of V){let m=await Ft(u);for(let v of m)_.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=_.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],X=[];for(let u=0;u<_.length;u+=e.concurrency)X.push(_.slice(u,u+e.concurrency));for(let u of X)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:L,props:bt,revalidate:Q}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Vt(j),Pt=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],it=[...vt,...Pt];if(it.length>0){let C=nt(d,L,F||{}),O=rt(C,null,void 0,{isServer:!0}),E=await st(it,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,U=Kt(String(R),d),T=Xt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,U),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(U),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 at=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(at)try{if(!await Function("route",`
|
|
45
45
|
const validate = ${at[1]};
|
|
46
46
|
return validate(route);
|
|
47
47
|
`)({params:L})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,ot=!1;if(e.cache){if(k=B.get(d,v.filePath),k)ot=!0,l.cachedCount++}if(!k){let C=await St(v,L,bt,e,s);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:
|
|
@@ -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={...s,debug:!1,cache:!1},L=await n(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={...s,debug:!1,cache:!1},v=await n(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=_t(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=
|
|
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={...s,debug:!1,cache:!1},L=await n(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={...s,debug:!1,cache:!1},v=await n(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=_t(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=er({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=Nt(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 G=Ro(e.outputDir);if(G.assets>0)console.log(`Externalized ${G.assets} asset(s) from ${G.pages} page(s) (${(G.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let z=Ao(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 Z=Jt();if(Z)await J(Z,g.join(e.outputDir,Gt)),console.log(`Copied assets from ${pt}`)}catch(D){throw await e.hooks.onError?.(D),D}if(l.buildTime=Date.now()-i,w.size>0){l.islandChunks={count:w.size,totalBytes:y};let D={generatedChunks:w.size,totalBytes:y,chunks:h,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
|
package/dist/theme-tokens.d.ts
CHANGED
|
@@ -144,4 +144,87 @@ export declare function shapeRadii(): Record<string, string>;
|
|
|
144
144
|
export declare function shapeTokenCSS(): string;
|
|
145
145
|
/** Every variable a shape role reads, for documentation and tooling. */
|
|
146
146
|
export declare function shapeTokenNames(): string[];
|
|
147
|
+
/**
|
|
148
|
+
* Density roles — how much room a control or a table cell takes.
|
|
149
|
+
*
|
|
150
|
+
* The last thing an app could not move without a visual change. Colour and
|
|
151
|
+
* corners became roles, but a text field still carried `px-4 py-2 text-base`
|
|
152
|
+
* and a table cell `px-6 py-4 text-sm`, and `className` is no escape hatch for
|
|
153
|
+
* either for the reason it was not one for a colour: `py-2` and `py-1.5` are
|
|
154
|
+
* single-class selectors of equal specificity, so the winner is whichever the
|
|
155
|
+
* engine happened to emit later — not something a call site controls
|
|
156
|
+
* (stacksjs/stx#1993).
|
|
157
|
+
*
|
|
158
|
+
* Each token is a CSS variable whose fallback is the value the library already
|
|
159
|
+
* used, so nothing moves until an app sets one.
|
|
160
|
+
*
|
|
161
|
+
* ## Why `px-control-x` and not `px-control`
|
|
162
|
+
*
|
|
163
|
+
* `px-*` and `py-*` both read `theme.spacing`, so one spacing name can only
|
|
164
|
+
* ever resolve to one value: `px-control` and `py-control` would be the SAME
|
|
165
|
+
* length. Inline and block padding are different decisions (a field is 1rem
|
|
166
|
+
* across and 0.5rem down), so each gets its own spacing name, and the name
|
|
167
|
+
* says which axis it is for.
|
|
168
|
+
*
|
|
169
|
+
* ## Why the line-height is a token too
|
|
170
|
+
*
|
|
171
|
+
* A control's height is its block padding twice plus its line-height — there
|
|
172
|
+
* is no `h-*` to fight (#1993) — so a font-size token without a line-height
|
|
173
|
+
* one could shrink the text and leave the box exactly as tall.
|
|
174
|
+
*
|
|
175
|
+
* ## One inline padding for a whole table
|
|
176
|
+
*
|
|
177
|
+
* Header and body cells share `--stx-cell-px`: a column is aligned only if its
|
|
178
|
+
* header and its cells start at the same inset, so there is nothing for a
|
|
179
|
+
* second inline token to decide except misalignment. The block padding and
|
|
180
|
+
* the type do differ — a header row is `py-3 text-xs`, a body row
|
|
181
|
+
* `py-4 text-sm` — so those have a header token each.
|
|
182
|
+
*/
|
|
183
|
+
export declare const DENSITY_TOKENS: Record<string, {
|
|
184
|
+
value: string;
|
|
185
|
+
description: string;
|
|
186
|
+
}>;
|
|
187
|
+
/**
|
|
188
|
+
* The `theme.spacing` names, each backed by one density token.
|
|
189
|
+
*
|
|
190
|
+
* `px-control-x`, `py-control-y`, `px-cell-x`, `py-cell-y`, `py-cell-head-y` —
|
|
191
|
+
* and, because they are ordinary spacing, `pl-control-x` and the rest too.
|
|
192
|
+
*/
|
|
193
|
+
export declare const DENSITY_SPACING: Record<string, string>;
|
|
194
|
+
/**
|
|
195
|
+
* The `theme.fontSize` names, each a size token and its line-height token.
|
|
196
|
+
*
|
|
197
|
+
* `text-control`, `text-cell`, `text-cell-head`. A fontSize entry and not a
|
|
198
|
+
* colour, so `text-control` sets the type and leaves the colour to `text-fg`.
|
|
199
|
+
*/
|
|
200
|
+
export declare const DENSITY_FONT_SIZES: Record<string, {
|
|
201
|
+
size: string;
|
|
202
|
+
leading: string;
|
|
203
|
+
}>;
|
|
204
|
+
/** The CSS custom property that backs a density role. */
|
|
205
|
+
export declare function densityVariable(name: string): string;
|
|
206
|
+
/**
|
|
207
|
+
* The `theme.spacing` entries to merge in.
|
|
208
|
+
*
|
|
209
|
+
* Same shape as {@link shapeRadii}: new names whose value is the variable with
|
|
210
|
+
* today's value as the fallback, so `px-control-x` is an ordinary utility and
|
|
211
|
+
* an app moves it by setting `--stx-control-px`.
|
|
212
|
+
*/
|
|
213
|
+
export declare function densitySpacing(): Record<string, string>;
|
|
214
|
+
/**
|
|
215
|
+
* The `theme.fontSize` entries to merge in, in the engine's own
|
|
216
|
+
* `[size, { lineHeight }]` form so a `text-*` utility sets both.
|
|
217
|
+
*/
|
|
218
|
+
export declare function densityFontSizes(): Record<string, [string, {
|
|
219
|
+
lineHeight: string;
|
|
220
|
+
}]>;
|
|
221
|
+
/**
|
|
222
|
+
* The `:root` block for the density roles.
|
|
223
|
+
*
|
|
224
|
+
* No `.dark` counterpart, for the reason the shape roles have none: room does
|
|
225
|
+
* not change with the colour scheme.
|
|
226
|
+
*/
|
|
227
|
+
export declare function densityTokenCSS(): string;
|
|
228
|
+
/** Every variable a density role reads, for documentation and tooling. */
|
|
229
|
+
export declare function densityTokenNames(): string[];
|
|
147
230
|
export {};
|
package/dist/theme-tokens.js
CHANGED
|
@@ -140,3 +140,60 @@ export function shapeTokenCSS() {
|
|
|
140
140
|
export function shapeTokenNames() {
|
|
141
141
|
return Object.keys(SHAPE_TOKENS).map(shapeVariable);
|
|
142
142
|
}
|
|
143
|
+
export const DENSITY_TOKENS = {
|
|
144
|
+
"control-px": { value: "1rem", description: "Inline padding of a md text control \u2014 px-4" },
|
|
145
|
+
"control-py": { value: "0.5rem", description: "Block padding of a md text control \u2014 py-2" },
|
|
146
|
+
"control-text": { value: "1rem", description: "Font size of a md text control \u2014 text-base" },
|
|
147
|
+
"control-leading": { value: "1.5rem", description: "Line height of a md text control \u2014 text-base" },
|
|
148
|
+
"cell-px": { value: "1.5rem", description: "Inline padding of every table cell, header or body \u2014 px-6" },
|
|
149
|
+
"cell-py": { value: "1rem", description: "Block padding of a body cell \u2014 py-4" },
|
|
150
|
+
"cell-text": { value: "0.875rem", description: "Font size of a body cell \u2014 text-sm" },
|
|
151
|
+
"cell-leading": { value: "1.25rem", description: "Line height of a body cell \u2014 text-sm" },
|
|
152
|
+
"cell-head-py": { value: "0.75rem", description: "Block padding of a header cell \u2014 py-3" },
|
|
153
|
+
"cell-head-text": { value: "0.75rem", description: "Font size of a header cell \u2014 text-xs" },
|
|
154
|
+
"cell-head-leading": { value: "1rem", description: "Line height of a header cell \u2014 text-xs" }
|
|
155
|
+
}, DENSITY_SPACING = {
|
|
156
|
+
"control-x": "control-px",
|
|
157
|
+
"control-y": "control-py",
|
|
158
|
+
"cell-x": "cell-px",
|
|
159
|
+
"cell-y": "cell-py",
|
|
160
|
+
"cell-head-y": "cell-head-py"
|
|
161
|
+
}, DENSITY_FONT_SIZES = {
|
|
162
|
+
control: { size: "control-text", leading: "control-leading" },
|
|
163
|
+
cell: { size: "cell-text", leading: "cell-leading" },
|
|
164
|
+
"cell-head": { size: "cell-head-text", leading: "cell-head-leading" }
|
|
165
|
+
};
|
|
166
|
+
export function densityVariable(name) {
|
|
167
|
+
return `--stx-${name}`;
|
|
168
|
+
}
|
|
169
|
+
function densityValue(token) {
|
|
170
|
+
const entry = DENSITY_TOKENS[token];
|
|
171
|
+
if (!entry)
|
|
172
|
+
throw Error(`[stx] unknown density token "${token}"`);
|
|
173
|
+
return `var(${densityVariable(token)}, ${entry.value})`;
|
|
174
|
+
}
|
|
175
|
+
export function densitySpacing() {
|
|
176
|
+
const spacing = {};
|
|
177
|
+
for (const [name, token] of Object.entries(DENSITY_SPACING))
|
|
178
|
+
spacing[name] = densityValue(token);
|
|
179
|
+
return spacing;
|
|
180
|
+
}
|
|
181
|
+
export function densityFontSizes() {
|
|
182
|
+
const sizes = {};
|
|
183
|
+
for (const [name, { size, leading }] of Object.entries(DENSITY_FONT_SIZES))
|
|
184
|
+
sizes[name] = [densityValue(size), { lineHeight: densityValue(leading) }];
|
|
185
|
+
return sizes;
|
|
186
|
+
}
|
|
187
|
+
export function densityTokenCSS() {
|
|
188
|
+
return [
|
|
189
|
+
"/* stx density tokens \u2014 how much room a control or a table cell takes. */",
|
|
190
|
+
":root {",
|
|
191
|
+
...Object.entries(DENSITY_TOKENS).map(([name, token]) => ` ${densityVariable(name)}: ${token.value};`),
|
|
192
|
+
"}",
|
|
193
|
+
""
|
|
194
|
+
].join(`
|
|
195
|
+
`);
|
|
196
|
+
}
|
|
197
|
+
export function densityTokenNames() {
|
|
198
|
+
return Object.keys(DENSITY_TOKENS).map(densityVariable);
|
|
199
|
+
}
|
package/dist/ts-css-config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { semanticColors, semanticTokenCSS, shapeRadii, shapeTokenCSS } from "./theme-tokens.js";
|
|
1
|
+
import { densityFontSizes, densitySpacing, densityTokenCSS, semanticColors, semanticTokenCSS, shapeRadii, shapeTokenCSS } from "./theme-tokens.js";
|
|
2
2
|
function isPlainObject(value) {
|
|
3
3
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4
4
|
}
|
|
@@ -20,6 +20,10 @@ export function mergeCssConfig(base = {}, user = {}) {
|
|
|
20
20
|
baseThemeKeys.colors = { ...basePalette, ...semanticColors(basePalette) };
|
|
21
21
|
const baseRadii = baseThemeKeys.borderRadius || {};
|
|
22
22
|
baseThemeKeys.borderRadius = { ...baseRadii, ...shapeRadii() };
|
|
23
|
+
const baseSpacing = baseThemeKeys.spacing || {};
|
|
24
|
+
baseThemeKeys.spacing = { ...baseSpacing, ...densitySpacing() };
|
|
25
|
+
const baseFontSizes = baseThemeKeys.fontSize || {};
|
|
26
|
+
baseThemeKeys.fontSize = { ...baseFontSizes, ...densityFontSizes() };
|
|
23
27
|
const theme = deepMergeThemes(baseThemeKeys, userThemeKeys), extend = deepMergeThemes(baseExtend || {}, userExtend || {});
|
|
24
28
|
if (Object.keys(extend).length > 0)
|
|
25
29
|
theme.extend = extend;
|
|
@@ -48,7 +52,7 @@ export function mergeCssConfig(base = {}, user = {}) {
|
|
|
48
52
|
shortcuts,
|
|
49
53
|
includePreflight: user.preflight !== !1,
|
|
50
54
|
minify: user.minify === !0,
|
|
51
|
-
tokenCSS: semanticTokenCSS(basePalette) + shapeTokenCSS(),
|
|
55
|
+
tokenCSS: semanticTokenCSS(basePalette) + shapeTokenCSS() + densityTokenCSS(),
|
|
52
56
|
...fonts ? { fonts } : {}
|
|
53
57
|
};
|
|
54
58
|
}
|
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.468",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -122,12 +122,12 @@
|
|
|
122
122
|
"dependencies": {
|
|
123
123
|
"@stacksjs/ts-css": "^0.3.2",
|
|
124
124
|
"@stacksjs/clapp": "^0.2.16",
|
|
125
|
-
"@stacksjs/desktop": "0.2.
|
|
126
|
-
"@stacksjs/sanitizer": "0.2.
|
|
125
|
+
"@stacksjs/desktop": "0.2.468",
|
|
126
|
+
"@stacksjs/sanitizer": "0.2.468",
|
|
127
127
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
128
|
-
"bun-plugin-stx": "0.2.
|
|
128
|
+
"bun-plugin-stx": "0.2.468",
|
|
129
129
|
"bunfig": "^0.15.19",
|
|
130
|
-
"stx-router": "0.2.
|
|
130
|
+
"stx-router": "0.2.468",
|
|
131
131
|
"ts-broadcasting": "^0.0.11",
|
|
132
132
|
"ts-images": "^0.2.22",
|
|
133
133
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-02e24cym.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ni,Ys,Li,ji,Zs,Bi,Fi,zi,Hi,Qs,Vi,Uc}from"./chunk-2cqymwe8.js";import{to,Gi}from"./chunk-rgwvqmhh.js";import{j,B,F,Ot,J,se,$n,Re,ut,Mt,Nt,Lt,z,jt,Bt,En}from"./chunk-z80d9dd2.js";import{Ea}from"./chunk-2bdthb37.js";export{B as DEFAULT_FORMATS,F as DEFAULT_QUALITY,j as DEFAULT_WIDTHS,En as ImageProcessingError,ji as clearImageCache,Zs as createImageDirective,Gi as createImageHandler,Fi as createImagePlugin,Uc as defaultImageConfig,Bt as formatSize,Qs as generateImageManifest,ut as generateSizes,Re as generateSrcSet,Mt as getFallbackVariant,$n as getImageMetadata,z as getMimeType,jt as getTotalSize,Nt as groupVariantsByFormat,to as handleImageRequest,Bi as imageDirective,J as isImageBackendAvailable,Lt as isImageFile,Ot as isSharpAvailable,Hi as optimizeDirectory,zi as optimizeImage,Ys as parseImageComponent,se as processImage,Li as processImageComponents,Ni as renderImageComponent,Ea as rewriteImagesWithSiblings,Vi as writeImageManifest};
|
package/dist/chunk-1mfggkga.js
DELETED
package/dist/chunk-1rbabtw0.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{W,qr,Kr,Ha,wt,Lo,Xr,jo,wu,Ne,Gr,me}from"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import{mi,s}from"./chunk-m08fk6ds.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{W as BROWSER_CORE_IMPORTS,Ha as STX_AUTO_IMPORTS,qr as extractAndStripCssImports,Ne as extractBridgeData,mi as findInterpolationEnd,jo as generateAutoImportDestructuring,wu as generateBrowserAutoImportDestructuring,Gr as generateServerDataBridge,wt as injectBrowserCoreAutoImports,me as processClientScript,Xr as referencesName,Kr as renderVendorStyleTags,s as stripCommentsAndLiterals,Lo as transformAutoImports};
|
package/dist/chunk-22972c8b.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{_r,Tr,Rr,oa,Ar,Pr,ia,Ir,Dr,fo,aa}from"./chunk-7h57dt0z.js";export{_r as VideoProcessorCache,fo as analyzeVideo,oa as clearVideoCache,Dr as generateDASHManifest,Ir as generateHLSManifest,Ar as generatePoster,ia as generateSpriteSheet,Pr as generateThumbnails,Tr as getCachedVideoResult,aa as processVideo,Rr as setCachedVideoResult};
|
package/dist/chunk-24xhcqt9.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Yi,dl,Zi,Qi,pl,fl}from"./chunk-y63bv55f.js";import"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{fl as applySlots,pl as extractSlotContent,dl as parseSlotElement,Yi as parseSlots,Qi as processSlots,Zi as renderSlot};
|
package/dist/chunk-2hddf9pn.js
DELETED
package/dist/chunk-3ar8gdyd.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{j,B,F,Ot,J,se,$n,Ji,Re,ut,Mt,Nt,Lt,z,jt,Bt,En}from"./chunk-z80d9dd2.js";export{B as DEFAULT_FORMATS,F as DEFAULT_QUALITY,j as DEFAULT_WIDTHS,En as ImageProcessingError,Bt as formatSize,ut as generateSizes,Re as generateSrcSet,Mt as getFallbackVariant,$n as getImageMetadata,z as getMimeType,jt as getTotalSize,Nt as groupVariantsByFormat,J as isImageBackendAvailable,Lt as isImageFile,Ot as isSharpAvailable,se as processImage,Ji as resizeAndConvert};
|
package/dist/chunk-3q2z7cts.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{pa,fa,ga,ma,ha,ya,ba,wa,va,xa,ml}from"./chunk-zasd9166.js";export{pa as createIslandRegistry,ml as default,xa as generateIslandManifest,ga as generatePartialHydrationCSS,ya as hydrateAll,ha as hydrateByStrategy,ma as hydrateIsland,ba as isHydrated,wa as onHydrated,fa as processPartialHydrationDirectives,va as processStaticDirectives};
|
package/dist/chunk-45ffx66n.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{d,ls,ri,si,yc,bc,wc,vc,xc,Sc,Ve,L,Ue,kc,Wn,Cc,ci,$c,We,r,qn,li,g,ee,Fu}from"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{ee as clearComponentCache,$c as componentClientSignalNames,ls as convertToCommonJS,g as createDetailedErrorMessage,xc as extractDirectiveNames,ri as extractScriptFromTemplate,d as extractVariables,r as fileExists,Fu as getComponentCacheStats,bc as getPositionInfo,L as getSharedTranspiler,li as getSourceLineInfo,vc as hasDirectives,si as hasVariables,Cc as isHydrateTrigger,Sc as isJavaScriptScript,We as renderComponentWithSlot,qn as resolveTemplatePath,kc as scopeOnRootElement,Ve as shouldTranspileTypeScript,ci as slotContentHasExpressions,Ue as transpileTypeScript,Wn as userComponentFileExists,wc as validateDirective,yc as validateTemplate};
|
package/dist/chunk-4qv9me8f.js
DELETED
package/dist/chunk-4rnncksa.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{nn,sc,ss}from"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import{ve}from"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{ve as freeIdentifiers,ss as processComponents,sc as processESImports,nn as rendersAsElement};
|
package/dist/chunk-5127n7rc.js
DELETED
package/dist/chunk-5564cka1.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Os,Ms,Ze,G,mn,ir,hn,ar,cr,Rc,Ac,Pc,yn,Ic,Dc,Oc,Mc,Ai,Pi,Ii,Ns,Di,Nc,Qe,et,tt,nt,rt,st,Se,Lc}from"./chunk-88px183j.js";export{hn as Router,Oc as abortNavigation,ir as bracketPathToRegex,Qe as clearMiddleware,Pi as createClientCookieManager,rt as createMiddlewareContext,nt as createRouteLocation,Ai as createServerCookieManager,Ii as createStorageManager,Mc as defineMiddleware,Ac as defineRoute,Pc as defineRoutes,ar as findErrorPage,cr as formatRoutes,Ms as generateRouteManifest,Os as generateRouteTypes,Di as getMiddleware,et as getMiddlewareNames,Se as getRouterScript,Lc as getRouterScriptDev,Nc as hasMiddleware,Ze as isFileRequestPath,tt as loadMiddlewareFromDirectory,mn as matchRoute,Dc as navigateTo,G as patternToRegex,Ns as registerMiddleware,Ic as resetRoutes,yn as route,st as runMiddleware,Rc as setAppUrl};
|
package/dist/chunk-58n62bxb.js
DELETED
package/dist/chunk-5xsd1dw1.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{kt,us,oi,mc}from"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{mc as declareBareLoopHead,kt as parseLoopBinding,oi as processLoops,us as reportDeferredLoopWarnings};
|
package/dist/chunk-6876vczs.js
DELETED
package/dist/chunk-6qsvh58v.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Jc}from"./chunk-t2hkwjvd.js";import"./chunk-f9c58ag8.js";import"./chunk-01zwbzyw.js";import"./chunk-hra6t4ch.js";import"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{Jc as buildForProduction};
|
package/dist/chunk-6xd9qbve.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ju,hc,ye,ii,Bu,ds,ps,gs}from"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{Bu as clearOnceStore,ii as onceStore,ye as partialsCache,ds as processIncludes,ps as processStackPushDirectives,gs as processStackReplacements,ju as resetUnscopedSignalWarnings,hc as topLevelElements};
|
package/dist/chunk-7fjatz47.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ks,Cs,$s,Es,Yn,Zn,Vu,Uu,Wu,qu,Qn,Ku}from"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";export{Ku as generateDefaultRobotsTxt,Qn as generateRobotsTxt,Uu as generateSitemap,Wu as generateSitemapIndex,Es as injectSeoTags,Yn as metaDirective,ks as processMetaDirectives,$s as processSeoDirective,Cs as processStructuredData,Vu as registerSeoDirectives,qu as scanForSitemapEntries,Zn as structuredDataDirective};
|
package/dist/chunk-7j1cpa9d.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ts,Xu,Gu,vi,pe,Tc,nr,Ju,Yu,Zu,Qu,ed,td,nd,rd,sd}from"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";export{td as applyHead,Ju as definePageMeta,Ts as getHead,Xu as getPageMeta,pe as mergeHeadConfigs,nd as processHeadDirective,sd as processMetaDirective,rd as processTitleDirective,ed as renderBodyAttrs,Zu as renderHead,Qu as renderHtmlAttrs,Gu as resetHead,nr as seoMetaToHeadConfig,vi as useHead,Yu as usePageTitle,Tc as useSeoMeta,Yu as useTitle};
|
package/dist/chunk-7tt84v1y.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import i from"path";var $t=".stx",o="STX_DIR",e=null;function wi(t){e=t?.trim()||null}function on(){return process.env[o]?.trim()||e||$t}function a(t=process.cwd(),...n){let r=on();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function an(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==$t&&!n.startsWith(`${$t}/`))return t;let r=n.slice($t.length+1);return r?i.join(on(),r):on()}
|
|
3
|
-
export{$t,wi,on,a,an};
|
package/dist/chunk-8bsz3ky4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Me,Ga,$u,Eu,_u,Tu,Ja,Ya,Ru,Au,Ho,Pu,Qt,en,Mn}from"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{Tu as __setSignalsGeneratorsForTest,Me as cacheEngineFingerprint,en as cacheTemplate,Qt as checkCache,Pu as clearDevCaches,Ya as getCachedRouterScript,Ja as getCachedSignalsRuntime,Ru as getServeClientAsset,Ho as getServeModuleBundle,Mn as hashFilePath,Eu as invalidateFileCache,_u as invalidateFileCacheByDir,$u as readFileCached,Au as registerServeModuleBundle,Ga as templateCache};
|
package/dist/chunk-9zx4p42m.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Pe,Wt,Xl}from"./chunk-01zwbzyw.js";import{V,_n,qt,Mr,Nr,Tn,Gl,Jl,Yl,Kt,Xt,Lr,Rn,Zl}from"./chunk-14vnnx44.js";import"./chunk-2jbyks2t.js";export{Mr as batch,Xl as default,_n as derived,qt as effect,Pe as generateSignalsRuntime,Wt as generateSignalsRuntimeDev,Xt as isDerived,Kt as isSignal,Tn as onDestroy,Nr as onMount,Rn as peek,Yl as pendingLifecycleCounts,Jl as runDestroyCallbacks,Gl as runMountCallbacks,V as state,Lr as untrack,Zl as useOptimistic};
|
package/dist/chunk-a32kqsff.js
DELETED
package/dist/chunk-cfk3skk4.js
DELETED
package/dist/chunk-d78wbjkz.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ql,Kl}from"./chunk-bnemhyg2.js";import"./chunk-jkf5k215.js";import"./chunk-hra6t4ch.js";import"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{Kl as clearStoreCache,ql as getStoreScript};
|
package/dist/chunk-fads0sap.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import g from"path";var y=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function I(...r){let o=new Set;for(let s of r){if(!s||!s.includes("__stxModules["))continue;for(let e of s.matchAll(y))try{o.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...o].sort()}async function M(r,o={}){if(r.length===0)return null;let s=process.cwd(),e=[],l=[];r.forEach((t,h)=>{let x=t.startsWith("npm:")?t.slice(4):g.resolve(s,t),a=`__stxRegistered${h}`,d=JSON.stringify(t);e.push(`import * as ${a} from ${JSON.stringify(x)};`),l.push(`if (!globalThis.__stxModules[${d}]) globalThis.__stxModules[${d}] = ${a};`)});let u=[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...l].join(`
|
|
3
|
-
`),n;try{let{bundleClientScript:t}=await import("./chunk-kkrmhb5b.js");n=await t(u,g.join(s,".stx-module-registry.ts"),{projectRoot:s,minify:o.minify,externalizeUserModules:!1,collectInputs:o.collectInputs})}catch(t){return console.warn("[stx] could not build the page module registry (#1957):",t),null}let{transformAutoImports:p,generateAutoImportDestructuring:m}=await import("./chunk-1rbabtw0.js"),i=p(n),f=m(i.stxImports,i.browserImports),{transformStoreImports:_}=await import("./chunk-0e1rga0j.js");n=_(i.code);let c=JSON.stringify(new Bun.CryptoHasher("md5").update(u).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${c}]) return;`,` __stxBundles[${c}] = true;`,f,n,"})();"].join(`
|
|
4
|
-
`)}export{M as buildModuleRegistryScript,I as registeredModuleIdsIn};
|
package/dist/chunk-fmtyrdgg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{So,ko,Co,mu}from"./chunk-rdp06c4s.js";import"./chunk-812sn7d5.js";import"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{So as buildNative,mu as default,Co as getAvailableFormats,ko as getAvailableTargets};
|
package/dist/chunk-gmccacxc.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ql,yo,_a,eu,tu,nu,ru,su,Ta,Ra,ou,iu,au,cu}from"./chunk-v6qxmac5.js";import"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{_a as SUSPENSE_RESOLVER_RUNTIME,yo as buildSuspenseResolveScript,su as createStreamRenderer,nu as extractStreamBoundaries,cu as generateHydrationRuntime,Ra as islandDirective,iu as processSectionDirectives,tu as processStreamDirectives,ou as registerStreamingDirectives,eu as renderStreamingPage,Ql as streamTemplate,ru as streamTemplateSimple,au as streamToResponse,Ta as streamingSuspenseDirective};
|
package/dist/chunk-h074e6w3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Lu,oc,os,is,Qo,ei,as,cs,Fn,ic,ti,ni,ac,He}from"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{Lu as clearScriptScanCache,as as convertServerLoopAttributesToDirectives,Qo as convertSignalDirectivesToAttributes,cs as convertSignalLoopsToAttributes,ic as extractExports,ni as findMarkupIndexOutsideScripts,is as hasSignalsSyntax,os as parseLoopExpression,ei as preEvalLiteralReactiveIfs,Fn as processScriptSetup,ti as processSignals,ac as rewriteStxImportSpecifiers,oc as scanScriptTags,He as stripStxRuntimeImports};
|
package/dist/chunk-h6ayvmaj.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{I,Ec,o,R,zu,Hu}from"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{R as config,I as defaultConfig,zu as defineStxConfig,o as loadStxConfig,Ec as resolveStxDirectories,Hu as validateConfig};
|
package/dist/chunk-ha5z623e.js
DELETED
package/dist/chunk-hqzq3a61.js
DELETED
package/dist/chunk-hvx3pc13.js
DELETED
package/dist/chunk-j9aberz0.js
DELETED
package/dist/chunk-j9qcrwbg.js
DELETED
package/dist/chunk-jkf5k215.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{m,Zt,w,Me,o,R}from"./chunk-0adxpd3e.js";import{Wr}from"./chunk-hra6t4ch.js";import{s,be}from"./chunk-m08fk6ds.js";import{a}from"./chunk-7tt84v1y.js";import g from"path";import S from"fs";function pe(e){if(!e||typeof e!=="object")return!1;let t=e;return typeof t.message==="string"&&(t.name==="BuildMessage"||t.name==="ResolveMessage"||("position"in t))}function fe(e){if(e&&typeof e==="object"&&Array.isArray(e.errors))return e.errors;return[e]}function P(e,t){let r=[];for(let l of fe(e)){if(pe(l)){let c=l.position||void 0;r.push({file:t||c?.file,line:c?.line,column:c?.column,message:l.message??"",lineText:c?.lineText});continue}r.push({file:t,message:l instanceof Error?l.message:String(l)})}return r}function De(e,t){return P(e,t).map((r)=>{let l=r.file?`${r.file}${r.line?`:${r.line}${r.column?`:${r.column}`:""}`:""}`:"",c=r.lineText?`
|
|
3
|
-
${r.lineText.trim()}`:"";return l?`${l}: ${r.message}${c}`:`${r.message}${c}`}).join(`
|
|
4
|
-
`)}var me=10;function V(e,t,r){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(g.basename(e))||Wr(e,t,r)}var re=1,se=new Map,W=600,ge=100,G=new Map;async function he(e){let t=G.get(e)??0;if(t>0&&t<ge){G.set(e,t+1);return}G.set(e,1);try{let r=(await S.promises.readdir(e)).filter((d)=>d.endsWith(".js"));if(r.length<=W)return;let c=(await Promise.all(r.map(async(d)=>{try{return{name:d,at:(await S.promises.stat(g.join(e,d))).mtimeMs}}catch{return null}}))).filter((d)=>d!==null);c.sort((d,u)=>u.at-d.at);for(let d of c.slice(W)){let u=d.name.slice(0,-3);await S.promises.rm(g.join(e,`${u}.js`),{force:!0}),await S.promises.rm(g.join(e,`${u}.deps.json`),{force:!0})}N("pruned bundle cache to",W,"entries")}catch{}}function ie(e){return se.get(e)??[]}function q(e,t){if(e)se.set(e,t)}function Na(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function N(...e){if(Na())console.log("[stx:bundler]",...e)}var Y=[];function Mo(e,t,r){Y.push({filePath:e||"<inline>",message:t,details:r})}function gt(){return Y.slice()}function mt(){Y.length=0}var H;function yu(e){H=e}function No(){if(H)return H;try{let e=R.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Z=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function ht(e){let t=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,r;while((r=t.exec(e))!==null){let c=r[1];if(!Z.some((u)=>u.test(c)))return N("detected user import:",c),!0}let l=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while((r=l.exec(e))!==null){let c=r[1];if(/\.css(?:\?.*)?$/.test(c))continue;if(!Z.some((u)=>u.test(c)))return N("detected side-effect import:",c),!0}return!1}var Yt="stx-module:",xe=/\.(?:[cm]?[jt]sx?|json)$/i;function La(e,t){return g.relative(e,t).split(g.sep).join("/")}function ja(e,t){if(t.size===0)return e;return e.replace(/^([ \t]*import\s+(?:[^;"']*?\s+from\s+)?)(["'])([^"']+)\2/gm,(r,l,c,d)=>{let u=t.get(d);return u&&!d.startsWith(Yt)?`${l}${c}${u}${c}`:r})}function Ba(e,t){let r=0,l=(d)=>{let u=`__stxMod${r++}`,B=JSON.stringify(d);return t.push(`var ${u} = globalThis.__stxModules && globalThis.__stxModules[${B}];`,`if (${u} === undefined) throw new Error("[stx] module " + ${JSON.stringify(B)} + " is not registered on this page (#1957)");`),u},c=(d,u)=>{for(let B of d.split(",")){let _=B.trim();if(!_)continue;let f=_.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!f)continue;let n=f[1].startsWith('"')?JSON.parse(f[1]):f[1],i=f[2]??n;t.push(`var ${i} = ${u}[${JSON.stringify(n)}];`)}};return e=e.replace(/^[ \t]*import\s+([^;"']*?)\s+from\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,u,B)=>{let _=B.slice(Yt.length),f=l(_),n=u.trim(),i=n.match(/^([\w$]+)\s*(?:,\s*|$)/);if(i&&!n.startsWith("{")&&!n.startsWith("*"))t.push(`var ${i[1]} = ${f}.default;`),n=n.slice(i[0].length).trim();let p=n.match(/^\*\s*as\s+([\w$]+)$/);if(p)t.push(`var ${p[1]} = ${f};`);else if(n.startsWith("{"))c(n.replace(/^\{|\}$/g,""),f);return""}),e=e.replace(/^[ \t]*import\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,u)=>(l(u.slice(Yt.length)),"")),e}function te(e){let t=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,g.join(e,"index.ts"),g.join(e,"index.tsx"),g.join(e,"index.js"),g.join(e,"index.mjs")];for(let r of t)try{if(S.existsSync(r)&&S.statSync(r,{throwIfNoEntry:!1})?.isFile())return r}catch{}return}function $e(e,t,r,l,c,d=new Map,u){let B=(f,n,i)=>{if(V(n,e,u))return null;if(!c||f!==r||!xe.test(n))return null;try{if(!S.statSync(n,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(n);let p=`${Yt}${La(process.cwd(),n)}`;return d.set(i,p),{path:p,external:!0}},_=(f,n)=>{let i=f===r?t:g.dirname(f),p=g.resolve(i,n);return te(p)??p};return{name:"stx-client-bundle",setup(f){if(f.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(n)=>({path:n.path,external:!0})),f.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(n)=>({path:n.path,external:!0})),f.onResolve({filter:/^\//},(n)=>{let i=te(n.path);if(i){let p=B(n.importer,i,n.path);if(p)return p;if(i!==r)l.add(i);return{path:i}}return{path:n.path,external:!0}}),f.onResolve({filter:/^\.\.?\//},(n)=>{let i=_(n.importer,n.path),p=B(n.importer,i,n.path);if(p)return p;return l.add(i),{path:i}}),f.onResolve({filter:/^[@~]\//},(n)=>{let i=g.resolve(e,n.path.slice(2)),p=[i,`${i}.ts`,`${i}.tsx`,`${i}.js`,`${i}.mjs`,`${i}.jsx`,g.join(i,"index.ts"),g.join(i,"index.tsx"),g.join(i,"index.js"),g.join(i,"index.mjs")];for(let E of p)if(S.existsSync(E)&&S.statSync(E,{throwIfNoEntry:!1})?.isFile()){let T=B(n.importer,E,n.path);if(T)return T;return N(`resolved ${n.path[0]}/ import:`,n.path,"\u2192",E),l.add(E),{path:E}}return console.warn(`[stx:bundler] could not resolve ${n.path[0]}/ import:`,n.path),{path:i}}),c)f.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(n)=>{if(n.importer!==r)return;let i=`${Yt}npm:${n.path}`;return d.set(n.path,i),{path:i,external:!0}});f.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(n)=>{if(V(n.path,e,u))throw Error(`Server-only API source cannot be imported by a client script: ${n.path}`);let i=g.extname(n.path).toLowerCase(),p=i===".json"?"json":i===".tsx"?"tsx":i===".jsx"?"jsx":i===".ts"||i===".mts"||i===".cts"?"ts":"js";if(n.path!==r)l.add(n.path);return{contents:S.readFileSync(n.path,"utf8"),loader:p}})}}}var X=new Map,U=m(64),ne=Symbol.for("stx.client-bundle-build-queue");function Fa(e){let t=globalThis,l=(t[ne]??Promise.resolve()).then(e,e);return t[ne]=l.then(()=>{return},()=>{return}),l}async function yt(e,t,r={}){let l=r.projectRoot||process.cwd(),c=(await o(l)).serverApi,d=r.minify??!1,u=r.externalizeUserModules??!0,B=r.expose?.length?[...new Set(r.expose)].sort():void 0,_=r.cacheDir||a(l,"bundle-cache"),f=new Bun.CryptoHasher("md5");f.update(`${me}\x00${Me()}\x00${JSON.stringify(c??!1)}\x00${u?"registry":"inline"}\x00${B?B.join(","):"*"}\x00${e}\x00${t}`);let n=f.digest("hex").slice(0,12),i=g.join(_,`${n}.js`),p=U.get(i);if(p){if(Zt(p.files)&&p.files.every((A)=>!V(A.path,l,c))){N("memo hit:",n);let A=p.files.map((v)=>v.path);return q(t,A),r.collectInputs?.push(...A),p.code}U.delete(i),N("memo invalidated by dep change:",n)}let E=g.join(_,`${n}.deps.json`),T=Bun.file(i);if(await T.exists()){let A=Bun.file(E),v=!1,D=null;if(await A.exists())try{let k=JSON.parse(await A.text());if(k.metadataVersion!==re||!Array.isArray(k.files))v=!1;else D=k.files,v=!0;if(D&&(!Zt(D)||D.some((I)=>V(I.path,l,c))))v=!1}catch{v=!1}if(v){if(N("cache hit:",n),D)q(t,D.map((I)=>I.path)),r.collectInputs?.push(...D.map((I)=>I.path));let k=await T.text();if(D)U.set(i,{code:k,files:D});return k}N("cache invalidated by dep change:",n)}let M=X.get(n);if(M){let A=await M;if(r.collectInputs)r.collectInputs.push(...(U.get(i)?.files??[]).map((v)=>v.path));return A}let z=Fa(()=>ye(e,t,{projectRoot:l,minify:d,cacheDir:_,hash:n,cachePath:i,depsPath:E,collectInputs:r.collectInputs,externalizeUserModules:u,serverApi:c,expose:B}));X.set(n,z);try{return await z}finally{X.delete(n)}}var we=0;function za(e){return`${e}-${process.pid}-${++we}`}async function ye(e,t,r){let{projectRoot:l,minify:c,cacheDir:d,hash:u,cachePath:B,depsPath:_,externalizeUserModules:f}=r,n=a(l,"bundle-tmp"),i=za(u),p=g.join(n,`${i}.ts`),E=g.join(n,"out",i);S.mkdirSync(n,{recursive:!0}),S.mkdirSync(E,{recursive:!0});let T=g.dirname(t),M=new Set,z=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,A=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,v=s(e),{depths:D,balanced:k}=be(v),I=(j)=>!k||D[j]===0,b;while((b=z.exec(v))!==null){if(b[1])continue;if(!I(b.index))continue;if(b[2])b[2].split(",").forEach((j)=>{let h=Be(j);if(h)M.add(h)});else if(b[3])M.add(b[3])}while((b=A.exec(v))!==null){if(b[1])continue;if(!I(b.index))continue;M.add(b[2])}let oe=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((b=oe.exec(v))!==null){if(!I(b.index))continue;let j=/^\s*['"]([^'"]+)['"]/.exec(e.slice(b.index+b[0].length))?.[1];if(j&&Z.some((h)=>h.test(j)))continue;if(b[1])M.add(b[1]);if(b[2])M.add(b[2]);for(let h of(b[3]??"").split(",")){let y=h.trim();if(!y||/^type\s/.test(y))continue;let L=/\bas\s+(\w+)\s*$/.exec(y)?.[1]??/^\w+$/.exec(y)?.[0];if(L)M.add(L)}}for(let j of v.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let h of j[1].split(",")){let y=/\bas\s+(\w+)\s*$/.exec(h)?.[1]??/^\s*(\w+)\s*$/.exec(h)?.[1];if(y)M.delete(y)}let le=M.size>0?`
|
|
5
|
-
export { ${[...M].join(", ")} }`:"";await Bun.write(p,e+le),N("bundling:",u,"from:",g.basename(t));let Q=new Set,K=new Map;try{let j=await Bun.build({entrypoints:[p],outdir:E,target:"browser",format:"esm",minify:c,plugins:[$e(l,T,p,Q,f,K,r.serverApi)],define:{"process.env.NODE_ENV":c?'"production"':'"development"',...w()},root:l});if(!j.success){let F=j.logs.filter((C)=>C.level==="error").map((C)=>C.message).join(", ")||`Unable to bundle ${g.basename(t)}`,O=P(j.logs,t||void 0);if(console.warn("[stx:bundler] build failed:",F),Mo(t||"",F,O),No()==="error")throw Error(F);return e}let h="";for(let x of j.outputs){h=await x.text();break}let y=[];for(let x of h.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let F of x[1].split(",")){let O=F.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(O){y.push([O[2],O[1]]);continue}let C=F.trim();if(/^[A-Za-z_$][\w$]*$/.test(C))y.push([C,C])}if(r.expose){let x=new Set(r.expose);for(let F=y.length-1;F>=0;F--)if(!x.has(y[F][0]))y.splice(F,1)}let L=[];h=Ba(ja(h,K),L);let ae=h.match(/^\s*import\s+[^;]+;?\s*$/gm)||[];h=h.replace(/^\s*import\s+[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim();let ee=`__stxBundle_${u}`,ce=y.map(([x,F])=>`${JSON.stringify(x)}: ${F}`).join(", "),ue=y.map(([x])=>`var ${x} = undefined;`).join(`
|
|
6
|
-
`),de=y.map(([x])=>`${x} = ${ee}[${JSON.stringify(x)}];`).join(`
|
|
7
|
-
`);if(h=`${ae.join(`
|
|
8
|
-
`)}
|
|
9
|
-
${ue}
|
|
10
|
-
var ${ee} = (function() {
|
|
11
|
-
${L.join(`
|
|
12
|
-
`)}
|
|
13
|
-
${h}
|
|
14
|
-
return { ${ce} };
|
|
15
|
-
})();
|
|
16
|
-
${de}`.trim(),N("bundled:",u,"output:",h.length,"bytes"),M.size>0&&y.length===0)return console.warn(`[stx:bundler] dropped every binding for ${g.basename(t)} (${u}); serving the unbundled source and not caching this result`),e;S.mkdirSync(d,{recursive:!0}),await Bun.write(B,h);let J=Array.from(Q).map((x)=>{try{return{path:x,mtimeMs:S.statSync(x).mtimeMs}}catch{return null}}).filter((x)=>x!==null);return await Bun.write(_,JSON.stringify({metadataVersion:re,files:J})),q(t,J.map((x)=>x.path)),r.collectInputs?.push(...J.map((x)=>x.path)),U.set(B,{code:h,files:J}),await he(d),h}catch(j){let h=P(j,t||void 0),y=De(j,t||void 0);if(console.warn(`[stx:bundler] error: ${y}`),Mo(t||"",y,h),No()==="error")throw j;return e}finally{try{S.rmSync(p,{force:!0}),S.rmSync(E,{recursive:!0,force:!0})}catch{}}}function Be(e){let t=e.trim();if(!t)return null;let r=t.indexOf("=");if(r!==-1)t=t.slice(0,r).trim();let l=t.indexOf(":");if(l!==-1)t=t.slice(l+1).trim();if(t.startsWith("..."))t=t.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(t)?t:null}
|
|
17
|
-
export{De,ie,Na,Mo,gt,mt,yu,No,ht,Yt,La,ja,Ba,Fa,yt,za};
|
package/dist/chunk-jmabeqfq.js
DELETED
package/dist/chunk-k2vcwa7m.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Yc,Zc,Qc,el,Xi,tl,nl,rl,sl,ol,il,al}from"./chunk-a8q8m5pp.js";export{il as Broadcast,al as BroadcastServer,Xi as broadcast,sl as broadcastPresence,rl as broadcastPrivate,ol as channel,Yc as getBroadcastServer,el as loadChannels,Zc as startBroadcasting,Qc as stopBroadcasting,tl as toUser,nl as toUsers};
|
package/dist/chunk-k8smv0at.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ui,eo,Wc,Wi,qi,qc,Kc}from"./chunk-pyqh70k2.js";import"./chunk-8bpyr4az.js";import"./chunk-jkf5k215.js";import"./chunk-hra6t4ch.js";import{ze,rc}from"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{Ui as buildVirtualSource,ze as extractScriptBlocks,rc as extractTemplateExpressions,Wi as findRuntimeTypeDeclarations,qi as findStxModuleDeclarations,Kc as formatTypecheckDiagnostics,Wc as sourcePathFor,qc as typecheckStxFiles,eo as virtualPathFor};
|
package/dist/chunk-kca543an.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{cl}from"./chunk-kax708d4.js";import"./chunk-0adxpd3e.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-wfqnxb38.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{cl as buildApp};
|