@stacksjs/stx 0.2.681 → 0.2.682
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-zcht5y0v.js → chunk-0527ytat.js} +1 -1
- package/dist/chunk-0gmwqhs0.js +2 -0
- package/dist/{chunk-gfa0dxjd.js → chunk-18jfkg1q.js} +1 -1
- package/dist/{chunk-wqn17d09.js → chunk-1gw26g89.js} +2 -2
- package/dist/{chunk-3cr308sm.js → chunk-1t6dg4s8.js} +1 -1
- package/dist/chunk-34ps2w1z.js +2 -0
- package/dist/chunk-3tkag58v.js +2 -0
- package/dist/{chunk-ekztn3f5.js → chunk-42qtadka.js} +2 -2
- package/dist/{chunk-x65g450d.js → chunk-47fwr1z7.js} +1 -1
- package/dist/{chunk-6xtzsw17.js → chunk-4g9wrxkm.js} +1 -1
- package/dist/{chunk-0kk86z2m.js → chunk-4m5g3f2b.js} +1 -1
- package/dist/{chunk-793qv470.js → chunk-4z4sqc8q.js} +3 -3
- package/dist/{chunk-4nst5nj4.js → chunk-5nfb4gxk.js} +60 -60
- package/dist/{chunk-2efy5ftv.js → chunk-5nrqc6v4.js} +5 -5
- package/dist/{chunk-d2z2kvyj.js → chunk-5rdfcpfe.js} +1 -1
- package/dist/{chunk-6aahems6.js → chunk-65jb75vz.js} +1 -1
- package/dist/{chunk-9nzx4fv4.js → chunk-7yree929.js} +1 -1
- package/dist/{chunk-ar4yk1rk.js → chunk-8nk56cs2.js} +1 -1
- package/dist/{chunk-ab5fc7cj.js → chunk-96hkch4q.js} +1 -1
- package/dist/chunk-9qx6ansy.js +2 -0
- package/dist/chunk-b375wt1n.js +2 -0
- package/dist/{chunk-esz22r0a.js → chunk-b5vqp3b2.js} +1 -1
- package/dist/{chunk-1x0jwz8m.js → chunk-bmqker64.js} +2 -2
- package/dist/{chunk-j3qcxtvc.js → chunk-bmv6spcd.js} +4 -4
- package/dist/{chunk-a358zpqd.js → chunk-brcj3953.js} +1 -1
- package/dist/{chunk-5yc7btc2.js → chunk-bv43s0gx.js} +1 -1
- package/dist/{chunk-5ha6gkfr.js → chunk-e97xj3rf.js} +4 -4
- package/dist/{chunk-9fnt6q57.js → chunk-ev1tnd36.js} +1 -1
- package/dist/{chunk-3h7k7cnr.js → chunk-f1hxrs7b.js} +1 -1
- package/dist/chunk-f80aqbwm.js +2 -0
- package/dist/chunk-fbbp8j97.js +2 -0
- package/dist/{chunk-y5ase5av.js → chunk-fqts9wvd.js} +2 -2
- package/dist/chunk-fy1waxy0.js +2 -0
- package/dist/{chunk-0w1132a5.js → chunk-g2v6c7kf.js} +1 -1
- package/dist/{chunk-r8xzqz8z.js → chunk-g83qeh2x.js} +3 -3
- package/dist/chunk-g9a56wwk.js +2 -0
- package/dist/{chunk-0c6ag7mk.js → chunk-gtktv6nn.js} +2 -2
- package/dist/{chunk-ms9v5tc9.js → chunk-h3bdqqzy.js} +1 -1
- package/dist/chunk-h5r4c9v5.js +2 -0
- package/dist/{chunk-gvpwc9hr.js → chunk-hg7ys8rn.js} +1 -1
- package/dist/{chunk-yzf8g9h1.js → chunk-hwaqwrc2.js} +2 -2
- package/dist/chunk-jecmxby7.js +2 -0
- package/dist/{chunk-a6h6ansh.js → chunk-ka3xmbrd.js} +5 -5
- package/dist/{chunk-pfvjqvzd.js → chunk-n8jq9yjy.js} +6 -6
- package/dist/{chunk-19kc8xnw.js → chunk-np3zdjhr.js} +1 -1
- package/dist/{chunk-g2h12kza.js → chunk-pmma4f1x.js} +2 -2
- package/dist/{chunk-aezxgrd2.js → chunk-pqg3ghvh.js} +1 -1
- package/dist/chunk-q7mpearc.js +2 -0
- package/dist/{chunk-5s9pjs20.js → chunk-qb806pks.js} +1 -1
- package/dist/chunk-r8hszntk.js +2 -0
- package/dist/{chunk-5cvdc2a0.js → chunk-remsyfdx.js} +1 -1
- package/dist/chunk-rk8kmshp.js +2 -0
- package/dist/{chunk-8fetb3cr.js → chunk-rs67af2x.js} +27 -27
- package/dist/{chunk-hy4j4r8a.js → chunk-s0wa7zjr.js} +1 -1
- package/dist/{chunk-km92eh3c.js → chunk-se4n8tth.js} +1 -1
- package/dist/chunk-tdwqwxhf.js +25 -0
- package/dist/chunk-th45zgbz.js +54 -0
- package/dist/{chunk-haqbkrdk.js → chunk-veh25cv5.js} +1 -1
- package/dist/{chunk-q7v05zcy.js → chunk-w1wzydvp.js} +1 -1
- package/dist/{chunk-7afqwh0m.js → chunk-wfg5379k.js} +2 -2
- package/dist/{chunk-144wmtba.js → chunk-xfdfk4g4.js} +1 -1
- package/dist/{chunk-rxmmrafq.js → chunk-yhfm939b.js} +1 -1
- package/dist/{chunk-avthzrdg.js → chunk-ypwetty7.js} +2 -2
- package/dist/{chunk-a2fa9aj4.js → chunk-z5av310q.js} +7 -7
- package/dist/chunk-zr16mga0.js +2 -0
- package/dist/cli.js +8 -8
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +2 -2
- package/dist/utils.js +13 -1
- package/package.json +5 -5
- package/dist/chunk-1h995e54.js +0 -2
- package/dist/chunk-4vxe0605.js +0 -54
- package/dist/chunk-540jj8a7.js +0 -2
- package/dist/chunk-5b1q41vy.js +0 -2
- package/dist/chunk-877tm3sp.js +0 -2
- package/dist/chunk-8q3j4jxr.js +0 -2
- package/dist/chunk-9cmmdbzc.js +0 -25
- package/dist/chunk-d3qxmety.js +0 -2
- package/dist/chunk-ehe5f2yn.js +0 -2
- package/dist/chunk-gjaqez01.js +0 -2
- package/dist/chunk-gr1331xc.js +0 -2
- package/dist/chunk-hsgbsj0g.js +0 -2
- package/dist/chunk-j7rzh56k.js +0 -2
- package/dist/chunk-me4f7ekt.js +0 -2
- package/dist/chunk-mndxjbmy.js +0 -2
- package/dist/chunk-ythdsen4.js +0 -2
- package/dist/chunk-zc6bkctv.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ze}from"./chunk-gymmbbzc.js";import{ft,Dn}from"./chunk-
|
|
2
|
+
import{Ze}from"./chunk-gymmbbzc.js";import{ft,Dn}from"./chunk-w1wzydvp.js";import{Oe,un,Qa,ec}from"./chunk-5nfb4gxk.js";import{mr,hr,yr,vr,Se}from"./chunk-w28wc7mv.js";import{A}from"./chunk-t6m5d64b.js";import{Vo}from"./chunk-remsyfdx.js";import{h}from"./chunk-bmqker64.js";import{o}from"./chunk-rs67af2x.js";import{N,i}from"./chunk-42qtadka.js";import{_a}from"./chunk-912r15hr.js";import{Ve,_e,Ii,Oi,Cn}from"./chunk-1gw26g89.js";import{en,Zs}from"./chunk-qb806pks.js";import{En}from"./chunk-pfn70zdr.js";import{Gt,Fn,zn}from"./chunk-bpf3xxng.js";import{q}from"./chunk-e97xj3rf.js";import m from"fs";import c from"path";import{createHash as Q}from"crypto";function W(n){return Q("sha256").update(n).digest("hex").slice(0,8)}function J(n=!1){let l=n?Dn():ft(),a=W(l);return{content:l,filename:`runtime.${a}.js`,hash:a}}function U(){let n=Ze(),l=W(n);return{content:n,filename:`router.${l}.js`,hash:l}}import V from"path";import{createHash as ee}from"crypto";function te(n={}){let l=new Set;return{context:new Proxy(n,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function X(n,l,a={}){let r=V.resolve(n),e=await Bun.file(r).text(),S=ee("sha256").update(e).digest("hex").slice(0,16);Qa();let _={};try{_=await i(a.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,f;while((f=d.exec(e))!==null){let R=f[1];if(/\bserver\b/.test(R))y.push(f[2])}let u=new Set(y.flatMap((R)=>Oe(R))),{context:D}=te({__filename:r,__dirname:V.dirname(r),__stx_serverDeclared:u}),w=new Set,j={...N,..._,...a,buildMode:"compile",strict:!1},b=await o(e,D,r,j,w),C=Ve(b),P=ec();return{route:l,sourceFile:n,html:b,fragment:C,placeholders:P,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(w),contentHash:S,status:un(e),streamTemplates:D.__streamTemplates}}var re=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(n,l){let a=0,r=0;if(!m.existsSync(n))return{copied:a,bytes:r};m.mkdirSync(l,{recursive:!0});function e(S,_){let y=m.readdirSync(S,{withFileTypes:!0});for(let d of y){if(re.has(d.name))continue;let f=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(f,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(f,u),a++,r+=m.statSync(u).size}}}return e(n,l),{copied:a,bytes:r}}async function zu(n={}){let l=Date.now(),a=c.resolve(n.root||process.cwd()),r=c.resolve(a,n.outputDir||".output");console.log("[stx build] Starting production build...");let e=await i(a),S=c.resolve(a,n.componentsDir??e.componentsDir??"components"),_=c.resolve(a,n.partialsDir??e.partialsDir??"partials"),y=c.resolve(a,n.layoutsDir??e.layoutsDir??"layouts"),d=n.publicDir??e.publicDir??"public",f=Se(e.app?.head,{known:vr,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",w=n.routeRules??e.routeRules??{},j=En(w),b=n.serverApi??e.serverApi,C=typeof b==="object"?b:{};if(b)en(a,C);if(e.runtimeConfig)A(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let P=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of P)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=q(a,{pagesDirs:e._layerPageDirs}),Y=["components","layouts","partials"],B=R.filter((s)=>!Y.some((g)=>s.pattern.startsWith(`/${g}/`)||s.pattern===`/${g}`));console.log(`[stx build] Found ${B.length} page routes (${R.length-B.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=J(n.debug),x=U();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",x.filename),x.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${x.filename} (${(x.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let M=[],k=[];for(let s of B){let g=j(s.pattern),O=g.rendering==="prerender";if(O&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await X(s.filePath,s.pattern,{configDir:a,componentsDir:S,partialsDir:_,layoutsDir:y,debug:n.debug});if(M.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,x.filename),t.html=yr(t.html,f,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=mr(t.html,u);if(f.htmlAttrs)t.html=hr(t.html,f.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let I=p[1];t.html=t.html.replace(" "+I,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${I}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await h(t.html),O){let p=await Cn(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=_e(t.html,D);let L=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),z=c.join("server","pages",`${L}.compiled.json`),G=c.join("server","fragments",`${L}.html`);await Bun.write(c.join(r,z),JSON.stringify(t,null,2)),await Bun.write(c.join(r,G),t.fragment),k.push({pattern:s.pattern,compiledPath:z,fragmentPath:G,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:O}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(g).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let E=c.resolve(a,d);if(m.existsSync(E)){let{copied:s,bytes:g}=Z(E,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(g/1024).toFixed(1)}KB) from ${d}/`)}let H=zn(a);if(H){let{copied:s,bytes:g}=Z(H,c.join(r,"public",Fn));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(g/1024).toFixed(1)}KB) from ${Gt}/`)}let F={runtime:v.filename,router:x.filename},T=Ii(k,F,r);if(T.routeRules=w,T.routerContainer=D,b)T.apiRoutes=await Zs(a,r,C);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Vo(a,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(_a(e._layerGraph),null,2));Oi(T,r);let K=Date.now()-l;return console.log(`
|
|
3
3
|
[stx build] Done in ${K}ms \u2014 ${M.length} pages compiled`),{pageCount:M.length,assets:F,outputDir:r,duration:K}}
|
|
4
4
|
export{zu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Iu}from"./chunk-4z4sqc8q.js";import"./chunk-rs67af2x.js";import"./chunk-bmqker64.js";import"./chunk-9bgb9n12.js";import"./chunk-tdwqwxhf.js";import"./chunk-th45zgbz.js";import"./chunk-brcj3953.js";import"./chunk-2a1eeywj.js";import"./chunk-ypwetty7.js";import"./chunk-e97xj3rf.js";import"./chunk-zt5hp5w5.js";import"./chunk-yhfm939b.js";import"./chunk-42qtadka.js";import"./chunk-hg7ys8rn.js";import"./chunk-tenbwcts.js";import"./chunk-912r15hr.js";import"./chunk-nbjyed3q.js";import"./chunk-gymmbbzc.js";import"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{Iu as startInteractive};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Pl,vp,wp,xp,Sp,Il,Ol,kp,_p,ho,Cp,Zn,Qn,Xr}from"./chunk-
|
|
2
|
+
import{Pl,vp,wp,xp,Sp,Il,Ol,kp,_p,ho,Cp,Zn,Qn,Xr}from"./chunk-yhfm939b.js";import{Qe}from"./chunk-yn9kvsk1.js";import"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{Sp as __setSignalsGeneratorsForTest,Qe as cacheEngineFingerprint,Qn as cacheTemplate,Zn as checkCache,Cp as clearDevCaches,Ol as getCachedRouterScript,Il as getCachedSignalsRuntime,kp as getServeClientAsset,ho as getServeModuleBundle,Xr as hashFilePath,wp as invalidateFileCache,xp as invalidateFileCacheByDir,vp as readFileCached,_p as registerServeModuleBundle,Pl as templateCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{vn}from"./chunk-w28wc7mv.js";import{F,z,At,Pt,dr,g,tc,zo,V,_}from"./chunk-
|
|
2
|
+
import{vn}from"./chunk-w28wc7mv.js";import{F,z,At,Pt,dr,g,tc,zo,V,_}from"./chunk-5nfb4gxk.js";import{Kt}from"./chunk-h3bdqqzy.js";import{W}from"./chunk-2ajbhefk.js";var H=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function B(e){let n=[],t=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=t.exec(e))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(e,n){return n.some((t)=>e>=t.start&&e<t.end)}function q(e){let n=(e||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let t={},r=n,s=r.match(/^[a-z][\w-]*/i);if(s)t.tag=s[0].toLowerCase(),r=r.slice(s[0].length);while(r.length>0){let o=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(t.attr=o[1],o[3]!==void 0&&o[3]!=="")t.attrValue=o[3];r=r.slice(o[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){t.id=a[1],r=r.slice(a[0].length);continue}let i=r.match(/^\.([\w-]+)/);if(i){t.className=i[1],r=r.slice(i[0].length);continue}return null}if(!t.tag&&!t.attr&&!t.id&&!t.className)return null;return t}function U(e,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(e))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(e))return!1}if(n.className){let t=e.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!t)return!1;if(!t[2].split(/\s+/).includes(n.className))return!1}return!0}function T(e,n="main"){let t=q(n);if(!t)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,s=B(e),o;while((o=r.exec(e))!==null){if(P(o.index,s))continue;let a=o[1].toLowerCase(),i=o[2]||"";if(i.trimEnd().endsWith("/")||H.has(a))continue;if(t.tag&&t.tag!==a)continue;if(!U(i,t))continue;let c=o[0],u=o.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=u;let f=1,m;while((m=l.exec(e))!==null){if(P(m.index,s))continue;let x=m[1]==="/";if(!x&&(m[2]||"").trimEnd().endsWith("/"))continue;if(f+=x?-1:1,f===0)return{openTag:c,openIndex:o.index,start:u,end:m.index,tagName:a}}return null}return null}var ut="private, no-store";function Ri(e){return e.replace(/&#(\d+);/g,(n,t)=>M(Number(t),n)).replace(/&#x([0-9a-f]+);/gi,(n,t)=>M(Number.parseInt(t,16),n)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function M(e,n){if(!Number.isInteger(e)||e<0||e>1114111)return n;try{return String.fromCodePoint(e)}catch{return n}}function ke(e){return e.headers.get("X-STX-Router")==="true"}function G(e,n){if(!e)return n;return e.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?e:`${e}, ${n}`}function O(e){return{Vary:G(e,"X-STX-Router")}}import E from"path";var X="stx-page-head:",J=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,C={dev:null,prod:null};function K(){let e=W()?"dev":"prod",n=C[e];if(n!==null)return n;try{let t=import.meta.require("./chunk-pvn0fc7j.js"),r=e==="dev"&&typeof t.getRouterScriptDev==="function"?t.getRouterScriptDev:t.getRouterScript;C[e]=`<script>${r()}</script>`}catch{C[e]=""}return C[e]}async function Ai(e,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=E.resolve(e,n);if(await Bun.file(r).exists())return r;return null}let t=E.join(e,"app.stx");if(await Bun.file(t).exists())return t;return null}async function Hs(e,n){try{let t=await Bun.file(e).text(),r=t,s=t.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(s)r=s[1].trim();let o=Kt(t),a=[...o.client.map((d)=>d.fullTag),...o.signals.map((d)=>d.fullTag)],i=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=c.exec(t))!==null)i.push(u[0]);let l=r;for(let d of o.server)l=l.replace(d.fullTag,"");for(let d of o.client)l=l.replace(d.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let f="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,f).replace(/<slot\s*>\s*<\/slot>/gi,f),!l.includes(f))return console.warn(`[stx] Shell ${e} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:m,extractVariables:x,defaultConfig:y,loadStxConfig:R}=await import("./chunk-fbbp8j97.js"),S=await R(),p={__filename:e,__dirname:E.dirname(e)};for(let d of a){let w=d.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(w&&!d.includes("client")&&!d.includes('type="module"'))await x(w[1],p,e)}let b=await m(l,p,e,{...y,...S,...n},new Set),h=b.indexOf(f);if(h===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:b.substring(0,h),afterSlot:b.substring(h+f.length),filePath:e,shellScripts:a,shellStyles:i}}catch(t){return console.error(`[stx] Error processing shell ${e}:`,t),null}}function Pr(e,n,t){let r,s="",o=n.match(J);if(o){n=n.replace(o[0],"");try{let l=Buffer.from(o[1],"base64").toString("utf8"),f=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(f)r=f[1].trim();s=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=t||r||"stx App",i=K(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -27,5 +27,5 @@ ${i}
|
|
|
27
27
|
`));if(s.length>0)S.push(s.filter((p)=>!c.has(p)).join(`
|
|
28
28
|
`));if(x.length>0)S.push(x.filter((p)=>!c.has(p)).join(`
|
|
29
29
|
`));return S.push(m),S.join(`
|
|
30
|
-
`)}import v from"fs";import I from"path";function Ii(e,n,t){return{version:1,buildTime:new Date().toISOString(),routes:e,assets:n,outputDir:t}}function Oi(e,n){let t=I.join(n,"manifest.json");v.writeFileSync(t,JSON.stringify(e,null,2))}function Ni(e){let n=I.join(e,"manifest.json");if(!v.existsSync(n))return null;try{let t=v.readFileSync(n,"utf-8"),r=JSON.parse(t);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(t){return console.warn("[stx] Failed to load manifest:",t),null}}function k(e,n,t={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(n)}`;if(t.maxAge!==void 0)r+=`; Max-Age=${t.maxAge}`;if(t.expires)r+=`; Expires=${t.expires.toUTCString()}`;if(t.path)r+=`; Path=${t.path}`;if(t.domain)r+=`; Domain=${t.domain}`;if(t.secure)r+="; Secure";if(t.httpOnly)r+="; HttpOnly";if(t.sameSite)r+=`; SameSite=${t.sameSite}`;return r}async function Z(e){let n=e.headers.get("content-type")||"",t={},r=(s,o)=>{let a=t[s];if(a===void 0)t[s]=o;else if(Array.isArray(a))a.push(o);else t[s]=[a,o]};if(n.includes("multipart/form-data")){let s=await e.formData();for(let[o,a]of s.entries())if(typeof a==="string")r(o,a);return t}if(n.includes("application/x-www-form-urlencoded")){for(let[s,o]of new URLSearchParams(await e.text()).entries())r(s,o);return t}return t}function Vs(e){if(!e)return!1;let n=e.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function D(e,n={}){let t=n.request,r=n.method??t?.method;if(!t||!Vs(r))return{ran:!1};if(typeof e.action!=="function")return{ran:!1};let s={};try{s=await Z(t)}catch{}let o=await e.action({request:t,form:s,params:n.params??{},query:e.query??{},cookies:n.cookies??{}});if(o&&typeof o==="object"){let a=o,i=Q(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...i.length>0?{cookies:i}:{}};let{cookies:u,redirect:l,...f}=a;if(Object.assign(e,f),i.length>0)return{ran:!0,cookies:i}}return{ran:!0}}function Q(e){if(!e||typeof e!=="object"||Array.isArray(e))return[];let n=[];for(let[t,r]of Object.entries(e)){if(!t)continue;if(typeof r==="string"){n.push(k(t,r));continue}if(r&&typeof r==="object"){let s=r;if(typeof s.value!=="string")continue;n.push(k(t,s.value,s))}}return n}function Di(e,n=[],t){let r=new Headers({Location:e,"Cache-Control":"no-store"});for(let s of n)r.append("Set-Cookie",s);for(let[s,o]of Object.entries(t??{}))if(s.toLowerCase()!=="location")r.set(s,o);return new Response(null,{status:303,headers:r})}async function Cn(e,n={}){let{html:t,context:r,redirect:s,cookies:o}=await tt(e,n),a=At(r),i=Pt(r);if(s)return{html:t,redirect:s,cookies:o,status:a,headers:i};let{extractStreamBoundaries:c}=await import("./chunk-
|
|
30
|
+
`)}import v from"fs";import I from"path";function Ii(e,n,t){return{version:1,buildTime:new Date().toISOString(),routes:e,assets:n,outputDir:t}}function Oi(e,n){let t=I.join(n,"manifest.json");v.writeFileSync(t,JSON.stringify(e,null,2))}function Ni(e){let n=I.join(e,"manifest.json");if(!v.existsSync(n))return null;try{let t=v.readFileSync(n,"utf-8"),r=JSON.parse(t);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(t){return console.warn("[stx] Failed to load manifest:",t),null}}function k(e,n,t={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(n)}`;if(t.maxAge!==void 0)r+=`; Max-Age=${t.maxAge}`;if(t.expires)r+=`; Expires=${t.expires.toUTCString()}`;if(t.path)r+=`; Path=${t.path}`;if(t.domain)r+=`; Domain=${t.domain}`;if(t.secure)r+="; Secure";if(t.httpOnly)r+="; HttpOnly";if(t.sameSite)r+=`; SameSite=${t.sameSite}`;return r}async function Z(e){let n=e.headers.get("content-type")||"",t={},r=(s,o)=>{let a=t[s];if(a===void 0)t[s]=o;else if(Array.isArray(a))a.push(o);else t[s]=[a,o]};if(n.includes("multipart/form-data")){let s=await e.formData();for(let[o,a]of s.entries())if(typeof a==="string")r(o,a);return t}if(n.includes("application/x-www-form-urlencoded")){for(let[s,o]of new URLSearchParams(await e.text()).entries())r(s,o);return t}return t}function Vs(e){if(!e)return!1;let n=e.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function D(e,n={}){let t=n.request,r=n.method??t?.method;if(!t||!Vs(r))return{ran:!1};if(typeof e.action!=="function")return{ran:!1};let s={};try{s=await Z(t)}catch{}let o=await e.action({request:t,form:s,params:n.params??{},query:e.query??{},cookies:n.cookies??{}});if(o&&typeof o==="object"){let a=o,i=Q(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...i.length>0?{cookies:i}:{}};let{cookies:u,redirect:l,...f}=a;if(Object.assign(e,f),i.length>0)return{ran:!0,cookies:i}}return{ran:!0}}function Q(e){if(!e||typeof e!=="object"||Array.isArray(e))return[];let n=[];for(let[t,r]of Object.entries(e)){if(!t)continue;if(typeof r==="string"){n.push(k(t,r));continue}if(r&&typeof r==="object"){let s=r;if(typeof s.value!=="string")continue;n.push(k(t,s.value,s))}}return n}function Di(e,n=[],t){let r=new Headers({Location:e,"Cache-Control":"no-store"});for(let s of n)r.append("Set-Cookie",s);for(let[s,o]of Object.entries(t??{}))if(s.toLowerCase()!=="location")r.set(s,o);return new Response(null,{status:303,headers:r})}async function Cn(e,n={}){let{html:t,context:r,redirect:s,cookies:o}=await tt(e,n),a=At(r),i=Pt(r);if(s)return{html:t,redirect:s,cookies:o,status:a,headers:i};let{extractStreamBoundaries:c}=await import("./chunk-9qx6ansy.js"),u=c(r),l=e.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:f}=await import("./chunk-jecmxby7.js"),{defaultConfig:m}=await import("./chunk-5rdfcpfe.js"),x=r.streamBoundaries||{},y={...m,autoShell:!1},R=Object.keys(l).map((p)=>({id:p,render:async()=>{let b=typeof x[p]==="function"?await x[p]():void 0;return f(l[p],{...r,$boundary:b},e.sourceFile,y,new Set)}})),S=new Set(R.map((p)=>p.id));u=[...(u||[]).filter((p)=>!S.has(p.id)),...R]}return{html:t,boundaries:u&&u.length>0?u:void 0,cookies:o,status:a,headers:i}}async function tt(e,n){let t={__filename:e.sourceFile,__dirname:e.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!e.hasServerScripts&&!zo(e.html))return{html:e.html,context:t};for(let a of e.serverScriptContent)try{await g(a,t,e.sourceFile)}catch(i){if(n.__stx_strict_hydration)throw i;console.warn(`[stx] Server script error in ${e.sourceFile}:`,i)}let r=await D(t,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),s=(a)=>{let i=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=dr(t);if(!c)return i;let u=i.indexOf("</head>");return u<0?c+i:i.slice(0,u)+c+i.slice(u)};if(r.redirect)return{html:e.html,context:t,redirect:r.redirect,cookies:r.cookies};if(!zo(e.html))return{html:s(e.html),context:t,cookies:r.cookies};let o=new Map;for(let[a,i]of Object.entries(e.placeholders))if(i.expression)try{let c=_(i.expression,t);if(i.type==="raw")o.set(a,c!==void 0&&c!==null?String(c):"");else o.set(a,c!==void 0&&c!==null?V(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;o.set(a,"")}return{html:s(tc(e.html,o)),context:t,cookies:r.cookies}}
|
|
31
31
|
export{ut,Ri,ke,O,Ai,Hs,Pr,Ve,Pi,_e,Ii,Oi,Ni,Vs,Di,Cn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{gl,ml,Ee,hl,ra,Xt,Jt,cp,sa,Yt,Hn,yl,bl,vl,Js,Zt,wl,Qt,xl}from"./chunk-
|
|
2
|
+
import{gl,ml,Ee,hl,ra,Xt,Jt,cp,sa,Yt,Hn,yl,bl,vl,Js,Zt,wl,Qt,xl}from"./chunk-5nrqc6v4.js";import"./chunk-qb806pks.js";import"./chunk-374nhgyf.js";import"./chunk-42qtadka.js";import"./chunk-hg7ys8rn.js";import"./chunk-tenbwcts.js";import"./chunk-912r15hr.js";import"./chunk-nbjyed3q.js";import"./chunk-gymmbbzc.js";import"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{Hn as MODULE_SPECIFIER_PREFIX,gl as bundleCacheDir,ml as bundleCacheEntryLimit,Qt as bundleClientScript,Jt as clearBundleFailures,Ee as clientBundleDependencies,Xt as getBundleFailures,Yt as hasUserImports,Zt as moduleSubstitutionKey,bl as normalizeRegistrySpecifiers,wl as queueClientBundleBuild,ra as recordBundleFailure,yl as registryIdForPath,sa as resolveBundlerFallback,vl as rewriteRegistryImports,cp as setBundlerFallbackMode,hl as shouldLogBundlerDiagnostics,xl as tempBuildName,Js as withModuleSubstitutes};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{qi,Gi,Ki,Xi,ip}from"./chunk-f1hxrs7b.js";import"./chunk-wfg5379k.js";import"./chunk-03xn8244.js";import"./chunk-rs67af2x.js";import"./chunk-bmqker64.js";import"./chunk-9bgb9n12.js";import"./chunk-tdwqwxhf.js";import"./chunk-th45zgbz.js";import"./chunk-brcj3953.js";import"./chunk-2a1eeywj.js";import"./chunk-ypwetty7.js";import"./chunk-e97xj3rf.js";import"./chunk-zt5hp5w5.js";import"./chunk-yhfm939b.js";import"./chunk-42qtadka.js";import"./chunk-hg7ys8rn.js";import"./chunk-tenbwcts.js";import"./chunk-912r15hr.js";import"./chunk-nbjyed3q.js";import"./chunk-gymmbbzc.js";import"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{qi as buildNative,ip as default,Gi as findCraftBinary,Xi as getAvailableFormats,Ki as getAvailableTargets};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Hc,td,Vc,Uc,nd,rd}from"./chunk-65jb75vz.js";import"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{rd as applySlots,nd as extractSlotContent,td as parseSlotElement,Hc as parseSlots,Uc as processSlots,Vc as renderSlot};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,a}from"./chunk-w28wc7mv.js";import{n,gn,m}from"./chunk-
|
|
2
|
+
import{t,a}from"./chunk-w28wc7mv.js";import{n,gn,m}from"./chunk-5nfb4gxk.js";import{Ze}from"./chunk-gymmbbzc.js";import{Qr,es}from"./chunk-nbjyed3q.js";import{ka,vo,Yr,Zr}from"./chunk-912r15hr.js";import{wa,xa}from"./chunk-hg7ys8rn.js";import{bt}from"./chunk-3hxd5td3.js";import{sn,Ra,sr,or}from"./chunk-xvs84gas.js";import{f}from"./chunk-b7e07ybq.js";import{Ps}from"./chunk-vxrhvrr9.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Ht}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function nt(e,r={}){let{duration:o,delay:l,ease:s,direction:c,custom:d}={...B,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
3
3
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
4
4
|
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${c==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
5
5
|
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
|
@@ -1307,6 +1307,6 @@ ${y}
|
|
|
1307
1307
|
customElements.define('${r}', ${d});
|
|
1308
1308
|
`}async function Qe(e,r,o,l){if(r.length<1)return a("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let s=r[0].replace(/['"]/g,""),d=(o.__stx_options||{}).componentsDir||"components",p=q.isAbsolute(d)?[q.join(d,`${s}.stx`),q.join(q.dirname(l),`${s}.stx`)]:[q.join(q.dirname(l),d,`${s}.stx`),q.join(process.cwd(),d,`${s}.stx`),q.join(q.dirname(l),`${s}.stx`)],u=null;for(let h of p)if(await n(h)){u=await Bun.file(h).text();break}if(!u)return a("WebComponent",`Component file not found: ${s}.stx`,t.FILE_NOT_FOUND);let g=Ft(u,s);return`<script type="module">
|
|
1309
1309
|
${qt(g)}
|
|
1310
|
-
</script>`}var N={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:sn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Qe,hasEndTag:!1,description:"Include a web component in the template"},wa,xa,Qr,es,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Ps],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,r,o){let l=r||"pages";if(e)return{root:e,pagesDir:l};let s=o||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:l};return{root:".",pagesDir:l}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,r){let o=r.replace(/[\\/]+$/,"");if(!o||o===".")return!0;let l=e.replace(/\\/g,"/"),s=o.replace(/\\/g,"/");return l===s||l.startsWith(`${s}/`)}function Nl(e,r){let o=!e.root,l=Ut(e.root,e.pagesDir,r);if(e.root=l.root,e.pagesDir=l.pagesDir,o&&l.root!=="."){let s=`${r}::${l.root}`;if(!et.has(s))et.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${l.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let s={};for(let c of ue){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Se.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of ue){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Bt(d,s))continue;e[c]=j.join(s,d)}}for(let s of ue){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(r,c)}return e}function Jt(e,r){let o=Se.get(e);for(let l of ue){let s=e[l];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(r,s);if(Q.existsSync(c))continue;let d=o?.[l]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(l)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(Ra(e.stateDir),e.stateDir=sr(),e.cachePath=or(e.cachePath),e.build)e.build.cacheDir=or(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=or(e.media.cache.directory);if(e.story)e.story.outDir=or(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function yo(e,r=Ht){try{return await r(e)}catch(o){if(o instanceof Error&&o.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw o}}async function i(e){let r=e?j.resolve(e):process.cwd(),o=de.get(r);if(o&&o.signature!==Yr(o.graph)){let c=Y.get(r);if(Y.delete(r),de.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-esz22r0a.js"),{partialsCache:p}=await import("./chunk-5yc7btc2.js");if(d(),p.clear(),c&&o.configSignature===Zr(o.graph)){let u=c.then(async(g)=>{let y={...o.graph};await vo(y,r),de.set(r,{graph:y,signature:Yr(y),configSignature:Zr(y)});let h={...g,_layerGraph:y};if(!e)K=h;return h});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let l=Y.get(r);if(l)return l;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await yo({name:"ui",cwd:j.join(r,"config"),defaultConfig:N,errorPolicy:"throw",verbose:!1});u=(await yo({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await yo({name:"stx",alias:"ui",cwd:r,defaultConfig:N,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||o){let v=await ka(r,N);u=v.config,de.set(r,{graph:v.graph,signature:Yr(v.graph),configSignature:Zr(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-wvz7rp5p.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-hy4j4r8a.js");await b(r,u.runtimeConfig)}Kt(u),Gt(u),Nl(u,r),Jt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{f.resolve(b,{paths:[r]}),g.push(b)}catch{}}let h=[...u.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-vqv5w6gs.js"),b=[],x=[];for(let P of h){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=f.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
|
|
1310
|
+
</script>`}var N={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:sn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Qe,hasEndTag:!1,description:"Include a web component in the template"},wa,xa,Qr,es,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Ps],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,r,o){let l=r||"pages";if(e)return{root:e,pagesDir:l};let s=o||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:l};return{root:".",pagesDir:l}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,r){let o=r.replace(/[\\/]+$/,"");if(!o||o===".")return!0;let l=e.replace(/\\/g,"/"),s=o.replace(/\\/g,"/");return l===s||l.startsWith(`${s}/`)}function Nl(e,r){let o=!e.root,l=Ut(e.root,e.pagesDir,r);if(e.root=l.root,e.pagesDir=l.pagesDir,o&&l.root!=="."){let s=`${r}::${l.root}`;if(!et.has(s))et.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${l.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let s={};for(let c of ue){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Se.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of ue){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Bt(d,s))continue;e[c]=j.join(s,d)}}for(let s of ue){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(r,c)}return e}function Jt(e,r){let o=Se.get(e);for(let l of ue){let s=e[l];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(r,s);if(Q.existsSync(c))continue;let d=o?.[l]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(l)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(Ra(e.stateDir),e.stateDir=sr(),e.cachePath=or(e.cachePath),e.build)e.build.cacheDir=or(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=or(e.media.cache.directory);if(e.story)e.story.outDir=or(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function yo(e,r=Ht){try{return await r(e)}catch(o){if(o instanceof Error&&o.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw o}}async function i(e){let r=e?j.resolve(e):process.cwd(),o=de.get(r);if(o&&o.signature!==Yr(o.graph)){let c=Y.get(r);if(Y.delete(r),de.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-b5vqp3b2.js"),{partialsCache:p}=await import("./chunk-bv43s0gx.js");if(d(),p.clear(),c&&o.configSignature===Zr(o.graph)){let u=c.then(async(g)=>{let y={...o.graph};await vo(y,r),de.set(r,{graph:y,signature:Yr(y),configSignature:Zr(y)});let h={...g,_layerGraph:y};if(!e)K=h;return h});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let l=Y.get(r);if(l)return l;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await yo({name:"ui",cwd:j.join(r,"config"),defaultConfig:N,errorPolicy:"throw",verbose:!1});u=(await yo({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await yo({name:"stx",alias:"ui",cwd:r,defaultConfig:N,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||o){let v=await ka(r,N);u=v.config,de.set(r,{graph:v.graph,signature:Yr(v.graph),configSignature:Zr(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-wvz7rp5p.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-s0wa7zjr.js");await b(r,u.runtimeConfig)}Kt(u),Gt(u),Nl(u,r),Jt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{f.resolve(b,{paths:[r]}),g.push(b)}catch{}}let h=[...u.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-vqv5w6gs.js"),b=[],x=[];for(let P of h){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=f.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
|
|
1311
1311
|
`)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}return u})();if(Y.set(r,s),s.catch(()=>{if(Y.get(r)===s)Y.delete(r)}),!e)se=s,s.then((c)=>{K=c}).catch(()=>{});return s}var R=new Proxy(N,{get(e,r){if(K&&r in K)return K[r];if(!se)i().catch((o)=>{console.warn("[stx] Failed to load config file:",o?.message||o)});return e[r]}});function Ep(e){return e}function Tp(e){let r=[],o=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")r.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")r.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")r.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")r.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)r.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)r.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let l=["auto","manual","sections"];if(!l.includes(e.streaming.strategy))r.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let l=["json","yaml","yml","js"];if(!l.includes(e.i18n.format))r.push({path:"i18n.format",message:`i18n.format must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)r.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)r.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let l=["AA","AAA"];if(!l.includes(e.a11y.level))r.push({path:"a11y.level",message:`a11y.level must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let l=["progressive","islands"];if(!l.includes(e.hydration.mode))r.push({path:"hydration.mode",message:`hydration.mode must be one of: ${l.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let l=["none","eager","lazy"];if(!l.includes(e.hydration.preload))r.push({path:"hydration.preload",message:`hydration.preload must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))r.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((l,s)=>{if(!l.name||typeof l.name!=="string")r.push({path:`customDirectives[${s}].name`,message:"Custom directive must have a name string",severity:"error"});if(!l.handler||typeof l.handler!=="function")r.push({path:`customDirectives[${s}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))r.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((l,s)=>{if(!l.name||typeof l.name!=="string")r.push({path:`middleware[${s}].name`,message:"Middleware must have a name string",severity:"error"});if(!l.handler||typeof l.handler!=="function")r.push({path:`middleware[${s}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!l.timing||!["before","after"].includes(l.timing))r.push({path:`middleware[${s}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)o.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)o.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)r.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let l=["fullscreen","standalone","minimal-ui","browser"];if(!l.includes(e.pwa.manifest.display))r.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let l=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!l.includes(e.pwa.manifest.orientation))r.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.routes){let l=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((s,c)=>{if(!s.pattern||typeof s.pattern!=="string")r.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!l.includes(s.strategy))r.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${l.join(", ")}`,severity:"error"});if(s.maxAgeSeconds!==void 0&&(typeof s.maxAgeSeconds!=="number"||s.maxAgeSeconds<0))r.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(s.maxEntries!==void 0&&(typeof s.maxEntries!=="number"||s.maxEntries<1))r.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((s)=>typeof s!=="number"||s<16||s>1024).length>0)r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let l=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!l.includes(c)).length>0)r.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)o.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)o.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:r.length===0,errors:r,warnings:o}}
|
|
1312
1312
|
export{ga,ma,er,Je,ha,Jr,N,Nl,yo,i,R,Ep,Tp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{en,Ys,Zs,Qs,lp,eo}from"./chunk-
|
|
2
|
+
import{en,Ys,Zs,Qs,lp,eo}from"./chunk-qb806pks.js";import"./chunk-912r15hr.js";import"./chunk-gymmbbzc.js";import"./chunk-t6m5d64b.js";export{Zs as buildServerApi,lp as createServerApi,en as discoverServerApi,Ys as generateApiTypes,eo as isServerApiSource,Qs as productionApiDispatcher};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ve,Lo,jo,Ql,It,Xa,Bo,Ja,Op,Ne,fn,De}from"./chunk-
|
|
2
|
+
import{ve,Lo,jo,Ql,It,Xa,Bo,Ja,Op,Ne,fn,De}from"./chunk-5nfb4gxk.js";import{nc,r}from"./chunk-9tg4995v.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{ve as BROWSER_CORE_IMPORTS,Ql as STX_AUTO_IMPORTS,Lo as extractAndStripCssImports,Ne as extractBridgeData,nc as findInterpolationEnd,Ja as generateAutoImportDestructuring,Op as generateBrowserAutoImportDestructuring,fn as generateServerDataBridge,It as injectBrowserCoreAutoImports,De as processClientScript,Bo as referencesName,jo as renderVendorStyleTags,r as stripCommentsAndLiterals,Xa as transformAutoImports};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{be,ws,cu,Dp,lu,Mp,Ot,d,V,Y,mn,we,uu,Ho,du,Lp,
|
|
2
|
+
import{be,ws,cu,Dp,lu,Mp,Ot,d,V,Y,mn,we,uu,Ho,du,Lp,x,pu,jp,_,Bp}from"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{pu as applyFilters,Mp as clearCustomFilters,uu as clientLoopScopes,ws as defaultFilters,mn as escapeAttributeValue,d as escapeHtml,V as escapeHtmlValue,Y as escapeInterpolatedHtmlValue,_ as evaluateExpression,be as findMustacheEnd,lu as getAllFilters,du as interpolateScriptAttributes,Ho as interpolateScriptExpressions,Lp as interpolateScriptsInTemplate,x as processExpressions,cu as registerFilter,Dp as registerFilters,Ot as replaceInterpolations,jp as resetRejectedExpressionWarnings,Bp as unescapeHtml,we as usesSignalsInScript};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{x}from"./chunk-5nfb4gxk.js";import{o}from"./chunk-rs67af2x.js";import p from"fs";import g from"path";import*as y from"readline";var e={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"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,n)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
|
|
3
3
|
${e.bold}${t[0]}${e.reset} - ${r.description}`),console.log(` Usage: ${e.cyan}${r.usage}${e.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${e.bold}Available Commands:${e.reset}
|
|
@@ -8,7 +8,7 @@ ${e.dim}Type 'help <command>' for more details${e.reset}
|
|
|
8
8
|
`)}}},render:{description:"Render a template file",usage:"render <file> [--raw]",handler:async(t,n)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file to render${e.reset}`);return}let r=g.resolve(n.cwd,t[0]);if(!await Bun.file(r).exists()){console.log(`${e.red}Error: File not found: ${r}${e.reset}`);return}try{let s=await Bun.file(r).text(),l=t.includes("--raw");console.log(`
|
|
9
9
|
${e.dim}Rendering ${r}...${e.reset}
|
|
10
10
|
`);let c=await o(s,n.context,r,{},new Set);if(n.lastResult=c,l)console.log(c);else c.split(`
|
|
11
|
-
`).forEach((d,i)=>{let f=String(i+1).padStart(3," ");console.log(`${e.dim}${f}${e.reset} ${d}`)});console.log()}catch(s){console.log(`${e.red}Error rendering template:${e.reset}`,s)}}},eval:{description:"Evaluate an expression",usage:"eval <expression>",handler:async(t,n)=>{if(!t.length){console.log(`${e.red}Error: Please provide an expression to evaluate${e.reset}`);return}let r=t.join(" ");try{let s=`{{ ${r} }}`,c=(await
|
|
11
|
+
`).forEach((d,i)=>{let f=String(i+1).padStart(3," ");console.log(`${e.dim}${f}${e.reset} ${d}`)});console.log()}catch(s){console.log(`${e.red}Error rendering template:${e.reset}`,s)}}},eval:{description:"Evaluate an expression",usage:"eval <expression>",handler:async(t,n)=>{if(!t.length){console.log(`${e.red}Error: Please provide an expression to evaluate${e.reset}`);return}let r=t.join(" ");try{let s=`{{ ${r} }}`,c=(await x(s,n.context,"eval")).trim();n.lastResult=c,console.log(`${e.green}\u2192${e.reset} ${c}`)}catch(s){console.log(`${e.red}Error:${e.reset}`,s)}}},set:{description:"Set a context variable",usage:"set <key> <value>",handler:async(t,n)=>{if(t.length<2){console.log(`${e.red}Error: Usage: set <key> <value>${e.reset}`);return}let r=t[0],s=t.slice(1).join(" "),l;try{l=JSON.parse(s)}catch{l=s}n.context[r]=l,console.log(`${e.green}\u2713${e.reset} ${r} = ${JSON.stringify(l)}`)}},unset:{description:"Remove a context variable",usage:"unset <key>",handler:async(t,n)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a variable to remove${e.reset}`);return}if(t[0]in n.context)delete n.context[t[0]],console.log(`${e.green}\u2713${e.reset} Removed ${t[0]}`);else console.log(`${e.yellow}Variable not found: ${t[0]}${e.reset}`)}},context:{description:"Show current context variables",usage:"context",handler:async(t,n)=>{let r=Object.keys(n.context);if(r.length===0){console.log(`${e.dim}Context is empty${e.reset}`);return}console.log(`
|
|
12
12
|
${e.bold}Context Variables:${e.reset}
|
|
13
13
|
`);for(let s of r){let l=n.context[s],c=Array.isArray(l)?"array":typeof l,a=JSON.stringify(l).slice(0,50);console.log(` ${e.cyan}${s}${e.reset} ${e.dim}(${c})${e.reset}: ${a}${a.length>=50?"...":""}`)}console.log()}},clear:{description:"Clear context or screen",usage:"clear [context|screen]",handler:async(t,n)=>{if(t[0]==="context"||!t[0])n.context={},console.log(`${e.green}\u2713${e.reset} Context cleared`);if(t[0]==="screen"||!t[0])console.clear()}},cd:{description:"Change working directory",usage:"cd <directory>",handler:async(t,n)=>{if(!t[0]){console.log(`${e.cyan}${n.cwd}${e.reset}`);return}let r=g.resolve(n.cwd,t[0]);if(!p.existsSync(r)){console.log(`${e.red}Error: Directory not found: ${r}${e.reset}`);return}if(!p.statSync(r).isDirectory()){console.log(`${e.red}Error: Not a directory: ${r}${e.reset}`);return}n.cwd=r,console.log(`${e.green}\u2713${e.reset} ${r}`)}},ls:{description:"List files in current directory",usage:"ls [pattern]",handler:async(t,n)=>{let r=t[0]||"*",s=new Bun.Glob(r),l=[];for await(let i of s.scan({cwd:n.cwd,onlyFiles:!1}))l.push(i);if(l.length===0){console.log(`${e.dim}No files found${e.reset}`);return}l.sort();let c=l.filter((i)=>i.endsWith(".stx")),a=l.filter((i)=>i.endsWith(".md")),d=l.filter((i)=>!i.endsWith(".stx")&&!i.endsWith(".md"));if(c.length>0)console.log(`
|
|
14
14
|
${e.bold}Templates:${e.reset}`),c.forEach((i)=>console.log(` ${e.green}${i}${e.reset}`));if(a.length>0)console.log(`
|
|
@@ -19,6 +19,6 @@ ${e.dim}Goodbye!${e.reset}
|
|
|
19
19
|
`)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,n)=>u.exit.handler(t,n)}};function h(t,n){let r=t.split(" "),s=r[0];if(r.length===1)return Object.keys(u).filter((l)=>l.startsWith(s));if(["render","cat","load","cd"].includes(s)){let l=r.slice(1).join(" "),c=g.dirname(l)||".",a=g.basename(l),d=g.resolve(n.cwd,c);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${s} ${c==="."?"":`${c}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(s)){let l=r[1]||"";return Object.keys(n.context).filter((c)=>c.startsWith(l)).map((c)=>`${s} ${c}`)}return[]}async function Iu(t={}){let n={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},r=y.createInterface({input:process.stdin,output:process.stdout,completer:(l)=>[h(l,n),l],historySize:t.maxHistory||100});console.log(`
|
|
20
20
|
${e.bold}${e.blue}stx Interactive Mode${e.reset}
|
|
21
21
|
${e.dim}Type 'help' for available commands, 'exit' to quit${e.reset}
|
|
22
|
-
`);let s=()=>{let l=n.cwd.replace(process.env.HOME||"","~");r.question(`${e.cyan}stx${e.reset} ${e.dim}${l}${e.reset} ${e.green}>${e.reset} `,async(c)=>{let a=c.trim();if(!a){if(n.running)s();return}n.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],i=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(i&&u[i])try{await u[i].handler(f,n)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(i)if(a.includes("{{")||a.includes("}}"))try{let m=await
|
|
22
|
+
`);let s=()=>{let l=n.cwd.replace(process.env.HOME||"","~");r.question(`${e.cyan}stx${e.reset} ${e.dim}${l}${e.reset} ${e.green}>${e.reset} `,async(c)=>{let a=c.trim();if(!a){if(n.running)s();return}n.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],i=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(i&&u[i])try{await u[i].handler(f,n)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(i)if(a.includes("{{")||a.includes("}}"))try{let m=await x(a,n.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(n.running)s();else r.close()})};r.on("SIGINT",()=>{console.log(`
|
|
23
23
|
${e.dim}(Use 'exit' to quit)${e.reset}`),s()}),s()}
|
|
24
24
|
export{Iu};
|