@stacksjs/stx 0.2.431 → 0.2.433
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-wy873fy8.js → chunk-0n28xm1q.js} +1 -1
- package/dist/{chunk-b7973zvk.js → chunk-114zdbnd.js} +2 -2
- package/dist/{chunk-21rqr54j.js → chunk-2psf6w7b.js} +2 -2
- package/dist/{chunk-0hd9xzf2.js → chunk-2q95we1n.js} +5 -5
- package/dist/{chunk-aen2baze.js → chunk-3rbz496d.js} +1 -1
- package/dist/{chunk-ha9tr90k.js → chunk-3yrg4kfm.js} +1 -1
- package/dist/{chunk-cznsm2n3.js → chunk-489z8wry.js} +2 -2
- package/dist/{chunk-84gsk8fk.js → chunk-51a50b67.js} +1 -1
- package/dist/chunk-52pc79vk.js +2 -0
- package/dist/chunk-60j147cj.js +2 -0
- package/dist/{chunk-z52txevf.js → chunk-61r70km9.js} +1 -1
- package/dist/{chunk-n58q81vv.js → chunk-720pm5yj.js} +2 -2
- package/dist/{chunk-mjgqhhap.js → chunk-721yq8qx.js} +3 -3
- package/dist/{chunk-0hhq9hbq.js → chunk-74j5jbs6.js} +3 -3
- package/dist/{chunk-e1vsbjtw.js → chunk-7g7500r7.js} +4 -4
- package/dist/chunk-7wfa6665.js +2 -0
- package/dist/{chunk-0bmc75w6.js → chunk-7x8qwshk.js} +2 -2
- package/dist/{chunk-msrrac1x.js → chunk-7ynzah39.js} +4 -4
- package/dist/{chunk-pdp961ge.js → chunk-82kf8t4n.js} +1 -1
- package/dist/{chunk-85pvq4a2.js → chunk-848mx840.js} +1 -1
- package/dist/chunk-88ey0pdm.js +2 -0
- package/dist/{chunk-ktedzx9e.js → chunk-8wkja2z2.js} +2 -2
- package/dist/{chunk-3ry9ca1s.js → chunk-8x47zcfa.js} +2 -2
- package/dist/{chunk-rnbgn7xn.js → chunk-93e1nf1y.js} +1 -1
- package/dist/{chunk-7a9h7ycs.js → chunk-9w5nse46.js} +3 -3
- package/dist/{chunk-eej89wkt.js → chunk-9yy4fyq6.js} +1 -1
- package/dist/{chunk-n4203761.js → chunk-a16fcrd1.js} +4 -4
- package/dist/{chunk-tpnfcb83.js → chunk-a88mq2k6.js} +1 -1
- package/dist/{chunk-jv9gvzvy.js → chunk-adgn0e36.js} +1 -1
- package/dist/chunk-b1qa6444.js +2 -0
- package/dist/{chunk-stxmwytg.js → chunk-b8dbq51z.js} +2 -2
- package/dist/{chunk-78ac2603.js → chunk-b8r87s8q.js} +5 -5
- package/dist/{chunk-h873ye0z.js → chunk-b9a5hkm2.js} +4 -4
- package/dist/{chunk-5f0r0g18.js → chunk-b9wpgn7b.js} +3 -3
- package/dist/{chunk-pdx27sbp.js → chunk-bge8ptbd.js} +1 -1
- package/dist/{chunk-c1dmr865.js → chunk-ccq35xp7.js} +3 -3
- package/dist/chunk-cnmz9543.js +2 -0
- package/dist/chunk-cqwbzm5r.js +2 -0
- package/dist/chunk-cv56m171.js +2 -0
- package/dist/{chunk-je7ymnck.js → chunk-d347pv7p.js} +1 -1
- package/dist/chunk-d5xnsqj9.js +2 -0
- package/dist/chunk-dkbcfevd.js +2 -0
- package/dist/{chunk-4hd5wb8x.js → chunk-dtvwes4f.js} +1 -1
- package/dist/{chunk-w3j0ppg4.js → chunk-eaa5rxst.js} +2 -2
- package/dist/chunk-ec32acc4.js +2 -0
- package/dist/{chunk-djdf6agj.js → chunk-ed7p2a5q.js} +1 -1
- package/dist/chunk-epf4s6qm.js +2 -0
- package/dist/chunk-f0f7qv7t.js +2 -0
- package/dist/{chunk-vpz0t82q.js → chunk-f4m0n9hr.js} +1 -1
- package/dist/chunk-fg8kmyz8.js +2 -0
- package/dist/{chunk-jp602m75.js → chunk-gnghq9yc.js} +1 -1
- package/dist/{chunk-ex0tq6x2.js → chunk-hc9242wm.js} +1 -1
- package/dist/chunk-jadv7091.js +2 -0
- package/dist/chunk-k5tcanyq.js +2 -0
- package/dist/{chunk-dhqwg62x.js → chunk-k6kvgdd0.js} +1 -1
- package/dist/{chunk-03n23sh6.js → chunk-kcwz3kvn.js} +1 -1
- package/dist/chunk-kvzbmn2x.js +2 -0
- package/dist/{chunk-sbdzqqr1.js → chunk-m607bd3m.js} +1 -1
- package/dist/{chunk-fb7bfyjz.js → chunk-my3jkpv7.js} +3 -3
- package/dist/{chunk-wr9ac0cv.js → chunk-nvht5259.js} +2 -2
- package/dist/chunk-p07v3har.js +2 -0
- package/dist/{chunk-02n071n7.js → chunk-p4wvc7wx.js} +4 -4
- package/dist/chunk-pd0qtjj1.js +2 -0
- package/dist/{chunk-y438dzvn.js → chunk-ptjqacjd.js} +2 -2
- package/dist/{chunk-12pvnn1e.js → chunk-pxqs3psa.js} +4 -4
- package/dist/chunk-q0vpbe85.js +2 -0
- package/dist/{chunk-hnx1jgfp.js → chunk-q5433grh.js} +1 -1
- package/dist/chunk-r089d1s4.js +2 -0
- package/dist/chunk-r7xbp439.js +2 -0
- package/dist/chunk-rf4xssb2.js +2 -0
- package/dist/{chunk-jkks9x5g.js → chunk-sce9mzjk.js} +8 -8
- package/dist/{chunk-k0v70ttf.js → chunk-ssrcvz36.js} +1 -1
- package/dist/chunk-st6exqqv.js +2 -0
- package/dist/{chunk-hxn9gk7h.js → chunk-sw8j8rnc.js} +198 -198
- package/dist/{chunk-k8sqs7j2.js → chunk-t7x753ga.js} +2 -2
- package/dist/{chunk-718avy9p.js → chunk-tdx1srqq.js} +1 -1
- package/dist/{chunk-c0ants8t.js → chunk-thx147nq.js} +3 -3
- package/dist/{chunk-6t7mxb0b.js → chunk-tywmtk33.js} +2 -2
- package/dist/chunk-vbb02yfw.js +2 -0
- package/dist/{chunk-rqfhknzj.js → chunk-veqzjwty.js} +1 -1
- package/dist/chunk-vswb4bcb.js +2 -0
- package/dist/{chunk-cf6htz63.js → chunk-vzek2z1v.js} +1 -1
- package/dist/chunk-w7zh2avv.js +2 -0
- package/dist/chunk-wg36jd98.js +2 -0
- package/dist/chunk-xdv4d3vt.js +2 -0
- package/dist/{chunk-tajqa4hv.js → chunk-xhnn2yj8.js} +1 -1
- package/dist/chunk-ynrnx1tp.js +2 -0
- package/dist/{chunk-98hj1mvn.js → chunk-ynzyzrqs.js} +1 -1
- package/dist/chunk-yqtqqsaa.js +2 -0
- package/dist/chunk-yr7b4x3y.js +2 -0
- package/dist/chunk-z5vkrfn5.js +2 -0
- package/dist/{chunk-drmddfta.js → chunk-zaz9phx6.js} +11 -11
- package/dist/chunk-zf4zdasc.js +2 -0
- package/dist/chunk-zt89wcns.js +2 -0
- package/dist/cli.js +16 -16
- package/dist/client-parameter-bindings.d.ts +4 -0
- package/dist/client-parameter-bindings.js +131 -0
- package/dist/client-script.js +8 -2
- 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/utils.js +23 -6
- package/package.json +5 -5
- package/dist/chunk-0sg48cd0.js +0 -2
- package/dist/chunk-1gqd0mdg.js +0 -2
- package/dist/chunk-1qf3wc23.js +0 -2
- package/dist/chunk-1sqf2vvk.js +0 -2
- package/dist/chunk-2mzy3z72.js +0 -2
- package/dist/chunk-35qj567j.js +0 -2
- package/dist/chunk-3hv5ggdq.js +0 -2
- package/dist/chunk-4rvwz6jn.js +0 -2
- package/dist/chunk-4yepzdrt.js +0 -2
- package/dist/chunk-513vzzf5.js +0 -2
- package/dist/chunk-5f6nfpm7.js +0 -2
- package/dist/chunk-6gnza26n.js +0 -2
- package/dist/chunk-6wynj5pv.js +0 -2
- package/dist/chunk-7gsdrmh1.js +0 -2
- package/dist/chunk-9d53d0t6.js +0 -2
- package/dist/chunk-9wfw0v60.js +0 -2
- package/dist/chunk-ahgrkva8.js +0 -2
- package/dist/chunk-akbb6j7s.js +0 -2
- package/dist/chunk-cr3f21mg.js +0 -2
- package/dist/chunk-db6sq3d2.js +0 -2
- package/dist/chunk-e6j0tynb.js +0 -2
- package/dist/chunk-hr5db6bk.js +0 -2
- package/dist/chunk-jeand25b.js +0 -2
- package/dist/chunk-kzkh3sb8.js +0 -2
- package/dist/chunk-mdr0sr41.js +0 -2
- package/dist/chunk-mkzxhfae.js +0 -2
- package/dist/chunk-n7nvj7dk.js +0 -2
- package/dist/chunk-rhkx17d9.js +0 -2
- package/dist/chunk-tznejj9h.js +0 -2
- package/dist/chunk-w64cepkh.js +0 -2
- package/dist/chunk-whdw6dhb.js +0 -2
- package/dist/chunk-wx7kfet5.js +0 -2
- package/dist/chunk-x38d7mvy.js +0 -2
- package/dist/chunk-yjgbxf26.js +0 -2
- package/dist/chunk-z21mv6bz.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-b9wpgn7b.js";import"./chunk-8x47zcfa.js";import"./chunk-8wkja2z2.js";import{a}from"./chunk-wtms9jhs.js";import f from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},o=t.snapshotDir||a(e.root,"story","snapshots");await f.promises.mkdir(o,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((i)=>t.filter.some((p)=>i.fileName.toLowerCase().includes(p.toLowerCase())));for(let i of r)await h(i,o,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let o=e.story;if(!o)return;for(let r of o.variants){n.total++;let i=l.join(t,`${e.id}-${r.id}.snap`),p=g(r.source||""),c=await w(i);if(s.update||!c){let u={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:p};if(await f.promises.writeFile(i,JSON.stringify(u,null,2)),!c)n.new++;n.passed++}else try{let u=await f.promises.readFile(i,"utf-8"),m=JSON.parse(u);if(m.hash===p)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,p)})}catch(u){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${u}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await f.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
|
|
3
3
|
`)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
|
|
@@ -30,7 +30,7 @@ ${q.join(`
|
|
|
30
30
|
data-quality="${o}"
|
|
31
31
|
data-formats="${u.join(",")}"
|
|
32
32
|
data-widths="${l.join(",")}"
|
|
33
|
-
`.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${U(e)}"${I}${b}${w}${v}${A}${S}${C} ${O} />`}}function
|
|
33
|
+
`.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${U(e)}"${I}${b}${w}${v}${A}${S}${C} ${O} />`}}function Gs(s){let r=s.match(/<Image\s+([^>]*?)\/?>/);if(!r)return null;let e=r[1],t={},n=/(\w+)(?:=(?:"([^"]*)"|'([^']*)'|(\{[^}]+\})))?/g,a;while((a=n.exec(e))!==null){let[,i,m,o,u]=a,l=m??o??u??!0;switch(i){case"src":t.src=String(l);break;case"alt":t.alt=String(l);break;case"width":t.width=Number(l)||l;break;case"height":t.height=Number(l)||l;break;case"sizes":t.sizes=String(l);break;case"loading":t.loading=l;break;case"priority":t.priority=l===!0||l==="true";break;case"quality":t.quality=Number(l);break;case"placeholder":t.placeholder=l;break;case"class":t.class=String(l);break;case"style":t.style=String(l);break;case"decoding":t.decoding=l;break;case"fetchpriority":t.fetchpriority=l;break;case"objectFit":t.objectFit=l;break;case"objectPosition":t.objectPosition=String(l);break}}if(!t.src||!t.alt)return null;return t}async function Mo(s,r){let e=/<Image\s+[^>]*?\/?>/g,t=[],n=[],a=s,i,m=[];while((i=e.exec(s))!==null)m.push({match:i[0],index:i.index});for(let o=m.length-1;o>=0;o--){let{match:u}=m[o],l=Gs(u);if(l){let f=await r(l);if(a=a.replace(u,f.html),f.preloadLink)t.push(f.preloadLink);if(f.placeholderCss)n.push(f.placeholderCss)}}return{html:a,preloadLinks:t,styles:n}}function U(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var D=new Map;function No(){D.clear()}async function ae(s,r){let e=`${s}:${JSON.stringify(r)}`;if(D.has(e))return D.get(e);try{let t=await se(s,r);return D.set(e,t),t}catch{return null}}function Js(){return qe({name:"image",hasEndTag:!1,description:"Render an optimized image with responsive variants",transform:async(s,r,e)=>{let{src:t,alt:n,options:a}=ie(s,r,e);if(!t)return console.warn("@image directive: missing src argument"),"<!-- @image: missing src -->";let i={widths:a.widths||(a.width?[a.width]:L),formats:a.formats||j,quality:a.quality||B,placeholder:(a.placeholder==="color"?"dominant-color":a.placeholder)||"none"};if(!await G())return H(t,n||"",a);let o=await ae(t,i);if(!o)return H(t,n||"",a);return oe(o,n||"",a)}})}function ie(s,r,e){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let n=s.trim();if(n.startsWith("@image(")||n.startsWith("("))n=n.replace(/^@image\(/,"").replace(/^\(/,"").replace(/\)$/,"");let a=ne(n),i=a[0]||"",m=a[1]||"",o={};if(i&&!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")){let u=e[i];if(typeof u==="string")i=u}if(a[2])try{if(typeof a[2]==="string")o=JSON.parse(a[2]);else o=a[2]}catch{}return{src:i,alt:m,options:o}}function ne(s){let r=[],e="",t=!1,n="",a=0,i=0;for(let m=0;m<s.length;m++){let o=s[m],u=m>0?s[m-1]:"";if((o==='"'||o==="'")&&u!=="\\"){if(!t)t=!0,n=o;else if(o===n)t=!1,n="";else e+=o;continue}if(!t){if(o==="{")a++;if(o==="}")a--;if(o==="[")i++;if(o==="]")i--;if(o===","&&a===0&&i===0){r.push(e.trim()),e="";continue}}e+=o}if(e.trim())r.push(e.trim());return r}function H(s,r,e){let t=[`src="${x(s)}"`];if(r)t.push(`alt="${x(r)}"`);if(e.width)t.push(`width="${e.width}"`);if(e.height)t.push(`height="${e.height}"`);if(e.class)t.push(`class="${x(e.class)}"`);if(e.style)t.push(`style="${x(e.style)}"`);if(e.lazy!==!1)t.push('loading="lazy"');return t.push('decoding="async"'),`<img ${t.join(" ")} />`}function oe(s,r,e){let{variants:t,placeholder:n,width:a,height:i,aspectRatio:m}=s,o=new Map;for(let g of t){let p=o.get(g.format)||[];p.push(g),o.set(g.format,p)}let u=["avif","webp","jpeg","png"],l=[];for(let g of u){let p=o.get(g);if(p&&p.length>0){let v=Re(p),w=F(g),I=e.sizes||"100vw";l.push(` <source type="${w}" srcset="${x(v)}" sizes="${x(I)}" />`)}}let f=o.get("jpeg")||[],y=f.length>0?f[Math.floor(f.length/2)]:t[Math.floor(t.length/2)],c=[`src="${y?.url||s.src}"`,`alt="${x(r)}"`];if(e.width||a)c.push(`width="${e.width||a}"`);if(e.height||i)c.push(`height="${e.height||i}"`);if(e.class)c.push(`class="${x(e.class)}"`);let h=[];if(m)h.push(`aspect-ratio: ${m.toFixed(4)}`);if(e.style)h.push(e.style);if(h.length>0)c.push(`style="${h.join("; ")}"`);if(e.lazy!==!1&&!e.priority)c.push('loading="lazy"');if(c.push('decoding="async"'),e.priority)c.push('fetchpriority="high"');let d=`<picture>
|
|
34
34
|
`;if(d+=l.join(`
|
|
35
35
|
`)+`
|
|
36
36
|
`,d+=` <img ${c.join(" ")} />
|
|
@@ -39,5 +39,5 @@ ${d}
|
|
|
39
39
|
</div>`}else if(e.placeholder==="color"){let p=n.replace(/[^a-zA-Z0-9#(),.\s%-]/g,"");d=`<div id="${g}" class="stx-image-placeholder" style="background-color: ${p};">
|
|
40
40
|
${d}
|
|
41
41
|
</div>`}}if(e.priority&&y){let g=F(y.format);d=`<link rel="preload" as="image" href="${x(y.url)}" type="${g}" />
|
|
42
|
-
`+d}return d}function x(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var Lo=
|
|
43
|
-
export{Oo,
|
|
42
|
+
`+d}return d}function x(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var Lo=Js();import P from"fs";import R from"path";function jo(s={}){let{inputDirs:r=["public","src/assets","assets"],outputDir:e="dist/images",baseUrl:t="/images",formats:n=j,widths:a=L,quality:i=B,placeholder:m="none",concurrency:o=4,cache:u=!0,cacheDir:l=".stx/image-cache",referencedOnly:f=!1,verbose:y=!1}=s,c={imageReferences:new Set,processedImages:new Map,stats:{totalImages:0,optimizedImages:0,savedBytes:0,variants:0}};return{name:"stx-image-optimization",async setup(h){if(!await G()){console.warn("[stx-images] no image backend available, optimization disabled");return}if(u)await P.promises.mkdir(l,{recursive:!0});if(y){let g=await Dt();console.log("[stx-images] Plugin initialized"),console.log(` Backend: ${g?"sharp (native fast path) + ts-images":"ts-images (pure TS)"}`),console.log(` Input dirs: ${r.join(", ")}`),console.log(` Output dir: ${e}`),console.log(` Formats: ${n.join(", ")}`),console.log(` Widths: ${a.join(", ")}`)}},async buildStart(){c.imageReferences.clear(),c.processedImages.clear(),c.stats={totalImages:0,optimizedImages:0,savedBytes:0,variants:0}},async transform(h,d){if(d.endsWith(".html")||d.endsWith(".stx")){let g=ce(h);for(let p of g)c.imageReferences.add(p)}if(h.includes("<Image")||h.includes("@image"))return await ge(h,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t,processedImages:c.processedImages});return h},async buildEnd(h){if(!await G())return;await P.promises.mkdir(e,{recursive:!0});let g=[];for(let w of r){if(!P.existsSync(w))continue;let I=await Q(w);g.push(...I)}let p=f?g.filter((w)=>le(w,c.imageReferences)):g;if(c.stats.totalImages=p.length,y)console.log(`[stx-images] Processing ${p.length} images...`);let v=Y(p,o);for(let w of v)await Promise.all(w.map(async(I)=>{try{let b=await se(I,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t});c.processedImages.set(I,b),c.stats.optimizedImages++,c.stats.variants+=b.variants.length;let A=P.statSync(I).size,S=Lt(b.variants);if(c.stats.savedBytes+=Math.max(0,A-S/b.variants.length),y)console.log(` \u2713 ${R.basename(I)} \u2192 ${b.variants.length} variants`)}catch(b){console.error(`[stx-images] Error processing ${I}:`,b)}}));if(console.log("[stx-images] Optimization complete:"),console.log(` Images: ${c.stats.optimizedImages}/${c.stats.totalImages}`),console.log(` Variants: ${c.stats.variants}`),c.stats.savedBytes>0)console.log(` Saved: ~${jt(c.stats.savedBytes)}`)}}}function ce(s){let r=[],e=/src=["']([^"']+\.(jpg|jpeg|png|webp|avif|gif))["']/gi,t;while((t=e.exec(s))!==null)r.push(t[1]);let n=/<Image[^>]+src=["']([^"']+)["']/gi;while((t=n.exec(s))!==null)r.push(t[1]);let a=/@image\s*\(\s*['"]([^'"]+)['"]/gi;while((t=a.exec(s))!==null)r.push(t[1]);let i=/background(?:-image)?:\s*url\(["']?([^"')]+\.(jpg|jpeg|png|webp|avif|gif))["']?\)/gi;while((t=i.exec(s))!==null)r.push(t[1]);return r}function le(s,r){let e=R.basename(s);for(let t of r)if(t.endsWith(e)||t.includes(e))return!0;return!1}async function ge(s,r){return s}async function Q(s){let r=[];async function e(t){let n=await P.promises.readdir(t,{withFileTypes:!0});for(let a of n){let i=R.join(t,a.name);if(a.isDirectory())await e(i);else if(a.isFile()&&Nt(i))r.push(i)}}return await e(s),r}function Y(s,r){let e=[];for(let t=0;t<s.length;t+=r)e.push(s.slice(t,t+r));return e}async function Bo(s,r,e={}){if(!await G())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");return se(s,{...e,outputDir:r})}async function Fo(s,r,e={}){let{formats:t=j,widths:n=L,quality:a=B,placeholder:i="none",concurrency:m=4,verbose:o=!1}=e;if(!await G())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");await P.promises.mkdir(r,{recursive:!0});let l=await Q(s),f=[],y={totalImages:l.length,optimizedImages:0,savedBytes:0,variants:0},c=Y(l,m);for(let h of c){let d=await Promise.all(h.map(async(g)=>{try{let p=await se(g,{formats:t,widths:n,quality:a,placeholder:i,outputDir:r,baseUrl:"/"});if(y.optimizedImages++,y.variants+=p.variants.length,o)console.log(` \u2713 ${R.basename(g)}`);return p}catch(p){return console.error(`Error processing ${g}:`,p),null}}));f.push(...d.filter((g)=>g!==null))}return{processed:f,stats:y}}function Ys(s){let r={};for(let e of s)r[e.src]={variants:e.variants,placeholder:e.placeholder};return r}async function zo(s,r){let e=Ys(s);await Bun.write(r,JSON.stringify(e,null,2))}var zc={enabled:!0,widths:[320,640,768,1024,1280,1536,1920],formats:["webp","jpeg"],quality:80,devOptimize:!1,cacheDir:".stx/image-cache",placeholder:"none",inputDirs:["public","src/assets","assets"],outputDir:"dist/images",baseUrl:"/images"};
|
|
43
|
+
export{Oo,Gs,Mo,No,Js,Lo,jo,Bo,Fo,Ys,zo,zc};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Sr,kr,Cr,Zo,Qo,ea,
|
|
2
|
+
import{Sr,kr,Cr,Zo,Qo,ea,li,ta,na}from"./chunk-hc9242wm.js";export{Sr as ImageProcessorCache,li as applyTransformations,Zo as clearImageCache,ta as generateResponsiveVariants,na as generateSrcset,kr as getCachedImageResult,ea as optimizeImage,Qo as processImage,Cr as setCachedImageResult};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h,d,n,g,A}from"./chunk-
|
|
2
|
+
import{h,d,n,g,A}from"./chunk-sw8j8rnc.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,s;M.lastIndex=0;while((s=M.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Jl(e,t={},o={}){let s={...A,...o,streaming:{...q,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(m.trim())await d(m,y,e);let E=H(c),u=new Set;if(!E.some((w)=>w.type==="suspense")){let w=s.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let p=await n(c,y,e,s,u);for(let b=0;b<p.length;b+=r)i.enqueue(p.slice(b,b+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],b=new RegExp(T.source,"g"),f;while((f=b.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of p){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await n(I,y,e,s,u);i.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await n(_.content,y,e,s,u);i.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await n(_,y,e,s,u);i.enqueue(C)}}}}else{let w=new Map;for(let l of E)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
|
|
3
3
|
<template data-suspense-fallback>Loading...</template>
|
|
4
4
|
</div>`),w.set(l.name,n(l.content,y,e,s,u))}i.enqueue(`
|
|
5
5
|
<script>
|
|
@@ -17,7 +17,7 @@ import{h,d,n,g,A}from"./chunk-hxn9gk7h.js";import k from"path";var q={enabled:!0
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
})();
|
|
20
|
-
</script>`);let x=Array.from(w.entries()).map(async([l,p])=>{i.enqueue(await
|
|
20
|
+
</script>`);let x=Array.from(w.entries()).map(async([l,p])=>{i.enqueue(await gi(l,p))});await Promise.all(x)}i.close()}catch(a){i.error(a)}}})}async function gi(e,t){try{let s=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
|
|
21
21
|
<script>
|
|
22
22
|
window.__stxSuspense.resolve('${e}', \`${s}\`);
|
|
23
23
|
</script>`}catch(o){let s=o instanceof Error?o.message:String(o);return`
|
|
@@ -43,7 +43,7 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
})();
|
|
46
|
-
</script>`;function z(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function Yl(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue($a),await Promise.all(t.map(async(i)=>{let a=z(i.render(),s,i.id);r.enqueue(await
|
|
46
|
+
</script>`;function z(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function Yl(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue($a),await Promise.all(t.map(async(i)=>{let a=z(i.render(),s,i.id);r.enqueue(await gi(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function Zl(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),S=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=S,`<div data-suspense="${i}">${m}</div>`})}function Ql(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function eu(e,t={},o={}){let s={...A,...o,streaming:{...q,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(m.trim())await d(m,y,e);let E=new Set,u=s.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(u!=="manual"&&R.test(c))){let x=await n(c,y,e,s,E);for(let l=0;l<x.length;l+=r)i.enqueue(x.slice(l,l+r))}else{let x=[],l=new RegExp(T.source,"g"),p;while((p=l.exec(c))!==null)x.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let b=0;for(let f of x){if(f.start>b){let _=c.slice(b,f.start);if(_.trim()){let C=await n(_,y,e,s,E);i.enqueue(C)}}let v=await n(f.content,y,e,s,E);i.enqueue(v),b=f.end}if(b<c.length){let f=c.slice(b);if(f.trim()){let v=await n(f,y,e,s,E);i.enqueue(v)}}}i.close()}catch(a){i.error(a)}}})}async function tu(e,t={}){let o={...A,...t,streaming:{...q,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),S=a,m={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let u=c[1],R=c[2];m[u]=R}let y=a.replace(T,"");return{renderShell:async(u={})=>{let R={...u,__filename:e,__dirname:k.dirname(e)};return await d(i,R,e),n(y,R,e,o,new Set)},renderSection:async(u,R={})=>{try{if(!m[u])return`<div class="error-message">Section "${h(u)}" not found in template "${h(e)}"</div>`;let w={...R,__filename:e,__dirname:k.dirname(e)};await d(i,w,e);let x=new Set;return await n(m[u],w,e,o,x)}catch(w){let x=w instanceof Error?w.message:String(w);return g("Expression",x,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>S}}var Ea={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Ta={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,S=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=S?S[1].trim():"",c=S?e.replace(S[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
|
|
47
47
|
${c}
|
|
48
48
|
<script type="application/json" data-island-props="${a}">
|
|
49
49
|
${m?`{${m}}`:"{}"}
|
|
@@ -191,4 +191,4 @@ else {
|
|
|
191
191
|
stx.hydrate();
|
|
192
192
|
}
|
|
193
193
|
})();`}
|
|
194
|
-
export{Jl,
|
|
194
|
+
export{Jl,gi,$a,Yl,Zl,Ql,eu,tu,Ea,Ta,nu,ru,su,iu};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$r,Er,Tr,ra,_r,Rr,sa,Ar,Pr,
|
|
2
|
+
import{$r,Er,Tr,ra,_r,Rr,sa,Ar,Pr,ui,ia}from"./chunk-dtvwes4f.js";export{$r as VideoProcessorCache,ui as analyzeVideo,ra as clearVideoCache,Pr as generateDASHManifest,Ar as generateHLSManifest,_r as generatePoster,sa as generateSpriteSheet,Rr as generateThumbnails,Er as getCachedVideoResult,ia as processVideo,Tr as setCachedVideoResult};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{d,
|
|
2
|
+
import{d,ss,Ki,Xi,gc,mc,hc,yc,bc,wc,Ve,N,Ue,vc,Vn,xc,io,Sc,We,r,Un,oo,g,ee,Lu}from"./chunk-sw8j8rnc.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-720pm5yj.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-eaa5rxst.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{ee as clearComponentCache,Sc as componentClientSignalNames,ss as convertToCommonJS,g as createDetailedErrorMessage,bc as extractDirectiveNames,Ki as extractScriptFromTemplate,d as extractVariables,r as fileExists,Lu as getComponentCacheStats,mc as getPositionInfo,N as getSharedTranspiler,oo as getSourceLineInfo,yc as hasDirectives,Xi as hasVariables,xc as isHydrateTrigger,wc as isJavaScriptScript,We as renderComponentWithSlot,Un as resolveTemplatePath,vc as scopeOnRootElement,Ve as shouldTranspileTypeScript,io as slotContentHasExpressions,Ue as transpileTypeScript,Vn as userComponentFileExists,hc as validateDirective,gc as validateTemplate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{yt,Fr,zr,Hr,mu,Vr}from"./chunk-2psf6w7b.js";import"./chunk-t7x753ga.js";import"./chunk-ptjqacjd.js";import"./chunk-pxqs3psa.js";export{zr as buildServerApi,mu as createServerApi,yt as discoverServerApi,Fr as generateApiTypes,Vr as isServerApiSource,Hr as productionApiDispatcher};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{F}from"./chunk-24e7qjb8.js";import S from"fs";import g from"path";import q from"crypto";var T=new Set(["webp","avif","jpeg","png"]),k=new Set(["cover","contain","fill","inside","outside"]),D=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),C=4096,U=80,A="cover";async function
|
|
3
|
-
export{
|
|
2
|
+
import{F}from"./chunk-24e7qjb8.js";import S from"fs";import g from"path";import q from"crypto";var T=new Set(["webp","avif","jpeg","png"]),k=new Set(["cover","contain","fill","inside","outside"]),D=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),C=4096,U=80,A="cover";async function Qs(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=L(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=S.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 S.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=q.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":F(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 N(),R=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,R),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(R),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function Ko(e){return async(t)=>await Qs(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function L(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(!D.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??C,l=t.maxHeight??C,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(!T.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...T].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??U;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||A;if(!k.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...k].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function N(){return await import("./chunk-6wmxrn6x.js")}
|
|
3
|
+
export{Qs,Ko};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{m}from"./chunk-
|
|
2
|
+
import{m}from"./chunk-eaa5rxst.js";import{H,St,He,gs,ms,Zi,Qi,eo,to,Hn,hs,no,ro,so,i}from"./chunk-sw8j8rnc.js";import{Ir}from"./chunk-51a50b67.js";import{a}from"./chunk-wtms9jhs.js";import{existsSync as M,readFileSync as K}from"fs";import b from"path";var me=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),te=St.filter((e)=>!me.has(e)).sort(),ne=[...m].sort(),he=[...new Set([...te,...ne])].sort(),be=new Set(te),ye=new Set(ne),xe=new Set(he),ee=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Se(e,t){if(t==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function ie(e,t){let r=[];for(let u of t){if(u.offset===void 0)continue;let s=u.kind==="server"?be:ye;ee.lastIndex=0;for(let l of u.code.matchAll(ee)){let g=l.index+l[0].indexOf("{")+1;for(let h of l[1].matchAll(/[^,]+/g)){let S=h[0];if(/^\s*type\s/.test(S))continue;let x=/^\s*([A-Za-z_$][\w$]*)/.exec(S);if(!x)continue;let o=x[1];if(!xe.has(o)||s.has(o))continue;let f=u.offset+g+h.index+x[0].length-o.length,p=e.slice(0,f),w=p.split(`
|
|
3
3
|
`).length;r.push({line:w,column:f-(p.lastIndexOf(`
|
|
4
4
|
`)+1)+1,offset:f,length:o.length,name:o,kind:u.kind,message:Se(o,u.kind)})}}}return r}import T from"path";var ke="@stacksjs/stx-typescript-plugin";function we(e,t){let r=T.resolve(e);for(;;){let u=T.join(r,"tsconfig.json");if(t(u))return u;let s=T.dirname(r);if(s===r)return;r=s}}function se(e,t,r){let u=we(e,r);if(!u)return;let s=new Set,l=(g)=>{if(s.has(g))return;s.add(g);let h=t(g);if(!h)return;let S=h.compilerOptions?.plugins;if(Array.isArray(S)){let o=S.find((p)=>p?.name===ke),f=Array.isArray(o?.libs)?o.libs.filter((p)=>typeof p==="string"):[];return o?{configPath:g,libs:f.map((p)=>T.resolve(T.dirname(g),p))}:null}let x=typeof h.extends==="string"?[h.extends]:Array.isArray(h.extends)?h.extends:[];for(let o of[...x].reverse()){if(typeof o!=="string"||!o.startsWith("."))continue;let f=T.resolve(T.dirname(g),o.endsWith(".json")?o:`${o}.json`),p=l(f);if(p!==void 0)return p}return};return l(u)??void 0}function Ho(e,t="",r=""){let u=e.startLine>1?`
|
|
5
|
-
`.repeat(e.startLine-1):"",s=
|
|
5
|
+
`.repeat(e.startLine-1):"",s=hs(e)+ms(gs(e.code)),l=e.kind==="client"||e.kind==="plain"?eo(t,e.code):"";return Hn(`${u+s}
|
|
6
6
|
${l}
|
|
7
7
|
export {}
|
|
8
8
|
`,r)}var $e=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function ve(e){if(e.length===0)return"";let t=["// Generated \u2014 the composables the runtime publishes as bare globals."],r=new Set(m),u=[];for(let{file:s,names:l}of e){let g=JSON.stringify(s.replace(/\\/g,"/").replace(/\.ts$/,""));u.push(` export * from ${g}`);for(let h of l){if(r.has(h)||$e.has(h))continue;r.add(h),t.push(`declare const ${h}: typeof import(${g})[${JSON.stringify(h)}]`)}}return t.push("declare module '@composables' {",...u,"}"),t.join(`
|
|
9
|
-
`)}function
|
|
9
|
+
`)}function Zs(e,t,r){return`${e}.__stx_${t}${r}.ts`}function Hc(e){return e.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function Vo(){return re("stx.d.ts")}function Uo(){return re("stx-module.d.ts")}function re(e){for(let t of[b.resolve(import.meta.dir,"..",e),b.resolve(import.meta.dir,"..","..",e)])if(M(t))return t;return null}var Te=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function De(e){return e>=1000&&e<2000}function oe(e){let t="",r=!1,u=!1;for(let s=0;s<e.length;s++){let l=e[s];if(r){if(t+=l,u)u=!1;else if(l==="\\")u=!0;else if(l==='"')r=!1;continue}if(l==='"'){r=!0,t+=l;continue}if(l==="/"&&e[s+1]==="/"){while(s<e.length&&e[s]!==`
|
|
10
10
|
`)s++;t+=`
|
|
11
11
|
`;continue}if(l==="/"&&e[s+1]==="*"){s+=2;while(s<e.length&&!(e[s]==="*"&&e[s+1]==="/"))s++;s++;continue}t+=l}return t.replace(/,(\s*[}\]])/g,"$1")}function Ee(e){try{return JSON.parse(oe(K(e,"utf8")))}catch{return}}function Oe(e){let t=b.resolve(e),r;for(;;){let o=b.join(t,"tsconfig.json");if(M(o)){r=o;break}let f=b.dirname(t);if(f===t)break;t=f}if(!r)return{};let u=new Set,s=r,l,g,h=r;while(s&&!u.has(s)){u.add(s);let o;try{o=JSON.parse(oe(K(s,"utf8")))}catch{break}let f=o?.compilerOptions??{};if(!l&&f.paths&&typeof f.paths==="object")l=f.paths,h=s;if(!g&&typeof f.baseUrl==="string")g=b.resolve(b.dirname(s),f.baseUrl);if(l&&g)break;s=typeof o?.extends==="string"?b.resolve(b.dirname(s),o.extends.endsWith(".json")?o.extends:`${o.extends}.json`):void 0}if(!l)return{};let S=g??b.dirname(h),x={};for(let[o,f]of Object.entries(l)){if(!Array.isArray(f))continue;x[o]=f.map((p)=>typeof p==="string"&&!b.isAbsolute(p)?b.resolve(S,p):p)}return{paths:x}}async function Vc(e,t={}){let r=t.client!==!1,u=t.server!==!1,s=t.templates!==!1,l=t.componentsDir??(s?(await i()).componentsDir:void 0),g=new Map,h=new Map,S=[],x=[],o=0,f=0,p=Vo();for(let n of e){let c=await Bun.file(n).text(),y=He(c).filter((d)=>{if(d.kind==="server")return u;return r}),k=He(c).filter((d)=>d.kind==="server").map((d)=>d.code).join(`
|
|
12
|
-
`);for(let d of ie(c,y))S.push({file:n,line:d.line,column:d.column,code:0,message:d.message,category:"error",blockKind:d.kind});if(r&&k){let d=y.filter((O)=>O.kind!=="server"),E=[...new Set(d.flatMap((O)=>to(k,O.code)))];if(E.length>0)h.set(n,{names:E,line:d[0].startLine,kind:d[0].kind})}let D=b.dirname(b.resolve(n)),v=s?no(c,{runtimeGlobals:!p,originDir:D,filePath:b.resolve(n),componentsDir:l}):null,R=v?[...v.lineMap.values()].filter((d)=>d.expression).length:0;if(y.length===0&&R===0)continue;if(x.push(n),o+=y.length,f+=R,y.forEach((d,E)=>{g.set(
|
|
12
|
+
`);for(let d of ie(c,y))S.push({file:n,line:d.line,column:d.column,code:0,message:d.message,category:"error",blockKind:d.kind});if(r&&k){let d=y.filter((O)=>O.kind!=="server"),E=[...new Set(d.flatMap((O)=>to(k,O.code)))];if(E.length>0)h.set(n,{names:E,line:d[0].startLine,kind:d[0].kind})}let D=b.dirname(b.resolve(n)),v=s?no(c,{runtimeGlobals:!p,originDir:D,filePath:b.resolve(n),componentsDir:l}):null,R=v?[...v.lineMap.values()].filter((d)=>d.expression).length:0;if(y.length===0&&R===0)continue;if(x.push(n),o+=y.length,f+=R,y.forEach((d,E)=>{g.set(Zs(n,d.kind,E),{source:Ho(d,k,D),origin:n,kind:d.kind})}),v&&R>0)g.set(Zs(n,"template",0),{source:v.text,origin:n,kind:"template",virtual:v})}if(g.size===0)return{diagnostics:S,checkedFiles:x,blockCount:0,expressionCount:0};let w=(t.extraLibs??[]).map((n)=>b.resolve(n)),ce=se(e.length>0?b.dirname(b.resolve(e[0])):process.cwd(),Ee,M);for(let n of ce?.libs??[])if(!w.includes(n)&&M(n))w.push(n);if(p)w.push(p);let G=p?Uo():null;if(G)w.push(G);let X=`${a()}/typecheck/__stx_globals.d.ts`,ae=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",Zi(p?Qi(K(p,"utf8")):void 0),...p?[]:["declare const window: any",...m.map((n)=>`declare const ${n}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...H.map((n)=>`declare const ${n}: any`)].join(`
|
|
13
13
|
`),ve(await Ir())].filter(Boolean).join(`
|
|
14
14
|
`),_=`${a()}/typecheck`;await Bun.$`rm -rf ${_}`.quiet().nothrow(),await Bun.$`mkdir -p ${_}`.quiet().nothrow(),await Bun.write(X,ae);let N=new Map,le=0;for(let[n,c]of g){let y=`${le++}_${n.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${_}/${y}`,c.source),N.set(y,c)}let ue={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...Oe(e.length>0?b.dirname(b.resolve(e[0])):process.cwd()),...t.compilerOptions??{}},F=async(n,c)=>{let y=`${_}/tsconfig${c===1?"":`.${c}`}.json`;await Bun.write(y,JSON.stringify({compilerOptions:ue,files:n.map((D)=>`${_}/${D}`).concat(X,...w)},null,2));let k=Bun.spawnSync(["bun","x","tsc","-p",y,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(k.stdout)+new TextDecoder().decode(k.stderr),exitCode:k.exitCode??0}},V=await F([...N.keys()],1),J=V.output,I=[],U=V.exitCode,W=0,pe=new Set(w.map((n)=>n.split("/").pop())),z=0,B=new Set,q=(n)=>{for(let c of n.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
|
|
15
15
|
`)){let y=c.match(Te);if(!y)continue;if(W++,pe.has(y[1].split("/").pop()))z++;let[,k,D,v,R,d,E]=y,O=k.split("/").pop(),C=N.get(O);if(!C)continue;if(De(Number(d)))B.add(O);let A=Number(D),L=Number(v),Y;if(C.virtual){let P=so(C.virtual,A,L);if(!P?.expression)continue;if(ro(P,Number(d)))continue;A=P.line,L=P.column,Y=P.expression.code.trim()}I.push({file:C.origin,line:A,column:L,code:Number(d),message:E,category:R==="error"?"error":"warning",blockKind:C.kind,expression:Y})}};q(J);let de=W,fe=z;if(B.size>0&&B.size<N.size){let n=[...N.keys()].filter((c)=>!B.has(c));q((await F(n,2)).output)}if(r)for(let[n,c]of h){if(c.names.length===0)continue;I.push({file:n,line:c.line,column:1,code:0,message:`${c.names.length===1?"1 value reaches":`${c.names.length} values reach`} this block on the implicit bridge and ${c.names.length===1?"is":"are"} untyped: ${c.names.join(", ")}. Declare them with defineClientPayload({ ${c.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:c.kind})}I.push(...S);let Z=new Set,j=I.filter((n)=>{let c=`${n.file}:${n.line}:${n.column}:${n.code}:${n.message}`;if(Z.has(c))return!1;return Z.add(c),!0});j.sort((n,c)=>n.file.localeCompare(c.file)||n.line-c.line||n.column-c.column);let Q=fe>0&&j.length===0,ge=Q||U!==0&&de===0?`${Q?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${U} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
|
|
@@ -17,4 +17,4 @@ ${J.trim().split(`
|
|
|
17
17
|
`).slice(0,12).join(`
|
|
18
18
|
`)||"(no output)"}`:void 0;return{diagnostics:j,checkedFiles:x,blockCount:o,expressionCount:f,failure:ge}}function Uc(e){return e.map((t)=>{let r=t.blockKind==="template"?`[template: ${t.expression??""}]`:`[${t.blockKind==="plain"?"<script>":`<script ${t.blockKind}>`}]`;return`${t.file}:${t.line}:${t.column} ${t.category} TS${t.code} ${t.message} ${r}`}).join(`
|
|
19
19
|
`)}
|
|
20
|
-
export{Ho,
|
|
20
|
+
export{Ho,Zs,Hc,Vo,Uo,Vc,Uc};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Pn,Oe,Ne,me,Hi,Mn,Z,q,nn,d,n,A}from"./chunk-
|
|
2
|
+
import{Pn,Oe,Ne,me,Hi,Mn,Z,q,nn,d,n,A}from"./chunk-sw8j8rnc.js";import{dirname as C,resolve as R}from"path";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function _(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(s,p){let u;while((u=s.exec(o))!==null){let t=u.index,i=t+u[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:r,content:m}=Pn(o),c=await(e.renderer??((s)=>Oe(s)))(m);return{html:_(c),frontmatter:r??{}}}function k(o){let e=o,r=Z(o);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),u;while((u=m.exec(o))!==null){let i=u[1],l=u[2],f=u[0],g=i.includes("server");if(p(l))s.push(f);else if(g)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let g=l.index+l[0].length,x=t.indexOf("</script>",g);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let g=f.length-1;g>=0;g--)t=t.substring(0,f[g].start)+t.substring(f[g].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function v(o,e){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -9,10 +9,10 @@ import{Pn,Oe,Ne,me,Hi,Mn,Z,q,nn,d,n,A}from"./chunk-hxn9gk7h.js";import{dirname a
|
|
|
9
9
|
<body>
|
|
10
10
|
${o}
|
|
11
11
|
</body>
|
|
12
|
-
</html>`}async function
|
|
12
|
+
</html>`}async function Ci(o,e={}){let r=R(o),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let a=await m.text(),c=null;if(h(r)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=R(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:u,injectCSS:t,...i}=e,l={...e.context||{}};nn(l);let f=await S(a,r,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),g=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(g,s,w)}return S(a,r,e)}async function S(o,e,r={}){let{templateContent:m,serverScripts:a,clientScripts:c}=k(o),s={...A,...r.options},p={__filename:e,__dirname:C(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...Mn(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let i of a)await d(i,p,e);let u=new Set,t=m;if(t=await n(t,p,e,s,u),Hi(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
|
|
13
13
|
${c.join(`
|
|
14
14
|
`)}`}else{if(r.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=Ne(p),g=(await Promise.all(c.map(async(w)=>{let y=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!y)return w;return await me(y[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})}))).join(`
|
|
15
15
|
`);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${g}
|
|
16
16
|
$1`);else t+=`
|
|
17
|
-
${g}`}t=await q(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=v(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-
|
|
18
|
-
export{
|
|
17
|
+
${g}`}t=await q(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=v(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-cqwbzm5r.js");t=await i(t)}catch{}return t}
|
|
18
|
+
export{Ci};
|
|
@@ -17,7 +17,7 @@ ${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\
|
|
|
17
17
|
`)}function ae(e,r,n){let i=e.split(`
|
|
18
18
|
`),s=Math.max(0,r-n-1),a=Math.min(i.length-1,r+n-1),g="\x1B[90m",u="\x1B[31m",d="\x1B[0m",f=[];for(let m=s;m<=a;m++){let h=(m+1).toString().padStart(4),E=m===r-1,x=E?"\x1B[31m>\x1B[0m":" ",y=E?`\x1B[31m${i[m]}\x1B[0m`:`\x1B[90m${i[m]}\x1B[0m`;f.push(`${x}\x1B[90m${h}\x1B[0m | ${y}`)}return f.join(`
|
|
19
19
|
`)}function M(e){return e.replace(/--/g,"- -").replace(/>/g,">")}function ce(e,r){let i=e.substring(0,r).split(`
|
|
20
|
-
`);return{line:i.length,column:i[i.length-1].length}}function o(e,r,n){return U({type:e,message:r,code:n,format:"html"}).formatted}async function te(e,r,n){try{return await e()}catch(i){if(n&&i instanceof Error)n(i);return r}}var
|
|
20
|
+
`);return{line:i.length,column:i[i.length-1].length}}function o(e,r,n){return U({type:e,message:r,code:n,format:"html"}).formatted}async function te(e,r,n){try{return await e()}catch(i){if(n&&i instanceof Error)n(i);return r}}var Ts={isEnabled(){return R().enableAutoRecovery},fixCommonSyntaxErrors(e){let r=R();if(!r.enableAutoRecovery)return{fixed:e,fixes:[]};let n=e,i=[],s=(n.match(/\{\{/g)||[]).length,a=(n.match(/\}\}/g)||[]).length;if(s>a){let u=s-a;n+="}}".repeat(u),i.push(`Added ${u} missing closing braces '}}'`)}let g=["if","foreach","for","switch","section"];for(let u of g){let d=(n.match(new RegExp(`@${u}\\b`,"g"))||[]).length,f=(n.match(new RegExp(`@end${u}\\b`,"g"))||[]).length;if(d>f){let m=d-f;for(let h=0;h<m;h++)n+=`
|
|
21
21
|
@end${u}`;i.push(`Added ${m} missing @end${u}`)}}if(i.length>0&&r.logRecoveryWarnings)console.warn("[stx] Auto-recovery applied fixes:"),i.forEach((u)=>console.warn(` - ${u}`)),console.warn(" Consider fixing these issues in your template.");return{fixed:n,fixes:i}},createFallbackContent(e,r){if(D())return`<!-- ${e} failed: ${r.message} -->`;return"<!-- stx rendering error -->"}};class O{errors=[];maxErrors;enableFileLogging;logFilePath;logFormat;maxFileSize;maxLogFiles;minLevel;writeQueue=Promise.resolve();constructor(e={}){this.maxErrors=e.maxErrors??1000,this.enableFileLogging=e.enableFileLogging??!1,this.logFilePath=e.logFilePath??".stx/errors.log",this.logFormat=e.logFormat??"json",this.maxFileSize=e.maxFileSize??10485760,this.maxLogFiles=e.maxLogFiles??5,this.minLevel=e.minLevel??"all"}configure(e){if(e.maxErrors!==void 0)this.maxErrors=e.maxErrors;if(e.enableFileLogging!==void 0)this.enableFileLogging=e.enableFileLogging;if(e.logFilePath!==void 0)this.logFilePath=e.logFilePath;if(e.logFormat!==void 0)this.logFormat=e.logFormat;if(e.maxFileSize!==void 0)this.maxFileSize=e.maxFileSize;if(e.maxLogFiles!==void 0)this.maxLogFiles=e.maxLogFiles;if(e.minLevel!==void 0)this.minLevel=e.minLevel}log(e,r,n="error"){let i={timestamp:new Date,error:e,context:r,level:n};if(this.errors.push(i),this.errors.length>this.maxErrors)this.errors=this.errors.slice(-this.maxErrors);if(this.enableFileLogging&&this.shouldLog(n))this.writeToFile(i)}shouldLog(e){if(this.minLevel==="all")return!0;if(this.minLevel==="warning")return e==="error"||e==="warning";if(this.minLevel==="error")return e==="error";return!0}formatEntry(e){if(this.logFormat==="json")return JSON.stringify({timestamp:e.timestamp.toISOString(),level:e.level||"error",type:e.error.constructor.name,message:e.error.message,stack:e.error.stack,context:e.context});let r=[`[${e.timestamp.toISOString()}] [${(e.level||"error").toUpperCase()}] ${e.error.constructor.name}: ${e.error.message}`];if(e.error.stack)r.push(` Stack: ${e.error.stack.split(`
|
|
22
22
|
`).slice(1).join(`
|
|
23
23
|
`)}`);if(e.context)r.push(` Context: ${JSON.stringify(e.context)}`);return r.join(`
|
|
@@ -25,7 +25,7 @@ ${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\
|
|
|
25
25
|
`;r.appendFileSync(this.logFilePath,s,"utf-8")}catch(r){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",r)}})}async rotateIfNeeded(e){try{if(!e.existsSync(this.logFilePath))return;if(e.statSync(this.logFilePath).size<this.maxFileSize)return;for(let n=this.maxLogFiles-1;n>=1;n--){let i=`${this.logFilePath}.${n}`,s=`${this.logFilePath}.${n+1}`;if(e.existsSync(i))if(n>=this.maxLogFiles-1)e.unlinkSync(i);else e.renameSync(i,s)}if(this.maxLogFiles<=1)e.writeFileSync(this.logFilePath,"");else e.renameSync(this.logFilePath,`${this.logFilePath}.1`)}catch(r){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",r)}}getRecentErrors(e=10){return this.errors.slice(-e)}getErrorsByType(e){return this.errors.filter((r)=>r.error.constructor.name===e)}getErrorsByLevel(e){return this.errors.filter((r)=>r.level===e)}clear(){this.errors.length=0}async clearLogFile(){try{let e=await import("fs");if(e.existsSync(this.logFilePath))e.writeFileSync(this.logFilePath,"","utf-8")}catch(e){if(process.env.STX_DEBUG==="true")console.error("Failed to clear error log:",e)}}getStats(){let e={},r={error:0,warning:0,info:0};for(let n of this.errors){let i=n.error.constructor.name;e[i]=(e[i]||0)+1;let s=n.level||"error";r[s]=(r[s]||0)+1}return{total:this.errors.length,byType:e,byLevel:r}}async exportToFile(e,r="json"){let n=await import("fs"),i=await import("path"),s=i.dirname(e);if(!n.existsSync(s))n.mkdirSync(s,{recursive:!0});if(r==="json"){let a=this.errors.map((g)=>({timestamp:g.timestamp.toISOString(),level:g.level||"error",type:g.error.constructor.name,message:g.error.message,stack:g.error.stack,context:g.context}));n.writeFileSync(e,JSON.stringify(a,null,2),"utf-8")}else{let a=this.errors.map((g)=>this.formatEntry(g));n.writeFileSync(e,a.join(`
|
|
26
26
|
|
|
27
27
|
`),"utf-8")}}async flush(){await this.writeQueue}}var _=new O,Et={isDevelopment(){return D()},logDetailedError(e,r){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",e.message),console.error("Stack:",e.stack),r)console.error("Context:",r);console.error("========================")},createErrorReport(e,r){let n=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${e.message}`,`Type: ${e.constructor.name}`,`Stack: ${e.stack}`];if(r)n.push(`Context: ${JSON.stringify(r,null,2)}`);return n.push("========================"),n.join(`
|
|
28
|
-
`)}};var le={maxSanitizeDepth:10,allowBracketNotation:!1},X={...le};var F=/\bnew\s+/,N="__stx_safe_ctors",G=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,F,/\bdelete\s+/,/\bthis\b/],ue=new Set(["eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",N]),H=new Set(["__proto__","constructor","prototype"]),ge=/[\w)\]]\s*\[\s*['"]/;function q(e){let r="",n=[],i=null,s=!1;for(let a=0;a<e.length;a++){let g=e[a];if(s){s=!1;continue}if(g==="\\"&&i){s=!0;continue}if(i){if(i==="`"&&g==="$"&&a+1<e.length&&e[a+1]==="{"){let u=1;a+=2;while(a<e.length&&u>0){if(e[a]==="{")u++;else if(e[a]==="}")u--;if(u>0)r+=e[a],n.push(a),a++}continue}if(g===i)i=null;continue}if(g==='"'||g==="'"||g==="`"){i=g;continue}r+=g,n.push(a)}return{text:r,map:n}}function fe(e){return q(e).text}var J=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],Y=(()=>{let e={Date,URL,URLSearchParams},r=Intl;for(let n of J)if(typeof r[n]==="function")e[`Intl_${n}`]=r[n];return Object.freeze(Object.assign(Object.create(null),e))})(),me=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,j=/(?<![\w$])new(?![\w$])/g,B=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${J.join(",")}}() are allowed`;function pe(e){let{text:r,map:n}=q(e),i=[];j.lastIndex=0;let s;while((s=j.exec(r))!==null){let g=s.index;if(/(?<!\.)\.\s*$/.test(r.slice(0,g)))continue;let u=me.exec(r.slice(g)),d=u?.[3],f=!u?null:d?`Intl_${d}`:u[2];if(!u||!f||!(f in Y))throw new b(`matched /${F.source}/; ${B}`,e);let m=g+u[0].length,h=n[g],E=n[m-1]+1;if(e.slice(h,E)!==r.slice(g,m))throw new b(`matched /${F.source}/; ${B}`,e);let x=h+3+u[1].length;i.push({start:x,end:x+u[2].length,key:f})}let a=e;for(let g=i.length-1;g>=0;g--){let u=i[g];a=`${a.slice(0,u.start)}${N}.${u.key}${a.slice(u.end)}`}return{source:a,usesSafeConstructors:i.length>0}}class b extends Error{rule;expression;constructor(e,r,n){super(n??`Potentially unsafe expression (${e}): ${r}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=r}}function dn(e){try{return T(e),null}catch(r){return r instanceof b?r.rule:r instanceof Error?r.message:String(r)}}function de(e,r){let n=/[$A-Z_a-z][$\w]*/g,i;while((i=n.exec(e))!==null){let s=i[0],a=e[i.index-1];if(ue.has(s))throw new b(`matched /\\b${s}\\b/; identifier ${s}`,r);if(a==="."&&H.has(s))throw new b(`matched /.${s}/; property ${s}`,r)}}function he(e){let r=/\[\s*(['"])(.*?)\1\s*\]/g,n;while((n=r.exec(e))!==null){let i=n[2];if(!H.has(i))continue;let s=e.slice(0,n.index).match(/\S(?=\s*$)/)?.[0],a=e.slice(n.index+n[0].length).match(/^\s*(\S)/)?.[1];if(!((s==="{"||s===",")&&a===":"))throw new b(`bracket key ${n[2]}`,e)}}function T(e){let r=e.trim(),n=fe(r);de(n,r),he(r);for(let i of G){if(i===F)continue;if(i.test(n))throw new b(`matched /${i.source}/`,r)}if(!X.allowBracketNotation&&ge.test(r))throw new b("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",r,`Bracket notation with strings not allowed: ${r}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return pe(r)}function
|
|
28
|
+
`)}};var le={maxSanitizeDepth:10,allowBracketNotation:!1},X={...le};var F=/\bnew\s+/,N="__stx_safe_ctors",G=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,F,/\bdelete\s+/,/\bthis\b/],ue=new Set(["eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",N]),H=new Set(["__proto__","constructor","prototype"]),ge=/[\w)\]]\s*\[\s*['"]/;function q(e){let r="",n=[],i=null,s=!1;for(let a=0;a<e.length;a++){let g=e[a];if(s){s=!1;continue}if(g==="\\"&&i){s=!0;continue}if(i){if(i==="`"&&g==="$"&&a+1<e.length&&e[a+1]==="{"){let u=1;a+=2;while(a<e.length&&u>0){if(e[a]==="{")u++;else if(e[a]==="}")u--;if(u>0)r+=e[a],n.push(a),a++}continue}if(g===i)i=null;continue}if(g==='"'||g==="'"||g==="`"){i=g;continue}r+=g,n.push(a)}return{text:r,map:n}}function fe(e){return q(e).text}var J=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],Y=(()=>{let e={Date,URL,URLSearchParams},r=Intl;for(let n of J)if(typeof r[n]==="function")e[`Intl_${n}`]=r[n];return Object.freeze(Object.assign(Object.create(null),e))})(),me=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,j=/(?<![\w$])new(?![\w$])/g,B=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${J.join(",")}}() are allowed`;function pe(e){let{text:r,map:n}=q(e),i=[];j.lastIndex=0;let s;while((s=j.exec(r))!==null){let g=s.index;if(/(?<!\.)\.\s*$/.test(r.slice(0,g)))continue;let u=me.exec(r.slice(g)),d=u?.[3],f=!u?null:d?`Intl_${d}`:u[2];if(!u||!f||!(f in Y))throw new b(`matched /${F.source}/; ${B}`,e);let m=g+u[0].length,h=n[g],E=n[m-1]+1;if(e.slice(h,E)!==r.slice(g,m))throw new b(`matched /${F.source}/; ${B}`,e);let x=h+3+u[1].length;i.push({start:x,end:x+u[2].length,key:f})}let a=e;for(let g=i.length-1;g>=0;g--){let u=i[g];a=`${a.slice(0,u.start)}${N}.${u.key}${a.slice(u.end)}`}return{source:a,usesSafeConstructors:i.length>0}}class b extends Error{rule;expression;constructor(e,r,n){super(n??`Potentially unsafe expression (${e}): ${r}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=r}}function dn(e){try{return T(e),null}catch(r){return r instanceof b?r.rule:r instanceof Error?r.message:String(r)}}function de(e,r){let n=/[$A-Z_a-z][$\w]*/g,i;while((i=n.exec(e))!==null){let s=i[0],a=e[i.index-1];if(ue.has(s))throw new b(`matched /\\b${s}\\b/; identifier ${s}`,r);if(a==="."&&H.has(s))throw new b(`matched /.${s}/; property ${s}`,r)}}function he(e){let r=/\[\s*(['"])(.*?)\1\s*\]/g,n;while((n=r.exec(e))!==null){let i=n[2];if(!H.has(i))continue;let s=e.slice(0,n.index).match(/\S(?=\s*$)/)?.[0],a=e.slice(n.index+n[0].length).match(/^\s*(\S)/)?.[1];if(!((s==="{"||s===",")&&a===":"))throw new b(`bracket key ${n[2]}`,e)}}function T(e){let r=e.trim(),n=fe(r);de(n,r),he(r);for(let i of G){if(i===F)continue;if(i.test(n))throw new b(`matched /${i.source}/`,r)}if(!X.allowBracketNotation&&ge.test(r))throw new b("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",r,`Bracket notation with strings not allowed: ${r}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return pe(r)}function _s(e){return T(e),e.trim()}function Rs(e){let r={};r.Math=Math,r.JSON=JSON,r.Date=Date,r.String=String,r.Number=Number,r.Boolean=Boolean,r.Array=Array,r.parseInt=Number.parseInt,r.parseFloat=Number.parseFloat,r.isNaN=Number.isNaN,r.isFinite=Number.isFinite,r.encodeURIComponent=encodeURIComponent,r.decodeURIComponent=decodeURIComponent;for(let[n,i]of Object.entries(e)){if(n.startsWith("__")||G.some((s)=>s.test(n)))continue;if(i&&typeof i==="object"&&!Array.isArray(i))r[n]=A(i);else r[n]=i}return r}function A(e,r=0){if(r>=X.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>A(i,r+1));if(e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error)return e;let n={};for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||i==="constructor"||i==="prototype")continue;if(s&&typeof s==="object")n[i]=A(s,r+1);else n[i]=s}return n}function c(e,r){try{let n=Rs(r),i=Object.keys(n),s=Object.values(n);return l(e,i)(...s)}catch{return}}function p(e){try{return _s(e),!0}catch{return!1}}function P(e,r){try{let n=c(e,r);if(n&&typeof n==="object"&&!Array.isArray(n))return n;return{}}catch{return{}}}var Z=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),Ee=2000,C=new Map;function V(e,r){let n=`${e.join(",")}\x00${r}`,i=C.get(n);if(i)return i;let s=Function(...e,r);if(C.size>=Ee)C.clear();return C.set(n,s),s}function ve(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var xe=/^[A-Za-z_$][\w$]*$/;function Ye(e){return xe.test(e)&&!Z.has(e)}function l(e,r){let{source:n,usesSafeConstructors:i}=T(e),s=[];for(let f=0;f<r.length;f++){if(!Ye(r[f]))continue;if(r[f]===N)continue;s.push({key:r[f],index:f})}s.sort((f,m)=>f.key.localeCompare(m.key));let a=s.map((f)=>f.key),g=s.map((f)=>f.index),u=`
|
|
29
29
|
'use strict';
|
|
30
30
|
try {
|
|
31
31
|
return ${n};
|
|
@@ -37,4 +37,4 @@ catch (e) {
|
|
|
37
37
|
throw e;
|
|
38
38
|
}
|
|
39
39
|
`;return be(i?(f)=>{let m=V([N,...a,...f],u);return(...h)=>m(Y,...h)}:(f)=>V([...a,...f],u),a,r,s,g)}function be(e,r,n,i,s){let a=e([]),g=i.every((d,f)=>d.index===f);if(r.length===n.length&&g)return W(a,r,e);return W((...d)=>{let f=Array(s.length);for(let m=0;m<s.length;m++)f[m]=d[s[m]];return a(...f)},r,e,(d)=>{a=e(d)})}function W(e,r,n,i){let a=/^(\w+) is not defined$/,g=e,u=[],d=new Set(r);return(...f)=>{for(let m=0;m<=8;m++)try{return g(...f)}catch(h){let E=h instanceof Error?h.message:"",x=a.exec(E);if(!(h instanceof ReferenceError)||!x)return;let y=x[1];if(d.has(y)||Z.has(y))return;if(d.add(y),u.push(y),i)i(u);else g=n(u)}return}}function nr(e){let r=e.trim(),n=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let i of n)if(i.test(r))return!1;return!0}
|
|
40
|
-
export{t,K,un,tr,o,te,
|
|
40
|
+
export{t,K,un,tr,o,te,Ts,_,Et,dn,_s,Rs,c,p,P,ve,Ye,l,nr};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{i}from"./chunk-
|
|
2
|
+
import{i}from"./chunk-sw8j8rnc.js";import{xr}from"./chunk-8zf5q1m3.js";import p from"path";async function il(t={}){let d=performance.now(),o=t.root||process.cwd(),e=await i(o),u=t.ssr?.routeRules??e.routeRules??{};if(xr(u),!e.ssr&&Object.keys(u).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let n,l;if(r==="ssg"){let{generateStaticSite:s}=await import("./ssg.js");n=await s({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:s}=await import("./chunk-wg36jd98.js");l=await s({root:o,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
|
|
3
3
|
export{il};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function
|
|
2
|
+
import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function $i(e){let t={pages:0,assets:0,bytesInlined:0},n=R.join(e,S),i=new Set;for(let s of k(e)){let r=y.readFileSync(s,"utf8"),{html:o,assets:g,bytesInlined:u}=I(r);if(o===r)continue;for(let c of g){if(i.has(c.filename))continue;i.add(c.filename),y.mkdirSync(n,{recursive:!0}),y.writeFileSync(R.join(n,c.filename),c.contents),t.assets++}y.writeFileSync(s,o),t.bytesInlined+=u,t.pages++}return t}import h from"fs";import T from"path";var L=1024,N=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,_=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function B(e){return Bun.hash(e).toString(16).slice(0,8)}function C(e){let t=[],n=(i)=>{for(let s of h.readdirSync(i,{withFileTypes:!0})){let r=T.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(h.existsSync(e))n(e);return t}function O(e,t){let n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!n)return;return n[2]??n[3]??n[4]??""}function H(e,t,n){if(n.length<L)return!1;if(/\b(?:src|href)\s*=/i.test(t))return!1;if(e.toLowerCase()==="script"){if(!_.has((O(t,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function D(e){let t=[];for(let n of e.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))t.push([n.index,n.index+n[0].length]);return t}function Ei(e){let t={pages:0,assets:0,bytesInlined:0},n=C(e);if(n.length<2)return t;let i=new Map,s=new Map;for(let a of n){let f=h.readFileSync(a,"utf8");i.set(a,f);let M=D(f);for(let d of f.matchAll(N)){let[x,p,l,m]=d;if(!H(p,l,m))continue;if(M.some(([j,A])=>d.index>=j&&d.index<A))continue;let w=`${p.toLowerCase()}\x00${m}`,b=s.get(w);if(b)b.push({file:a,whole:x,tag:p,attrs:l,body:m});else s.set(w,[{file:a,whole:x,tag:p,attrs:l,body:m}])}}let r=[...s.values()].filter((a)=>new Set(a.map((f)=>f.file)).size>1);if(r.length===0)return t;let o=T.join(e,S),g=new Map(i),u=new Map,c=[];for(let a of r){let{tag:f,body:M}=a[0],d=f.toLowerCase()==="script",x=`${d?"chunk":"style"}.${B(M)}.${d?"js":"css"}`;c.push({filename:x,contents:M,contentType:d?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let p=`/${S}/${x}`;for(let l of a){let m=d?`<script${l.attrs} src="${p}"></script>`:`<link${l.attrs} rel="stylesheet" href="${p}">`,w=g.get(l.file),b=w.replace(l.whole,()=>m);if(b===w)continue;g.set(l.file,b),u.set(l.file,(u.get(l.file)??0)+l.body.length)}}h.mkdirSync(o,{recursive:!0});for(let a of c)h.writeFileSync(T.join(o,a.filename),a.contents),t.assets++;for(let[a,f]of g){if(f===i.get(a))continue;h.writeFileSync(a,f),t.pages++,t.bytesInlined+=u.get(a)??0}return t}import E from"fs";import v from"path";var K="layout-types.d.ts";function P(e){let t=[],n=(i,s)=>{let r;try{r=E.readdirSync(i,{withFileTypes:!0})}catch{return}for(let o of r){if(o.name.startsWith("."))continue;let g=v.join(i,o.name);if(o.isDirectory())n(g,s?`${s}/${o.name}`:o.name);else if(o.isFile()&&o.name.endsWith(".stx")&&o.name!=="_layout.stx"){let u=o.name.slice(0,-4);t.push(s?`${s}/${u}`:u)}}};return n(e,""),t.sort()}function W(e){let t=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(e.length===0)return t.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),t.join(`
|
|
3
3
|
`);return t.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...e.map((n)=>` '${n}': true`)," }","}","","export {}",""),t.join(`
|
|
4
|
-
`)}function
|
|
5
|
-
export{
|
|
4
|
+
`)}function Ti(e,t){if(!e)return[];let n=v.isAbsolute(e)?e:v.resolve(process.cwd(),e),i=P(n),s=W(i),r=v.join(t,K);try{if(E.existsSync(r)&&E.readFileSync(r,"utf8")===s)return i;E.mkdirSync(t,{recursive:!0}),E.writeFileSync(r,s)}catch{}return i}
|
|
5
|
+
export{$i,Ei,Ti};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ru,Fi,Au,zi,Ja,Ya,vt,en,Pu,Za,Qa,ec,f}from"./chunk-sw8j8rnc.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-720pm5yj.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-eaa5rxst.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{vt as buildCss,Za as extractClassNames,Ya as fingerprintConfig,Qa as generateCss,Pu as getCachedCSS,Ru as getCssServeAsset,f as injectCss,Fi as loadCssEngine,zi as loadCssEngineConfig,en as rebuildCss,Au as resetCssCache,Ja as resolveUserCssConfig,ec as withLinkedModuleBundles};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
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-
|
|
3
|
+
`),n;try{let{bundleClientScript:t}=await import("./chunk-ec32acc4.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-jadv7091.js"),i=p(n),f=m(i.stxImports,i.browserImports),{transformStoreImports:_}=await import("./chunk-wtqjfar3.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
4
|
`)}export{M as buildModuleRegistryScript,I as registeredModuleIdsIn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{A,kc,i,T,ju,Bu}from"./chunk-sw8j8rnc.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-720pm5yj.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-eaa5rxst.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{T as config,A as defaultConfig,ju as defineStxConfig,i as loadStxConfig,kc as resolveStxDirectories,Bu as validateConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Mu,ye,Ji,Nu,os,as,cs}from"./chunk-sw8j8rnc.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-720pm5yj.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-eaa5rxst.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{Nu as clearOnceStore,Ji as onceStore,ye as partialsCache,os as processIncludes,as as processStackPushDirectives,cs as processStackReplacements,Mu as resetUnscopedSignalWarnings};
|
|
@@ -26,4 +26,4 @@ import{E,x,Bt,Ft,zt}from"./chunk-45rfv3a5.js";import{resolve as k,basename as J,
|
|
|
26
26
|
</Representation>
|
|
27
27
|
`}s+=` </AdaptationSet>
|
|
28
28
|
`}return s+=` </Period>
|
|
29
|
-
</MPD>`,s}function I(t){let e=Math.floor(t/3600),a=Math.floor(t%3600/60),c=Math.floor(t%60),r="PT";if(e>0)r+=`${e}H`;if(a>0)r+=`${a}M`;return r+=`${c}S`,r}async function O(){try{return await import("ts-videos")}catch{return null}}function ee(t){switch(t){case"very-low":return 500000;case"low":return 1e6;case"medium":return 2500000;case"high":return 5000000;case"very-high":return 1e7;case"lossless":return 0;default:return 2500000}}function te(t){switch(t){case"youtube":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};case"twitter":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"instagram-feed":return{codec:"h264",maxWidth:1080,maxHeight:1080,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"instagram-story":case"instagram-reels":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"tiktok":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"discord":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:60,bitrate:8000000,audioCodec:"aac",audioBitrate:192000};case"linkedin":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"facebook":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"web-progressive":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000,twoPass:!0};case"web-streaming":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};default:return{}}}async function
|
|
29
|
+
</MPD>`,s}function I(t){let e=Math.floor(t/3600),a=Math.floor(t%3600/60),c=Math.floor(t%60),r="PT";if(e>0)r+=`${e}H`;if(a>0)r+=`${a}M`;return r+=`${c}S`,r}async function O(){try{return await import("ts-videos")}catch{return null}}function ee(t){switch(t){case"very-low":return 500000;case"low":return 1e6;case"medium":return 2500000;case"high":return 5000000;case"very-high":return 1e7;case"lossless":return 0;default:return 2500000}}function te(t){switch(t){case"youtube":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};case"twitter":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"instagram-feed":return{codec:"h264",maxWidth:1080,maxHeight:1080,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"instagram-story":case"instagram-reels":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"tiktok":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"discord":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:60,bitrate:8000000,audioCodec:"aac",audioBitrate:192000};case"linkedin":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"facebook":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"web-progressive":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000,twoPass:!0};case"web-streaming":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};default:return{}}}async function ui(t){let e=await O();if(!e)return null;try{let a=k(t),r=await new e.Input(a).getInfo();return{duration:r.duration||0,width:r.width||0,height:r.height||0,frameRate:r.frameRate||0,bitrate:r.bitrate||0,codec:r.videoCodec||"",audioCodec:r.audioCodec}}catch(a){return console.warn(`[stx-media] Failed to analyze video: ${a}`),null}}async function ia(t,e,a,c){let r=await O();if(!r)return console.warn("[stx-media] ts-videos not installed, skipping processing"),{src:t,processed:!1};let n=await Er(t,e,a);if(n)return n;try{let i=k(t);if(!await x(i))return{src:t,processed:!1,errors:[`Source file not found: ${t}`]};let s=a.outputDir||"dist/videos",o=a.baseUrl||"/videos";await Z(s,{recursive:!0});let h=await E(i),y=J(t,K(t)),u={src:t,processed:!0,hash:h};c?.({percentage:5,stage:"analyzing"}),u.metadata=await ui(i)||void 0;let m={};if(e.quality)m.bitrate=ee(e.quality);if(e.platform)Object.assign(m,te(e.platform));if(e.transcode)Object.assign(m,e.transcode);if(Object.keys(m).length>0||e.process){c?.({percentage:10,stage:"transcoding"});let d=`${y}-${h}.mp4`,g=Y(s,d);try{let l=await ae(i,g,m,r,(f)=>c?.({percentage:10+f*0.5,stage:"transcoding"}));if(l)u.transcoded={path:g,url:`${o}/${d}`,duration:l.duration,size:l.size,video:{codec:m.codec||"h264",width:l.width,height:l.height,bitrate:l.bitrate,frameRate:l.frameRate},audio:l.audioCodec?{codec:m.audioCodec||"aac",bitrate:m.audioBitrate||128000,sampleRate:m.sampleRate||48000,channels:m.channels||2}:void 0}}catch(l){u.errors=u.errors||[],u.errors.push(`Transcoding failed: ${l}`)}}if(e.generatePoster){c?.({percentage:65,stage:"generating-poster"});let d=typeof e.generatePoster==="object"?e.generatePoster:{timestamp:0},g=await _r(i,d,s,o);if(g)u.poster=g}if(a.thumbnails?.enabled){c?.({percentage:70,stage:"generating-thumbnails"});let d=await Rr(i,a.thumbnails,s,o);if(d.length>0)u.thumbnails=d}if(e.streaming){c?.({percentage:80,stage:"generating-manifests"});let d=typeof e.streaming==="object"?e.streaming:a.streaming||{format:"hls"};if(d.format==="hls"||d.format===void 0){let g=await Ar(i,d.qualities||a.streaming?.defaultQualities||[],s,o);if(g)u.streaming={...u.streaming,hls:g}}if(d.format==="dash"){let g=await Pr(i,d.qualities||a.streaming?.defaultQualities||[],s,o);if(g)u.streaming={...u.streaming,dash:g}}}if(e.spriteSheet)c?.({percentage:90,stage:"generating-sprite-sheet"});return c?.({percentage:100,stage:"complete"}),await Tr(t,e,u,a),u}catch(i){return{src:t,processed:!1,errors:[`Processing failed: ${i}`]}}}async function ae(t,e,a,c,r){try{let i=await new c.Conversion(t,e,{videoCodec:a.codec,videoBitrate:a.bitrate,width:a.maxWidth,height:a.maxHeight,frameRate:a.frameRate,audioCodec:a.audioCodec,audioBitrate:a.audioBitrate,sampleRate:a.sampleRate,channels:a.channels}).run((s)=>{r?.(s.percentage/100)});return{duration:i.duration||0,size:i.size||0,width:i.width||a.maxWidth||0,height:i.height||a.maxHeight||0,bitrate:i.bitrate||a.bitrate||0,frameRate:i.frameRate||a.frameRate||30,audioCodec:i.audioCodec}}catch(n){return console.error(`[stx-media] Transcoding failed: ${n}`),null}}export{$r,Er,Tr,ra,_r,Rr,sa,Ar,Pr,ui,ia};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import u from"fs";import l from"path";var g=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,x=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],h=3;function y(e,t){let r=l.resolve(l.dirname(t),e);for(let o of b){let s=r+o;try{if(u.statSync(s).isFile())return s}catch{}}return null}function fn(e,t,r=0,o=new Set){if(!t||r>=h)return!1;for(let s of e.matchAll(x)){let n=y(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=u.readFileSync(n,"utf8")}catch{continue}if(g.test(i))return!0;if(fn(i,n,r+1,o))return!0}return!1}var m=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refresh","registerStoresClient","setKeptScope","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useTimeout","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],wo=["onMount","onDestroy"];function _t(e="const",t=[],r){let o=t.length?m.filter((s)=>!t.includes(s)):m;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var E=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=m.filter((e)=>!E.includes(e));function
|
|
3
|
-
export{fn,m,wo,_t,
|
|
2
|
+
import u from"fs";import l from"path";var g=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,x=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],h=3;function y(e,t){let r=l.resolve(l.dirname(t),e);for(let o of b){let s=r+o;try{if(u.statSync(s).isFile())return s}catch{}}return null}function fn(e,t,r=0,o=new Set){if(!t||r>=h)return!1;for(let s of e.matchAll(x)){let n=y(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=u.readFileSync(n,"utf8")}catch{continue}if(g.test(i))return!0;if(fn(i,n,r+1,o))return!0}return!1}var m=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refresh","registerStoresClient","setKeptScope","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useTimeout","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],wo=["onMount","onDestroy"];function _t(e="const",t=[],r){let o=t.length?m.filter((s)=>!t.includes(s)):m;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var E=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=m.filter((e)=>!E.includes(e));function As(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],T=/\s@[a-z][\w.:-]*\s*=/i;function vo(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(As(e))return!0;return R(e,t)}function R(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(fn(r[1],t))return!0;return!1}function xo(e,t){if(!e)return!1;let r=f(e);return T.test(r)||d(r,t)}var _=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function So(e){return _.includes(e.toLowerCase())}var rr=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],w=["x-init","x-transition","x-effect","x-on"],ko=[...rr,...w];function Co(){return`{${rr.map((e)=>`'${e}':1`).join(",")}}`}var Ps=["class","style","text","html","show","model","if","ref"];function $o(){return`{${Ps.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function Eo(){return`/^(${p.join("|")})/`}function To(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var A=65536,N=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=A;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=N){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
|
|
3
|
+
export{fn,m,wo,_t,As,vo,xo,So,rr,ko,Co,Ps,$o,Eo,To};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{oe,Oa,Ii,ft,gt,gu,Di,mt,Jt,Ma,Na,La,ja,ht,Ba}from"./chunk-2q95we1n.js";import"./chunk-2psf6w7b.js";import"./chunk-sw8j8rnc.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-720pm5yj.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-eaa5rxst.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{Jt as MODULE_SPECIFIER_PREFIX,ht as bundleClientScript,gt as clearBundleFailures,oe as clientBundleDependencies,ft as getBundleFailures,mt as hasUserImports,Na as normalizeRegistrySpecifiers,ja as queueClientBundleBuild,Ii as recordBundleFailure,Ma as registryIdForPath,Di as resolveBundlerFallback,La as rewriteRegistryImports,gu as setBundlerFallbackMode,Oa as shouldLogBundlerDiagnostics,Ba as tempBuildName};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{fi,va,Ht,fl,xa,Sa,ka,gl}from"./chunk-nvht5259.js";export{Ht as Validator,va as defineForm,xa as processErrorDirective,Sa as processErrorsDirective,gl as processFormValidationDirectives,ka as processHasErrorsDirective,fi as useForm,fl as v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Io,Do}from"./chunk-zaz9phx6.js";import"./chunk-thx147nq.js";import"./chunk-9w5nse46.js";import"./chunk-b8r87s8q.js";import"./chunk-5vwg3h5g.js";import"./chunk-82kf8t4n.js";import"./chunk-xhnn2yj8.js";import"./chunk-spx27cs4.js";import"./chunk-b8dbq51z.js";import"./chunk-bge8ptbd.js";import"./chunk-3yrg4kfm.js";import{ei}from"./chunk-7ynzah39.js";import"./chunk-3rbz496d.js";import"./chunk-24e7qjb8.js";import"./chunk-f4m0n9hr.js";import"./chunk-hc9242wm.js";import"./chunk-dtvwes4f.js";import"./chunk-p4wvc7wx.js";import"./chunk-4wf68rht.js";import"./chunk-nvht5259.js";import"./chunk-s28eh0jn.js";import"./chunk-51a50b67.js";import"./chunk-j1q65enz.js";import"./chunk-4xemkkm8.js";import"./chunk-bjnvymb7.js";import"./chunk-w2085fwx.js";import"./chunk-zfzcedw4.js";import"./chunk-3hmy75tw.js";import"./chunk-tdx1srqq.js";import"./chunk-gnghq9yc.js";import"./chunk-a16fcrd1.js";import"./chunk-b9a5hkm2.js";import"./chunk-ccq35xp7.js";import"./chunk-2q95we1n.js";import"./chunk-2psf6w7b.js";import{me,Zt,Qt,q,d,n,Wn,A,i,ce}from"./chunk-sw8j8rnc.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-720pm5yj.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-eaa5rxst.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{Wn as buildWebComponents,Qt as cacheTemplate,Zt as checkCache,ei as classifyAllScripts,Io as createMiddleware,Do as createRoute,A as defaultConfig,d as extractVariables,q as injectRouterScript,i as loadStxConfig,me as processClientScript,n as processDirectives,ce as readMarkdownFile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{kt,is,Gi,pc}from"./chunk-sw8j8rnc.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-720pm5yj.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-eaa5rxst.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{pc as declareBareLoopHead,kt as parseLoopBinding,Gi as processLoops,is as reportDeferredLoopWarnings};
|