@stacksjs/stx 0.2.412 → 0.2.413
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/builtins/image-delivery.d.ts +38 -0
- package/dist/builtins/image-delivery.js +17 -0
- package/dist/builtins/stx-image.js +1 -5
- package/dist/{chunk-btd7ds3x.js → chunk-0d0qeqvv.js} +1 -1
- package/dist/{chunk-x8f6wqxd.js → chunk-0psndabd.js} +1 -1
- package/dist/{chunk-twz64kvy.js → chunk-0qv8yf53.js} +1 -1
- package/dist/{chunk-5h104qh1.js → chunk-0vkxyvsd.js} +1 -1
- package/dist/{chunk-tp8pzf94.js → chunk-0xqdmemy.js} +1 -1
- package/dist/{chunk-6zggmce7.js → chunk-158wqccn.js} +12 -12
- package/dist/{chunk-aq1xq0r4.js → chunk-1cyxbb8y.js} +1 -1
- package/dist/{chunk-04tgatyy.js → chunk-1enwnh2a.js} +1 -1
- package/dist/{chunk-td08rnk3.js → chunk-213pzm0d.js} +1 -1
- package/dist/{chunk-vzgzaw66.js → chunk-21hzqyja.js} +1 -1
- package/dist/{chunk-qvnbnsv9.js → chunk-24zher49.js} +1 -1
- package/dist/{chunk-cj3adc77.js → chunk-266t58b8.js} +1 -1
- package/dist/{chunk-90b2vt2n.js → chunk-2a9n102n.js} +1 -1
- package/dist/chunk-2eqzrczk.js +2 -0
- package/dist/{chunk-p4zrvt5f.js → chunk-2ke37m54.js} +1 -1
- package/dist/{chunk-hdysywd8.js → chunk-2snqdnk9.js} +1 -1
- package/dist/{chunk-1te8k8gp.js → chunk-35ds08e7.js} +1 -1
- package/dist/chunk-3mtwkjcg.js +2 -0
- package/dist/{chunk-8wp64mym.js → chunk-4f9zyfdw.js} +2 -2
- package/dist/{chunk-50pszj17.js → chunk-4xr8zwkp.js} +1 -1
- package/dist/chunk-58v77x2c.js +2 -0
- package/dist/{chunk-9xew0kgf.js → chunk-5mhq8605.js} +1 -1
- package/dist/{chunk-zpcnbdhn.js → chunk-5se8xt9e.js} +2 -2
- package/dist/{chunk-tgadbsd4.js → chunk-5zh0h080.js} +1 -1
- package/dist/{chunk-s6g8wksg.js → chunk-62435225.js} +1 -1
- package/dist/{chunk-vsbmc9kt.js → chunk-6n2rr3x7.js} +1 -1
- package/dist/{chunk-qqpqgwvb.js → chunk-6xk87qf2.js} +2 -2
- package/dist/{chunk-hj4vpyhp.js → chunk-7ekd7zj9.js} +1 -1
- package/dist/{chunk-n2swas11.js → chunk-7pr3wdd5.js} +1 -1
- package/dist/{chunk-a7bnvz91.js → chunk-7rxvafwc.js} +1 -1
- package/dist/{chunk-zq4ssxj9.js → chunk-7tnwfa7w.js} +1 -1
- package/dist/chunk-8c5je0wf.js +2 -0
- package/dist/{chunk-kvmx7dnb.js → chunk-8dz6nyvx.js} +1 -1
- package/dist/{chunk-fpwzacpm.js → chunk-8sdhs0zk.js} +1 -1
- package/dist/{chunk-4q1c6fw2.js → chunk-98zj3fv2.js} +2 -2
- package/dist/{chunk-2fw05hs2.js → chunk-ay6zjq8v.js} +1 -1
- package/dist/{chunk-gbmeh7jg.js → chunk-az4v4ard.js} +1 -1
- package/dist/chunk-ba5erggg.js +2 -0
- package/dist/chunk-bnagrdz6.js +2 -0
- package/dist/{chunk-dbc5awz9.js → chunk-bwjxk1dw.js} +2 -2
- package/dist/{chunk-spxsw4mp.js → chunk-by8wghtf.js} +1 -1
- package/dist/{chunk-00g9x6w2.js → chunk-cd7h4q51.js} +1 -1
- package/dist/{chunk-18n1ftn0.js → chunk-cjmv8hgp.js} +1 -1
- package/dist/{chunk-ct1jwd4r.js → chunk-cthf912y.js} +1 -1
- package/dist/{chunk-k5ptvy0b.js → chunk-cxbpmwq5.js} +1 -1
- package/dist/chunk-d3sy16qn.js +2 -0
- package/dist/{chunk-1ws3xcea.js → chunk-dh6s7mrj.js} +1 -1
- package/dist/{chunk-0pkk226n.js → chunk-dm2nzg7a.js} +1 -1
- package/dist/{chunk-82pd4b5w.js → chunk-e2sgcnxc.js} +1 -1
- package/dist/chunk-e3b7jj74.js +2 -0
- package/dist/{chunk-cs54ek9m.js → chunk-ec4wq2sv.js} +2 -2
- package/dist/{chunk-akwd34xt.js → chunk-ekzg97dn.js} +1 -1
- package/dist/chunk-epjt342x.js +2 -0
- package/dist/{chunk-rcv2ehpq.js → chunk-eqe26g14.js} +2 -2
- package/dist/chunk-ev0v1yma.js +2 -0
- package/dist/{chunk-kxc2h5vn.js → chunk-f53psr2y.js} +1 -1
- package/dist/{chunk-h83jrhfq.js → chunk-f8p69dsg.js} +1 -1
- package/dist/{chunk-gs18069g.js → chunk-f95drhdb.js} +1 -1
- package/dist/{chunk-de8t7sc9.js → chunk-ff5a6hvb.js} +1 -1
- package/dist/chunk-fs5fy4h8.js +2 -0
- package/dist/chunk-fzsygce3.js +2 -0
- package/dist/chunk-g465x63k.js +2 -0
- package/dist/chunk-g708ekh1.js +2 -0
- package/dist/{chunk-hrkvsj5c.js → chunk-gcr9e83g.js} +1 -1
- package/dist/{chunk-xwts5yky.js → chunk-gdmyrsr8.js} +2 -2
- package/dist/{chunk-38wvkv3s.js → chunk-gkms2ngq.js} +1 -1
- package/dist/{chunk-rz9f3zqz.js → chunk-gnfywmgs.js} +2 -2
- package/dist/chunk-hpf8kq7e.js +2 -0
- package/dist/{chunk-p4jb9v0w.js → chunk-j4x3faf8.js} +1 -1
- package/dist/chunk-jkavtw9f.js +2 -0
- package/dist/{chunk-563shnkz.js → chunk-kg1rdena.js} +2 -2
- package/dist/{chunk-t5ja7qkn.js → chunk-kgd8kchy.js} +1 -1
- package/dist/chunk-km91wx0v.js +2 -0
- package/dist/{chunk-1fs9jvpb.js → chunk-nk3czvnk.js} +1 -1
- package/dist/chunk-nmw4eewb.js +2 -0
- package/dist/{chunk-t1htzg9e.js → chunk-nq5zxrk0.js} +1 -1
- package/dist/{chunk-6kd5jjwc.js → chunk-p4wdxp2c.js} +1 -1
- package/dist/chunk-pdyeaxc1.js +2 -0
- package/dist/chunk-pf06ded4.js +2 -0
- package/dist/chunk-pfs0gpzm.js +2 -0
- package/dist/chunk-pshdwq44.js +2 -0
- package/dist/{chunk-s9za1vvd.js → chunk-pv3d7sfn.js} +1 -1
- package/dist/{chunk-24w86pek.js → chunk-pwgv84pn.js} +2 -2
- package/dist/{chunk-wc66mcn4.js → chunk-pwsnafp3.js} +159 -159
- package/dist/chunk-qr346wnp.js +2 -0
- package/dist/{chunk-8w2mqdnv.js → chunk-r02hke04.js} +1 -1
- package/dist/chunk-ranshpyc.js +3 -0
- package/dist/{chunk-5qjk7drw.js → chunk-rn194bhp.js} +1 -1
- package/dist/{chunk-gvbf1mhs.js → chunk-rn1hgyc8.js} +1 -1
- package/dist/{chunk-p5wp0ce6.js → chunk-s7z5dp70.js} +1 -1
- package/dist/{chunk-eenk6s3t.js → chunk-smcj3442.js} +1 -1
- package/dist/{chunk-k80sn8d1.js → chunk-sn7exv0n.js} +1 -1
- package/dist/{chunk-bbt3tp6f.js → chunk-t6qx04s8.js} +1 -1
- package/dist/chunk-t6y6gyps.js +2 -0
- package/dist/chunk-tjfs7cc3.js +2 -0
- package/dist/chunk-tntv9hvq.js +2 -0
- package/dist/{chunk-gc06g35w.js → chunk-vd4cb5xr.js} +1 -1
- package/dist/{chunk-tgrpp58r.js → chunk-vkhdce50.js} +1 -1
- package/dist/{chunk-qmmp5kb5.js → chunk-w183av08.js} +1 -1
- package/dist/{chunk-fcnrgxck.js → chunk-w2m02njv.js} +1 -1
- package/dist/chunk-wpjrcrs5.js +2 -0
- package/dist/{chunk-1a0v39k5.js → chunk-wqmppf6b.js} +1 -1
- package/dist/{chunk-1qq26zt0.js → chunk-wtb9fxdy.js} +1 -1
- package/dist/{chunk-rq414kn5.js → chunk-xmzygmcz.js} +1 -1
- package/dist/{chunk-vx86cf4r.js → chunk-xssw417m.js} +1 -1
- package/dist/{chunk-naw4jt7j.js → chunk-xxzefj4j.js} +1 -1
- package/dist/{chunk-bn1edb1y.js → chunk-yq8x8bxq.js} +2 -2
- package/dist/{chunk-z5rwnnk1.js → chunk-ytma76qe.js} +1 -1
- package/dist/{chunk-603x5gb2.js → chunk-yw1m115e.js} +1 -1
- package/dist/{chunk-mq5ewmz6.js → chunk-z64a924m.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/pwa.js +2 -2
- package/dist/ssg.js +2 -2
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-097jnwd5.js +0 -2
- package/dist/chunk-213jwgpx.js +0 -3
- package/dist/chunk-2tbez006.js +0 -2
- package/dist/chunk-3rkejwjp.js +0 -2
- package/dist/chunk-3t65wb35.js +0 -2
- package/dist/chunk-3w6z6tw9.js +0 -2
- package/dist/chunk-7dmgt8at.js +0 -2
- package/dist/chunk-8d7nf67s.js +0 -2
- package/dist/chunk-c4511wng.js +0 -2
- package/dist/chunk-c4h579e3.js +0 -2
- package/dist/chunk-cxrgxzxc.js +0 -2
- package/dist/chunk-fqzcft9d.js +0 -2
- package/dist/chunk-h564hgzt.js +0 -2
- package/dist/chunk-hyr4ag1k.js +0 -2
- package/dist/chunk-jxvmf02k.js +0 -2
- package/dist/chunk-k8t2cmyd.js +0 -2
- package/dist/chunk-kq4b6cwj.js +0 -2
- package/dist/chunk-mbxehgrq.js +0 -2
- package/dist/chunk-mgnq5de2.js +0 -2
- package/dist/chunk-mgrckqww.js +0 -2
- package/dist/chunk-n4299xgy.js +0 -2
- package/dist/chunk-pjrn29gg.js +0 -2
- package/dist/chunk-prxwsp7n.js +0 -2
- package/dist/chunk-py2r6wtv.js +0 -2
- package/dist/chunk-q738pwv6.js +0 -2
- package/dist/chunk-strcy64y.js +0 -2
- package/dist/chunk-tat1cjec.js +0 -2
- package/dist/chunk-wkanrfb3.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Lt as a,Pt as b,Qt as c,Rt as d,St as e,Tt as f,Ut as g,Vt as h,Wt as i,Xt as j,Yt as k}from"./chunk-ranshpyc.js";import"./chunk-ay6zjq8v.js";export{a as webpHeaderHasAlpha,i as snapshotImageDelivery,b as setImageEncoderIdentity,k as prepareImageDelivery,e as isTransparentImage,j as installImageDelivery,c as imageEncoderIdentity,d as getImageDelivery,f as efficientDeliverySources,g as deliveredImage,h as clearImageDeliveryCatalog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{hk as a,ik as b,jk as c,kk as d}from"./chunk-mrahwn5v.js";import"./chunk-
|
|
2
|
+
import{hk as a,ik as b,jk as c,kk as d}from"./chunk-mrahwn5v.js";import"./chunk-ay6zjq8v.js";export{d as default,c as createHotReloadServer,b as compileToNative,a as NATIVE_COMPONENTS};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{createHash as n}from"crypto";import B from"fs";import Y from"path";import{decode as $Q,generateThumbHash as JQ}from"ts-images";import{createImageDeliveryCatalog as h}from"ts-images/delivery";import R from"fs";function T(Q,Z,$){let J=Buffer.alloc($),M=R.readSync(Q,J,0,$,Z);return J.subarray(0,M)}function P(Q){if(Q.length<25)return!1;let Z=(J,M)=>String.fromCharCode(...Q.subarray(J,M));if(Z(0,4)!=="RIFF"||Z(8,12)!=="WEBP")return!1;let $=Z(12,16);if($==="VP8X")return(Q[20]&16)!==0;if($==="VP8L")return((Q[21]|Q[22]<<8|Q[23]<<16|Q[24]<<24)>>>28&1)===1;return!1}function k(Q){let Z;try{Z=R.openSync(Q,"r");let $=T(Z,0,33);if($.length>=3&&$[0]===255&&$[1]===216&&$[2]===255)return"none";if($.length>=26&&$[0]===137&&$.toString("latin1",1,4)==="PNG"){let J=$[25];if(J===4||J===6)return"possible";let M=8;for(let X=0;X<64;X++){let q=T(Z,M,8);if(q.length<8)return"unknown";let x=q.toString("latin1",4,8);if(x==="tRNS")return"possible";if(x==="IDAT"||x==="IEND")return"none";M+=12+q.readUInt32BE(0)}return"unknown"}if($.length>=25&&$.toString("latin1",0,4)==="RIFF"&&$.toString("latin1",8,12)==="WEBP"){if(P($))return"possible";let J=$.toString("latin1",12,16);return J==="VP8 "||J==="VP8X"?"none":"unknown"}return"unknown"}catch{return"unknown"}finally{if(Z!==void 0)R.closeSync(Z)}}import i from"fs";import O from"os";import{join as b}from"path";import{fileURLToPath as m}from"url";import{Worker as g}from"worker_threads";var E=Symbol("stx.image-worker.unavailable");function t(Q=typeof O.availableParallelism==="function"?O.availableParallelism():O.cpus().length){return Math.max(1,Math.min(2,Q-1))}var C=0,u=[];async function a(){if(C<t()){C++;return}await new Promise((Q)=>u.push(Q)),C++}function r(){C--,u.shift()?.()}var e="@stacksjs/stx/builtins/image-warmup-worker";function QQ(Q=process.cwd()){let Z=import.meta.url.endsWith(".ts")?"ts":"js";try{let $=new URL(`./image-warmup-worker.${Z}`,import.meta.url);if($.protocol==="file:"&&i.existsSync(m($)))return m($)}catch{}try{let $=typeof Bun<"u"?Bun.resolveSync(e,Q):void 0;return $&&ZQ($)?$:void 0}catch{return}}function ZQ(Q,Z=process.env){let $=Q.replace(/\\/g,"/");if($.split("/").some((M)=>/@\d[^/]*@@@\d+$/.test(M)))return!1;return![Z.BUN_INSTALL_CACHE_DIR,b(Z.BUN_INSTALL||b(O.homedir(),".bun"),"install","cache")].filter((M)=>!!M).map((M)=>`${M.replace(/\\/g,"/").replace(/\/$/,"")}/`).some((M)=>$.startsWith(M))}var v=!1;function N(Q){if(!v)v=!0,console.warn(`[stx] image worker unavailable (${Q}); running the image pass on the serving thread instead. Results are the same, but requests may stall while it runs.`);return E}function A(Q){return Q instanceof Error?Q.message:String(Q)}async function y(Q,Z){if(typeof g!=="function")return N("node:worker_threads has no Worker in this runtime");let $=QQ();if(!$)return N("no image-warmup-worker entry beside this module or in the installed @stacksjs/stx");await a();try{return await new Promise((J,M)=>{let X;try{X=new g($)}catch(G){J(N(`could not start ${$}: ${A(G)}`));return}let q=!1,x=!1,K=(G)=>{if(x)return;x=!0,G(),X.terminate()};X.on("message",(G)=>{if(G.type==="ready"){q=!0,X.postMessage({task:Q,args:Z});return}if(G.type==="result"){K(()=>J(G.value));return}let j=Error(G.error?.message??"image worker failed");if(G.error?.name)j.name=G.error.name;if(G.error?.stack)j.stack=G.error.stack;K(()=>M(j))}),X.on("error",(G)=>{K(()=>q?M(G instanceof Error?G:Error(A(G)||"image worker crashed")):J(N(`the worker failed before it was ready: ${A(G)}`)))}),X.on("exit",(G)=>{K(()=>q?M(Error("image worker exited before it finished")):J(N(`the worker exited with code ${G} before it was ready`)))})})}finally{r()}}var MQ=new Set([".avif",".jpeg",".jpg",".png",".webp"]),XQ=[320,640,960,1280,1920],L="/_stx/images",GQ=`stx:${L}:alpha-1`,qQ=["@stacksjs/ts-webp","@stacksjs/ts-avif"],W;function KQ(Q,Z){let $=Y.dirname(Bun.resolveSync(Q,Z));while($!==Y.dirname($)){let J=Y.join($,"package.json");if(B.existsSync(J)){let M=JSON.parse(B.readFileSync(J,"utf8"));if(M.name===Q)return M.version}$=Y.dirname($)}return}function uQ(Q){W=Q}function YQ(){if(W!==void 0)return W;let Q;try{Q=Y.dirname(Bun.resolveSync("ts-images",import.meta.dir))}catch{}return W=qQ.map((Z)=>{let $;try{$=Q?KQ(Z,Q):void 0}catch{}return`${Z.replace("@stacksjs/","")}@${$??"unknown"}`}).join("+"),W}var U=new Map,_=new Set,f=new Set;function xQ(Q){return`/${Q.split(Y.sep).map(encodeURIComponent).join("/")}`}function BQ(Q){let Z=Y.extname(Q),$=Q.slice(0,-Z.length).replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),J=n("sha256").update(Q).digest("hex").slice(0,8);return`${$||"image"}-${J}`}function c(Q,Z=`stx:${L}`){let $=(J)=>`${L}/${J.split("/").map(encodeURIComponent).join("/")}`;return{cacheNamespace:Z,async stat(J){let M=Y.join(Q,J);try{let X=await B.promises.stat(M);return X.size>0?{bytes:X.size,path:M,url:$(J)}:null}catch{return null}},async write(J,M){let X=Y.join(Q,J);await B.promises.mkdir(Y.dirname(X),{recursive:!0});let q=`${X}.${process.pid}.tmp`;return await B.promises.writeFile(q,M),await B.promises.rename(q,X),{bytes:M.byteLength,path:X,url:$(J)}},url:$}}async function l(Q,Z=Q){let $=await B.promises.readdir(Z,{withFileTypes:!0});$.sort((M,X)=>M.name.localeCompare(X.name));let J=[];for(let M of $){let X=Y.join(Z,M.name);if(M.isDirectory()){J.push(...await l(Q,X));continue}if(!M.isFile()||!MQ.has(Y.extname(M.name).toLowerCase()))continue;J.push({absolutePath:X,relativePath:Y.relative(Q,X)})}return J}function p(Q,Z){return Q.map(($)=>({key:xQ($.relativePath),input:$.absolutePath,name:BQ($.relativePath),...jQ($.absolutePath)?{options:{storage:Z}}:{}}))}function jQ(Q){return k(Q)==="possible"}function zQ(Q){for(let Z=3;Z<Q.length;Z+=4)if(Q[Z]!==255)return!0;return!1}async function FQ(Q){let Z=Object.entries(Q).filter(([,M])=>M.fallback.format==="png"),$=new Set,J=8;for(let M=0;M<Z.length;M+=8)await Promise.all(Z.slice(M,M+8).map(async([X,q])=>{let x=q.variants.filter((K)=>K.format==="png").sort((K,G)=>K.width-G.width)[0];try{let K=await $Q(new Uint8Array(await B.promises.readFile(x?.path??q.fallback.path)));if(zQ(K.data))$.add(X)}catch{$.add(X)}}));return $}function VQ(Q,Z){let $=[];for(let J of Z){let M=Q[J],X=M?.variants.filter((x)=>x.format==="webp")??[];if(!M||X.length===0)continue;if(!X.some((x)=>{let K;try{return K=B.openSync(x.path,"r"),!P(T(K,0,32))}catch{return!0}finally{if(K!==void 0)B.closeSync(K)}}))continue;if(M.variants=M.variants.filter((x)=>x.format!=="webp"),delete M.sources.webp,$.push(J),!f.has(J))f.add(J),console.warn(`[stx-images] ${J} is transparent but its WebP variants have no alpha channel; serving PNG instead. Upgrade @stacksjs/ts-webp to 0.1.6 or later.`)}return $}async function HQ(Q){let Z=[],$=8;for(let J=0;J<Q.length;J+=8){let M=Q.slice(J,J+8),X=await Promise.all(M.map(async(q)=>{try{return await JQ(q.absolutePath),q}catch{return console.warn(`[stx-images] Skipping unreadable raster: ${q.relativePath}`),null}}));Z.push(...X.filter((q)=>q!==null))}return Z}function I(Q){return Y.join(Q,"undecodable.json")}function NQ(Q){try{let Z=B.readFileSync(I(Q),"utf-8"),$=JSON.parse(Z);return $&&typeof $==="object"?$:{}}catch{return{}}}function OQ(Q,Z){try{B.mkdirSync(Y.dirname(I(Q)),{recursive:!0}),B.writeFileSync(I(Q),JSON.stringify(Z))}catch{}}function d(Q){try{let Z=B.statSync(Q);return{mtimeMs:Z.mtimeMs,size:Z.size}}catch{return}}function o(Q){if(!Q||Q.startsWith("data:")||Q.startsWith("blob:")||/^https?:\/\//i.test(Q)||Q.startsWith("//"))return;let Z=Q.split(/[?#]/,1)[0];if(!Z)return;try{return`/${Z.replace(/^\/+/,"").split("/").map(decodeURIComponent).map(encodeURIComponent).join("/")}`}catch{return}}function WQ(Q){let Z=o(Q);return Z?U.get(Z):void 0}function UQ(Q){let Z=o(Q);return Z?_.has(Z):!1}function _Q(Q){let Z=(J)=>Q.variants.filter((M)=>M.format===J).reduce((M,X)=>M+X.bytes,0),$=Z(Q.fallback.format);return["avif","webp"].map((J)=>({format:J,srcset:Q.sources[J]||"",bytes:Z(J)})).filter((J)=>J.srcset&&J.bytes>0&&J.bytes<$).sort((J,M)=>J.bytes-M.bytes).map(({format:J,srcset:M})=>({format:J,srcset:M}))}function yQ(Q){let Z=WQ(Q);if(!Z)return;return{src:Z.fallback.url,srcset:Z.sources[Z.fallback.format]||"",sources:_Q(Z).map(({format:$,srcset:J})=>({type:`image/${$}`,srcset:J})),width:Z.source.width,height:Z.source.height,placeholder:UQ(Q)?void 0:Z.placeholder?.dataUrl}}function S(){U=new Map,_=new Set}function hQ(){return{entries:[...U],transparent:[..._]}}function TQ(Q){U=new Map(Q.entries),_=new Set(Q.transparent)}async function fQ(Q,Z,$={}){if(!Q||!B.existsSync(Q))return S(),{count:0,fingerprint:""};if($.offThread){let z=await y("delivery",{publicDir:Q,outputDir:Z});if(z!==E)return TQ(z.state),z.result}let J=await l(Q);if(J.length===0)return S(),{count:0,fingerprint:""};let M=NQ(Z),X=J.filter((z)=>{let V=M[z.relativePath];if(!V)return!0;let F=d(z.absolutePath);return!F||F.mtimeMs!==V.mtimeMs||F.size!==V.size});if(X.length===0)return S(),{count:0,fingerprint:""};let q=c(Y.join(Z,"_stx","images"),`${GQ}:${YQ()}`),x={outDir:Y.join(Z,"_stx","images"),storage:c(Y.join(Z,"_stx","images")),baseUrl:L,widths:XQ,formats:["avif","webp"],quality:{avif:70,webp:78,jpeg:82,png:100},includeOriginal:!1,placeholder:!0,batchConcurrency:4,concurrency:4},K=X,G;try{G=await h({...x,entries:p(X,q)})}catch(z){if(K=await HQ(X),K.length===X.length)throw z;let V=new Set(K.map((H)=>H.relativePath)),F=!1;for(let H of X){if(V.has(H.relativePath))continue;let D=d(H.absolutePath);if(!D)continue;M[H.relativePath]=D,F=!0}if(F)OQ(Z,M);if(K.length===0)return S(),{count:0,fingerprint:""};G=await h({...x,entries:p(K,q)})}let j=await FQ(G.entries),w=VQ(G.entries,j);U=new Map(Object.entries(G.entries)),_=j;let s=j.size===0&&w.length===0?G.fingerprint:n("sha256").update(G.fingerprint).update(JSON.stringify({transparent:[...j].sort(),droppedWebp:w.sort()})).digest("hex");return{count:K.length,fingerprint:s}}
|
|
3
|
+
export{P as Lt,k as Mt,E as Nt,y as Ot,uQ as Pt,YQ as Qt,WQ as Rt,UQ as St,_Q as Tt,yQ as Ut,S as Vt,hQ as Wt,TQ as Xt,fQ as Yt};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mi as jH}from"./chunk-
|
|
2
|
+
import{mi as jH}from"./chunk-cjmv8hgp.js";import{Or as BH,Qo as e,bq as S,cq as zH,dq as qH,gq as JH,hq as WH,iq as VH,jq as AH,kq as GH,lm as $H,lq as UH,mq as FH,nq as MH,oq as XH}from"./chunk-pwsnafp3.js";import{Jt as f}from"./chunk-tkyrk66a.js";import{Qv as D}from"./chunk-az4v4ard.js";import{existsSync as x,readFileSync as m}from"fs";import U from"path";var EH=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),HH=e.filter((H)=>!EH.has(H)).sort(),KH=[...D].sort(),DH=[...new Set([...HH,...KH])].sort(),PH=new Set(HH),TH=new Set(KH),SH=new Set(DH),t=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function xH(H,K){if(K==="server")return`'${H}' 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`'${H}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${H}', so it is undefined in the browser.`}function QH(H,K){let Z=[];for(let q of K){if(q.offset===void 0)continue;let Y=q.kind==="server"?PH:TH;t.lastIndex=0;for(let z of q.code.matchAll(t)){let A=z.index+z[0].indexOf("{")+1;for(let G of z[1].matchAll(/[^,]+/g)){let X=G[0];if(/^\s*type\s/.test(X))continue;let M=/^\s*([A-Za-z_$][\w$]*)/.exec(X);if(!M)continue;let $=M[1];if(!SH.has($)||Y.has($))continue;let V=q.offset+A+G.index+M[0].length-$.length,J=H.slice(0,V),I=J.split(`
|
|
3
3
|
`).length;Z.push({line:I,column:V-(J.lastIndexOf(`
|
|
4
4
|
`)+1)+1,offset:V,length:$.length,name:$,kind:q.kind,message:xH($,q.kind)})}}}return Z}import w from"path";var hH="@stacksjs/stx-typescript-plugin";function kH(H,K){let Z=w.resolve(H);for(;;){let q=w.join(Z,"tsconfig.json");if(K(q))return q;let Y=w.dirname(Z);if(Y===Z)return;Z=Y}}function YH(H,K,Z){let q=kH(H,Z);if(!q)return;let Y=new Set,z=(A)=>{if(Y.has(A))return;Y.add(A);let G=K(A);if(!G)return;let X=G.compilerOptions?.plugins;if(Array.isArray(X)){let $=X.find((J)=>J?.name===hH),V=Array.isArray($?.libs)?$.libs.filter((J)=>typeof J==="string"):[];return $?{configPath:A,libs:V.map((J)=>w.resolve(w.dirname(A),J))}:null}let M=typeof G.extends==="string"?[G.extends]:Array.isArray(G.extends)?G.extends:[];for(let $ of[...M].reverse()){if(typeof $!=="string"||!$.startsWith("."))continue;let V=w.resolve(w.dirname(A),$.endsWith(".json")?$:`${$}.json`),J=z(V);if(J!==void 0)return J}return};return z(q)??void 0}function gH(H,K="",Z=""){let q=H.startLine>1?`
|
|
5
5
|
`.repeat(H.startLine-1):"",Y=UH(H)+qH(zH(H.code)),z=H.kind==="client"||H.kind==="plain"?VH(K,H.code):"";return GH(`${q+Y}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{kx as y}from"./chunk-ay6zjq8v.js";function b4(){if(typeof Notification<"u"&&Notification.permission==="granted")return!0;return!1}function RZ(){return typeof window<"u"&&typeof document<"u"}async function u4(){if(typeof Notification>"u")return!1;if(Notification.permission==="granted")return!0;if(Notification.permission==="denied")return!1;return await Notification.requestPermission()==="granted"}var g=new Map;function m4(){return`alert-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function h4(Z){switch(Z){case"info":return"ℹ";case"success":return"✔";case"warning":return"⚠";case"error":return"✖";default:return"ℹ"}}function c4(Z="top-right"){if(!RZ())throw Error("Toast container requires browser environment");try{let Y=document.querySelector(`.stx-toast-container[data-position="${Z}"]`);if(Y)return Y}catch{}let $=document.createElement("div");$.className=`stx-toast-container ${Z}`,$.dataset.position=Z;try{if(document.body)document.body.appendChild($)}catch{}return $}function p4(Z){let{options:$}=Z,Y=h4($.type),J=$.type||"info",Q=$.duration!==0;return`
|
|
3
3
|
<div class="stx-toast ${J}" data-alert-id="${Z.id}" role="alert" aria-live="polite">
|
|
4
4
|
<div class="stx-toast-icon">${Y}</div>
|
|
5
5
|
<div class="stx-toast-content">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Hf as L,If as w,Jf as x,Kf as p,Lf as F,Mf as T,Pf as I,Qf as f,Rf as l,Sf as n,Tf as i,Uf as P,Vf as o,Wf as a}from"./chunk-
|
|
2
|
+
import{Hf as L,If as w,Jf as x,Kf as p,Lf as F,Mf as T,Pf as I,Qf as f,Rf as l,Sf as n,Tf as i,Uf as P,Vf as o,Wf as a}from"./chunk-ytma76qe.js";import{Ts as ZG}from"./chunk-0btmm4m2.js";function HG(X,Z={}){let{src:G,alt:J,width:q,height:$,sizes:K="100vw",loading:Q="lazy",priority:Y=!1,quality:M=x,placeholder:N="none",formats:j=w,widths:C=L,decoding:B="async",fetchpriority:V,objectFit:O,objectPosition:W}=X,H=X.class,z=X.style,{processedImage:R,variants:_,optimize:E=!0,isDev:S=!1}=Z;if(_&&_.length>0)return OG(X,_,R);if(S||!E)return MG(X);return VG(X)}function OG(X,Z,G){let{src:J,alt:q,width:$,height:K,sizes:Q="100vw",loading:Y="lazy",priority:M=!1,decoding:N="async",fetchpriority:j,objectFit:C,objectPosition:B,placeholder:V="none"}=X,O=X.class,W=X.style,H=n(Z),z=l(Z),R=typeof Q==="object"?f(Q):Q,_=G?G.aspectRatio:$&&K?Number($)/Number(K):void 0,E=[];if(_)E.push(`aspect-ratio: ${_}`);if(C)E.push(`object-fit: ${C}`);if(B)E.push(`object-position: ${B}`);if(W)E.push(W);let S=E.length>0?` style="${E.join("; ")}"`:"",b=O?` class="${O}"`:"",u=M?"":` loading="${Y}"`,d=` decoding="${N}"`,h=j?` fetchpriority="${j}"`:M?' fetchpriority="high"':"",r=["avif","webp","jpeg","png"],s=[];for(let U of r){let D=H.get(U);if(D&&D.length>0){let m=I(D),QG=P(U);s.push(` <source type="${QG}" srcset="${m}" sizes="${R}" />`)}}let e="",t="",g;if(V!=="none"&&G?.placeholder){let U=`img-${Math.random().toString(36).slice(2,8)}`;if(e=`<div class="stx-image-wrapper" id="${U}">`,t="</div>",V==="blur")g=`
|
|
3
3
|
#${U} {
|
|
4
4
|
position: relative;
|
|
5
5
|
background-image: url('${G.placeholder}');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Dk as m}from"./chunk-
|
|
2
|
+
import{Dk as m}from"./chunk-eqe26g14.js";import{kx as z}from"./chunk-ay6zjq8v.js";import{existsSync as s,mkdirSync as T,copyFileSync as F,chmodSync as A}from"fs";import{join as Z,basename as Yq}from"path";import{spawn as j,execSync as Zq}from"child_process";import{tmpdir as c,homedir as P,platform as Lq}from"os";var Iq=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Fu as a,Gu as b,Hu as c,Iu as d,Ju as e,Ku as f,Lu as g,Mu as h,Nu as i,Ou as j,Pu as k,Qu as l,Ru as m,Su as n,Tu as o,Uu as p}from"./chunk-gnfywmgs.js";import"./chunk-yq8x8bxq.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{i as useTitle,f as useSeoMeta,i as usePageTitle,d as useHead,g as seoMetaToHeadConfig,c as resetHead,k as renderHtmlAttrs,j as renderHead,l as renderBodyAttrs,o as processTitleDirective,p as processMetaDirective,n as processHeadDirective,e as mergeHeadConfigs,b as getPageMeta,a as getHead,h as definePageMeta,m as applyHead};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-ay6zjq8v.js";import v from"fs";import H from"path";import{gzipSync as z}from"zlib";import{createHash as g}from"crypto";var D={".js":"js",".mjs":"js",".cjs":"js",".ts":"js",".jsx":"js",".tsx":"js",".css":"css",".scss":"css",".sass":"css",".less":"css",".html":"html",".htm":"html",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".avif":"image",".ico":"image",".woff":"font",".woff2":"font",".ttf":"font",".eot":"font",".otf":"font"},b=[/node_modules/,/vendor/,/bower_components/,/\.min\./],B=[/index\.(js|ts|html)$/,/main\.(js|ts)$/,/app\.(js|ts)$/,/entry\.(js|ts)$/];async function L(X,Z={}){let{includeSourceMaps:Q=!1,parseImports:$=!0,detectDuplicates:U=!0,topModulesCount:K=20}=Z;if(!v.existsSync(X))throw Error(`Build directory not found: ${X}`);if(!v.statSync(X).isDirectory())throw Error(`Not a directory: ${X}`);let q=await k(X,Q),J=[],F=[];for(let A of q)try{let O=await f(A,X,$);J.push(O)}catch(O){F.push(`Failed to process ${A}: ${O}`)}let Y=c(J,X),V=J.reduce((A,O)=>A+O.size,0),_=J.reduce((A,O)=>A+O.gzipSize,0),w=m(J),G=U?p(J):[],C=[...J].sort((A,O)=>O.size-A.size).slice(0,K);return{timestamp:Date.now(),buildDir:H.resolve(X),chunks:Y,totalSize:V,totalGzipSize:_,moduleCount:J.length,duplicates:G,byType:w,largestModules:C,warnings:F}}async function k(X,Z){let Q=[];async function $(U){let K=await v.promises.readdir(U,{withFileTypes:!0});for(let j of K){let q=H.join(U,j.name);if(j.isDirectory()){if(!j.name.startsWith(".")&&j.name!=="node_modules")await $(q)}else if(j.isFile()){if(!Z&&j.name.endsWith(".map"))continue;Q.push(q)}}}return await $(X),Q}async function f(X,Z,Q){let $=await v.promises.readFile(X),U=H.relative(Z,X),K=H.extname(X).toLowerCase(),j=$.length,q=y($),J=h($,K),F=g("md5").update($).digest("hex").slice(0,8),Y=D[K]||"other",V=[];if(Q&&Y==="js")V.push(...d($.toString("utf-8")));return{id:U,path:U,size:j,gzipSize:q,parsedSize:J,extension:K,type:Y,imports:V,importedBy:[],hash:F}}function y(X){try{let Z=z(X,{level:9}).length;return Math.min(Z,X.length)}catch{return X.length}}function h(X,Z){if(Z.includes(".min.")||X.length<1000)return X.length;let $=D[Z];if($==="js")return Math.round(X.length*0.6);if($==="css")return Math.round(X.length*0.7);return X.length}function d(X){let Z=[],Q=/import\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]/g,$;while(($=Q.exec(X))!==null)Z.push($[1]);let U=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=U.exec(X))!==null)Z.push($[1]);let K=/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=K.exec(X))!==null)Z.push($[1]);return[...new Set(Z)]}function c(X,Z){let Q=new Map;for(let U of X){let K=U.path.split(H.sep),j;if(K.length===1)j=H.basename(U.path,U.extension);else j=K[0];let q=Q.get(j)||[];q.push(U),Q.set(j,q)}let $=[];for(let[U,K]of Q){let j=K.reduce((Y,V)=>Y+V.size,0),q=K.reduce((Y,V)=>Y+V.gzipSize,0),J=K.some((Y)=>B.some((V)=>V.test(Y.path))),F=K.some((Y)=>b.some((V)=>V.test(Y.path)));$.push({name:U,files:K.map((Y)=>Y.path),modules:K,size:j,gzipSize:q,isEntry:J,isVendor:F})}return $.sort((U,K)=>K.size-U.size)}function m(X){let Z={js:{count:0,size:0,gzipSize:0},css:{count:0,size:0,gzipSize:0},html:{count:0,size:0,gzipSize:0},image:{count:0,size:0,gzipSize:0},font:{count:0,size:0,gzipSize:0},other:{count:0,size:0,gzipSize:0}};for(let Q of X)Z[Q.type].count++,Z[Q.type].size+=Q.size,Z[Q.type].gzipSize+=Q.gzipSize;return Z}function p(X){let Z=new Map;for(let $ of X){let U=Z.get($.hash)||[];U.push($),Z.set($.hash,U)}let Q=[];for(let[,$]of Z)if($.length>1){let U=$[0];Q.push({path:U.path,count:$.length,wastedBytes:U.size*($.length-1),locations:$.map((K)=>K.path)})}return Q.sort(($,U)=>U.wastedBytes-$.wastedBytes)}function W(X){if(X<1024)return`${X} B`;if(X<1048576)return`${(X/1024).toFixed(2)} KB`;return`${(X/1048576).toFixed(2)} MB`}function I(X){let Z=X.match(/^([\d.]+)\s*(B|KB|MB|GB)?$/i);if(!Z)return 0;let Q=Number.parseFloat(Z[1]);switch((Z[2]||"B").toUpperCase()){case"KB":return Q*1024;case"MB":return Q*1024*1024;case"GB":return Q*1024*1024*1024;default:return Q}}function E(X,Z){if(Z===0)return"0%";return`${(X/Z*100).toFixed(1)}%`}function R(X,Z){switch(Z.format){case"json":return u(X,Z);case"markdown":return l(X,Z);case"text":default:return r(X,Z)}}function u(X,Z){let Q=N(X,Z);return JSON.stringify({timestamp:X.timestamp,buildDir:X.buildDir,summary:{totalSize:X.totalSize,totalSizeFormatted:W(X.totalSize),totalGzipSize:X.totalGzipSize,totalGzipSizeFormatted:W(X.totalGzipSize),moduleCount:X.moduleCount,chunkCount:X.chunks.length,duplicateCount:X.duplicates.length},byType:Object.fromEntries(Object.entries(X.byType).map(([$,U])=>[$,{...U,sizeFormatted:W(U.size),gzipSizeFormatted:W(U.gzipSize)}])),chunks:X.chunks.map(($)=>({name:$.name,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),moduleCount:$.modules.length,isEntry:$.isEntry,isVendor:$.isVendor})),largestModules:X.largestModules.slice(0,Z.topModules||10).map(($)=>({path:$.path,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),type:$.type})),duplicates:X.duplicates,analysis:Q,warnings:X.warnings},null,2)}function r(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push(""),Q.push("Bundle Analysis Report"),Q.push("\u2550".repeat(50)),Q.push(""),Q.push("Summary"),Q.push("\u2500".repeat(50)),$)Q.push(`Total Size: ${W(X.totalSize)} (${W(X.totalGzipSize)} gzip)`);else Q.push(`Total Size: ${W(X.totalSize)}`);if(Q.push(`Modules: ${X.moduleCount}`),Q.push(`Chunks: ${X.chunks.length}`),X.duplicates.length>0)Q.push(`Duplicates: ${X.duplicates.length}`);if(Q.push(""),Z.threshold&&X.totalSize>Z.threshold)Q.push(`\u26A0\uFE0F Bundle exceeds threshold of ${W(Z.threshold)}!`),Q.push("");Q.push("Size by Type"),Q.push("\u2500".repeat(50));let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0){let J=E(q.size,X.totalSize),F=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${j.padEnd(8)} ${W(q.size).padStart(12)}${F} ${J.padStart(6)} (${q.count} files)`)}}Q.push(""),Q.push("Chunks"),Q.push("\u2500".repeat(50));for(let j of X.chunks.slice(0,10)){let q=[];if(j.isEntry)q.push("entry");if(j.isVendor)q.push("vendor");let J=q.length>0?` [${q.join(", ")}]`:"",F=$?` (${W(j.gzipSize)} gzip)`:"";Q.push(` ${j.name.padEnd(20)} ${W(j.size).padStart(12)}${F}${J}`)}if(X.chunks.length>10)Q.push(` ... and ${X.chunks.length-10} more chunks`);Q.push("");let K=Z.topModules||10;Q.push(`Largest Modules (Top ${K})`),Q.push("\u2500".repeat(50));for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j],J=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${(j+1).toString().padStart(2)}. ${q.path}`),Q.push(` ${W(q.size)}${J}`)}if(Q.push(""),X.duplicates.length>0){Q.push("Duplicate Modules"),Q.push("\u2500".repeat(50));for(let j of X.duplicates.slice(0,5))Q.push(` ${j.path}`),Q.push(` ${j.count} copies, wasting ${W(j.wastedBytes)}`);if(X.duplicates.length>5)Q.push(` ... and ${X.duplicates.length-5} more duplicates`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("Recommendations"),Q.push("\u2500".repeat(50));for(let q of j.recommendations.slice(0,5)){let J=q.impact==="high"?"\u26A1":q.impact==="medium"?"\uD83D\uDCCA":"\uD83D\uDCA1";Q.push(` ${J} ${q.title}`),Q.push(` ${q.description}`)}Q.push("")}}if(X.warnings.length>0){Q.push("Warnings"),Q.push("\u2500".repeat(50));for(let j of X.warnings)Q.push(` \u26A0\uFE0F ${j}`);Q.push("")}return Q.join(`
|
|
3
3
|
`)}function l(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push("# Bundle Analysis Report"),Q.push(""),Q.push(`Generated: ${new Date(X.timestamp).toISOString()}`),Q.push(""),Q.push("## Summary"),Q.push(""),Q.push("| Metric | Value |"),Q.push("|--------|-------|"),Q.push(`| Total Size | ${W(X.totalSize)} |`),$)Q.push(`| Gzip Size | ${W(X.totalGzipSize)} |`);Q.push(`| Modules | ${X.moduleCount} |`),Q.push(`| Chunks | ${X.chunks.length} |`),Q.push(`| Duplicates | ${X.duplicates.length} |`),Q.push(""),Q.push("## Size by Type"),Q.push(""),Q.push("| Type | Size | Gzip | % | Files |"),Q.push("|------|------|------|---|-------|");let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0)Q.push(`| ${j} | ${W(q.size)} | ${W(q.gzipSize)} | ${E(q.size,X.totalSize)} | ${q.count} |`)}Q.push(""),Q.push("## Chunks"),Q.push(""),Q.push("| Name | Size | Gzip | Modules | Type |"),Q.push("|------|------|------|---------|------|");for(let j of X.chunks.slice(0,15)){let q=j.isEntry?"Entry":j.isVendor?"Vendor":"-";Q.push(`| ${j.name} | ${W(j.size)} | ${W(j.gzipSize)} | ${j.modules.length} | ${q} |`)}Q.push("");let K=Z.topModules||10;Q.push(`## Largest Modules (Top ${K})`),Q.push(""),Q.push("| # | Path | Size | Gzip |"),Q.push("|---|------|------|------|");for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j];Q.push(`| ${j+1} | \`${q.path}\` | ${W(q.size)} | ${W(q.gzipSize)} |`)}if(Q.push(""),X.duplicates.length>0){Q.push("## Duplicates"),Q.push(""),Q.push("| Path | Copies | Wasted |"),Q.push("|------|--------|--------|");for(let j of X.duplicates.slice(0,10))Q.push(`| \`${j.path}\` | ${j.count} | ${W(j.wastedBytes)} |`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("## Recommendations"),Q.push("");for(let q of j.recommendations)Q.push(`### ${q.title}`),Q.push(""),Q.push(q.description),Q.push(""),Q.push(`- **Impact:** ${q.impact}`),Q.push(`- **Effort:** ${q.effort}`),Q.push("")}}return Q.join(`
|
|
4
4
|
`)}function N(X,Z){let Q=[],$=[];if(Z.threshold&&X.totalSize>Z.threshold)Q.push({severity:"error",message:`Bundle size (${W(X.totalSize)}) exceeds threshold (${W(Z.threshold)})`});if(X.totalSize>1048576)Q.push({severity:"warning",message:`Bundle is over 1MB (${W(X.totalSize)})`,details:"Large bundles can significantly impact load time"});if(X.duplicates.length>0){let q=X.duplicates.reduce((J,F)=>J+F.wastedBytes,0);Q.push({severity:"warning",message:`${X.duplicates.length} duplicate modules found, wasting ${W(q)}`}),$.push({title:"Remove Duplicate Modules",description:"Consider using import aliases or ensuring consistent package versions to eliminate duplicates.",impact:"medium",effort:"low"})}if(X.byType.js.size/X.totalSize>0.8&&X.totalSize>512000)$.push({title:"Code Splitting",description:"Over 80% of your bundle is JavaScript. Consider splitting code by route or feature.",impact:"high",effort:"medium"});let K=X.largestModules.filter((q)=>q.size>102400);if(K.length>0){Q.push({severity:"info",message:`${K.length} modules are over 100KB`});for(let q of K){if(q.path.includes("lodash")&&!q.path.includes("lodash-es"))$.push({title:"Use lodash-es instead of lodash",description:"lodash-es supports tree-shaking and can significantly reduce bundle size.",impact:"high",effort:"low"});if(q.path.includes("moment"))$.push({title:"Replace moment.js",description:"Consider using date-fns or dayjs for smaller date handling libraries.",impact:"high",effort:"medium"})}}if(X.byType.image.size>512000)$.push({title:"Optimize Images",description:`Images account for ${W(X.byType.image.size)}. Consider using WebP/AVIF formats and responsive images.`,impact:"high",effort:"low"});let j=100;if(X.totalSize>1048576)j-=20;else if(X.totalSize>512000)j-=10;if(j-=Math.min(20,X.duplicates.length*2),j-=Math.min(15,K.length*3),Z.threshold&&X.totalSize>Z.threshold)j-=25;return{score:Math.max(0,j),issues:Q,recommendations:$}}var i={lodash:{alternative:"lodash-es or individual imports",savings:"~70%"},moment:{alternative:"date-fns or dayjs",savings:"~90%"},"chart.js":{alternative:"chart.js with tree-shaking",savings:"~50%"},"highlight.js":{alternative:"Selective language imports",savings:"~80%"},fontawesome:{alternative:"Individual icon imports",savings:"~90%"},"material-ui":{alternative:"Named imports from @mui/*",savings:"~60%"}};function n(X){for(let[Z,Q]of Object.entries(i))if(X.includes(Z))return{title:`Optimize ${Z}`,description:`Consider using ${Q.alternative}. Potential savings: ${Q.savings}`,impact:"high",effort:"low"};return null}var o={default:{js:"#f7df1e",css:"#264de4",html:"#e34c26",image:"#4caf50",font:"#9c27b0",other:"#607d8b",vendor:"#ff5722"},pastel:{js:"#fff3b0",css:"#b0d4ff",html:"#ffb0b0",image:"#b0ffb0",font:"#e0b0ff",other:"#d0d0d0",vendor:"#ffcfb0"},monochrome:{js:"#333333",css:"#555555",html:"#777777",image:"#999999",font:"#bbbbbb",other:"#dddddd",vendor:"#444444"}};function x(X,Z={}){let{title:Q="Bundle Analysis",gzip:$=!0,colorScheme:U="default"}=Z,K=o[U],j=a(X),q=JSON.stringify(j);return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ep as a,fp as b,gp as c,hp as d,ip as e,jp as f,kp as g}from"./chunk-pwsnafp3.js";import"./chunk-1cyxbb8y.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-pwgv84pn.js";import"./chunk-tkyrk66a.js";import"./chunk-ranshpyc.js";import"./chunk-98zj3fv2.js";import"./chunk-35ds08e7.js";import"./chunk-5se8xt9e.js";import"./chunk-gnfywmgs.js";import"./chunk-yq8x8bxq.js";import"./chunk-266t58b8.js";import"./chunk-nq5zxrk0.js";import"./chunk-az4v4ard.js";import"./chunk-4f9zyfdw.js";import"./chunk-xssw417m.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{a as resetUnscopedSignalWarnings,g as processStackReplacements,f as processStackPushDirectives,e as processIncludes,b as partialsCache,c as onceStore,d as clearOnceStore};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Mr as a,Nr as b,Or as c,Pr as d,Qr as e,Rr as f}from"./chunk-pwsnafp3.js";import"./chunk-1cyxbb8y.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-pwgv84pn.js";import"./chunk-tkyrk66a.js";import"./chunk-ranshpyc.js";import"./chunk-98zj3fv2.js";import"./chunk-35ds08e7.js";import"./chunk-5se8xt9e.js";import"./chunk-gnfywmgs.js";import"./chunk-yq8x8bxq.js";import"./chunk-266t58b8.js";import"./chunk-nq5zxrk0.js";import"./chunk-az4v4ard.js";import"./chunk-4f9zyfdw.js";import"./chunk-xssw417m.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$g as d,Yg as a,Zg as b,_g as c,ah as e,bh as f,ch as g,dh as h,eh as i}from"./chunk-
|
|
2
|
+
import{$g as d,Yg as a,Zg as b,_g as c,ah as e,bh as f,ch as g,dh as h,eh as i}from"./chunk-dm2nzg7a.js";import"./chunk-pcxp4r9n.js";import"./chunk-ay6zjq8v.js";export{c as setCachedImageResult,e as processImage,f as optimizeImage,b as getCachedImageResult,i as generateSrcset,h as generateResponsiveVariants,d as clearImageCache,g as applyTransformations,a as ImageProcessorCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Aj as p,Bj as q,zj as o}from"./chunk-
|
|
2
|
+
import{Aj as p,Bj as q,zj as o}from"./chunk-kgd8kchy.js";import{Hj as a,Ij as b,Jj as c,Kj as d,Lj as e,Mj as f,Nj as g,Oj as h,Pj as i,Qj as j,Rj as k,Sj as l,Tj as m,Uj as n}from"./chunk-9e8t0twa.js";import"./chunk-az4v4ard.js";import"./chunk-ay6zjq8v.js";export{n as useOptimistic,l as untrack,a as state,g as runMountCallbacks,h as runDestroyCallbacks,i as pendingLifecycleCounts,m as peek,e as onMount,f as onDestroy,j as isSignal,k as isDerived,p as generateSignalsRuntimeDev,o as generateSignalsRuntime,c as effect,b as derived,q as default,d as batch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Gg as a,Hg as b,Ig as c,Jg as d,Kg as e,Lg as f,Mg as g,Ng as h,Og as i,Pg as j,Qg as k,Rg as l}from"./chunk-xsng1mtq.js";import"./chunk-
|
|
2
|
+
import{Gg as a,Hg as b,Ig as c,Jg as d,Kg as e,Lg as f,Mg as g,Ng as h,Og as i,Pg as j,Qg as k,Rg as l}from"./chunk-xsng1mtq.js";import"./chunk-ay6zjq8v.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Di as a,Ei as b,Fi as c,Gi as d,Hi as e}from"./chunk-qn5srnj3.js";import"./chunk-
|
|
2
|
+
import{Di as a,Ei as b,Fi as c,Gi as d,Hi as e}from"./chunk-qn5srnj3.js";import"./chunk-ay6zjq8v.js";export{a as processAsyncDirectives,c as isAsyncComponent,e as generateAsyncComponentRuntime,d as generateAsyncComponentCSS,b as defineAsyncComponent};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Eg as I}from"./chunk-ny67c03k.js";import{Or as H}from"./chunk-
|
|
2
|
+
import{Eg as I}from"./chunk-ny67c03k.js";import{Or as H}from"./chunk-pwsnafp3.js";import{kx as G}from"./chunk-ay6zjq8v.js";import L from"path";async function Q(k={}){let J=performance.now(),A=k.root||process.cwd(),j=await H(A),B=k.ssr?.routeRules??j.routeRules??{};if(I(B),!j.ssr&&Object.keys(B).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!j.ssr&&(k.ssr?.serverApi??j.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let D,E;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");D=await z({pagesDir:L.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-pdyeaxc1.js");E=await z({root:A,outputDir:".output",debug:k.debug,...k.ssr})}let K=Math.round(performance.now()-J);return{mode:q,ssg:D,ssr:E,duration:K}}
|
|
3
3
|
export{Q as $e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{di as a,ei as b,fi as c,gi as d,hi as e,ii as f,ji as g,ki as h}from"./chunk-27fgag95.js";import"./chunk-9e8t0twa.js";import"./chunk-
|
|
2
|
+
import{di as a,ei as b,fi as c,gi as d,hi as e,ii as f,ji as g,ki as h}from"./chunk-27fgag95.js";import"./chunk-9e8t0twa.js";import"./chunk-ay6zjq8v.js";export{d as v,a as useForm,g as processHasErrorsDirective,h as processFormValidationDirectives,f as processErrorsDirective,e as processErrorDirective,b as defineForm,c as Validator};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ag as YJ,Cg as jJ,hg as ZJ,jg as g,lg as A,sg as n,vg as GJ,yg as WJ}from"./chunk-
|
|
2
|
+
import{Ag as YJ,Cg as jJ,hg as ZJ,jg as g,lg as A,sg as n,vg as GJ,yg as WJ}from"./chunk-6xk87qf2.js";import{Fg as $J}from"./chunk-ny67c03k.js";import{Cl as XJ}from"./chunk-ec4wq2sv.js";import{xo as h}from"./chunk-pwsnafp3.js";import{Ys as e}from"./chunk-pwgv84pn.js";import{$t as QJ,du as i,fu as p}from"./chunk-35ds08e7.js";import{Tw as l,Yw as VJ,qw as KJ}from"./chunk-4f9zyfdw.js";import{kx as DJ}from"./chunk-ay6zjq8v.js";import JJ from"fs";import k from"path";var{serve:wJ}=globalThis.Bun;VJ();import y from"zlib";import{promisify as a}from"util";var IJ=a(y.brotliCompress),OJ=a(y.gzip),UJ=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],BJ=["text/event-stream","multipart/x-mixed-replace"],_J=1024;function zJ(K){if(!K)return!1;let J=K.toLowerCase();if(BJ.some((G)=>J.startsWith(G)))return!1;return UJ.some((G)=>J.startsWith(G))}function FJ(K){let J=new Map;for(let G of K.split(",")){let[Z,...W]=G.trim().split(";"),O=Z.trim().toLowerCase();if(!O)continue;let U=1;for(let B of W){let w=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(B);if(!w)continue;let F=Number.parseFloat(w[1]);if(Number.isFinite(F))U=F}J.set(O,U)}return J}function LJ(K){if(!K)return null;let J=FJ(K),G=J.get("*"),Z=(W)=>J.get(W)??G??0;if(Z("br")>0)return"br";if(Z("gzip")>0)return"gzip";return null}async function t(K,J,G={}){if(J.headers.get("content-encoding"))return J;if(J.status===204||J.status===304||!J.body)return J;if(!zJ(J.headers.get("content-type")))return J;let Z=LJ(K.headers.get("accept-encoding"));if(!Z)return J;let W;try{W=new Uint8Array(await J.arrayBuffer())}catch{return J}let O=()=>new Response(W,{status:J.status,statusText:J.statusText,headers:s(J.headers)});if(W.length<(G.threshold??_J))return O();try{let U=Z==="br"?await IJ(W,{params:{[y.constants.BROTLI_PARAM_QUALITY]:G.quality??5,[y.constants.BROTLI_PARAM_SIZE_HINT]:W.length}}):await OJ(W);if(U.length>=W.length)return O();let B=s(J.headers);return B.set("Content-Encoding",Z),B.set("Content-Length",String(U.length)),new Response(U,{status:J.status,statusText:J.statusText,headers:B})}catch{return O()}}function s(K){let J=new Headers(K),G=J.get("Vary");if(!G)return J.set("Vary","Accept-Encoding"),J;if(!G.split(",").some((W)=>W.trim().toLowerCase()==="accept-encoding"))J.set("Vary",`${G}, Accept-Encoding`);return J}class d{now;entries=new e(1000,{maxBytes:33554432,sizeOf:(K)=>K.body.byteLength+JSON.stringify(K.headers).length*2});pending=new Map;generation=0;constructor(K=Date.now){this.now=K}invalidate(K){this.generation++,this.pending.clear();for(let J of Array.from(this.entries.keys()))if(K===void 0||this.entries.get(J)?.path===K)this.entries.delete(J)}async respond(K,J,G){let Z,W=async()=>{let X=Z??await G();return X.headers.set("Cache-Control","private, no-store"),X.headers.set("Vary",A(X.headers.get("Vary")).Vary),X};if(!J||K.method!=="GET"||K.headers.has("Cookie")||K.headers.has("Authorization")||K.headers.has("Range"))return W();let O=new URL(K.url),U=`${O.origin}${O.pathname}${O.search}|${g(K)?"fragment":"document"}`,B=this.entries.get(U),w=(X)=>{let T=new Headers(X.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-X.created)/1000)))),new Response(X.body.slice(0),{headers:T})},F=B?(this.now()-B.created)/1000:1/0;if(B&&F<J.maxAge)return w(B);let S=this.generation,q=async()=>{let X=await G();Z=X;let T=(X.headers.get("Vary")??"").toLowerCase().split(",").map((L)=>L.trim()).filter(Boolean);if(X.status!==200||X.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(X.headers.get("Cache-Control")??"")||T.some((L)=>L!=="x-stx-router"&&L!=="accept-encoding"))return null;let M=await X.clone().arrayBuffer();if(M.byteLength>1048576)return null;X.headers.set("Vary",A(X.headers.get("Vary")).Vary);let Q={body:M,headers:Array.from(X.headers.entries()),created:this.now(),path:O.pathname};if(this.generation===S)this.entries.set(U,Q);return Q},H=this.pending.get(U);if(!H){if(this.pending.size>=1000)return W();H=q().finally(()=>{if(this.pending.get(U)===H)this.pending.delete(U)}),this.pending.set(U,H)}if(B&&F<J.maxAge+(J.swr??0))return H.catch(()=>{}),w(B);let x=await H;return x?w(x):W()}}var HJ={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function uJ(K={}){let J=k.resolve(K.outputDir||".output"),G=K.port??3000,Z=GJ(J);if(!Z)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${Z.routes.length} routes...`);let W=$J(Z.routeRules),O=new d,U=XJ(J,Z.apiRoutes??[]),B=Bun.file(k.join(J,"server/runtime-config.json")),w=K.runtimeConfig??(await B.exists()?await B.json():void 0),F=w?i(w):void 0,S=new Map,q=new Map,H=new Map,x=new Map;for(let Q of Z.routes)try{let L=k.join(J,Q.compiledPath),Y=JSON.parse(await Bun.file(L).text());if(F)Y.html=p(Y.html,F);S.set(Q.pattern,Y),H.set(Q.pattern,l(Y.html)),x.set(Q.pattern,h(Y.html));let C=k.join(J,Q.fragmentPath);if(await Bun.file(C).exists()){let P=await Bun.file(C).text();q.set(Q.pattern,F?p(P,F):P)}}catch(L){console.warn(`[stx] Failed to load route ${Q.pattern}:`,L)}let X=new Map,T=[];for(let Q of Z.routes)if(Q.hasParams){let{regex:L,params:Y}=KJ(Q.pattern);T.push({regex:L,route:Q,paramNames:Y})}else X.set(Q.pattern,Q);let M=wJ({port:G,async fetch(Q){return t(Q,await QJ(F??i(),async()=>{let Y=new URL(Q.url).pathname;if(K.onRequest){let j=await K.onRequest(Q);if(j)return j}if(K.apiRouter){let j=await K.apiRouter.handleRequest(Q);if(j.status!==404)return j}if(K.apiRoutes?.[Y])return K.apiRoutes[Y](Q);let C=await U(Q);if(C)return C;if((Q.method==="GET"||Q.method==="HEAD")&&Y!=="/"){let j=k.resolve(J,"public"),_;try{_=decodeURIComponent(Y)}catch{_=Y}if(!_.includes("\x00")){let I=k.resolve(j,`.${_}`);if(I===j||I.startsWith(`${j}${k.sep}`))try{if(JJ.existsSync(I)&&JJ.statSync(I).isFile()){let z=k.extname(I).toLowerCase(),E=HJ[z]||"application/octet-stream",v=Y.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(Y);return new Response(Bun.file(I),{headers:{"Content-Type":E,"Cache-Control":v?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=g(Q),D=null,o={};if(D=X.get(Y)||null,!D)for(let{regex:j,route:_,paramNames:I}of T){let $=Y.match(j);if($){D=_,I.forEach((z,E)=>{o[z]=$[E+1]});break}}if(!D){let j=X.get("/404")||null;if(j){let _=S.get(j.pattern);if(_)return new Response(_.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}let R=W(Y),r=Object.keys(R).length>0;return O.respond(Q,R.cache,async()=>{let j=S.get(D.pattern);if(P&&Q.method==="GET"&&j&&!j.hasServerScripts&&Object.keys(j.placeholders).length===0){let $=q.get(D.pattern);if($){let z=H.get(D.pattern);return new Response($,{status:j.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...x.has(D.pattern)?{"X-STX-Runtime":x.get(D.pattern)?"true":"false"}:{},...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},...A(),...R.cache?{}:{"Cache-Control":ZJ}}})}}let _=WJ(Q.method),I=S.get(D.pattern);if(!I){let $=X.get("/500")||null;if($){let z=S.get($.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(D.prerendered&&_)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!_&&!I.hasServerScripts&&Object.keys(I.placeholders).length===0)return new Response(I.html,{status:I.status??200,headers:{"Content-Type":"text/html",...A(),"Cache-Control":"public, max-age=60"}});try{let{html:$,boundaries:z,redirect:E,cookies:v,status:m,headers:c}=await jJ(I,{params:o,request:Q,method:Q.method,__stx_strict_hydration:r,__stx_runtime_config:F});if(E)return YJ(E,v,c);if(z&&z.length>0){let{renderStreamingPage:N,streamToResponse:u}=await import("./chunk-epjt342x.js"),b=new Headers({...A(),...c,"Cache-Control":"private, no-store"});for(let f of v??[])b.append("Set-Cookie",f);if(P&&!_){let f=l($);b.set("X-STX-Fragment","true"),b.set("X-STX-Runtime",h($)?"true":"false"),b.set("X-STX-Layout",f.layout),b.set("X-STX-Layout-Group",f.group)}return u(N(P&&!_?n($,Z.routerContainer||"main"):$,z,{timeoutMs:30000}),{status:m??I.status??200,headers:b})}let V=new Headers({"Content-Type":"text/html",...A(),...R.cache?{}:{"Cache-Control":"private, no-store"}});for(let N of v??[])V.append("Set-Cookie",N);for(let[N,u]of Object.entries(c??{}))V.set(N,u);if(V.set("Vary",A(V.get("Vary")).Vary),P&&!_){let N=l($);return V.set("X-STX-Fragment","true"),V.set("X-STX-Runtime",h($)?"true":"false"),V.set("X-STX-Layout",N.layout),V.set("X-STX-Layout-Group",N.group),new Response(n($,Z.routerContainer||"main"),{status:m??I.status??200,headers:V})}return new Response($,{status:m??I.status??200,headers:V})}catch($){if(console.error(`[stx] Hydration error for ${Y}:`,$),r)return new Response("Internal Server Error",{status:500});return new Response(I.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${M.port}`),console.log(`[stx] Serving ${Z.routes.length} routes (${S.size} pre-loaded)`),{port:M.port,stop:()=>{O.invalidate(),M.stop()},invalidate:(Q)=>O.invalidate(Q)}}
|
|
3
3
|
export{zJ as af,LJ as bf,t as cf,uJ as df};
|
|
@@ -299,4 +299,4 @@ catch (error) {
|
|
|
299
299
|
}
|
|
300
300
|
})();
|
|
301
301
|
</script>`}var N={name:"pwa.installButton",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return H(j,q)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Q={name:"pwa.updatePrompt",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return J(j,q)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},T={name:"pwa.offlineIndicator",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return L(j,q)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},V={name:"pwa.pushSubscribe",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return M(j,q)},hasEndTag:!0,description:"Renders a push notification subscription button"},X=[N,Q,T,V];function Z(j){return[...j,...X]}
|
|
302
|
-
export{N as
|
|
302
|
+
export{N as Zw,Q as _w,T as $w,V as ax,X as bx,Z as cx};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ef as a,ff as b,gf as c,hf as d,if as e,jf as f,kf as g,lf as h,mf as i,nf as j,of as k,pf as l,qf as m,rf as n,sf as o}from"./chunk-6kdrncsx.js";import"./chunk-
|
|
2
|
+
import{ef as a,ff as b,gf as c,hf as d,if as e,jf as f,kf as g,lf as h,mf as i,nf as j,of as k,pf as l,qf as m,rf as n,sf as o}from"./chunk-6kdrncsx.js";import"./chunk-ay6zjq8v.js";export{k as writeNetlifyConfig,n as initNetlify,l as hasNetlifyConfig,g as getTotalSize,h as generateNetlifyToml,f as formatSize,e as filterRequiredFiles,i as detectProjectConfig,m as deploy,a as createNetlifyClient,d as createFileManifest,j as createDefaultNetlifyConfig,c as collectDeployFiles,b as calculateSha1,o as DeployError};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ex as O,gx as x}from"./chunk-kg1rdena.js";import{kx as z}from"./chunk-ay6zjq8v.js";var Gq={1001:{message:"Unclosed directive: {{directive}}",help:"Make sure to close the directive with the appropriate end tag"},1002:{message:"Unclosed expression at position {{position}}",help:"Check for missing closing braces }}"},1003:{message:"Invalid directive syntax: {{directive}}",help:"Review the directive documentation for correct syntax"},1004:{message:"Malformed expression: {{expression}}",help:"Check for syntax errors in your expression"},1005:{message:"Unexpected token: {{token}}",help:"Remove or fix the unexpected token"},1101:{message:"Undefined variable: {{variable}}",help:"Make sure the variable is defined in the template context"},1102:{message:"Type error: {{details}}",help:"Check that you are using the correct types"},1103:{message:"Evaluation error: {{details}}",help:"Review the expression for errors"},1104:{message:"Infinite loop detected in {{location}}",help:"Check your loop conditions"},1105:{message:"Circular reference detected: {{path}}",help:"Remove the circular dependency"},1201:{message:"Unsafe expression blocked: {{expression}}",help:"This expression contains potentially dangerous code"},1202:{message:"Path traversal attempt blocked: {{path}}",help:"Use only relative paths within allowed directories"},1203:{message:"Potential XSS attempt blocked",help:"Sanitize user input before rendering"},1204:{message:"Code injection attempt blocked: {{code}}",help:"Avoid executing dynamic code"},1205:{message:"Prohibited DOM API usage: {{api}}",help:"Use STX.useRefs(), STX.useRef(), STX.el() and other STX helpers instead of direct DOM manipulation"},1301:{message:"File not found: {{path}}",help:"Check that the file exists and the path is correct"},1302:{message:"Error reading file: {{path}}",help:"Check file permissions and encoding"},1303:{message:"Invalid file path: {{path}}",help:"Use a valid file path"},1304:{message:"Permission denied: {{path}}",help:"Check file permissions"},1401:{message:"Invalid configuration: {{details}}",help:"Review your stx.config.ts file"},1402:{message:"Missing required configuration: {{key}}",help:"Add the required configuration option"},1403:{message:"Deprecated configuration: {{key}}",help:"Update to the new configuration format"},1501:{message:"Component not found: {{name}}",help:"Check that the component exists in your components directory"},1502:{message:"Invalid props for component {{name}}: {{details}}",help:"Check the component prop requirements"},1503:{message:"Error rendering component {{name}}: {{details}}",help:"Check the component template for errors"},1601:{message:"Filter not found: {{filter}}",help:"Register the filter or check the filter name"},1602:{message:"Invalid arguments for filter {{filter}}: {{details}}",help:"Check the filter documentation for correct arguments"},1603:{message:"Expression evaluation timed out",help:"Simplify the expression or increase the timeout"}},L={},u="en";function Hq(q){u=q}function Bq(){return u}function Wq(q){L={...L,...q}}function Mq(){L={}}function f(q,J={}){let Q=L[q]||Gq[q]||{message:`Unknown error (code: ${q})`},Z=Q.message,$=Q.help;for(let[Y,V]of Object.entries(J)){let X=`{{${Y}}}`;if(Z=Z.replace(new RegExp(X,"g"),V),$)$=$.replace(new RegExp(X,"g"),V)}return{message:Z,help:$}}function Iq(q,J={}){let{message:Q,help:Z}=f(q,J);return Z?`${Q}
|
|
3
3
|
Help: ${Z}`:Q}var w={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603};function S(q){for(let[J,Q]of Object.entries(w))if(Q===q)return J;return}x();import wq from"path";var m={showRelativePaths:!1,enableAutoRecovery:O(),logRecoveryWarnings:!0},D={...m};function Fq(q){D={...D,...q}}function _(){return{...D}}function jq(){D={...m}}function T(q){if(!D.showRelativePaths||!q)return q;let J=D.baseDir||process.cwd();try{let Q=wq.relative(J,q);return Q.startsWith("..")?q:Q}catch{return q}}class U extends Error{code;filePath;line;column;context;numericCode;constructor(q,J,Q,Z,$,Y,V){super(q);this.code=J;this.filePath=Q;this.line=Z;this.column=$;this.context=Y;if(this.name="StxError",this.numericCode=V||w.EVALUATION_ERROR,this.filePath)this.filePath=T(this.filePath)}}class c extends U{constructor(q,J,Q,Z,$,Y){super(q,"stx_SYNTAX_ERROR",J,Q,Z,$,Y||w.INVALID_DIRECTIVE_SYNTAX);this.name="StxSyntaxError"}}class d extends U{constructor(q,J,Q,Z,$,Y){super(q,"stx_RUNTIME_ERROR",J,Q,Z,$,Y||w.EVALUATION_ERROR);this.name="StxRuntimeError"}}class p extends U{constructor(q,J,Q,Z,$,Y){super(q,"stx_SECURITY_ERROR",J,Q,Z,$,Y||w.UNSAFE_EXPRESSION);this.name="StxSecurityError"}}class l extends U{constructor(q,J,Q,Z,$,Y){super(q,"stx_FILE_ERROR",J,Q,Z,$,Y||w.FILE_NOT_FOUND);this.name="StxFileError"}}class o extends U{isFatal=!0;constructor(q,J,Q,Z,$,Y){super(q,"stx_VALIDATION_ERROR",J,Q,Z,$,Y||w.DOM_API_VIOLATION);this.name="StxValidationError"}}function C(q){let{type:J,message:Q,code:Z,filePath:$,line:Y,column:V,template:X,offset:H,snippet:G,suggestion:B,format:W="text"}=q,M=Y,I=V;if(!M&&X&&H!==void 0){let E=r(X,H);M=E.line,I=E.column}let j=$?T($):void 0,Vq=Z?S(Z):void 0,K={type:J,code:Z,codeName:Vq,message:Q,filePath:j,line:M,column:I,snippet:G,suggestion:B,timestamp:new Date().toISOString()},k;switch(W){case"html":k=Dq(K);break;case"json":k=JSON.stringify(K,null,2);break;case"console":k=Kq(K,X,H);break;case"text":default:k=Uq(K,X,H);break}return{formatted:k,data:K}}function Uq(q,J,Q){let Z=[],$=q.code?` [${q.codeName||q.code}]`:"";if(Z.push(`[${q.type} Error${$}]`),q.filePath){let Y=q.filePath;if(q.line){if(Y+=`:${q.line}`,q.column)Y+=`:${q.column}`}Z.push(`at ${Y}`)}if(Z.push(`
|
|
4
4
|
${q.message}`),J&&q.line){let Y=kq(J,q.line,2);if(Y)Z.push(`
|
|
5
5
|
${Y}`)}if(q.snippet)Z.push(`
|
|
@@ -44,4 +44,4 @@ catch (e) {
|
|
|
44
44
|
throw e;
|
|
45
45
|
}
|
|
46
46
|
`;return nq(Z?(G)=>{let B=t([b,...Y,...G],X);return(...W)=>B(Yq,...W)}:(G)=>t([...Y,...G],X),Y,J,$,V)}function nq(q,J,Q,Z,$){let Y=q([]),V=Z.every((H,G)=>H.index===G);if(J.length===Q.length&&V)return e(Y,J,q);return e((...H)=>{let G=Array($.length);for(let B=0;B<$.length;B++)G[B]=H[$[B]];return Y(...G)},J,q,(H)=>{Y=q(H)})}function e(q,J,Q,Z){let Y=/^(\w+) is not defined$/,V=q,X=[],H=new Set(J);return(...G)=>{for(let B=0;B<=8;B++)try{return V(...G)}catch(W){let M=W instanceof Error?W.message:"",I=Y.exec(M);if(!(W instanceof ReferenceError)||!I)return;let j=I[1];if(H.has(j)||Xq.has(j))return;if(H.add(j),X.push(j),Z)Z(X);else V=Q(X)}return}}function OJ(q){let J=q.trim(),Q=[/\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 Z of Q)if(Z.test(J))return!1;return!0}
|
|
47
|
-
export{Hq as
|
|
47
|
+
export{Hq as Vu,Bq as Wu,Wq as Xu,Mq as Yu,f as Zu,Iq as _u,w as $u,S as av,Fq as bv,_ as cv,jq as dv,T as ev,U as fv,c as gv,d as hv,p as iv,l as jv,o as kv,C as lv,zq as mv,Lq as nv,_q as ov,Tq as pv,Nq as qv,Aq as rv,P as sv,Rq as tv,bq as uv,v as vv,N as wv,Cq as xv,Pq as yv,gq as zv,n as Av,UJ as Bv,cq as Cv,dq as Dv,pq as Ev,DJ as Fv,KJ as Gv,kJ as Hv,sq as Iv,rq as Jv,OJ as Kv};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{kx as l}from"./chunk-ay6zjq8v.js";import U from"fs";import G from"path";import I from"os";import H from"crypto";import{generatePlaceholder as m,processImage as g}from"ts-images";var d=[320,640,768,1024,1280,1536,1920],h=["webp","jpeg"],b=80,u=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],P={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},N=null,W=!1;async function Y(){if(W)return N;W=!0;try{let J=await import("sharp");return N=J.default||J,N}catch{return null}}async function e(){return await Y()!==null}async function t(){return!0}async function JJ(J,K={}){let{widths:Z=d,formats:$=h,quality:q=b,fit:C="cover",placeholder:X="none",outputDir:Q=".stx/images",baseUrl:_="/images"}=K,j,x;if(typeof J==="string"){if(x=J,!await Bun.file(J).exists())throw new L(`Image not found: ${J}`,"NOT_FOUND");j=await Bun.file(J).arrayBuffer().then((V)=>Buffer.from(V))}else x="buffer-input",j=J;let w=H.createHash("sha256").update(j).digest("hex").slice(0,12),y=await O(j),{width:B,height:D}=y,A=B/D;await U.promises.mkdir(Q,{recursive:!0});let T=[],v=G.basename(x,G.extname(x)),z=Z.filter((V)=>V<=B);if(!z.includes(B)&&B<=Math.max(...Z))z.push(B);z.sort((V,R)=>V-R);for(let V of z){let R=Math.round(V/A);for(let F of $){let S=`${v}-${V}w-${w}.${F}`,k=G.join(Q,S),c=`${_}/${S}`,E=await n(j,{width:V,height:R,format:F,quality:q,fit:C});await Bun.write(k,E),T.push({path:k,url:c,width:V,height:R,format:F,size:E.length})}}let M;if(X!=="none")M=await o(j,X);return{src:x,variants:T,placeholder:M,width:B,height:D,aspectRatio:A,hash:w}}async function O(J){let K=typeof J==="string"?Buffer.from(await Bun.file(J).arrayBuffer()):J,Z=await Y();if(Z){let q=await Z(K).metadata();return{width:q.width||0,height:q.height||0,format:q.format||"unknown",hasAlpha:q.hasAlpha}}return p(K)}function p(J){if(J[0]===137&&J[1]===80&&J[2]===78&&J[3]===71){let K=J.readUInt32BE(16),Z=J.readUInt32BE(20);return{width:K,height:Z,format:"png",hasAlpha:!0}}if(J[0]===255&&J[1]===216){let K=2;while(K<J.length){if(J[K]!==255)break;let Z=J[K+1];if(Z>=192&&Z<=207&&Z!==196&&Z!==200&&Z!==204){let q=J.readUInt16BE(K+5);return{width:J.readUInt16BE(K+7),height:q,format:"jpeg",hasAlpha:!1}}let $=J.readUInt16BE(K+2);K+=2+$}}if(J.toString("utf8",0,4)==="RIFF"&&J.toString("utf8",8,12)==="WEBP"){let K=J.toString("utf8",12,16);if(K==="VP8 "){let Z=J.readUInt16LE(26)&16383,$=J.readUInt16LE(28)&16383;return{width:Z,height:$,format:"webp",hasAlpha:!1}}if(K==="VP8L"){let Z=J.readUInt32LE(21),$=(Z&16383)+1,q=(Z>>14&16383)+1;return{width:$,height:q,format:"webp",hasAlpha:!0}}}if(J.toString("utf8",0,3)==="GIF"){let K=J.readUInt16LE(6),Z=J.readUInt16LE(8);return{width:K,height:Z,format:"gif",hasAlpha:!0}}throw new L("Unable to parse image dimensions","PARSE_ERROR")}async function n(J,K){let Z=await Y();if(Z){let q=Z(J).resize(K.width,K.height,{fit:K.fit});switch(K.format){case"webp":q=q.webp({quality:K.quality});break;case"avif":q=q.avif({quality:K.quality});break;case"jpeg":q=q.jpeg({quality:K.quality});break;case"png":q=q.png({quality:K.quality});break}return q.toBuffer()}let $=G.join(I.tmpdir(),`stx-img-${H.randomBytes(8).toString("hex")}.${K.format}`);try{return await g({input:J,output:$,format:K.format,quality:K.quality,resize:{width:K.width,height:K.height,fit:K.fit}}),Buffer.from(await Bun.file($).arrayBuffer())}finally{await U.promises.unlink($).catch(()=>{})}}async function o(J,K){let Z=await Y();if(K==="blur"&&Z){let X=(await Z(J).resize(20).blur(10).toBuffer()).toString("base64"),Q=await O(J);return`data:${P[Q.format]||"image/jpeg"};base64,${X}`}if(K==="dominant-color"&&Z){let{dominant:C}=await Z(J).resize(1,1).toBuffer().then(async(X)=>{let Q=await Z(X).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${C.r}, ${C.g}, ${C.b})`}let $=await O(J),q=G.join(I.tmpdir(),`stx-ph-${H.randomBytes(8).toString("hex")}.${$.format==="unknown"?"bin":$.format}`);try{await Bun.write(q,J);let C=K==="blur"?"blur":K==="thumbhash"?"thumbhash":"dominant-color",Q=await m(q,{strategy:C,width:C==="thumbhash"?void 0:32});if(K==="dominant-color"&&Q.dominantColor)return Q.dominantColor;if(Q.dataURL)return Q.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await U.promises.unlink(q).catch(()=>{})}}function KJ(J,K){return(K?J.filter(($)=>$.format===K):J).sort(($,q)=>$.width-q.width).map(($)=>`${$.url} ${$.width}w`).join(", ")}function ZJ(J){if(!J||Object.keys(J).length===0)return"100vw";return Object.entries(J).sort((Z,$)=>{let q=Number.parseInt(Z[0].replace(/\D/g,""))||0;return(Number.parseInt($[0].replace(/\D/g,""))||0)-q}).map(([Z,$])=>`(max-width: ${Z}) ${$}`).join(", ")+", 100vw"}function $J(J){let K=J.filter(($)=>$.format==="jpeg");if(K.length===0)return J[Math.floor(J.length/2)];let Z=K.sort(($,q)=>$.width-q.width);return Z[Math.floor(Z.length/2)]}function qJ(J){let K=new Map;for(let Z of J){let $=K.get(Z.format)||[];$.push(Z),K.set(Z.format,$)}return K}function CJ(J){let K=G.extname(J).toLowerCase();return u.includes(K)}function QJ(J){return P[J]||"application/octet-stream"}function VJ(J){return J.reduce((K,Z)=>K+Z.size,0)}function XJ(J){if(J<1024)return`${J} B`;if(J<1048576)return`${(J/1024).toFixed(1)} KB`;return`${(J/1048576).toFixed(2)} MB`}class L extends Error{code;constructor(J,K){super(J);this.name="ImageProcessingError",this.code=K}}
|
|
3
3
|
export{d as Hf,h as If,b as Jf,e as Kf,t as Lf,JJ as Mf,O as Nf,n as Of,KJ as Pf,ZJ as Qf,$J as Rf,qJ as Sf,CJ as Tf,QJ as Uf,VJ as Vf,XJ as Wf,L as Xf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Rk as a,Sk as b,Tk as c,Uk as d,Vk as e}from"./chunk-kmsyvaex.js";import"./chunk-
|
|
2
|
+
import{Rk as a,Sk as b,Tk as c,Uk as d,Vk as e}from"./chunk-kmsyvaex.js";import"./chunk-ay6zjq8v.js";export{d as runPwaAudit,e as formatAuditResult,c as calculateAuditResult,a as auditConfig,b as auditBuildOutput};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{si as a,ti as b,ui as c,vi as d,wi as e,xi as f}from"./chunk-hx998w7n.js";import"./chunk-
|
|
2
|
+
import{si as a,ti as b,ui as c,vi as d,wi as e,xi as f}from"./chunk-hx998w7n.js";import"./chunk-ay6zjq8v.js";export{c as processTransitionDirectives,f as processTransitionAttributes,b as performLeave,a as performEnter,e as generateTransitionRuntime,d as generateTransitionCSS};
|