@stacksjs/stx 0.2.265 → 0.2.266
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/caching.js +2 -0
- package/dist/{chunk-25de1sj7.js → chunk-0athjw48.js} +2 -2
- package/dist/{chunk-38ykv2gd.js → chunk-135mme4g.js} +1 -1
- package/dist/{chunk-gpt6ggxj.js → chunk-1hhxj2r5.js} +1 -1
- package/dist/{chunk-f0rjjfk0.js → chunk-1j77d7fw.js} +1 -1
- package/dist/{chunk-sr49fd8p.js → chunk-1m4sa11y.js} +1 -1
- package/dist/{chunk-nteg247p.js → chunk-278yw67q.js} +1 -1
- package/dist/{chunk-0mk858ne.js → chunk-2ed60g20.js} +2 -2
- package/dist/{chunk-qpsj28s2.js → chunk-2qsa4h1t.js} +2 -2
- package/dist/{chunk-3rnc94mp.js → chunk-2x9s5z8x.js} +1 -1
- package/dist/{chunk-va2wwrpf.js → chunk-455pgdzh.js} +1 -1
- package/dist/{chunk-k6st4606.js → chunk-4ay1ymgp.js} +1 -1
- package/dist/{chunk-x7pp10qb.js → chunk-4cr21p7m.js} +1 -1
- package/dist/chunk-4mvpapjz.js +2 -0
- package/dist/{chunk-7exqxjx5.js → chunk-4mw2kfqd.js} +1 -1
- package/dist/chunk-4wnnet1k.js +12 -0
- package/dist/{chunk-jt8as8j8.js → chunk-52wr95ps.js} +1 -1
- package/dist/chunk-5htqgzbb.js +2 -0
- package/dist/chunk-5jcsg2mc.js +2 -0
- package/dist/{chunk-z0aygs4h.js → chunk-5k0j7bjy.js} +1 -1
- package/dist/{chunk-aw651z2y.js → chunk-5wkwhjjn.js} +54 -20
- package/dist/{chunk-xr1758xj.js → chunk-6746wmsf.js} +1 -1
- package/dist/{chunk-pfm1325e.js → chunk-6g4mnrr0.js} +1 -1
- package/dist/{chunk-new80es4.js → chunk-6g7m08rv.js} +1 -1
- package/dist/{chunk-4zkv1vqh.js → chunk-6yphtg3q.js} +1 -1
- package/dist/{chunk-p1rswnys.js → chunk-73yr54sg.js} +1 -1
- package/dist/{chunk-2pavh1yg.js → chunk-78bm61kd.js} +1 -1
- package/dist/chunk-7cts329z.js +2 -0
- package/dist/chunk-7kkc13rc.js +2 -0
- package/dist/chunk-8evws5cc.js +11 -0
- package/dist/{chunk-zr4emtxf.js → chunk-8jvmjzmr.js} +1 -1
- package/dist/{chunk-zr6m5k3t.js → chunk-987kjtg8.js} +1 -1
- package/dist/{chunk-3fa6t4fw.js → chunk-9gzmcxzg.js} +1 -1
- package/dist/{chunk-b3f5dwzz.js → chunk-9rdg7x9h.js} +1 -1
- package/dist/chunk-9rkcrzj4.js +2 -0
- package/dist/{chunk-8pvymy12.js → chunk-9y175wxc.js} +1 -1
- package/dist/{chunk-4xr8099h.js → chunk-a78tzerx.js} +1 -1
- package/dist/{chunk-qqfsm20p.js → chunk-a7x7dmtf.js} +1 -1
- package/dist/{chunk-3txrk37v.js → chunk-a95rrp0j.js} +1 -1
- package/dist/{chunk-w5b2bwxp.js → chunk-aagn8j9e.js} +10 -10
- package/dist/{chunk-dnhckx52.js → chunk-bby4emay.js} +1 -1
- package/dist/{chunk-j59pkkzn.js → chunk-behbakfv.js} +1 -1
- package/dist/chunk-c1r9q5pk.js +15 -0
- package/dist/chunk-cd4v7xyr.js +2 -0
- package/dist/chunk-d3v3p15c.js +2 -0
- package/dist/{chunk-jq375v8t.js → chunk-dhe8sp1a.js} +1 -1
- package/dist/chunk-dpgp6rzq.js +2 -0
- package/dist/{chunk-g8tce9rr.js → chunk-f1jd5qjb.js} +1 -1
- package/dist/chunk-f3k5xbhk.js +2 -0
- package/dist/{chunk-4qq5wj04.js → chunk-f3m0q482.js} +1 -1
- package/dist/{chunk-wb7dfcnc.js → chunk-f8g0zbm3.js} +1 -1
- package/dist/{chunk-0y6f4037.js → chunk-f8wjdg40.js} +1 -1
- package/dist/chunk-fcv00xs9.js +2 -0
- package/dist/{chunk-sne7938g.js → chunk-fn9yw31x.js} +1 -1
- package/dist/chunk-g4z7gah7.js +2 -0
- package/dist/{chunk-ph5f8eev.js → chunk-gej3rmfy.js} +1 -1
- package/dist/{chunk-a90d3xne.js → chunk-gn48cpgb.js} +1 -1
- package/dist/{chunk-1qnyvw5w.js → chunk-hhyf0s7s.js} +1 -1
- package/dist/{chunk-x84g0m0p.js → chunk-j24k071e.js} +1 -1
- package/dist/chunk-jb7h4qgh.js +22 -0
- package/dist/{chunk-a8mnhryz.js → chunk-jnbhyzkv.js} +2 -2
- package/dist/{chunk-nqy2v6vh.js → chunk-k4m48h62.js} +1 -1
- package/dist/chunk-k5c19t7e.js +2 -0
- package/dist/{chunk-6vqb54c8.js → chunk-k7n88ess.js} +1 -1
- package/dist/{chunk-wj2trgsn.js → chunk-krgth3gf.js} +1 -1
- package/dist/chunk-mb0kqnwf.js +2 -0
- package/dist/{chunk-r7dd7c7y.js → chunk-mbvkvac6.js} +332 -343
- package/dist/{chunk-4w3gg4g7.js → chunk-mcn9mwzv.js} +1 -1
- package/dist/{chunk-bjj27mf3.js → chunk-mv0syvrg.js} +1 -1
- package/dist/{chunk-rp0m678g.js → chunk-n2r83qwt.js} +1 -1
- package/dist/{chunk-j6e4vwv5.js → chunk-n3jgypjf.js} +1 -1
- package/dist/{chunk-rkrnb0ec.js → chunk-nfykda12.js} +1 -1
- package/dist/chunk-ng1wyd2v.js +2 -0
- package/dist/{chunk-ecyac25w.js → chunk-nswz1rkm.js} +1 -1
- package/dist/{chunk-1n16xphq.js → chunk-nwq01xh0.js} +1 -1
- package/dist/chunk-p9ase2nx.js +2 -0
- package/dist/{chunk-s2wm8qwg.js → chunk-q4n8a7sf.js} +1 -1
- package/dist/chunk-q5et8k2d.js +2 -0
- package/dist/chunk-qf5grrg1.js +2 -0
- package/dist/{chunk-k1e72asa.js → chunk-qh6223a0.js} +1 -1
- package/dist/{chunk-gg2en16q.js → chunk-qkbrbys7.js} +1 -1
- package/dist/{chunk-yjk7vyd8.js → chunk-r4nkpr60.js} +1 -1
- package/dist/{chunk-c17txgm7.js → chunk-r9z71gj0.js} +1 -1
- package/dist/{chunk-c59rkxwf.js → chunk-rc4zrsw3.js} +1 -1
- package/dist/chunk-rgh4njyv.js +2 -0
- package/dist/{chunk-10tcqry1.js → chunk-rwb4nztb.js} +1 -1
- package/dist/chunk-scdxk8nn.js +2 -0
- package/dist/{chunk-5h5ydexj.js → chunk-sde45gh3.js} +1 -1
- package/dist/{chunk-chsfdfqm.js → chunk-shtemwbq.js} +1 -1
- package/dist/chunk-tc01rmwh.js +2 -0
- package/dist/{chunk-wx73fmky.js → chunk-tv6ds16a.js} +1 -1
- package/dist/chunk-tybdapd3.js +2 -0
- package/dist/chunk-v9crchhq.js +2 -0
- package/dist/{chunk-95mj2e8x.js → chunk-vrskjx64.js} +1 -1
- package/dist/{chunk-4svmpj7y.js → chunk-w7gpyx2k.js} +1 -1
- package/dist/{chunk-gyga6sjp.js → chunk-wacr03x4.js} +1 -1
- package/dist/chunk-x2mke7a1.js +2 -0
- package/dist/chunk-xkb16kmv.js +2 -0
- package/dist/chunk-xpsxwbw0.js +2 -0
- package/dist/{chunk-yb3nrbqz.js → chunk-yhtq662h.js} +1 -1
- package/dist/chunk-ykxs16y7.js +2 -0
- package/dist/chunk-yxp7wv61.js +3 -0
- package/dist/{chunk-x0t0ndxd.js → chunk-z66a9nnd.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/client-script-bundler.d.ts +14 -0
- package/dist/client-script-bundler.js +37 -21
- package/dist/client-script.d.ts +1 -0
- package/dist/client-script.js +4 -2
- package/dist/color-mode-boot.js +6 -3
- package/dist/component-client-factories.d.ts +29 -0
- package/dist/component-client-factories.js +24 -0
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/dev-server/crosswind.d.ts +0 -3
- package/dist/dev-server/crosswind.js +13 -0
- package/dist/framework-composables.js +12 -2
- package/dist/performance-utils.d.ts +22 -1
- package/dist/performance-utils.js +30 -5
- package/dist/pwa.js +2 -2
- package/dist/render-memo.d.ts +40 -0
- package/dist/render-memo.js +33 -0
- package/dist/script-validation.js +25 -11
- package/dist/ssg.js +2 -2
- package/dist/store-loader.js +10 -1
- package/dist/style-scoping.js +18 -7
- package/dist/utils.js +108 -58
- package/dist/variable-extractor.js +14 -8
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-0ha9e1wt.js +0 -5
- package/dist/chunk-0x022m9m.js +0 -2
- package/dist/chunk-14cps421.js +0 -2
- package/dist/chunk-1r8c2wws.js +0 -2
- package/dist/chunk-2p4v6ed7.js +0 -2
- package/dist/chunk-2qbde7w2.js +0 -2
- package/dist/chunk-3wwnx5d4.js +0 -2
- package/dist/chunk-4s2p4hry.js +0 -2
- package/dist/chunk-6gc8phhe.js +0 -2
- package/dist/chunk-7qgnd7z8.js +0 -2
- package/dist/chunk-85wgtm01.js +0 -2
- package/dist/chunk-8raem8ng.js +0 -2
- package/dist/chunk-9v8be077.js +0 -2
- package/dist/chunk-a5sn113x.js +0 -12
- package/dist/chunk-b3zes539.js +0 -11
- package/dist/chunk-c2mvr9z1.js +0 -2
- package/dist/chunk-fenb3cqw.js +0 -2
- package/dist/chunk-g4t9zc0a.js +0 -2
- package/dist/chunk-gayjne01.js +0 -2
- package/dist/chunk-gd9gfw08.js +0 -2
- package/dist/chunk-h44qqffw.js +0 -2
- package/dist/chunk-jftmdf4j.js +0 -2
- package/dist/chunk-k6wnmjhf.js +0 -3
- package/dist/chunk-m116b3d9.js +0 -2
- package/dist/chunk-m8hggrdc.js +0 -2
- package/dist/chunk-mjbsb088.js +0 -2
- package/dist/chunk-ptcpaeem.js +0 -11
- package/dist/chunk-rs5w6cm5.js +0 -2
- package/dist/chunk-tn2kwwy4.js +0 -13
- package/dist/chunk-venjrj7g.js +0 -2
- package/dist/chunk-xezfdh27.js +0 -2
- package/dist/chunk-xmrwskw2.js +0 -2
- package/dist/chunk-zcz486dz.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$s as
|
|
2
|
+
import{$s as f,Ws as a,Xs as b,Ys as c,Zs as d,_s as e,at as g,bt as h,ct as i,dt as j,et as k,ft as l,gt as m}from"./chunk-jb7h4qgh.js";import"./chunk-bby4emay.js";import"./chunk-f8wjdg40.js";export{f as resolveUserCrosswindConfig,c as resetCssCache,d as resetCrosswindCache,i as rebuildCrosswindCSS,e as loadCrosswindConfig,b as loadCrosswind,m as injectCrosswindCSS,a as getCrosswindServeAsset,j as getCachedCSS,l as generateCrosswindCSS,g as fingerprintConfig,k as extractClassNames,h as buildCrosswindCSS};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{eh as L,fh as w,gh as x,hh as p,ih as F,jh as T,mh as I,nh as f,oh as l,ph as n,qh as i,rh as P,sh as o,th as a}from"./chunk-
|
|
2
|
+
import{eh as L,fh as w,gh as x,hh as p,ih as F,jh as T,mh as I,nh as f,oh as l,ph as n,qh as i,rh as P,sh as o,th as a}from"./chunk-4ay1ymgp.js";import{Cs as ZG}from"./chunk-135mme4g.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,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}from"./chunk-f5v2qf95.js";import"./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}from"./chunk-f5v2qf95.js";import"./chunk-f8wjdg40.js";export{g as timingPlugin,c as pluginManager,a as definePlugin,f as debugPlugin,h as createVariablesPlugin,e as createFilterPlugin,d as createDirectivePlugin,b as PluginManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mf as t,nf as u,of as v,pf as w,qf as x,rf as y,sf as z,tf as A,uf as B,vf as C,wf as D,xf as E}from"./chunk-
|
|
2
|
+
import{mf as t,nf as u,of as v,pf as w,qf as x,rf as y,sf as z,tf as A,uf as B,vf as C,wf as D,xf as E}from"./chunk-mv0syvrg.js";import{ig as r,jg as s}from"./chunk-behbakfv.js";import{eh as b,fh as c,gh as d,hh as e,ih as f,jh as g,kh as h,mh as i,nh as j,oh as k,ph as l,qh as m,rh as n,sh as o,th as p,uh as q}from"./chunk-4ay1ymgp.js";import{Dh as a}from"./chunk-w3ycm4na.js";import"./chunk-135mme4g.js";import"./chunk-f8wjdg40.js";export{D as writeImageManifest,a as rewriteImagesWithSiblings,t as renderImageComponent,v as processImageComponents,g as processImage,u as parseImageComponent,A as optimizeImage,B as optimizeDirectory,e as isSharpAvailable,m as isImageFile,f as isImageBackendAvailable,y as imageDirective,r as handleImageRequest,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,h as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,C as generateImageManifest,p as formatSize,E as defaultImageConfig,z as createImagePlugin,s as createImageHandler,x as createImageDirective,w as clearImageCache,q as ImageProcessingError,b as DEFAULT_WIDTHS,d as DEFAULT_QUALITY,c as DEFAULT_FORMATS};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Rf as p}from"./chunk-
|
|
2
|
+
import{Rf as p}from"./chunk-6yphtg3q.js";import{Hg as a,Jg as JF,Kg as ZF,Lg as qF}from"./chunk-a7x7dmtf.js";import{sj as C,tj as D}from"./chunk-gej3rmfy.js";import{Ek as QF,Fk as XF,Gk as YF}from"./chunk-58f0mthg.js";import{$o as o,Bq as FF,Fq as c,Nm as u,as as n,cs as N,fm as l,gq as e,hm as d,uq as t}from"./chunk-mbvkvac6.js";import{gt as r}from"./chunk-jb7h4qgh.js";import{Mu as S,Ou as WF}from"./chunk-5wkwhjjn.js";import G from"fs";import Z from"path";import{createHash as $F}from"crypto";WF();function g(J){return $F("sha256").update(J).digest("hex").slice(0,8)}function f(J=!1){let q=J?D():C(),z=g(q);return{content:q,filename:`runtime.${z}.js`,hash:z}}function m(){let J=S(),q=g(J);return{content:J,filename:`router.${q}.js`,hash:q}}function UF(J){return{runtimeTag:J.runtime?`<script src="/__stx/${J.runtime.filename}"></script>`:"",routerTag:J.router?`<script src="/__stx/${J.router.filename}"></script>`:"",cssTag:J.css?`<link rel="stylesheet" href="/__stx/${J.css.filename}">`:""}}import h from"path";import{createHash as GF}from"crypto";function VF(J={}){let q=new Set;return{context:new Proxy(J,{get(Q,X){if(X in Q)return Q[X];if(typeof X==="string"&&!X.startsWith("__"))q.add(X);return},has(Q,X){if(X in Q)return!0;if(typeof X==="string"&&!X.startsWith("__"))q.add(X);return!1}}),accessedKeys:q}}async function i(J,q,z={}){let Q=h.resolve(J),X=await Bun.file(Q).text(),I=GF("sha256").update(X).digest("hex").slice(0,16);l();let K={};try{K=await N()}catch{}let B=[],V=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,k;while((k=V.exec(X))!==null){let $=k[1];if(/\bserver\b/.test($))B.push(k[2])}let W=new Set(B.flatMap(($)=>p($))),{context:E}=VF({__filename:Q,__dirname:h.dirname(Q),__stx_serverDeclared:W}),L=new Set,_={...n,...K,...z,buildMode:"compile",strict:!1},w=await c(X,E,Q,_,L),U=a(w),H=d();return{route:q,sourceFile:J,html:w,fragment:U,placeholders:H,hasServerScripts:B.length>0,serverScriptContent:B,dependencies:Array.from(L),contentHash:I,status:u(X),streamTemplates:E.__streamTemplates}}var kF=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function s(J,q){let z=0,Q=0;if(!G.existsSync(J))return{copied:z,bytes:Q};G.mkdirSync(q,{recursive:!0});function X(I,K){let B=G.readdirSync(I,{withFileTypes:!0});for(let V of B){if(kF.has(V.name))continue;let k=Z.join(I,V.name),W=Z.join(K,V.name);if(V.isDirectory())G.mkdirSync(W,{recursive:!0}),X(k,W);else if(V.isFile()){if(G.existsSync(W))continue;G.copyFileSync(k,W),z++,Q+=G.statSync(W).size}}}return X(J,q),{copied:z,bytes:Q}}async function lF(J={}){let q=Date.now(),z=Z.resolve(J.root||process.cwd()),Q=Z.resolve(z,J.outputDir||".output");console.log("[stx build] Starting production build...");let X={};try{X=await N()}catch{}let I=J.componentsDir??X.componentsDir??"components",K=J.partialsDir??X.partialsDir??"partials",B=J.layoutsDir??X.layoutsDir??"layouts",V=J.publicDir??X.publicDir??"public",k=X.app?.head||{},W=X.app?.colorMode,E=X.router?.container||"main";if(G.existsSync(Q))G.rmSync(Q,{recursive:!0});let L=[Z.join(Q,"public","__stx"),Z.join(Q,"public","assets"),Z.join(Q,"server","pages"),Z.join(Q,"server","fragments")];for(let Y of L)G.mkdirSync(Y,{recursive:!0});console.log("[stx build] Discovering routes...");let _=o(z),w=["components","layouts","partials"],U=_.filter((Y)=>{return!w.some((F)=>Y.pattern.startsWith(`/${F}/`)||Y.pattern===`/${F}`)});console.log(`[stx build] Found ${U.length} page routes (${_.length-U.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let H=f(J.debug),$=m();await Bun.write(Z.join(Q,"public","__stx",H.filename),H.content),await Bun.write(Z.join(Q,"public","__stx",$.filename),$.content),console.log(`[stx build] Runtime: ${H.filename} (${(H.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${$.filename} (${($.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let O=[],j=[];for(let Y of U)try{let F=await i(Y.filePath,Y.pattern,{componentsDir:I,partialsDir:K,layoutsDir:B,debug:J.debug});if(O.push(F),F.html=F.html.replace(/runtime\.__STX_HASH__\.js/g,H.filename).replace(/router\.__STX_HASH__\.js/g,$.filename),F.html=FF(F.html,k,{bodyScripts:[`<script src="/__stx/${$.filename}"></script>`],...W&&{colorMode:W}}),W)F.html=e(F.html,W);if(k.htmlAttrs)F.html=t(F.html,k.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(F.html)){let T=F.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(T&&T[1]){let P=T[1];F.html=F.html.replace(" "+P,""),F.html=F.html.replace(/<body([^>]*)>/,`<body$1 ${P}>`)}}F.html=F.html.replace(/<style data-crosswind="generated">[\s\S]*?<\/style>\s*/g,""),F.html=await r(F.html),F.fragment=JF(F.html,E);let y=Y.pattern==="/"?"index":Y.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),b=Z.join("server","pages",`${y}.compiled.json`),A=Z.join("server","fragments",`${y}.html`);await Bun.write(Z.join(Q,b),JSON.stringify(F,null,2)),await Bun.write(Z.join(Q,A),F.fragment),j.push({pattern:Y.pattern,compiledPath:b,fragmentPath:A,isDynamic:F.hasServerScripts,hasParams:Y.pattern.includes(":")||Y.pattern.includes("[")}),console.log(`[stx build] \u2713 ${Y.pattern}`)}catch(F){console.error(`[stx build] \u2717 ${Y.pattern}:`,F instanceof Error?F.message:F)}let M=Z.resolve(z,V);if(G.existsSync(M)){let{copied:Y,bytes:F}=s(M,Z.join(Q,"public"));if(Y>0)console.log(`[stx build] Copied ${Y} public asset${Y===1?"":"s"} (${(F/1024).toFixed(1)}KB) from ${V}/`)}let v=YF(z);if(v){let{copied:Y,bytes:F}=s(v,Z.join(Q,"public",XF));if(Y>0)console.log(`[stx build] Copied ${Y} asset${Y===1?"":"s"} (${(F/1024).toFixed(1)}KB) from ${QF}/`)}let R={runtime:H.filename,router:$.filename},zF=ZF(j,R,Q);qF(zF,Q);let x=Date.now()-q;return console.log(`
|
|
3
3
|
[stx build] Done in ${x}ms \u2014 ${O.length} pages compiled`),{pageCount:O.length,assets:R,outputDir:Q,duration:x}}
|
|
4
4
|
export{g as Hf,f as If,m as Jf,UF as Kf,i as Lf,lF as Mf};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ag as t,Bg as e,Dg as b,Mg as JJ}from"./chunk-qqfsm20p.js";import{Bm as v,Sm as u,Tm as l,dp as o,km as y,lm as P,um as x,vp as g}from"./chunk-r7dd7c7y.js";import{Eu as s,Iu as OJ,bu as a}from"./chunk-aw651z2y.js";import{Su as R}from"./chunk-0y6f4037.js";import r from"fs";import B from"path";var{serve:IJ}=globalThis.Bun;function q(J,K,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(K)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let K=J.headers.get("content-type")||"",Q={},X=(Z,$)=>{let G=Q[Z];if(G===void 0)Q[Z]=$;else if(Array.isArray(G))G.push($);else Q[Z]=[G,$]};if(K.includes("multipart/form-data")){let Z=await J.formData();for(let[$,G]of Z.entries())if(typeof G==="string")X($,G);return Q}if(K.includes("application/x-www-form-urlencoded")){for(let[Z,$]of new URLSearchParams(await J.text()).entries())X(Z,$);return Q}return Q}function f(J){if(!J)return!1;let K=J.toUpperCase();return K!=="GET"&&K!=="HEAD"}async function h(J,K={}){let Q=K.request,X=K.method??Q?.method;if(!Q||!f(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let Z={};try{Z=await KJ(Q)}catch{}let $=await J.action({request:Q,form:Z,params:K.params??{},query:J.query??{},cookies:K.cookies??{}});if($&&typeof $==="object"){let G=$,W=QJ(G.cookies),I=G.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:_,redirect:N,...U}=G;if(Object.assign(J,U),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function QJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let K=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){K.push(q(Q,X));continue}if(X&&typeof X==="object"){let Z=X;if(typeof Z.value!=="string")continue;K.push(q(Q,Z.value,Z))}}return K}function m(J,K=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let Z of K)X.append("Set-Cookie",Z);for(let[Z,$]of Object.entries(Q??{}))if(Z.toLowerCase()!=="location")X.set(Z,$);return new Response(null,{status:303,headers:X})}async function wJ(J,K={}){return(await c(J,K)).html}async function d(J,K={}){let{html:Q,context:X,redirect:Z,cookies:$}=await c(J,K),G=u(X),W=l(X);if(Z)return{html:Q,redirect:Z,cookies:$,status:G,headers:W};let{extractStreamBoundaries:I}=await import("./chunk-2pavh1yg.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-7qgnd7z8.js"),{defaultConfig:z}=await import("./chunk-m116b3d9.js"),O=X.streamBoundaries||{},w={...z,autoShell:!1},D=Object.keys(N).map((V)=>({id:V,render:async()=>{let F=typeof O[V]==="function"?await O[V]():void 0;return U(N[V],{...X,$boundary:F},J.sourceFile,w,new Set)}})),E=new Set(D.map((V)=>V.id));_=[...(_||[]).filter((V)=>!E.has(V.id)),...D]}return{html:Q,boundaries:_&&_.length>0?_:void 0,cookies:$,status:G,headers:W}}async function c(J,K){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};if(!J.hasServerScripts&&!P(J.html))return{html:J.html,context:Q};for(let $ of J.serverScriptContent)try{await g($,Q,J.sourceFile)}catch(G){console.warn(`[stx] Server script error in ${J.sourceFile}:`,G)}let X=await h(Q,{request:K.request,method:K.method,params:K.params??{},cookies:K.cookies??{}});if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!P(J.html))return{html:J.html,context:Q,cookies:X.cookies};let Z=new Map;for(let[$,G]of Object.entries(J.placeholders))if(G.expression)try{let W=v(G.expression,Q);if(G.type==="raw")Z.set($,W!==void 0&&W!==null?String(W):"");else Z.set($,W!==void 0&&W!==null?x(String(W)):"")}catch{Z.set($,"")}return{html:y(J.html,Z),context:Q,cookies:X.cookies}}async function AJ(J,K={}){if(!J.hasServerScripts&&!P(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};for(let Z of J.serverScriptContent)try{await g(Z,Q,J.sourceFile)}catch($){console.warn(`[stx] Server script error in ${J.sourceFile}:`,$)}if(!P(J.fragment))return J.fragment;let X=new Map;for(let[Z,$]of Object.entries(J.placeholders))if($.expression)try{let G=v($.expression,Q);if($.type==="raw")X.set(Z,G!==void 0&&G!==null?String(G):"");else X.set(Z,G!==void 0&&G!==null?x(String(G)):"")}catch{X.set(Z,"")}return y(J.fragment,X)}OJ();import C from"zlib";import{promisify as n}from"util";var XJ=n(C.brotliCompress),ZJ=n(C.gzip),$J=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],GJ=["text/event-stream","multipart/x-mixed-replace"],UJ=1024;function WJ(J){if(!J)return!1;let K=J.toLowerCase();if(GJ.some((Q)=>K.startsWith(Q)))return!1;return $J.some((Q)=>K.startsWith(Q))}function jJ(J){let K=new Map;for(let Q of J.split(",")){let[X,...Z]=Q.trim().split(";"),$=X.trim().toLowerCase();if(!$)continue;let G=1;for(let W of Z){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(W);if(!I)continue;let _=Number.parseFloat(I[1]);if(Number.isFinite(_))G=_}K.set($,G)}return K}function YJ(J){if(!J)return null;let K=jJ(J),Q=K.get("*"),X=(Z)=>K.get(Z)??Q??0;if(X("br")>0)return"br";if(X("gzip")>0)return"gzip";return null}async function i(J,K,Q={}){if(K.headers.get("content-encoding"))return K;if(K.status===204||K.status===304||!K.body)return K;if(!WJ(K.headers.get("content-type")))return K;let X=YJ(J.headers.get("accept-encoding"));if(!X)return K;let Z;try{Z=new Uint8Array(await K.arrayBuffer())}catch{return K}let $=()=>new Response(Z,{status:K.status,statusText:K.statusText,headers:p(K.headers)});if(Z.length<(Q.threshold??UJ))return $();try{let G=X==="br"?await XJ(Z,{params:{[C.constants.BROTLI_PARAM_QUALITY]:Q.quality??5,[C.constants.BROTLI_PARAM_SIZE_HINT]:Z.length}}):await ZJ(Z);if(G.length>=Z.length)return $();let W=p(K.headers);return W.set("Content-Encoding",X),W.set("Content-Length",String(G.length)),new Response(G,{status:K.status,statusText:K.statusText,headers:W})}catch{return $()}}function p(J){let K=new Headers(J),Q=K.get("Vary");if(!Q)return K.set("Vary","Accept-Encoding"),K;if(!Q.split(",").some((Z)=>Z.trim().toLowerCase()==="accept-encoding"))K.set("Vary",`${Q}, Accept-Encoding`);return K}var _J={".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 mJ(J={}){let K=B.resolve(J.outputDir||".output"),Q=J.port||3000,X=JJ(K);if(!X)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${X.routes.length} routes...`);let Z=new Map,$=new Map,G=new Map,W=new Map;for(let U of X.routes)try{let z=B.join(K,U.compiledPath),O=JSON.parse(await Bun.file(z).text());Z.set(U.pattern,O),G.set(U.pattern,s(O.html)),W.set(U.pattern,o(O.html));let w=B.join(K,U.fragmentPath);if(await Bun.file(w).exists())$.set(U.pattern,await Bun.file(w).text())}catch(z){console.warn(`[stx] Failed to load route ${U.pattern}:`,z)}let I=new Map,_=[];for(let U of X.routes)if(U.hasParams){let{regex:z,params:O}=a(U.pattern);_.push({regex:z,route:U,paramNames:O})}else I.set(U.pattern,U);let N=IJ({port:Q,async fetch(U){return i(U,await(async()=>{let O=new URL(U.url).pathname;if(J.onRequest){let j=await J.onRequest(U);if(j)return j}if(J.apiRoutes?.[O])return J.apiRoutes[O](U);if((U.method==="GET"||U.method==="HEAD")&&O!=="/"){let j=B.resolve(K,"public"),Y;try{Y=decodeURIComponent(O)}catch{Y=O}if(!Y.includes("\x00")){let L=B.resolve(j,`.${Y}`);if(L===j||L.startsWith(`${j}${B.sep}`))try{if(r.existsSync(L)&&r.statSync(L).isFile()){let M=B.extname(L).toLowerCase(),S=_J[M]||"application/octet-stream",H=O.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(O);return new Response(Bun.file(L),{headers:{"Content-Type":S,"Cache-Control":H?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let w=e(U),D=null,E={};if(D=I.get(O)||null,!D)for(let{regex:j,route:Y,paramNames:L}of _){let A=O.match(j);if(A){D=Y,L.forEach((M,S)=>{E[M]=A[S+1]});break}}if(!D){let j=I.get("/404")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(w){let j=$.get(D.pattern);if(j){let Y=G.get(D.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...W.has(D.pattern)?{"X-STX-Runtime":W.get(D.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},...b(),"Cache-Control":t}})}}let V=f(U.method),F=Z.get(D.pattern);if(!F){let j=I.get("/500")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!V&&!F.hasServerScripts&&Object.keys(F.placeholders).length===0)return new Response(F.html,{status:F.status??200,headers:{"Content-Type":"text/html",...b(),"Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:Y,redirect:L,cookies:A,status:M,headers:S}=await d(F,{params:E,request:U,method:U.method});if(L)return m(L,A,S);if(Y&&Y.length>0){let{renderStreamingPage:T,streamToResponse:k}=await import("./chunk-2pavh1yg.js");return k(T(j,Y,{timeoutMs:30000}),{status:M??F.status??200,headers:{"Cache-Control":"no-cache",...S}})}let H=new Headers({"Content-Type":"text/html",...b(),"Cache-Control":"no-cache"});for(let T of A??[])H.append("Set-Cookie",T);for(let[T,k]of Object.entries(S??{}))H.set(T,k);return new Response(j,{status:M??F.status??200,headers:H})}catch(j){return console.error(`[stx] Hydration error for ${O}:`,j),new Response(F.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${Q}`),console.log(`[stx] Serving ${X.routes.length} routes (${Z.size} pre-loaded)`),{port:Q,stop:()=>N.stop()}}
|
|
2
|
+
import{Ag as t,Bg as e,Dg as b,Mg as JJ}from"./chunk-a7x7dmtf.js";import{Am as v,Qm as u,Rm as l,bp as o,jm as y,km as P,tm as x,tp as g}from"./chunk-mbvkvac6.js";import{Ku as s,Ou as OJ,hu as a}from"./chunk-5wkwhjjn.js";import{Yu as R}from"./chunk-f8wjdg40.js";import r from"fs";import B from"path";var{serve:IJ}=globalThis.Bun;function q(J,K,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(K)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let K=J.headers.get("content-type")||"",Q={},X=(Z,$)=>{let G=Q[Z];if(G===void 0)Q[Z]=$;else if(Array.isArray(G))G.push($);else Q[Z]=[G,$]};if(K.includes("multipart/form-data")){let Z=await J.formData();for(let[$,G]of Z.entries())if(typeof G==="string")X($,G);return Q}if(K.includes("application/x-www-form-urlencoded")){for(let[Z,$]of new URLSearchParams(await J.text()).entries())X(Z,$);return Q}return Q}function f(J){if(!J)return!1;let K=J.toUpperCase();return K!=="GET"&&K!=="HEAD"}async function h(J,K={}){let Q=K.request,X=K.method??Q?.method;if(!Q||!f(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let Z={};try{Z=await KJ(Q)}catch{}let $=await J.action({request:Q,form:Z,params:K.params??{},query:J.query??{},cookies:K.cookies??{}});if($&&typeof $==="object"){let G=$,W=QJ(G.cookies),I=G.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:_,redirect:N,...U}=G;if(Object.assign(J,U),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function QJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let K=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){K.push(q(Q,X));continue}if(X&&typeof X==="object"){let Z=X;if(typeof Z.value!=="string")continue;K.push(q(Q,Z.value,Z))}}return K}function m(J,K=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let Z of K)X.append("Set-Cookie",Z);for(let[Z,$]of Object.entries(Q??{}))if(Z.toLowerCase()!=="location")X.set(Z,$);return new Response(null,{status:303,headers:X})}async function wJ(J,K={}){return(await c(J,K)).html}async function d(J,K={}){let{html:Q,context:X,redirect:Z,cookies:$}=await c(J,K),G=u(X),W=l(X);if(Z)return{html:Q,redirect:Z,cookies:$,status:G,headers:W};let{extractStreamBoundaries:I}=await import("./chunk-78bm61kd.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-g4z7gah7.js"),{defaultConfig:z}=await import("./chunk-k5c19t7e.js"),O=X.streamBoundaries||{},w={...z,autoShell:!1},D=Object.keys(N).map((V)=>({id:V,render:async()=>{let F=typeof O[V]==="function"?await O[V]():void 0;return U(N[V],{...X,$boundary:F},J.sourceFile,w,new Set)}})),E=new Set(D.map((V)=>V.id));_=[...(_||[]).filter((V)=>!E.has(V.id)),...D]}return{html:Q,boundaries:_&&_.length>0?_:void 0,cookies:$,status:G,headers:W}}async function c(J,K){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};if(!J.hasServerScripts&&!P(J.html))return{html:J.html,context:Q};for(let $ of J.serverScriptContent)try{await g($,Q,J.sourceFile)}catch(G){console.warn(`[stx] Server script error in ${J.sourceFile}:`,G)}let X=await h(Q,{request:K.request,method:K.method,params:K.params??{},cookies:K.cookies??{}});if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!P(J.html))return{html:J.html,context:Q,cookies:X.cookies};let Z=new Map;for(let[$,G]of Object.entries(J.placeholders))if(G.expression)try{let W=v(G.expression,Q);if(G.type==="raw")Z.set($,W!==void 0&&W!==null?String(W):"");else Z.set($,W!==void 0&&W!==null?x(String(W)):"")}catch{Z.set($,"")}return{html:y(J.html,Z),context:Q,cookies:X.cookies}}async function AJ(J,K={}){if(!J.hasServerScripts&&!P(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};for(let Z of J.serverScriptContent)try{await g(Z,Q,J.sourceFile)}catch($){console.warn(`[stx] Server script error in ${J.sourceFile}:`,$)}if(!P(J.fragment))return J.fragment;let X=new Map;for(let[Z,$]of Object.entries(J.placeholders))if($.expression)try{let G=v($.expression,Q);if($.type==="raw")X.set(Z,G!==void 0&&G!==null?String(G):"");else X.set(Z,G!==void 0&&G!==null?x(String(G)):"")}catch{X.set(Z,"")}return y(J.fragment,X)}OJ();import C from"zlib";import{promisify as n}from"util";var XJ=n(C.brotliCompress),ZJ=n(C.gzip),$J=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],GJ=["text/event-stream","multipart/x-mixed-replace"],UJ=1024;function WJ(J){if(!J)return!1;let K=J.toLowerCase();if(GJ.some((Q)=>K.startsWith(Q)))return!1;return $J.some((Q)=>K.startsWith(Q))}function jJ(J){let K=new Map;for(let Q of J.split(",")){let[X,...Z]=Q.trim().split(";"),$=X.trim().toLowerCase();if(!$)continue;let G=1;for(let W of Z){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(W);if(!I)continue;let _=Number.parseFloat(I[1]);if(Number.isFinite(_))G=_}K.set($,G)}return K}function YJ(J){if(!J)return null;let K=jJ(J),Q=K.get("*"),X=(Z)=>K.get(Z)??Q??0;if(X("br")>0)return"br";if(X("gzip")>0)return"gzip";return null}async function i(J,K,Q={}){if(K.headers.get("content-encoding"))return K;if(K.status===204||K.status===304||!K.body)return K;if(!WJ(K.headers.get("content-type")))return K;let X=YJ(J.headers.get("accept-encoding"));if(!X)return K;let Z;try{Z=new Uint8Array(await K.arrayBuffer())}catch{return K}let $=()=>new Response(Z,{status:K.status,statusText:K.statusText,headers:p(K.headers)});if(Z.length<(Q.threshold??UJ))return $();try{let G=X==="br"?await XJ(Z,{params:{[C.constants.BROTLI_PARAM_QUALITY]:Q.quality??5,[C.constants.BROTLI_PARAM_SIZE_HINT]:Z.length}}):await ZJ(Z);if(G.length>=Z.length)return $();let W=p(K.headers);return W.set("Content-Encoding",X),W.set("Content-Length",String(G.length)),new Response(G,{status:K.status,statusText:K.statusText,headers:W})}catch{return $()}}function p(J){let K=new Headers(J),Q=K.get("Vary");if(!Q)return K.set("Vary","Accept-Encoding"),K;if(!Q.split(",").some((Z)=>Z.trim().toLowerCase()==="accept-encoding"))K.set("Vary",`${Q}, Accept-Encoding`);return K}var _J={".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 mJ(J={}){let K=B.resolve(J.outputDir||".output"),Q=J.port||3000,X=JJ(K);if(!X)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${X.routes.length} routes...`);let Z=new Map,$=new Map,G=new Map,W=new Map;for(let U of X.routes)try{let z=B.join(K,U.compiledPath),O=JSON.parse(await Bun.file(z).text());Z.set(U.pattern,O),G.set(U.pattern,s(O.html)),W.set(U.pattern,o(O.html));let w=B.join(K,U.fragmentPath);if(await Bun.file(w).exists())$.set(U.pattern,await Bun.file(w).text())}catch(z){console.warn(`[stx] Failed to load route ${U.pattern}:`,z)}let I=new Map,_=[];for(let U of X.routes)if(U.hasParams){let{regex:z,params:O}=a(U.pattern);_.push({regex:z,route:U,paramNames:O})}else I.set(U.pattern,U);let N=IJ({port:Q,async fetch(U){return i(U,await(async()=>{let O=new URL(U.url).pathname;if(J.onRequest){let j=await J.onRequest(U);if(j)return j}if(J.apiRoutes?.[O])return J.apiRoutes[O](U);if((U.method==="GET"||U.method==="HEAD")&&O!=="/"){let j=B.resolve(K,"public"),Y;try{Y=decodeURIComponent(O)}catch{Y=O}if(!Y.includes("\x00")){let L=B.resolve(j,`.${Y}`);if(L===j||L.startsWith(`${j}${B.sep}`))try{if(r.existsSync(L)&&r.statSync(L).isFile()){let M=B.extname(L).toLowerCase(),S=_J[M]||"application/octet-stream",H=O.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(O);return new Response(Bun.file(L),{headers:{"Content-Type":S,"Cache-Control":H?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let w=e(U),D=null,E={};if(D=I.get(O)||null,!D)for(let{regex:j,route:Y,paramNames:L}of _){let A=O.match(j);if(A){D=Y,L.forEach((M,S)=>{E[M]=A[S+1]});break}}if(!D){let j=I.get("/404")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(w){let j=$.get(D.pattern);if(j){let Y=G.get(D.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...W.has(D.pattern)?{"X-STX-Runtime":W.get(D.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},...b(),"Cache-Control":t}})}}let V=f(U.method),F=Z.get(D.pattern);if(!F){let j=I.get("/500")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!V&&!F.hasServerScripts&&Object.keys(F.placeholders).length===0)return new Response(F.html,{status:F.status??200,headers:{"Content-Type":"text/html",...b(),"Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:Y,redirect:L,cookies:A,status:M,headers:S}=await d(F,{params:E,request:U,method:U.method});if(L)return m(L,A,S);if(Y&&Y.length>0){let{renderStreamingPage:T,streamToResponse:k}=await import("./chunk-78bm61kd.js");return k(T(j,Y,{timeoutMs:30000}),{status:M??F.status??200,headers:{"Cache-Control":"no-cache",...S}})}let H=new Headers({"Content-Type":"text/html",...b(),"Cache-Control":"no-cache"});for(let T of A??[])H.append("Set-Cookie",T);for(let[T,k]of Object.entries(S??{}))H.set(T,k);return new Response(j,{status:M??F.status??200,headers:H})}catch(j){return console.error(`[stx] Hydration error for ${O}:`,j),new Response(F.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${Q}`),console.log(`[stx] Serving ${X.routes.length} routes (${Z.size} pre-loaded)`),{port:Q,stop:()=>N.stop()}}
|
|
3
3
|
export{WJ as lg,YJ as mg,i as ng,q as og,KJ as pg,f as qg,h as rg,m as sg,wJ as tg,d as ug,AJ as vg,mJ as wg};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Fq as X,ym as W}from"./chunk-mbvkvac6.js";import V from"fs";import M from"path";import*as Y from"readline";var j={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},Q={help:{description:"Show available commands",usage:"help [command]",handler:async(q,z)=>{if(q[0]&&Q[q[0]]){let A=Q[q[0]];console.log(`
|
|
3
3
|
${j.bold}${q[0]}${j.reset} - ${A.description}`),console.log(` Usage: ${j.cyan}${A.usage}${j.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${j.bold}Available Commands:${j.reset}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{kg as a}from"./chunk-6g4mnrr0.js";import"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{a as buildApp};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ps as Q}from"./chunk-0athjw48.js";import"./chunk-f3m0q482.js";import{st as R}from"./chunk-bby4emay.js";import"./chunk-f8wjdg40.js";import O from"fs";import U from"path";async function W(j,b={}){let q=Date.now(),z={total:0,passed:0,failed:0,new:0,failures:[],duration:0},K=b.snapshotDir||R(j.root,"story","snapshots");await O.promises.mkdir(K,{recursive:!0});let B=j.storyFiles;if(b.filter&&b.filter.length>0)B=B.filter((J)=>b.filter.some((G)=>J.fileName.toLowerCase().includes(G.toLowerCase())));for(let J of B)await X(J,K,b,z);return z.duration=Date.now()-q,z}async function X(j,b,q,z){let K=j.story;if(!K)return;for(let B of K.variants){z.total++;let J=U.join(b,`${j.id}-${B.id}.snap`),G=Y(B.source||""),L=await _(J);if(q.update||!L){let M={storyId:j.id,variantId:B.id,component:j.fileName,timestamp:Date.now(),hash:G};if(await O.promises.writeFile(J,JSON.stringify(M,null,2)),!L)z.new++;z.passed++}else try{let M=await O.promises.readFile(J,"utf-8"),N=JSON.parse(M);if(N.hash===G)z.passed++;else z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:"Snapshot mismatch",difference:Z(N.hash,G)})}catch(M){z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:`Error reading snapshot: ${M}`})}}}async function A(j,b={}){return(await W(j,{...b,update:!0})).total}function Y(j){let b=0;for(let q=0;q<j.length;q++){let z=j.charCodeAt(q);b=(b<<5)-b+z,b=b&b}return b.toString(16)}function Z(j,b){if(j===b)return 0;let q=Math.abs(Number.parseInt(j,16)-Number.parseInt(b,16));return Math.min(q/1e6,1)}async function _(j){try{return await O.promises.access(j),!0}catch{return!1}}function I(j){let b=[];if(b.push(""),b.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"),b.push(" STX Story Visual Regression Tests"),b.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"),b.push(""),j.failures.length>0){b.push(" \u274C Failures:"),b.push("");for(let q of j.failures){if(b.push(` \u2022 ${q.component} / ${q.variantId}`),b.push(` ${q.message}`),q.difference!==void 0)b.push(` Difference: ${(q.difference*100).toFixed(2)}%`);b.push("")}}if(b.push(" Summary:"),b.push(` Total: ${j.total}`),b.push(` Passed: ${j.passed} \u2713`),b.push(` Failed: ${j.failed} \u2717`),j.new>0)b.push(` New: ${j.new} \u26A1`);return b.push(` Time: ${j.duration}ms`),b.push(""),b.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"),b.push(""),b.join(`
|
|
3
3
|
`)}async function S(j,b={}){let q=performance.now(),z=[],K=0,B=0;for(let G of j.storyFiles)try{let L=await Bun.file(G.path).text(),M=await Q(L,G.path);if(M.length>0){for(let N of M)z.push({storyId:G.id,variantId:"default",component:G.component,message:`A11y: ${N.message}`,expected:"No accessibility violations",actual:`${N.type}: ${N.message} (impact: ${N.impact})`});B++}else K++}catch(L){z.push({storyId:G.id,variantId:"default",component:G.component,message:`Failed to check a11y: ${L instanceof Error?L.message:String(L)}`,expected:"File readable for a11y check",actual:"File read error"}),B++}let J=performance.now()-q;return{total:j.storyFiles.length,passed:K,failed:B,new:0,failures:z,duration:J}}export{A as updateSnapshots,W as runVisualTests,S as runA11yTests,I as formatTestResults};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{dp as a,ep as b,fp as c,gp as d,hp as e,ip as f,jp as g,kp as h,lp as i,mp as j,np as k,op as l}from"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{l as stripStxRuntimeImports,a as scanScriptTags,k as rewriteStxImportSpecifiers,i as processSignals,g as processScriptSetup,e as preEvalLiteralReactiveIfs,b as parseLoopExpression,c as hasSignalsSyntax,j as findMarkupIndexOutsideScripts,h as extractExports,f as convertSignalLoopsToAttributes,d as convertSignalDirectivesToAttributes};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$l as l,Ql as c,Tl as d,Ul as e,Vl as f,Wl as g,Xl as h,Yl as i,Zl as j,_l as k,am as m}from"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import{Js as a,Ks as b}from"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{h as transformAutoImports,b as stripCommentsAndLiterals,e as renderVendorStyleTags,m as processClientScript,g as injectBrowserCoreAutoImports,l as generateServerDataBridge,j as generateBrowserAutoImportDestructuring,i as generateAutoImportDestructuring,a as findInterpolationEnd,k as extractBridgeData,d as extractAndStripCssImports,f as STX_AUTO_IMPORTS,c as BROWSER_CORE_IMPORTS};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mk as a,nk as b,ok as c,pk as d}from"./chunk-fvh9ca47.js";import"./chunk-
|
|
2
|
+
import{mk as a,nk as b,ok as c,pk as d}from"./chunk-fvh9ca47.js";import"./chunk-f8wjdg40.js";export{d as default,c as createHotReloadServer,b as compileToNative,a as NATIVE_COMPONENTS};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-f8wjdg40.js";var Y=null,S=[],F=new WeakMap;function I(z){let K=z,B=new Set,G={get value(){if(Y){let H=F.get(G);if(!H)H=new Set,F.set(G,H);H.add(Y)}return K},set value(H){if(!Object.is(K,H)){K=H,B.forEach((J)=>J(H));let L=F.get(G);if(L)L.forEach((J)=>J())}},subscribe(H){return B.add(H),()=>B.delete(H)},peek(){return K}};return G}function W(z){return z!==null&&typeof z==="object"&&"value"in z&&"subscribe"in z&&"peek"in z}function P(z){return W(z)?z.value:z}function j(z){let K={};for(let B in z)if(Object.prototype.hasOwnProperty.call(z,B))K[B]=I(z[B]);return K}function D(z){return I(z)}function U(z){let K=typeof z==="function",B=K?z:z.get,G=K?void 0:z.set,H=K?Object.is:z.equals||Object.is,L,J=!0,Q=new Set,X=new Set,_=()=>{if(J=!0,X.size>0){let N=T.value;X.forEach(($)=>$(N))}};function Z(){Q.clear();let N=Y;Y=_,S.push(_);try{return B()}finally{S.pop(),Y=N}}let T={get value(){if(Y){let N=F.get(T);if(!N)N=new Set,F.set(T,N);N.add(Y)}if(J){let N=Z();if(!H(L,N))L=N;J=!1}return L},set value(N){if(G)G(N);else console.warn("Computed property is readonly")},subscribe(N){return X.add(N),()=>X.delete(N)},peek(){if(J)L=B(),J=!1;return L},invalidate(){J=!0},get dirty(){return J},get deps(){return Q}};return T}function x(z,K,B={}){let{immediate:G=!1,deep:H=!1,flush:L="pre",once:J=!1}=B,Q,X=!0,_=!1,Z=()=>{if(W(z))return H?q(z.value):z.value;return z()},T=()=>{if(!X||_)return;let M=Z();if(Q!==void 0&&Object.is(Q,M)&&!H)return;let A=()=>{if(K(M,Q),Q=H?q(M):M,J)$()};if(L==="sync")A();else if(L==="post")queueMicrotask(A);else Promise.resolve().then(A)},N=null;if(W(z))N=z.subscribe(()=>T());else N=U(z).subscribe(()=>T());if(G)Q=void 0,T();else Q=Z();let $=()=>{if(X=!1,N)N(),N=null};return $.pause=()=>{_=!0},$.resume=()=>{_=!1},$}function E(z,K,B={}){let{immediate:G=!1,once:H=!1}=B,L=z.map((T)=>W(T)?T.value:void 0),J=!0,Q=!1,X=()=>{if(!J||Q)return;let T=z.map((N)=>W(N)?N.value:void 0);if(K(T,L),L=[...T],H)Z()},_=z.map((T)=>{if(W(T))return T.subscribe(()=>X());return()=>{}});if(G)X();let Z=()=>{J=!1,_.forEach((T)=>T())};return Z.pause=()=>{Q=!0},Z.resume=()=>{Q=!1},Z}function y(z,K={}){let{flush:B="pre"}=K,G,H=!0,L=!1,J=()=>{if(!H||L)return;if(G)G();let X=Y;Y=J,S.push(J);try{G=z()}finally{S.pop(),Y=X}};if(B==="sync")J();else if(B==="post")queueMicrotask(J);else Promise.resolve().then(J);let Q=()=>{if(H=!1,G)G()};return Q.pause=()=>{L=!0},Q.resume=()=>{L=!1},Q}function C(z,K={},B){let G=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return z.replace(G,(H,L,J)=>{try{let X=Function(...Object.keys(K),`return ${J}`)(...Object.values(K));return K[L]=X,`<!-- computed: ${L} = ${X} -->`}catch(Q){return`<!-- computed error: ${L} - ${Q} -->`}})}function R(z,K={},B){let G=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return z.replace(G,(H,L,J)=>{return`
|
|
3
3
|
<script data-watch="${`watch-${Math.random().toString(36).substring(2,9)}`}">
|
|
4
4
|
(function() {
|
|
5
5
|
// Watch implementation for ${L}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ht as a,it as b,jt as c,kt as d,lt as e,mt as f,nt as g}from"./chunk-jnbhyzkv.js";import"./chunk-f8wjdg40.js";export{g as warmImagePlaceholders,f as svgDataUrl,d as setImagePlaceholder,b as placeholdersWarmed,e as meshSvg,a as getImagePlaceholder,c as clearImagePlaceholders};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{tk as m}from"./chunk-
|
|
2
|
+
import{tk as m}from"./chunk-2qsa4h1t.js";import{Yu as z}from"./chunk-f8wjdg40.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,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-f8wjdg40.js";var N=0;function P(){return`eb-${++N}-${Date.now().toString(36)}`}function W(q,z={},A){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(D,F,J,K)=>{let L=P(),M=Q(F||"");return T(L,J.trim(),K.trim(),M)})}function Q(q){let z={},A=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=A.exec(q))!==null){let D=j[1],F=j[2]||j[3]||j[4];switch(D){case"id":z.id=F;break;case"logErrors":z.logErrors=F==="true";break}}return z}function T(q,z,A,j){let D=j.logErrors!==!1;return`
|
|
3
3
|
<div class="stx-error-boundary" data-boundary-id="${q}" data-has-error="false">
|
|
4
4
|
<div class="stx-error-boundary-content" data-boundary-content="${q}">
|
|
5
5
|
${z}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Au as z,Bu as A,Cu as B,Du as C,Eu as D,Fu as E,Gu as F,Hu as G,Iu as H,Ju as I,Ku as J,Mu as K,Ou as L,bu as a,cu as b,du as c,eu as d,fu as e,gu as f,hu as g,iu as h,ju as i,ku as j,lu as k,mu as l,nu as m,ou as n,pu as o,qu as p,ru as q,su as r,tu as s,uu as t,vu as u,wu as v,xu as w,yu as x,zu as y}from"./chunk-5wkwhjjn.js";import"./chunk-f8wjdg40.js";L();export{o as setAppUrl,H as runMiddleware,r as route,j as resolveLayoutChain,s as resetRoutes,z as registerMiddleware,g as patternToRegex,t as navigateTo,h as matchRoute,E as loadMiddlewareFromDirectory,c as isNonPageRoutePattern,b as isNonPageRoutePath,B as hasMiddleware,K as getRouterScript,D as getMiddlewareNames,A as getMiddleware,d as generateRouteTypes,e as generateRouteManifest,n as formatRoutes,m as findErrorPage,f as filePathToPattern,J as extractLayoutMetadata,I as deriveLayoutGroup,q as defineRoutes,p as defineRoute,v as defineMiddleware,y as createStorageManager,w as createServerCookieManager,l as createRouter,F as createRouteLocation,G as createMiddlewareContext,x as createClientCookieManager,C as clearMiddleware,i as bracketPathToRegex,u as abortNavigation,k as Router,a as NON_PAGE_DIRS};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Oj as a,Pj as b,Qj as c,Rj as d,Sj as e,Tj as f,Uj as g,Vj as h,Wj as i,Xj as j,Yj as k}from"./chunk-yxp7wv61.js";import"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{a as templateCache,b as readFileCached,d as invalidateFileCacheByDir,c as invalidateFileCache,k as hashFilePath,f as getCachedSignalsRuntime,g as getCachedRouterScript,h as clearDevCaches,i as checkCache,j as cacheTemplate,e as __setSignalsGeneratorsForTest};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import V from"fs";import Y from"path";var G=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^<>()]*>)?\s*\(/,U=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,B=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],X=3;function w(z,J){let Q=Y.resolve(Y.dirname(J),z);for(let Z of B){let $=Q+Z;try{if(V.statSync($).isFile())return $}catch{}}return null}function K(z,J,Q=0,Z=new Set){if(!J||Q>=X)return!1;for(let $ of z.matchAll(U)){let j=w($[1],J);if(!j||Z.has(j))continue;Z.add(j);let q;try{q=V.readFileSync(j,"utf8")}catch{continue}if(G.test(q))return!0;if(K(q,j,Q+1,Z))return!0}return!1}var W=["batch","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refresh","registerStoresClient","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebouncedValue","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","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"],R=["onMount","onDestroy"];function A(z="const",J=[],Q){let Z=J.length?W.filter(($)=>!J.includes($)):W;if(Q!==void 0)Z=Z.filter(($)=>{let j=$.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${j}(?![\\w$])`).test(Q)});return`${z} { ${Z.join(", ")} } = window.stx;`}var H=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"],L={redirect:{category:"server-only",reason:"returns an HTTP Response for <script server>/edge/build; use navigate() on the client."},useAsyncData:{category:"browser-composable",reason:"inlined on demand from src/composables when a script references it; reachable, not a bare global."},Teleport:{category:"compile-time-directive",reason:"template tag resolved by processTeleportDirectives; not a script callable."},StxModalBuiltin:{category:"builtin-component",reason:"builtin component used as a template tag; drive open/close from the modal store."},StxToastBuiltin:{category:"builtin-component",reason:"builtin component used as a template tag; push toasts via the toast store."},useForm:{category:"browser-composable",reason:"reactive form primitive; lives in src/composables/use-form.ts and is inlined on demand when a <script client> references it (#1846)."},defineForm:{category:"browser-composable",reason:"deprecated alias of useForm, kept for a minor (#1843). Same delivery path \u2014 inlined on demand from src/composables/use-form.ts."},validateFields:{category:"isomorphic-import",reason:"pure validation helper; import it directly, not auto-delivered to <script client> (per client-api-delivery.test.ts)."},validateField:{category:"isomorphic-import",reason:"singular pure validation helper; same explicit-import boundary as validateFields."}},D=W.filter((z)=>!H.includes(z));function y(z){if(!z)return!1;return D.some((J)=>new RegExp(`\\b${J}\\s*(?:<[^>]*>)?\\s*\\(`).test(z))}var M=[/@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/],O=/\s@[a-z][\w.:-]*\s*=/i;function k(z,J){if(!z)return!1;let Q=C(z);if(M.some((Z)=>Z.test(Q)))return!0;if(y(Q))return!0;return P(Q,J)}function P(z,J){if(!J)return!1;for(let Q of z.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(K(Q[1],J))return!0;return!1}function g(z,J){if(!z)return!1;return O.test(C(z))||k(z,J)}var N=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function f(z){return N.includes(z.toLowerCase())}var F=["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"],b=["x-init","x-transition","x-effect","x-on"],_=[...F,...b];function E(){return`{${F.map((z)=>`'${z}':1`).join(",")}}`}function C(z){if(!z)return z;let J=(Q)=>Q.replace(/(<[^>]*>)|([^<]+)/g,(Z,$,j)=>$??" ".repeat(j.length));return z.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(Q,Z,$,j)=>Z+J($)+j).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(Q,Z,$,j)=>Z+J($)+j).replace(/<!--[\s\S]*?-->/g,(Q)=>" ".repeat(Q.length))}
|
|
3
|
-
export{K as
|
|
3
|
+
export{K as Mt,W as Nt,R as Ot,A as Pt,H as Qt,L as Rt,D as St,y as Tt,k as Ut,g as Vt,N as Wt,f as Xt,F as Yt,b as Zt,_ as _t,E as $t,C as au};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ii as a,ji as b,ki as c,li as d,mi as e}from"./chunk-y7m2dpd3.js";import"./chunk-
|
|
2
|
+
import{ii as a,ji as b,ki as c,li as d,mi as e}from"./chunk-y7m2dpd3.js";import"./chunk-f8wjdg40.js";export{c as renderSSRSuspense,a as processSuspenseDirectives,e as generateSuspenseRuntime,d as generateSuspenseCSS,b as createSSRSuspense};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as N,c as R,e as W,g as j,i as H,k as J}from"./chunk-0y46fbkx.js";import{l as k,m as w,n as B}from"./chunk-q9n5swx7.js";import"./chunk-
|
|
2
|
+
import{a as N,c as R,e as W,g as j,i as H,k as J}from"./chunk-0y46fbkx.js";import{l as k,m as w,n as B}from"./chunk-q9n5swx7.js";import"./chunk-f8wjdg40.js";import E from"fs";import K from"path";var V=[];function _(U){V=[];for(let A of U.storyFiles)if(V.push({text:A.fileName.toLowerCase(),original:A.fileName,type:"story",storyId:A.id}),V.push({text:A.relativePath.toLowerCase(),original:A.relativePath,type:"story",storyId:A.id}),A.story)for(let z of A.story.variants)V.push({text:z.title.toLowerCase(),original:z.title,type:"story",storyId:A.id,variantId:z.id})}function $(){return JSON.stringify(V)}async function O(U={}){let A=Date.now();N();let z=await k({mode:"build"});if(!z.config.enabled){W("Story feature is disabled in config.");return}let P=await H(z);w(z,P);let Y=J(z.config,P);B(z,Y),R(P.length);let X=U.outDir??z.config.outDir,Q=K.resolve(z.root,X);await E.promises.mkdir(Q,{recursive:!0}),console.log(` Building to ${X}...`);let M=F(z);await E.promises.writeFile(K.join(Q,"index.html"),M);let v={files:P.map((G)=>({id:G.id,fileName:G.fileName,relativePath:G.relativePath,treePath:G.treePath})),tree:Y};await E.promises.writeFile(K.join(Q,"stories.json"),JSON.stringify(v,null,2));let L={theme:z.config.theme,responsivePresets:z.config.responsivePresets,backgroundPresets:z.config.backgroundPresets};await E.promises.writeFile(K.join(Q,"config.json"),JSON.stringify(L,null,2));let Z=K.join(Q,"stories");await E.promises.mkdir(Z,{recursive:!0});for(let G of P){let g=await E.promises.readFile(G.path,"utf-8");await E.promises.writeFile(K.join(Z,`${G.id}.stx`),g)}_(z);let T=$();await E.promises.writeFile(K.join(Q,"search-index.json"),T);let C=Date.now()-A;j(P.length,X,C)}function F(U){let{theme:A}=U.config,z=A.title||"STX Story";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Af as e,Bf as f,Cf as g,Df as h,yf as c,zf as d}from"./chunk-k4m48h62.js";import{Nf as a,Qf as b}from"./chunk-6yphtg3q.js";import"./chunk-6g7m08rv.js";import"./chunk-9n0gvfrg.js";import"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{d as virtualPathFor,g as typecheckStxFiles,e as sourcePathFor,h as formatTypecheckDiagnostics,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{wg as a}from"./chunk-nswz1rkm.js";import"./chunk-a7x7dmtf.js";import"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{a as startProductionServer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ah as f,Bh as g,Ch as h,vh as a,wh as b,xh as c,yh as d,zh as e}from"./chunk-49kk0s96.js";import"./chunk-w95sp0k9.js";import"./chunk-
|
|
2
|
+
import{Ah as f,Bh as g,Ch as h,vh as a,wh as b,xh as c,yh as d,zh as e}from"./chunk-49kk0s96.js";import"./chunk-w95sp0k9.js";import"./chunk-f8wjdg40.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,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Vu as W,Wu as k,Xu as G}from"./chunk-f8wjdg40.js";import A from"fs";import B from"path";function h(j){let q=0;for(let K=0;K<j.length;K++){let Q=j[K];q=(q<<5)-q+Q,q=q&q}return Math.abs(q).toString(16).padStart(8,"0")}function u(j,q){let K=B.basename(j);for(let Q of q)if(Q.startsWith("*.")){let Y=Q.slice(1);if(K.endsWith(Y))return!0}else if(Q.includes("*")){let Y=new RegExp(`^${Q.replace(/\*/g,".*")}$`);if(Y.test(K)||Y.test(j))return!0}else if(K===Q||j.includes(Q))return!0;return!1}function f(j,q,K){let Q=B.extname(j).toLowerCase(),Y=l[Q],X=(K.maxFileSizeKB||500)*1024;if(q>X)return!1;if(K.exclude&&u(j,K.exclude))return!1;if(K.include&&K.include.length>0){for(let Z of K.include)if(Z.startsWith("*.")){if(j.endsWith(Z.slice(1)))return!0}else if(j.includes(Z))return!0}if(Y&&K[Y]===!0)return!0;if(!Y)return!1;return!1}function T(j,q,K,Q){let Y=A.readdirSync(j,{withFileTypes:!0});for(let X of Y){let Z=B.join(j,X.name);if(X.isDirectory()){if(["node_modules",".git",".stx"].includes(X.name))continue;T(Z,q,K,Q)}else if(X.isFile()){let O=A.statSync(Z),_=B.relative(q,Z);if(f(_,O.size,K)){let $=A.readFileSync(Z),L=h($),V=`/${_.replace(/\\/g,"/")}`;Q.push({url:V,revision:L,size:O.size})}}}}function U(j,q){let K=q.pwa?.precache,Q=[];if(!K?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!A.existsSync(j))return{entries:[],totalSize:0,fileCount:0};T(j,j,K,Q),Q.sort((X,Z)=>X.url.localeCompare(Z.url));let Y=Q.reduce((X,Z)=>X+Z.size,0);return{entries:Q,totalSize:Y,fileCount:Q.length}}function J(j){if(j.entries.length===0)return"[]";return`[
|
|
3
3
|
${j.entries.map((K)=>` { url: '${K.url}', revision: '${K.revision}' }`).join(`,
|
|
4
4
|
`)}
|
|
5
5
|
]`}function E(j){if(j<1024)return`${j} B`;if(j<1048576)return`${(j/1024).toFixed(1)} KB`;return`${(j/1048576).toFixed(2)} MB`}var l;var F=G(()=>{l={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"}});function g(j){let q={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return q[j]||q["network-first"]}function R(j){return g(j).className}function M(j){let q=j.pwa;if(!q?.enabled)return"";let K=q.routes||[],Q=q.cacheStorage,Y=[];for(let X of K){let Z=R(X.strategy),O=[];if(X.maxAgeSeconds||X.maxEntries||Q?.maxEntries){let $=X.maxEntries||Q?.maxEntries||100,L=X.maxAgeSeconds||(Q?.maxAge?Q.maxAge*24*60*60:void 0);O.push(`new ExpirationPlugin({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{cj as a,dj as b}from"./chunk-refwkt87.js";import"./chunk-
|
|
2
|
+
import{cj as a,dj as b}from"./chunk-refwkt87.js";import"./chunk-f8wjdg40.js";export{a as processTeleportDirectives,b as ensureTeleportTargets};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Gf as a}from"./chunk-nwq01xh0.js";import"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{a as startInteractive};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Bp as a,Cp as b,Dp as c,Ep as d,Fp as e,Gp as f}from"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{f as processStackReplacements,e as processStackPushDirectives,d as processIncludes,a as partialsCache,b as onceStore,c as clearOnceStore};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ap as b,zp as a}from"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{b as processLoops,a as parseLoopBinding};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Hk as a,Ik as b,Jk as c,Kk as d,Lk as e}from"./chunk-hpybjwwf.js";import"./chunk-
|
|
2
|
+
import{Hk as a,Ik as b,Jk as c,Kk as d,Lk as e}from"./chunk-hpybjwwf.js";import"./chunk-f8wjdg40.js";export{d as runPwaAudit,e as formatAuditResult,c as calculateAuditResult,a as auditConfig,b as auditBuildOutput};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Vi as a,Wi as b}from"./chunk-8evws5cc.js";import"./chunk-9n0gvfrg.js";import"./chunk-c1r9q5pk.js";import"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{a as getStoreScript,b as clearStoreCache};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Uq as D,Yq as T}from"./chunk-mbvkvac6.js";import{Ps as N}from"./chunk-jb7h4qgh.js";import{Yu as L}from"./chunk-f8wjdg40.js";import Q from"fs";import Y from"path";var b=new Map,V=new Map;async function v(j){let z;for(let K=0;K<3;K++)try{let W=(await Q.promises.stat(j)).mtime.getTime(),J=V.get(j);if(J&&J.mtime===W)return J.content;let X=await Bun.file(j).text(),U=(await Q.promises.stat(j)).mtime.getTime();if(U!==W)continue;return V.set(j,{content:X,mtime:U}),X}catch(I){z=I;break}throw V.delete(j),Error(`File not found: ${j}${z?` (${z.message})`:""}`)}function E(j){V.delete(j)}function F(j){for(let B of V.keys())if(B.startsWith(j))V.delete(B)}var $=null,G=null,k=null;function R(j){k=j}async function S(j=!1){let B=k??await import("./chunk-4cr21p7m.js");if(j)return B.generateSignalsRuntimeDev();if($===null)$=B.generateSignalsRuntime();return $}var q=null;async function _(){if(q===null){let{getRouterScript:j}=await import("./chunk-rwb4nztb.js");q=j()}return q}function g(){V.clear(),T(),N(),$=null,G=null,q=null}function y(j){let B={debug:j.debug===!0,middleware:(j.middleware??[]).map((z)=>({name:z.name,timing:z.timing,handler:String(z.handler)})),customDirectives:(j.customDirectives??[]).map((z)=>({name:z.name,hasEndTag:z.hasEndTag===!0,handler:String(z.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(B)).digest("hex")}async function C(j,B){try{if(!B.cachePath)return null;let z=Y.resolve(B.cachePath),K=Y.join(z,`${M(j)}.html`),I=Y.join(z,`${M(j)}.meta.json`);if(!await D(K)||!await D(I))return null;let W=await Bun.file(I).text(),J=JSON.parse(W);if(J.cacheVersion!==B.cacheVersion)return null;if(J.optionsSignature!==y(B))return null;if((await Q.promises.stat(j)).mtime.getTime()>J.mtime)return null;for(let Z of J.dependencies)if(await D(Z)){if((await Q.promises.stat(Z)).mtime.getTime()>J.mtime)return null}else return null;return await Bun.file(K).text()}catch(z){return console.warn(`Cache error for ${j}:`,z),null}}async function u(j,B,z,K){try{if(!K.cachePath)return;let I=Y.resolve(K.cachePath);await Q.promises.mkdir(I,{recursive:!0});let W=Y.join(I,`${M(j)}.html`),J=Y.join(I,`${M(j)}.meta.json`),X=await Q.promises.stat(j);await Bun.write(W,B);let Z={sourcePath:j,mtime:X.mtime.getTime(),dependencies:Array.from(z),cacheVersion:K.cacheVersion,optionsSignature:y(K),generatedAt:Date.now()};await Bun.write(J,JSON.stringify(Z,null,2)),b.set(j,{output:B,mtime:X.mtime.getTime(),dependencies:z})}catch(I){console.warn(`Failed to cache template ${j}:`,I)}}var O=16;function M(j){return new Bun.CryptoHasher("sha1").update(j).digest("hex").substring(0,O)}
|
|
3
|
+
export{b as Oj,v as Pj,E as Qj,F as Rj,R as Sj,S as Tj,_ as Uj,g as Vj,C as Wj,u as Xj,M as Yj};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ef as a,Ff as b}from"./chunk-pbsfbgx7.js";import"./chunk-
|
|
2
|
+
import{Ef as a,Ff as b}from"./chunk-pbsfbgx7.js";import"./chunk-f8wjdg40.js";export{b as captureScreenshots,a as captureScreenshot};
|