@stacksjs/stx 0.2.445 → 0.2.447
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/app-service-worker.d.ts +6 -0
- package/dist/{chunk-qa7j3j71.js → chunk-0tchj3ct.js} +4 -4
- package/dist/{chunk-7676qzab.js → chunk-0xztxj98.js} +3 -3
- package/dist/{chunk-5mxr3acg.js → chunk-13raxes0.js} +1 -1
- package/dist/{chunk-hkx8pggg.js → chunk-19h1j59a.js} +1 -1
- package/dist/chunk-21ypr4t0.js +2 -0
- package/dist/{chunk-1g91pegz.js → chunk-237psdsd.js} +1 -1
- package/dist/{chunk-mx9wp3va.js → chunk-26wmppja.js} +1 -1
- package/dist/chunk-2tpvt1c5.js +2 -0
- package/dist/chunk-4gjc61wn.js +2 -0
- package/dist/{chunk-9ad04ksh.js → chunk-4yyzje7d.js} +1 -1
- package/dist/{chunk-f85dyf2f.js → chunk-538h1sfc.js} +2 -2
- package/dist/{chunk-vxgtq00t.js → chunk-56rk985x.js} +3 -3
- package/dist/{chunk-1qnyn82e.js → chunk-5cyme1g0.js} +2 -2
- package/dist/chunk-5ftzrjpd.js +2 -0
- package/dist/{chunk-vyw0csez.js → chunk-5vgdbqbz.js} +3 -3
- package/dist/{chunk-56hvemdx.js → chunk-5xj1df83.js} +17 -17
- package/dist/{chunk-b5emjcf1.js → chunk-7417f610.js} +2 -2
- package/dist/chunk-78wsn958.js +2 -0
- package/dist/chunk-7aspn183.js +2 -0
- package/dist/{chunk-gvefw19e.js → chunk-7vdsd9rn.js} +1 -1
- package/dist/{chunk-r3f9jcf7.js → chunk-849wf19d.js} +3 -3
- package/dist/{chunk-j0nyamyf.js → chunk-8ah8npj3.js} +1 -1
- package/dist/chunk-8bzc2v6z.js +2 -0
- package/dist/{chunk-8nsmx2w4.js → chunk-8fj8sm1a.js} +2 -2
- package/dist/chunk-8gk34047.js +2 -0
- package/dist/{chunk-dvja1k84.js → chunk-8nsfkr5n.js} +1 -1
- package/dist/chunk-8y4wrp43.js +2 -0
- package/dist/{chunk-cm875f73.js → chunk-90562q79.js} +2 -2
- package/dist/{chunk-bbnyq3gm.js → chunk-9ndzk9r4.js} +2 -2
- package/dist/{chunk-97tb2m44.js → chunk-9xf7yk65.js} +2 -2
- package/dist/{chunk-224x6rsx.js → chunk-a5695s8k.js} +1 -1
- package/dist/{chunk-2xnwsavq.js → chunk-afhkvj3k.js} +2 -2
- package/dist/{chunk-m4q2e418.js → chunk-b1q5sh7x.js} +2 -2
- package/dist/{chunk-w9ebf2rb.js → chunk-bderms43.js} +1 -1
- package/dist/{chunk-gmzaknjp.js → chunk-bqc07550.js} +1 -1
- package/dist/chunk-brtvd5bs.js +2 -0
- package/dist/{chunk-cmctzee2.js → chunk-bxhzs857.js} +2 -2
- package/dist/{chunk-fbhgabf2.js → chunk-cs3507d0.js} +1 -1
- package/dist/chunk-cwc3p6p7.js +2 -0
- package/dist/chunk-d3yrvve4.js +2 -0
- package/dist/chunk-dk3zazaw.js +2 -0
- package/dist/{chunk-ye27ept1.js → chunk-e593pr1r.js} +1 -1
- package/dist/chunk-e8y69gg0.js +2 -0
- package/dist/chunk-es85mgdw.js +2 -0
- package/dist/chunk-fhpfe2s3.js +2 -0
- package/dist/chunk-fmc9fj4a.js +2 -0
- package/dist/chunk-fn863yek.js +2 -0
- package/dist/{chunk-ean2kjmg.js → chunk-fp6v2dq5.js} +4 -4
- package/dist/{chunk-egaknprm.js → chunk-frv8bhmz.js} +82 -82
- package/dist/{chunk-rvbcnahe.js → chunk-g2afpsw0.js} +2 -2
- package/dist/{chunk-dn9thd0h.js → chunk-g3h7j2n7.js} +2 -2
- package/dist/chunk-g4hv6v3e.js +2 -0
- package/dist/{chunk-aa7w63xc.js → chunk-g8k5rsqq.js} +32 -32
- package/dist/{chunk-4mppjen3.js → chunk-get6k573.js} +1 -1
- package/dist/{chunk-7v163hb5.js → chunk-gm7ewgf4.js} +1 -1
- package/dist/{chunk-csjm1z0c.js → chunk-h3gdfbmf.js} +1 -1
- package/dist/chunk-hdat2brj.js +2 -0
- package/dist/{chunk-81zfdd95.js → chunk-hhjff2r8.js} +3 -3
- package/dist/{chunk-j3gcjbnm.js → chunk-hz6a476h.js} +1 -1
- package/dist/chunk-j19s8n7w.js +2 -0
- package/dist/chunk-j1h2z4wh.js +2 -0
- package/dist/chunk-j3se49h7.js +2 -0
- package/dist/{chunk-xq4jdzje.js → chunk-jn8tj4kn.js} +3 -3
- package/dist/chunk-kwsw9tc4.js +2 -0
- package/dist/{chunk-xgwempyb.js → chunk-m5298269.js} +2 -2
- package/dist/{chunk-41fbr3m6.js → chunk-mmp7x8f0.js} +1 -1
- package/dist/chunk-mtctv02d.js +2 -0
- package/dist/{chunk-4rpfmh9w.js → chunk-n5w8nwec.js} +1 -1
- package/dist/{chunk-b3e0hcw0.js → chunk-n7n9zxmh.js} +100 -100
- package/dist/chunk-nkzn1hqq.js +2 -0
- package/dist/{chunk-06qhvtsv.js → chunk-ns7e951g.js} +1 -1
- package/dist/{chunk-ca24g1fa.js → chunk-p7m673vn.js} +4 -4
- package/dist/chunk-p9shre7t.js +2 -0
- package/dist/chunk-pgnr089q.js +2 -0
- package/dist/{chunk-0xntpjmp.js → chunk-pkpmyr0x.js} +2 -2
- package/dist/{chunk-ybk279xj.js → chunk-qmfwhvcr.js} +4 -4
- package/dist/{chunk-sgxjqqvd.js → chunk-qmp7j5h4.js} +1 -1
- package/dist/chunk-rp69az5a.js +2 -0
- package/dist/{chunk-h7ny0py8.js → chunk-s6e8mmk1.js} +1 -1
- package/dist/chunk-sfvyfvbm.js +2 -0
- package/dist/{chunk-9tbevvm3.js → chunk-t01a2dfe.js} +12 -12
- package/dist/chunk-t6d5zq7d.js +2 -0
- package/dist/{chunk-mcgpeyy8.js → chunk-tehvry9a.js} +4 -4
- package/dist/{chunk-t9tg1syw.js → chunk-vbzeeeax.js} +8 -8
- package/dist/{chunk-3yws0k28.js → chunk-vnq2c0tg.js} +5 -5
- package/dist/{chunk-ak7eyyka.js → chunk-w8ek4fe8.js} +2 -2
- package/dist/chunk-wf09xg7j.js +2 -0
- package/dist/{chunk-bh432b7n.js → chunk-x4ztj64h.js} +2 -2
- package/dist/{chunk-b7x7099z.js → chunk-y6zm894z.js} +5 -5
- package/dist/{chunk-9f0srtmg.js → chunk-yfd0e7dr.js} +1 -1
- package/dist/{chunk-39726w03.js → chunk-yn3w9g2z.js} +4 -4
- package/dist/chunk-ytq686vx.js +2 -0
- package/dist/{chunk-5zpt78j4.js → chunk-yx37nrgr.js} +4 -4
- package/dist/{chunk-3wdarmh7.js → chunk-z4b0kr1z.js} +4 -4
- package/dist/{chunk-12mzd0gf.js → chunk-z72wwstp.js} +3 -3
- package/dist/chunk-zj80vrv6.js +2 -0
- package/dist/{chunk-cs15xqf0.js → chunk-zqzv5jy2.js} +4 -4
- package/dist/cli.js +12 -12
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/offline/app-service-worker.d.ts +6 -0
- package/dist/offline/app-service-worker.js +10 -3
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +16 -16
- package/dist/utils.js +24 -9
- package/package.json +2 -2
- package/dist/chunk-0e6da0m4.js +0 -2
- package/dist/chunk-2b66v3yx.js +0 -2
- package/dist/chunk-4awtqfv7.js +0 -2
- package/dist/chunk-4ct5vj9n.js +0 -2
- package/dist/chunk-66czf70n.js +0 -2
- package/dist/chunk-7cdrpkzz.js +0 -2
- package/dist/chunk-7kyr2atb.js +0 -2
- package/dist/chunk-8bsy7r0w.js +0 -2
- package/dist/chunk-93wp5h7v.js +0 -2
- package/dist/chunk-a14zkmbp.js +0 -2
- package/dist/chunk-a8hjvjb8.js +0 -2
- package/dist/chunk-e1n2t5tk.js +0 -2
- package/dist/chunk-frys2748.js +0 -2
- package/dist/chunk-gy7t9wd0.js +0 -2
- package/dist/chunk-h15q5qan.js +0 -2
- package/dist/chunk-hvawaf7a.js +0 -2
- package/dist/chunk-k2k6engs.js +0 -2
- package/dist/chunk-kp7r61aj.js +0 -2
- package/dist/chunk-kr2phxhf.js +0 -2
- package/dist/chunk-m2k2b81v.js +0 -2
- package/dist/chunk-p2b0r3qn.js +0 -2
- package/dist/chunk-p46gy056.js +0 -2
- package/dist/chunk-p5hrdsk9.js +0 -2
- package/dist/chunk-qy8wb31b.js +0 -2
- package/dist/chunk-qzyfjyna.js +0 -2
- package/dist/chunk-rwdkh7c0.js +0 -2
- package/dist/chunk-sjgg6r0a.js +0 -2
- package/dist/chunk-tq441vbg.js +0 -2
- package/dist/chunk-vn09wm09.js +0 -2
- package/dist/chunk-xex4nkgq.js +0 -2
- package/dist/chunk-xr03p49w.js +0 -2
- package/dist/chunk-y8kz05mn.js +0 -2
- package/dist/chunk-ycmc1zpt.js +0 -2
- package/dist/chunk-ymvdbs80.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as rl}from"ts-broadcasting";import{Broadcast as sl,BroadcastServer as
|
|
3
|
-
export{Gc,Jc,Yc,Zc,
|
|
2
|
+
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as rl}from"ts-broadcasting";import{Broadcast as sl,BroadcastServer as ol}from"ts-broadcasting";var e=null,u=[];function Gc(){return e}async function Jc(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Yc(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function Zc(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();Ki(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function Ki(n,t,r){if(!i())return;s.send(n,t,r)}function Qc(n,t,r){if(!i())return;s.toUser(n,t,r)}function el(n,t,r){if(!i())return;s.toUsers(n,t,r)}function tl(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function nl(n,t,r){if(!i())return;s.presence(n,t,r)}
|
|
3
|
+
export{Gc,Jc,Yc,Zc,Ki,Qc,el,tl,nl,rl,sl,ol};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import I from"fs";import u from"path";import V from"os";import x from"crypto";import{generatePlaceholder as C,processImage as D}from"ts-images";var L=[320,640,768,1024,1280,1536,1920],j=["webp","jpeg"],B=80,O=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],k={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},w=null,v=!1;async function p(){if(v)return w;v=!0;try{let t=await import("sharp");return w=t.default||t,w}catch{return null}}async function Dt(){return await p()!==null}async function G(){return!0}async function se(t,e={}){let{widths:a=L,formats:r=j,quality:n=B,fit:i="cover",placeholder:m="none",outputDir:o=".stx/images",baseUrl:b="/images"}=e,h,g;if(typeof t==="string"){if(g=t,!await Bun.file(t).exists())throw new $n(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else g="buffer-input",h=t;let y=x.createHash("sha256").update(h).digest("hex").slice(0,12),R=await Cn(h),{width:c,height:S}=R,P=c/S;await I.promises.mkdir(o,{recursive:!0});let E=[],T=u.basename(g,u.extname(g)),l=a.filter((s)=>s<=c);if(!l.includes(c)&&c<=Math.max(...a))l.push(c);l.sort((s,f)=>s-f);for(let s of l){let f=Math.round(s/P);for(let d of r){let U=`${T}-${s}w-${y}.${d}`,A=u.join(o,U),z=`${b}/${U}`,q=await
|
|
3
|
-
export{L,j,B,Dt,G,se,Cn,
|
|
2
|
+
import I from"fs";import u from"path";import V from"os";import x from"crypto";import{generatePlaceholder as C,processImage as D}from"ts-images";var L=[320,640,768,1024,1280,1536,1920],j=["webp","jpeg"],B=80,O=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],k={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},w=null,v=!1;async function p(){if(v)return w;v=!0;try{let t=await import("sharp");return w=t.default||t,w}catch{return null}}async function Dt(){return await p()!==null}async function G(){return!0}async function se(t,e={}){let{widths:a=L,formats:r=j,quality:n=B,fit:i="cover",placeholder:m="none",outputDir:o=".stx/images",baseUrl:b="/images"}=e,h,g;if(typeof t==="string"){if(g=t,!await Bun.file(t).exists())throw new $n(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else g="buffer-input",h=t;let y=x.createHash("sha256").update(h).digest("hex").slice(0,12),R=await Cn(h),{width:c,height:S}=R,P=c/S;await I.promises.mkdir(o,{recursive:!0});let E=[],T=u.basename(g,u.extname(g)),l=a.filter((s)=>s<=c);if(!l.includes(c)&&c<=Math.max(...a))l.push(c);l.sort((s,f)=>s-f);for(let s of l){let f=Math.round(s/P);for(let d of r){let U=`${T}-${s}w-${y}.${d}`,A=u.join(o,U),z=`${b}/${U}`,q=await Gi(h,{width:s,height:f,format:d,quality:n,fit:i});await Bun.write(A,q),E.push({path:A,url:z,width:s,height:f,format:d,size:q.length})}}let M;if(m!=="none")M=await _(h,m);return{src:g,variants:E,placeholder:M,width:c,height:S,aspectRatio:P,hash:y}}async function Cn(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await p();if(a){let n=await a(e).metadata();return{width:n.width||0,height:n.height||0,format:n.format||"unknown",hasAlpha:n.hasAlpha}}return N(e)}function N(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let n=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:n,format:"jpeg",hasAlpha:!1}}let r=t.readUInt16BE(e+2);e+=2+r}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,r=t.readUInt16LE(28)&16383;return{width:a,height:r,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),r=(a&16383)+1,n=(a>>14&16383)+1;return{width:r,height:n,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new $n("Unable to parse image dimensions","PARSE_ERROR")}async function Gi(t,e){let a=await p();if(a){let n=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":n=n.webp({quality:e.quality});break;case"avif":n=n.avif({quality:e.quality});break;case"jpeg":n=n.jpeg({quality:e.quality});break;case"png":n=n.png({quality:e.quality});break}return n.toBuffer()}let r=u.join(V.tmpdir(),`stx-img-${x.randomBytes(8).toString("hex")}.${e.format}`);try{return await D({input:t,output:r,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(r).arrayBuffer())}finally{await I.promises.unlink(r).catch(()=>{})}}async function _(t,e){let a=await p();if(e==="blur"&&a){let m=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),o=await Cn(t);return`data:${k[o.format]||"image/jpeg"};base64,${m}`}if(e==="dominant-color"&&a){let{dominant:i}=await a(t).resize(1,1).toBuffer().then(async(m)=>{let o=await a(m).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${i.r}, ${i.g}, ${i.b})`}let r=await Cn(t),n=u.join(V.tmpdir(),`stx-ph-${x.randomBytes(8).toString("hex")}.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(n,t);let i=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",o=await C(n,{strategy:i,width:i==="thumbhash"?void 0:32});if(e==="dominant-color"&&o.dominantColor)return o.dominantColor;if(o.dataURL)return o.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await I.promises.unlink(n).catch(()=>{})}}function Re(t,e){return(e?t.filter((r)=>r.format===e):t).sort((r,n)=>r.width-n.width).map((r)=>`${r.url} ${r.width}w`).join(", ")}function ut(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,r)=>{let n=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(r[0].replace(/\D/g,""))||0)-n}).map(([a,r])=>`(max-width: ${a}) ${r}`).join(", ")+", 100vw"}function Ot(t){let e=t.filter((r)=>r.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((r,n)=>r.width-n.width);return a[Math.floor(a.length/2)]}function Mt(t){let e=new Map;for(let a of t){let r=e.get(a.format)||[];r.push(a),e.set(a.format,r)}return e}function Nt(t){let e=u.extname(t).toLowerCase();return O.includes(e)}function F(t){return k[t]||"application/octet-stream"}function Lt(t){return t.reduce((e,a)=>e+a.size,0)}function jt(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class $n extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
|
|
3
|
+
export{L,j,B,Dt,G,se,Cn,Gi,Re,ut,Ot,Mt,Nt,F,Lt,jt,$n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Mu,rc,ts,ns,Wo,qo,rs,ss,jn,sc,Ko,Xo,oc,ze}from"./chunk-n7n9zxmh.js";import"./chunk-0xztxj98.js";import"./chunk-73h7qjgq.js";import"./chunk-yx37nrgr.js";import"./chunk-gm7ewgf4.js";import"./chunk-jwpcck1b.js";import"./chunk-g8k5rsqq.js";import"./chunk-zqzv5jy2.js";import"./chunk-5xj1df83.js";import"./chunk-axydabse.js";import"./chunk-afhkvj3k.js";import"./chunk-7417f610.js";import"./chunk-dqr5n49p.js";export{Mu as clearScriptScanCache,rs as convertServerLoopAttributesToDirectives,Wo as convertSignalDirectivesToAttributes,ss as convertSignalLoopsToAttributes,sc as extractExports,Xo as findMarkupIndexOutsideScripts,ns as hasSignalsSyntax,ts as parseLoopExpression,qo as preEvalLiteralReactiveIfs,jn as processScriptSetup,Ko as processSignals,oc as rewriteStxImportSpecifiers,rc as scanScriptTags,ze as stripStxRuntimeImports};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,
|
|
3
|
-
`,
|
|
4
|
-
`;if(e.description)
|
|
5
|
-
`;if(e.keywords){let
|
|
6
|
-
`}if(e.robots)
|
|
7
|
-
`;if(e.canonical)
|
|
8
|
-
`;let
|
|
9
|
-
`,
|
|
10
|
-
`}if(
|
|
11
|
-
`}if(
|
|
12
|
-
`}if(
|
|
13
|
-
`,
|
|
14
|
-
`;if(
|
|
15
|
-
`;if(
|
|
16
|
-
`;if(
|
|
17
|
-
`}if(
|
|
18
|
-
`;if(
|
|
19
|
-
`;if(
|
|
20
|
-
`}}let c=A(e,"twitter",r,n);if(c){if(
|
|
21
|
-
`,c.title||e.title){let
|
|
22
|
-
`}if(c.description||e.description){let
|
|
23
|
-
`}if(c.image||
|
|
24
|
-
`;let u=c.imageAlt||(!c.image&&
|
|
25
|
-
`}if(c.site)
|
|
26
|
-
`;if(c.creator)
|
|
27
|
-
`}if(e.structuredData!==void 0&&e.structuredData!==null){let
|
|
28
|
-
`;else Qn(r,`structuredData must be an object or an array of objects, got ${ue(e.structuredData)}; it was left out`,n)}return
|
|
2
|
+
import{t,i}from"./chunk-5xj1df83.js";import{Xe,Ge,Je,ue,we,k,Qn,cn,pe}from"./chunk-zqzv5jy2.js";var I=/(?<![\w$@])@meta\s*\(/g,C=/(?<![\w$@])@metaTag\s*\(/g,x=/(?<![\w$@])@structuredData\s*\(/g,N=/(?<![\w$@])@seo\s*\(/g;function S(e,r){return(n)=>k(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function j(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function Ss(e,r,n,p){if(!e.includes("@meta"))return e;let s=Xe(e,I,(a,c)=>{let o=cn(Ge(a),r);if(o.kind==="tag")return j(o.tag);if(o.kind==="empty")return"";return k("Meta",c,o.message,n,o.code)},S("Meta",n));return s=Xe(s,C,(a,c)=>{let o=Je(a,r);if(!o.ok)return k("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!we(o.value))return k("MetaTag",c,`expected an object such as { name, content }, got ${ue(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return k("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let g="<meta";if(u.name)g+=` name="${l(u.name)}"`;if(u.property)g+=` property="${l(u.property)}"`;if(u.httpEquiv)g+=` http-equiv="${l(u.httpEquiv)}"`;return g+=` content="${l(u.content)}">`,g},S("MetaTag",n)),s}function R(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(we(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(we))return e.map(r);return null}function _(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function ks(e,r,n){if(!e.includes("@structuredData"))return e;return Xe(e,x,(p,s)=>{let a=Je(p,r);if(!a.ok)return k("StructuredData",s,a.message,n,a.code);if(a.value===void 0||a.value===null)return"";let c=R(a.value);if(!c)return k("StructuredData",s,`expected an object or an array of objects, got ${ue(a.value)}`,n,t.TYPE_ERROR);try{return _(c)}catch(o){let u=o instanceof Error?o.message:String(o);return k("StructuredData",s,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},S("StructuredData",n))}var L=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),E={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Cs(e,r,n,p){if(!e.includes("@seo"))return e;return Xe(e,N,(s,a)=>{if(!s.trim())return k("SEO",a,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=Je(s,r);if(!c.ok)return k("SEO",a,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!we(c.value))return k("SEO",a,`expected an object such as { title, description }, got ${ue(c.value)}`,n,t.TYPE_ERROR);try{return q(c.value,a,n)}catch(o){let u=o instanceof Error?o.message:String(o);return k("SEO",a,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},S("SEO",n))}function A(e,r,n,p){let s=e[r];if(s===void 0||s===null||s===!1)return;if(we(s))return s;Qn(n,`${r} must be an object, got ${ue(s)}; its tags were left out`,p);return}function q(e,r,n){let p=Object.keys(e).filter((o)=>!L.has(o));if(p.length>0){let o=p.map((u)=>E[u]?`${u} (use ${E[u]})`:u).join(", ");Qn(r,`@seo does not read ${o}; ${p.length===1?"it was":"they were"} ignored`,n)}let s="";if(e.title)s+=`<title>${l(e.title)}</title>
|
|
3
|
+
`,s+=`<meta name="title" content="${l(e.title)}">
|
|
4
|
+
`;if(e.description)s+=`<meta name="description" content="${l(e.description)}">
|
|
5
|
+
`;if(e.keywords){let o=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;s+=`<meta name="keywords" content="${l(o)}">
|
|
6
|
+
`}if(e.robots)s+=`<meta name="robots" content="${l(e.robots)}">
|
|
7
|
+
`;if(e.canonical)s+=`<link rel="canonical" href="${l(e.canonical)}">
|
|
8
|
+
`;let a=A(e,"openGraph",r,n);if(a){if(s+=`<meta property="og:type" content="${l(a.type||"website")}">
|
|
9
|
+
`,a.title||e.title){let o=a.title||e.title||"";s+=`<meta property="og:title" content="${l(o)}">
|
|
10
|
+
`}if(a.description||e.description){let o=a.description||e.description||"";s+=`<meta property="og:description" content="${l(o)}">
|
|
11
|
+
`}if(a.url||e.canonical){let o=a.url||e.canonical||"";s+=`<meta property="og:url" content="${l(o)}">
|
|
12
|
+
`}if(a.image){if(s+=`<meta property="og:image" content="${l(a.image)}">
|
|
13
|
+
`,a.imageAlt)s+=`<meta property="og:image:alt" content="${l(a.imageAlt)}">
|
|
14
|
+
`;if(a.imageWidth)s+=`<meta property="og:image:width" content="${l(String(a.imageWidth))}">
|
|
15
|
+
`;if(a.imageHeight)s+=`<meta property="og:image:height" content="${l(String(a.imageHeight))}">
|
|
16
|
+
`;if(a.imageType)s+=`<meta property="og:image:type" content="${l(a.imageType)}">
|
|
17
|
+
`}if(a.siteName)s+=`<meta property="og:site_name" content="${l(a.siteName)}">
|
|
18
|
+
`;if(a.locale)s+=`<meta property="og:locale" content="${l(a.locale)}">
|
|
19
|
+
`;if(a.profile){let o=[["first_name",a.profile.firstName],["last_name",a.profile.lastName],["username",a.profile.username],["gender",a.profile.gender]];for(let[u,g]of o)if(g)s+=`<meta property="profile:${u}" content="${l(g)}">
|
|
20
|
+
`}}let c=A(e,"twitter",r,n);if(c){if(s+=`<meta name="twitter:card" content="${l(c.card||"summary_large_image")}">
|
|
21
|
+
`,c.title||e.title){let o=c.title||e.title||"";s+=`<meta name="twitter:title" content="${l(o)}">
|
|
22
|
+
`}if(c.description||e.description){let o=c.description||e.description||"";s+=`<meta name="twitter:description" content="${l(o)}">
|
|
23
|
+
`}if(c.image||a&&a.image){let o=c.image||(a?a.image:"")||"";s+=`<meta name="twitter:image" content="${l(o)}">
|
|
24
|
+
`;let u=c.imageAlt||(!c.image&&a?a.imageAlt:void 0);if(u)s+=`<meta name="twitter:image:alt" content="${l(u)}">
|
|
25
|
+
`}if(c.site)s+=`<meta name="twitter:site" content="${l(c.site)}">
|
|
26
|
+
`;if(c.creator)s+=`<meta name="twitter:creator" content="${l(c.creator)}">
|
|
27
|
+
`}if(e.structuredData!==void 0&&e.structuredData!==null){let o=R(e.structuredData);if(o)s+=`${_(o)}
|
|
28
|
+
`;else Qn(r,`structuredData must be an object or an array of objects, got ${ue(e.structuredData)}; it was left out`,n)}return s.trim()}function $s(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let p=r.__stx_runtime_head;if(!!(p?.title||p?.meta?.some((w)=>w.property==="og:title"||w.name==="og:title"||w.name==="twitter:title"||w.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let a=e.includes("<title>")||e.includes("</title>"),c=M(e),o=V(c),u=U(c),g="";if(r.title)g=r.title;else if(r.meta&&r.meta.title)g=r.meta.title;else if(o)g=o;else if(n.seo?.defaultConfig?.title)g=n.seo.defaultConfig.title;else g=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=a?"":`
|
|
29
29
|
<meta name="title" content="${l(g)}">`,h=G(c)?"":`
|
|
30
30
|
<meta name="description" content="${l(m)}">`,T=`
|
|
31
31
|
<!-- stx SEO Tags -->${f}${h}
|
|
@@ -38,14 +38,14 @@ import{t,o}from"./chunk-56hvemdx.js";import{Xe,Ge,Je,ue,we,k,Qn,cn,pe}from"./chu
|
|
|
38
38
|
`;if(d)T+=`
|
|
39
39
|
<meta property="og:image" content="${l(d)}">
|
|
40
40
|
<meta name="twitter:image" content="${l(d)}">
|
|
41
|
-
`;let y=e;if(!
|
|
41
|
+
`;let y=e;if(!a)y=y.replace(/<head[^>]*>/,`$&
|
|
42
42
|
<title>${l(g)}</title>`);let D=r.__stx_head_injections;if(D)return r.__stx_seo_staged=!0,D.afterOpen.push(`
|
|
43
43
|
${T}
|
|
44
44
|
`),y;return y.replace(/<head[^>]*>/,`$&
|
|
45
45
|
${T}
|
|
46
|
-
`)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function b(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?b(r[1].trim()):""}function v(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return v(e).length>0}function U(e){for(let r of v(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),p=(n?.[1]??n?.[2]??"").trim();if(p)return b(p)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Jn={name:"meta",rawParams:!0,handler:(e,r,n,p)=>{let
|
|
46
|
+
`)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function b(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?b(r[1].trim()):""}function v(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return v(e).length>0}function U(e){for(let r of v(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),p=(n?.[1]??n?.[2]??"").trim();if(p)return b(p)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Jn={name:"meta",rawParams:!0,handler:(e,r,n,p)=>{let s=cn(r,n??{});if(s.kind==="error")return k("Meta",`@meta(${r.join(", ")})`,s.message,p,s.code);if(s.kind==="empty")return"";if(n)n.__stx_runtime_head=pe(n.__stx_runtime_head??{},{meta:[s.tag]});return""},hasEndTag:!1},Yn={name:"structuredData",handler:(e,r,n,p)=>{if(e.trim()==="")return i("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let s=JSON.parse(e);if(!s["@context"])s["@context"]="https://schema.org";if(!s["@type"])return i("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return _(s)}catch(s){let a=s instanceof Error?s.message:String(s);return i("StructuredData",a,t.EVALUATION_ERROR)}},hasEndTag:!0};function zu(){return[Jn,Yn]}function Hu(e,r){let{baseUrl:n,defaultChangefreq:p="weekly",defaultPriority:s=0.5,includeLastmod:a=!0}=r,c=n.replace(/\/$/,"");return`<?xml version="1.0" encoding="UTF-8"?>
|
|
47
47
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
48
|
-
${e.map((u)=>{let g=u.loc.startsWith("http")?u.loc:`${c}${u.loc.startsWith("/")?"":"/"}${u.loc}`,m=u.lastmod||(
|
|
48
|
+
${e.map((u)=>{let g=u.loc.startsWith("http")?u.loc:`${c}${u.loc.startsWith("/")?"":"/"}${u.loc}`,m=u.lastmod||(a?new Date().toISOString().split("T")[0]:void 0),d=u.changefreq||p,f=u.priority??s,h=` <url>
|
|
49
49
|
<loc>${O(g)}</loc>`;if(m)h+=`
|
|
50
50
|
<lastmod>${m}</lastmod>`;return h+=`
|
|
51
51
|
<changefreq>${d}</changefreq>`,h+=`
|
|
@@ -54,11 +54,11 @@ ${e.map((u)=>{let g=u.loc.startsWith("http")?u.loc:`${c}${u.loc.startsWith("/")?
|
|
|
54
54
|
`)}
|
|
55
55
|
</urlset>`}function Vu(e,r){let n=r.replace(/\/$/,""),p=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
|
|
56
56
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
57
|
-
${e.map((
|
|
57
|
+
${e.map((a)=>{let c=a.startsWith("http")?a:`${n}${a.startsWith("/")?"":"/"}${a}`;return` <sitemap>
|
|
58
58
|
<loc>${O(c)}</loc>
|
|
59
59
|
<lastmod>${p}</lastmod>
|
|
60
60
|
</sitemap>`}).join(`
|
|
61
61
|
`)}
|
|
62
|
-
</sitemapindex>`}async function Uu(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:p=["_*",".*","node_modules","components","partials","layouts"]}=r,
|
|
62
|
+
</sitemapindex>`}async function Uu(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:p=["_*",".*","node_modules","components","partials","layouts"]}=r,s=[],a=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${a}`);for await(let o of c.scan(e)){if(p.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let g=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!g.startsWith("/"))g=`/${g}`;if(g!=="/"&&g.endsWith("/"))g=g.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}s.push({loc:g||"/",lastmod:d,priority:g==="/"?1:0.5})}return s.sort((o,u)=>o.loc.localeCompare(u.loc)),s}function Zn(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let p of n.allow)r.push(`Allow: ${p}`);if(n.disallow)for(let p of n.disallow)r.push(`Disallow: ${p}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let p of n)r.push(`Sitemap: ${p}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
|
|
63
63
|
`).trim()}function Wu(e){return Zn({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function O(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
64
64
|
export{Ss,ks,Cs,$s,Jn,Yn,zu,Hu,Vu,Uu,Zn,Wu};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{V,ae}from"./chunk-
|
|
2
|
+
import{V,ae}from"./chunk-n7n9zxmh.js";import{le,S,Ke}from"./chunk-jwpcck1b.js";import{Ze,X,xe}from"./chunk-7417f610.js";import{_e,ne,C,re,ao,xr,co,Pt}from"./chunk-z4b0kr1z.js";import{Vr}from"./chunk-5vgdbqbz.js";import{It}from"./chunk-rdq113p4.js";import H from"zlib";import{promisify as Y}from"util";var Q=Y(H.brotliCompress),Z=Y(H.gzip),K=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ee=["text/event-stream","multipart/x-mixed-replace"],te=1024;function se(t){if(!t)return!1;let e=t.toLowerCase();if(ee.some((i)=>e.startsWith(i)))return!1;return K.some((i)=>e.startsWith(i))}function oe(t){let e=new Map;for(let i of t.split(",")){let[s,...c]=i.trim().split(";"),l=s.trim().toLowerCase();if(!l)continue;let m=1;for(let f of c){let x=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(f);if(!x)continue;let g=Number.parseFloat(x[1]);if(Number.isFinite(g))m=g}e.set(l,m)}return e}function ie(t){if(!t)return null;let e=oe(t),i=e.get("*"),s=(c)=>e.get(c)??i??0;if(s("br")>0)return"br";if(s("gzip")>0)return"gzip";return null}async function At(t,e,i={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!se(e.headers.get("content-type")))return e;let s=ie(t.headers.get("accept-encoding"));if(!s)return e;let c;try{c=new Uint8Array(await e.arrayBuffer())}catch{return e}let l=()=>new Response(c,{status:e.status,statusText:e.statusText,headers:q(e.headers)});if(c.length<(i.threshold??te))return l();try{let m=s==="br"?await Q(c,{params:{[H.constants.BROTLI_PARAM_QUALITY]:i.quality??5,[H.constants.BROTLI_PARAM_SIZE_HINT]:c.length}}):await Z(c);if(m.length>=c.length)return l();let f=q(e.headers);return f.set("Content-Encoding",s),f.set("Content-Length",String(m.length)),new Response(m,{status:e.status,statusText:e.statusText,headers:f})}catch{return l()}}function q(t){let e=new Headers(t),i=e.get("Vary");if(!i)return e.set("Vary","Accept-Encoding"),e;if(!i.split(",").some((c)=>c.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${i}, Accept-Encoding`);return e}import J from"fs";import M from"path";var{serve:ce}=globalThis.Bun;class G{now;entries=new V(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,i){let s,c=async()=>{let r=s??await i();return r.headers.set("Cache-Control","private, no-store"),r.headers.set("Vary",C(r.headers.get("Vary")).Vary),r};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return c();let l=new URL(t.url),m=`${l.origin}${l.pathname}${l.search}|${ne(t)?"fragment":"document"}`,f=this.entries.get(m),x=(r)=>{let T=new Headers(r.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-r.created)/1000)))),new Response(r.body.slice(0),{headers:T})},g=f?(this.now()-f.created)/1000:1/0;if(f&&g<e.maxAge)return x(f);let b=this.generation,O=async()=>{let r=await i();s=r;let T=(r.headers.get("Vary")??"").toLowerCase().split(",").map((R)=>R.trim()).filter(Boolean);if(r.status!==200||r.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(r.headers.get("Cache-Control")??"")||T.some((R)=>R!=="x-stx-router"&&R!=="accept-encoding"))return null;let L=await r.clone().arrayBuffer();if(L.byteLength>1048576)return null;r.headers.set("Vary",C(r.headers.get("Vary")).Vary);let n={body:L,headers:Array.from(r.headers.entries()),created:this.now(),path:l.pathname};if(this.generation===b)this.entries.set(m,n);return n},v=this.pending.get(m);if(!v){if(this.pending.size>=1000)return c();v=O().finally(()=>{if(this.pending.get(m)===v)this.pending.delete(m)}),this.pending.set(m,v)}if(f&&g<e.maxAge+(e.swr??0))return v.catch(()=>{}),x(f);let E=await v;return E?x(E):c()}}var pe={".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 al(t={}){let e=M.resolve(t.outputDir||".output"),i=t.port??3000,s=ao(e);if(!s)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${s.routes.length} routes...`);let c=It(s.routeRules),l=new G,m=Vr(e,s.apiRoutes??[]),f=Bun.file(M.join(e,"server/runtime-config.json")),x=t.runtimeConfig??(await f.exists()?await f.json():void 0),g=x?S(x):void 0,b=new Map,O=new Map,v=new Map,E=new Map;for(let n of s.routes)try{let R=M.join(e,n.compiledPath),o=JSON.parse(await Bun.file(R).text());if(g)o.html=Ke(o.html,g);b.set(n.pattern,o),v.set(n.pattern,xe(o.html)),E.set(n.pattern,ae(o.html));let _=M.join(e,n.fragmentPath);if(await Bun.file(_).exists()){let A=await Bun.file(_).text();O.set(n.pattern,g?Ke(A,g):A)}}catch(R){console.warn(`[stx] Failed to load route ${n.pattern}:`,R)}let r=new Map,T=[];for(let n of s.routes)if(n.hasParams){let{regex:R,params:o}=X(n.pattern,{page:!0});T.push({regex:R,route:n,paramNames:o})}else r.set(n.pattern,n);let L=ce({port:i,async fetch(n){return At(n,await le(g??S(),async()=>{let o=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[o])return t.apiRoutes[o](n);let _=await m(n);if(_)return _;if((n.method==="GET"||n.method==="HEAD")&&o!=="/"){let p=M.resolve(e,"public"),d;try{d=decodeURIComponent(o)}catch{d=o}if(!d.includes("\x00")){let u=M.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${M.sep}`))try{if(J.existsSync(u)&&J.statSync(u).isFile()){let h=M.extname(u).toLowerCase(),j=pe[h]||"application/octet-stream",B=o.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(o);return new Response(Bun.file(u),{headers:{"Content-Type":j,"Cache-Control":B?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=ne(n),y=null,U={};if(y=r.get(o)||null,!y)for(let{regex:p,route:d,paramNames:u}of T){let a=o.match(p);if(a){y=d,u.forEach((h,j)=>{U[h]=a[j+1]});break}}if(!y){let p=Ze(o)?null:r.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let k=c(o),W=Object.keys(k).length>0;return l.respond(n,k.cache,async()=>{let p=b.get(y.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let a=O.get(y.pattern);if(a){let h=v.get(y.pattern);return new Response(a,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(y.pattern)?{"X-STX-Runtime":E.get(y.pattern)?"true":"false"}:{},...h?{"X-STX-Layout":h.layout,"X-STX-Layout-Group":h.group}:{},...C(),...k.cache?{}:{"Cache-Control":_e}}})}}let d=xr(n.method),u=b.get(y.pattern);if(!u){let a=r.get("/500")||null;if(a){let h=b.get(a.pattern);if(h)return new Response(h.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(y.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...C(),"Cache-Control":"public, max-age=60"}});try{let{html:a,boundaries:h,redirect:j,cookies:B,status:I,headers:z}=await Pt(u,{params:U,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:g});if(j)return co(j,B,z);if(h&&h.length>0){let{renderStreamingPage:P,streamToResponse:D}=await import("./chunk-2tpvt1c5.js"),N=new Headers({...C(),...z,"Cache-Control":"private, no-store"});for(let F of B??[])N.append("Set-Cookie",F);if(A&&!d){let F=xe(a);N.set("X-STX-Fragment","true"),N.set("X-STX-Runtime",ae(a)?"true":"false"),N.set("X-STX-Layout",F.layout),N.set("X-STX-Layout-Group",F.group)}return D(P(A&&!d?re(a,s.routerContainer||"main"):a,h,{timeoutMs:30000}),{status:I??u.status??200,headers:N})}let w=new Headers({"Content-Type":"text/html",...C(),...k.cache?{}:{"Cache-Control":"private, no-store"}});for(let P of B??[])w.append("Set-Cookie",P);for(let[P,D]of Object.entries(z??{}))w.set(P,D);if(w.set("Vary",C(w.get("Vary")).Vary),A&&!d){let P=xe(a);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",ae(a)?"true":"false"),w.set("X-STX-Layout",P.layout),w.set("X-STX-Layout-Group",P.group),new Response(re(a,s.routerContainer||"main"),{status:I??u.status??200,headers:w})}return new Response(a,{status:I??u.status??200,headers:w})}catch(a){if(console.error(`[stx] Hydration error for ${o}:`,a),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${L.port}`),console.log(`[stx] Serving ${s.routes.length} routes (${b.size} pre-loaded)`),{port:L.port,stop:()=>{l.invalidate(),L.stop()},invalidate:(n)=>l.invalidate(n)}}
|
|
3
3
|
export{At,al};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$t,S}from"./chunk-jwpcck1b.js";import m from"fs";import e from"path";async function an(r,o,i){if(r.__stx_runtime_config)return;let n=$t();if(n||i){r.__stx_runtime_config=n??S(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-
|
|
2
|
+
import{$t,S}from"./chunk-jwpcck1b.js";import m from"fs";import e from"path";async function an(r,o,i){if(r.__stx_runtime_config)return;let n=$t();if(n||i){r.__stx_runtime_config=n??S(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-hdat2brj.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=S(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function vs(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
|
|
3
3
|
declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
|
|
4
4
|
`),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
|
|
5
5
|
declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{an,vs}from"./chunk-
|
|
2
|
+
import{an,vs}from"./chunk-gm7ewgf4.js";import"./chunk-jwpcck1b.js";export{vs as generateRuntimeConfigTypes,an as prepareRuntimeConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{A,Cc,o,T,Bu,Fu}from"./chunk-n7n9zxmh.js";import"./chunk-0xztxj98.js";import"./chunk-73h7qjgq.js";import"./chunk-yx37nrgr.js";import"./chunk-gm7ewgf4.js";import"./chunk-jwpcck1b.js";import"./chunk-g8k5rsqq.js";import"./chunk-zqzv5jy2.js";import"./chunk-5xj1df83.js";import"./chunk-axydabse.js";import"./chunk-afhkvj3k.js";import"./chunk-7417f610.js";import"./chunk-dqr5n49p.js";export{T as config,A as defaultConfig,Bu as defineStxConfig,o as loadStxConfig,Cc as resolveStxDirectories,Fu as validateConfig};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var jr=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function ki(e,t={}){let r=performance.now(),n={target:t.target||"universal",format:t.format||"zig",optimize:t.optimize??!0,treeShake:t.treeShake??!0,hotReload:t.hotReload??!1,debug:t.debug??!1,sourceMaps:t.sourceMaps??!1,bundle:t.bundle??!0,minify:t.minify??!1,components:t.components||jr},i=typeof e==="string"?w(e):e,o=I(i.tree,n),s=L(o),a=n.treeShake?O(o,s):o,l=new Map;if(n.target==="universal"){let c=["macos","windows","linux","ios","android"];for(let g of c){let q=u(a,{...n,target:g});l.set(g,q)}}else{let c=u(a,n);l.set(n.target,c)}let p=H(a,n,l),S=_(i,a,n),k={compilationTime:performance.now()-r,totalComponents:f(i.tree),nativeComponents:d(a),webComponents:f(i.tree)-d(a),bundleSize:p.length,treeShakenSize:n.treeShake?W(o,a):p.length,warnings:[],errors:[]},m;if(n.sourceMaps)m=B(i,a);return{code:p,platformCode:l,dependencies:s,manifest:S,sourceMaps:m,stats:k}}function w(e){let t={type:"fragment",children:[]},r=e.match(/<body[^>]*>([\s\S]*?)<\/body>/i),n=r?r[1]:e;return b(n,t),{id:T(),hash:x(e),tree:t,scripts:U(e),styles:Z(e),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:e.includes("{{"),hasEventHandlers:e.includes("onclick")||e.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:e.length}}}function b(e,t){let r=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,n;while((n=r.exec(e))!==null){let[,i,o,s]=n,a=i.startsWith("@craft-"),l={type:a?"component":"element",tag:a?i.slice(1):i,props:z(o),children:[],componentName:a?i.slice(1):void 0};if(s){let p=s.replace(/<[^>]+>/g,"").trim();if(p)l.children=l.children??[],l.children.push({type:"text",text:p});b(s,l)}t.children=t.children??[],t.children.push(l)}}function z(e){let t={},r=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,n;while((n=r.exec(e))!==null){let[,i,o]=n;t[i]=o??!0}return t}function I(e,t){return h(e,t)}function h(e,t){let r=e.componentName?t.components?.get(e.componentName):void 0,n="craft.View";if(r)n=r.zigType;else if(e.type==="text")n="craft.Text";else if(e.tag)n=R(e.tag);let i={};if(e.props)for(let[l,p]of Object.entries(e.props))i[l]=M(p);let o=[];if(e.children)for(let l of e.children)o.push(h(l,t));let s=new Map;if(e.props){for(let[l,p]of Object.entries(e.props))if(l.startsWith("on")&&typeof p==="string")s.set(l.slice(2).toLowerCase(),p)}let a=V(e);return{type:A(e,r),zigType:n,props:i,children:o,events:s,styles:a,id:e.hydrationKey,key:e.props?.key}}function R(e){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[e.toLowerCase()]||"craft.View"}function M(e){if(typeof e==="string"){if(e.startsWith("{{")&&e.endsWith("}}"))return{type:"binding",path:e.slice(2,-2).trim()};if(e.includes("(")&&e.includes(")"))return{type:"callback",handler:e};return{type:"literal",value:e}}if(typeof e==="number"||typeof e==="boolean")return{type:"literal",value:e};return{type:"literal",value:String(e)}}function A(e,t){if(t){let n=t.name.toLowerCase();if(n.includes("button"))return"button";if(n.includes("input")||n.includes("text"))return"input";if(n.includes("image")||n.includes("avatar"))return"image";if(n.includes("list")||n.includes("table"))return"list";if(n.includes("scroll"))return"scroll";return"custom"}if(e.type==="text")return"text";let r=e.tag?.toLowerCase();if(r==="button")return"button";if(r==="input"||r==="textarea")return"input";if(r==="img")return"image";if(r==="ul"||r==="ol")return"list";return"view"}function V(e){let t=e.props?.style,r={},n={};if(t){let i=t.split(";").filter(Boolean);for(let o of i){let[s,a]=o.split(":").map((l)=>l.trim());if(!s||!a)continue;switch(s){case"display":r.display=a;break;case"flex-direction":r.flexDirection=a;break;case"justify-content":r.justifyContent=j(a);break;case"align-items":r.alignItems=D(a);break;case"gap":r.gap=Number.parseInt(a,10);break;case"padding":r.padding=Number.parseInt(a,10);break;case"margin":r.margin=Number.parseInt(a,10);break;case"width":r.width=a==="auto"?"auto":Number.parseInt(a,10);break;case"height":r.height=a==="auto"?"auto":Number.parseInt(a,10);break;case"background-color":case"background":n.backgroundColor=a;break;case"border-color":n.borderColor=a;break;case"border-width":n.borderWidth=Number.parseInt(a,10);break;case"border-radius":n.borderRadius=Number.parseInt(a,10);break;case"opacity":n.opacity=Number.parseFloat(a);break}}}return{layout:r,appearance:n}}function j(e){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[e]||"start"}function D(e){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[e]||"start"}function L(e){let t=[],r=new Set;function n(i,o){let s=i.id||T();if(r.has(s))return;r.add(s);let a={id:s,type:"component",path:i.zigType,dependencies:o?[o]:[],size:C(i),isStatic:P(i)};t.push(a);for(let l of i.children)n(l,s)}return n(e),t}function C(e){let t=100;return t+=Object.keys(e.props).length*20,t+=e.events.size*50,t}function P(e){for(let t of Object.values(e.props))if(t.type!=="literal")return!1;return e.events.size===0}function O(e,t){return e}function W(e,t){let r=0;function n(i){r+=C(i);for(let o of i.children)n(o)}return n(t),r}function u(e,t){switch(t.format){case"zig":return y(e,t);case"typescript":return E(e,t);case"json":return JSON.stringify(e,null,t.minify?0:2);default:return y(e,t)}}function y(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('const std = @import("std");'),r.push('const craft = @import("craft");'),r.push(""),r.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),r.push(" return try build(allocator);"),r.push("}"),r.push(""),N(e,r,0),r.join(`
|
|
2
|
+
var jr=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function Co(e,t={}){let r=performance.now(),n={target:t.target||"universal",format:t.format||"zig",optimize:t.optimize??!0,treeShake:t.treeShake??!0,hotReload:t.hotReload??!1,debug:t.debug??!1,sourceMaps:t.sourceMaps??!1,bundle:t.bundle??!0,minify:t.minify??!1,components:t.components||jr},i=typeof e==="string"?w(e):e,o=I(i.tree,n),s=L(o),a=n.treeShake?O(o,s):o,l=new Map;if(n.target==="universal"){let c=["macos","windows","linux","ios","android"];for(let g of c){let q=u(a,{...n,target:g});l.set(g,q)}}else{let c=u(a,n);l.set(n.target,c)}let p=H(a,n,l),S=_(i,a,n),k={compilationTime:performance.now()-r,totalComponents:f(i.tree),nativeComponents:d(a),webComponents:f(i.tree)-d(a),bundleSize:p.length,treeShakenSize:n.treeShake?W(o,a):p.length,warnings:[],errors:[]},m;if(n.sourceMaps)m=B(i,a);return{code:p,platformCode:l,dependencies:s,manifest:S,sourceMaps:m,stats:k}}function w(e){let t={type:"fragment",children:[]},r=e.match(/<body[^>]*>([\s\S]*?)<\/body>/i),n=r?r[1]:e;return b(n,t),{id:T(),hash:x(e),tree:t,scripts:U(e),styles:Z(e),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:e.includes("{{"),hasEventHandlers:e.includes("onclick")||e.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:e.length}}}function b(e,t){let r=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,n;while((n=r.exec(e))!==null){let[,i,o,s]=n,a=i.startsWith("@craft-"),l={type:a?"component":"element",tag:a?i.slice(1):i,props:z(o),children:[],componentName:a?i.slice(1):void 0};if(s){let p=s.replace(/<[^>]+>/g,"").trim();if(p)l.children=l.children??[],l.children.push({type:"text",text:p});b(s,l)}t.children=t.children??[],t.children.push(l)}}function z(e){let t={},r=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,n;while((n=r.exec(e))!==null){let[,i,o]=n;t[i]=o??!0}return t}function I(e,t){return h(e,t)}function h(e,t){let r=e.componentName?t.components?.get(e.componentName):void 0,n="craft.View";if(r)n=r.zigType;else if(e.type==="text")n="craft.Text";else if(e.tag)n=R(e.tag);let i={};if(e.props)for(let[l,p]of Object.entries(e.props))i[l]=M(p);let o=[];if(e.children)for(let l of e.children)o.push(h(l,t));let s=new Map;if(e.props){for(let[l,p]of Object.entries(e.props))if(l.startsWith("on")&&typeof p==="string")s.set(l.slice(2).toLowerCase(),p)}let a=V(e);return{type:A(e,r),zigType:n,props:i,children:o,events:s,styles:a,id:e.hydrationKey,key:e.props?.key}}function R(e){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[e.toLowerCase()]||"craft.View"}function M(e){if(typeof e==="string"){if(e.startsWith("{{")&&e.endsWith("}}"))return{type:"binding",path:e.slice(2,-2).trim()};if(e.includes("(")&&e.includes(")"))return{type:"callback",handler:e};return{type:"literal",value:e}}if(typeof e==="number"||typeof e==="boolean")return{type:"literal",value:e};return{type:"literal",value:String(e)}}function A(e,t){if(t){let n=t.name.toLowerCase();if(n.includes("button"))return"button";if(n.includes("input")||n.includes("text"))return"input";if(n.includes("image")||n.includes("avatar"))return"image";if(n.includes("list")||n.includes("table"))return"list";if(n.includes("scroll"))return"scroll";return"custom"}if(e.type==="text")return"text";let r=e.tag?.toLowerCase();if(r==="button")return"button";if(r==="input"||r==="textarea")return"input";if(r==="img")return"image";if(r==="ul"||r==="ol")return"list";return"view"}function V(e){let t=e.props?.style,r={},n={};if(t){let i=t.split(";").filter(Boolean);for(let o of i){let[s,a]=o.split(":").map((l)=>l.trim());if(!s||!a)continue;switch(s){case"display":r.display=a;break;case"flex-direction":r.flexDirection=a;break;case"justify-content":r.justifyContent=j(a);break;case"align-items":r.alignItems=D(a);break;case"gap":r.gap=Number.parseInt(a,10);break;case"padding":r.padding=Number.parseInt(a,10);break;case"margin":r.margin=Number.parseInt(a,10);break;case"width":r.width=a==="auto"?"auto":Number.parseInt(a,10);break;case"height":r.height=a==="auto"?"auto":Number.parseInt(a,10);break;case"background-color":case"background":n.backgroundColor=a;break;case"border-color":n.borderColor=a;break;case"border-width":n.borderWidth=Number.parseInt(a,10);break;case"border-radius":n.borderRadius=Number.parseInt(a,10);break;case"opacity":n.opacity=Number.parseFloat(a);break}}}return{layout:r,appearance:n}}function j(e){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[e]||"start"}function D(e){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[e]||"start"}function L(e){let t=[],r=new Set;function n(i,o){let s=i.id||T();if(r.has(s))return;r.add(s);let a={id:s,type:"component",path:i.zigType,dependencies:o?[o]:[],size:C(i),isStatic:P(i)};t.push(a);for(let l of i.children)n(l,s)}return n(e),t}function C(e){let t=100;return t+=Object.keys(e.props).length*20,t+=e.events.size*50,t}function P(e){for(let t of Object.values(e.props))if(t.type!=="literal")return!1;return e.events.size===0}function O(e,t){return e}function W(e,t){let r=0;function n(i){r+=C(i);for(let o of i.children)n(o)}return n(t),r}function u(e,t){switch(t.format){case"zig":return y(e,t);case"typescript":return E(e,t);case"json":return JSON.stringify(e,null,t.minify?0:2);default:return y(e,t)}}function y(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('const std = @import("std");'),r.push('const craft = @import("craft");'),r.push(""),r.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),r.push(" return try build(allocator);"),r.push("}"),r.push(""),N(e,r,0),r.join(`
|
|
3
3
|
`)}function N(e,t,r){let n=" ".repeat(r);if(r===0)t.push("fn build(allocator: std.mem.Allocator) !craft.Element {");let i=`node_${r}`;t.push(`${n} var ${i} = try ${e.zigType}.init(allocator);`);for(let[o,s]of Object.entries(e.props))if(s.type==="literal"){let a=typeof s.value==="string"?`"${s.value}"`:String(s.value);t.push(`${n} ${i}.set${J(o)}(${a});`)}for(let o=0;o<e.children.length;o++){let s=e.children[o];if(s.type==="text"){let a=s.props.text?.type==="literal"?String(s.props.text.value):"";t.push(`${n} try ${i}.addChild(try craft.Text.init(allocator, "${a}"));`)}else N(s,t,r+1),t.push(`${n} try ${i}.addChild(node_${r+1});`)}if(r===0)t.push(` return ${i}.element();`),t.push("}")}function E(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('import { Craft } from "@stacksjs/craft";'),r.push(""),r.push("export function render(): Craft.Element {"),r.push(" return "+v(e,1)+";"),r.push("}"),r.join(`
|
|
4
4
|
`)}function v(e,t){let r=" ".repeat(t),n=[];for(let[a,l]of Object.entries(e.props))if(l.type==="literal"){let p=typeof l.value==="string"?`"${l.value}"`:String(l.value);n.push(`${a}: ${p}`)}let i=n.length>0?`{ ${n.join(", ")} }`:"{}",o=e.children.map((a)=>a.type==="text"?`"${a.props.text?.type==="literal"?a.props.text.value:""}"`:v(a,t+1)),s=o.length>0?`,
|
|
5
5
|
${r} [${o.join(`,
|
|
6
6
|
${r} `)}]`:"";return`Craft.create("${e.zigType}", ${i}${s})`}function H(e,t,r){if(t.target==="universal"){let n=[];n.push("// Universal entry point"),n.push("");for(let[i,o]of r)n.push(`// --- ${i.toUpperCase()} ---`),n.push(`#if ${i.toUpperCase()}`),n.push(o),n.push("#endif"),n.push("");return n.join(`
|
|
7
|
-
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function
|
|
8
|
-
export{jr,
|
|
7
|
+
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function $o(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Co,createHotReloadServer:$o,NATIVE_COMPONENTS:jr},gu=K;
|
|
8
|
+
export{jr,Co,$o,gu};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{mo,xa,Ht,gl,Sa,ka,Ca,ml}from"./chunk-pkpmyr0x.js";export{Ht as Validator,xa as defineForm,Sa as processErrorDirective,ka as processErrorsDirective,ml as processFormValidationDirectives,Ca as processHasErrorsDirective,mo as useForm,gl as v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{q,ds,ps,gs,n}from"./chunk-n7n9zxmh.js";import"./chunk-0xztxj98.js";import"./chunk-73h7qjgq.js";import"./chunk-yx37nrgr.js";import"./chunk-gm7ewgf4.js";import"./chunk-jwpcck1b.js";import"./chunk-g8k5rsqq.js";import"./chunk-zqzv5jy2.js";import"./chunk-5xj1df83.js";import"./chunk-axydabse.js";import"./chunk-afhkvj3k.js";import"./chunk-7417f610.js";import"./chunk-dqr5n49p.js";export{q as injectRouterScript,n as processDirectives,ds as processJsonDirective,ps as processOnceDirective,gs as validateClientScript};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Me,Xa,ku,Cu,$u,Eu,Ga,Ja,Tu,_u,zo,Ru,Zt,Qt,On}from"./chunk-n7n9zxmh.js";import"./chunk-0xztxj98.js";import"./chunk-73h7qjgq.js";import"./chunk-yx37nrgr.js";import"./chunk-gm7ewgf4.js";import"./chunk-jwpcck1b.js";import"./chunk-g8k5rsqq.js";import"./chunk-zqzv5jy2.js";import"./chunk-5xj1df83.js";import"./chunk-axydabse.js";import"./chunk-afhkvj3k.js";import"./chunk-7417f610.js";import"./chunk-dqr5n49p.js";export{Eu as __setSignalsGeneratorsForTest,Me as cacheEngineFingerprint,Qt as cacheTemplate,Zt as checkCache,Ru as clearDevCaches,Ja as getCachedRouterScript,Ga as getCachedSignalsRuntime,Tu as getServeClientAsset,zo as getServeModuleBundle,On as hashFilePath,Cu as invalidateFileCache,$u as invalidateFileCacheByDir,ku as readFileCached,_u as registerServeModuleBundle,Xa as templateCache};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ul,Wl}from"./chunk-z72wwstp.js";import"./chunk-vnq2c0tg.js";import"./chunk-5vgdbqbz.js";import"./chunk-n7n9zxmh.js";import"./chunk-0xztxj98.js";import"./chunk-73h7qjgq.js";import"./chunk-yx37nrgr.js";import"./chunk-gm7ewgf4.js";import"./chunk-jwpcck1b.js";import"./chunk-g8k5rsqq.js";import"./chunk-zqzv5jy2.js";import"./chunk-5xj1df83.js";import"./chunk-axydabse.js";import"./chunk-afhkvj3k.js";import"./chunk-7417f610.js";import"./chunk-dqr5n49p.js";export{Wl as clearStoreCache,Ul as getStoreScript};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{oe,pt,Fr}from"./chunk-9ndzk9r4.js";function An(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?oe(a,e):null,h=u?pt(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
|
|
3
3
|
* Service Worker - Auto-generated by stx
|
|
4
4
|
* Cache Version: ${i}
|
|
5
5
|
*
|
|
@@ -825,5 +825,5 @@ self.addEventListener('message', (event) => {
|
|
|
825
825
|
event.waitUntil(registerFormSync(event.data.payload));
|
|
826
826
|
}
|
|
827
827
|
});
|
|
828
|
-
`}function Ie(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function
|
|
829
|
-
export{An,Ie,
|
|
828
|
+
`}function Ie(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function Do(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function Oa(e,a){if(!e.pwa?.enabled)return"";if(Do(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-538h1sfc.js");return t(e,a)}return An(e,a)}
|
|
829
|
+
export{An,Ie,Do,Oa};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{il}from"./chunk-m5298269.js";import"./chunk-n7n9zxmh.js";import"./chunk-0xztxj98.js";import"./chunk-73h7qjgq.js";import"./chunk-yx37nrgr.js";import"./chunk-gm7ewgf4.js";import"./chunk-jwpcck1b.js";import"./chunk-g8k5rsqq.js";import"./chunk-zqzv5jy2.js";import"./chunk-5xj1df83.js";import"./chunk-axydabse.js";import"./chunk-afhkvj3k.js";import"./chunk-7417f610.js";import"./chunk-dqr5n49p.js";export{il as buildApp};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{
|
|
2
|
+
import{o}from"./chunk-n7n9zxmh.js";import{Sr}from"./chunk-rdq113p4.js";import p from"path";async function il(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if(Sr(u),!e.ssr&&Object.keys(u).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let n,l;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");n=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-nkzn1hqq.js");l=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
|
|
3
|
+
export{il};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{fo,go,aa,ca,la,ua,pl}from"./chunk-0tchj3ct.js";export{fo as createVirtualList,pl as default,aa as generateVirtualListCSS,la as processInfiniteListDirectives,ua as processVirtualGridDirectives,go as processVirtualListDirectives,ca as useVirtualList};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{tn,nc,es}from"./chunk-n7n9zxmh.js";import"./chunk-0xztxj98.js";import"./chunk-73h7qjgq.js";import"./chunk-yx37nrgr.js";import"./chunk-gm7ewgf4.js";import"./chunk-jwpcck1b.js";import"./chunk-g8k5rsqq.js";import"./chunk-zqzv5jy2.js";import{ve}from"./chunk-5xj1df83.js";import"./chunk-axydabse.js";import"./chunk-afhkvj3k.js";import"./chunk-7417f610.js";import"./chunk-dqr5n49p.js";export{ve as freeIdentifiers,es as processComponents,nc as processESImports,tn as rendersAsElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Pe,Ut,ql}from"./chunk-
|
|
2
|
+
import{Pe,Ut,ql}from"./chunk-p7m673vn.js";import{z,En,Wt,Or,Mr,Tn,Kl,Xl,Gl,qt,Kt,Nr,_n,Jl}from"./chunk-149r1q6c.js";import"./chunk-afhkvj3k.js";export{Or as batch,ql as default,En as derived,Wt as effect,Pe as generateSignalsRuntime,Ut as generateSignalsRuntimeDev,Kt as isDerived,qt as isSignal,Tn as onDestroy,Mr as onMount,_n as peek,Gl as pendingLifecycleCounts,Xl as runDestroyCallbacks,Kl as runMountCallbacks,z as state,Nr as untrack,Jl as useOptimistic};
|