@stacksjs/stx 0.2.855 → 0.2.858
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-0ts3p84y.js +2 -0
- package/dist/{chunk-zme05d1n.js → chunk-0vptj943.js} +2 -2
- package/dist/{chunk-0dmpc70r.js → chunk-0z2gqttt.js} +16 -16
- package/dist/{chunk-1qybwj8k.js → chunk-1347hwt5.js} +15 -15
- package/dist/chunk-139mxsyc.js +2 -0
- package/dist/chunk-1barsha6.js +2 -0
- package/dist/chunk-1fnx7ze9.js +2 -0
- package/dist/chunk-1g06wfs9.js +2 -0
- package/dist/{chunk-w032x0zm.js → chunk-1nankvf6.js} +2 -2
- package/dist/chunk-1nasq00e.js +2 -0
- package/dist/{chunk-csgfws3j.js → chunk-1z2am28h.js} +2 -2
- package/dist/chunk-2102tvxh.js +2 -0
- package/dist/{chunk-yzvp90yk.js → chunk-252enthj.js} +2 -2
- package/dist/{chunk-2j2qzv8g.js → chunk-27zp4q77.js} +2 -2
- package/dist/{chunk-77kanny8.js → chunk-2bks42z4.js} +9 -9
- package/dist/chunk-39cwa35j.js +2 -0
- package/dist/{chunk-fj5jw2jd.js → chunk-3b7q7d7j.js} +6 -6
- package/dist/{chunk-9z7fnv33.js → chunk-3evwxrpx.js} +1 -1
- package/dist/chunk-3rcegvgg.js +2 -0
- package/dist/chunk-3wvq28hz.js +2 -0
- package/dist/{chunk-68pvvd7v.js → chunk-3zjyhhg4.js} +3 -3
- package/dist/{chunk-mhjxx64x.js → chunk-4ezfen91.js} +25 -25
- package/dist/{chunk-a2fngjfx.js → chunk-4h9kkkh7.js} +1 -1
- package/dist/{chunk-gxqtbbz0.js → chunk-5xy1z71a.js} +5 -5
- package/dist/{chunk-63rvsnt2.js → chunk-69zj9q02.js} +3 -3
- package/dist/chunk-6d74qdc6.js +2 -0
- package/dist/chunk-6m4v1tsq.js +2 -0
- package/dist/{chunk-9hvfmqs1.js → chunk-6qbha6fb.js} +9 -9
- package/dist/{chunk-q0jmc3m4.js → chunk-71s4hpkj.js} +9 -9
- package/dist/chunk-75e4wzzs.js +3 -0
- package/dist/{chunk-11y3106w.js → chunk-78amng8s.js} +5 -5
- package/dist/chunk-7ambc4f7.js +2 -0
- package/dist/{chunk-ngnvyqk3.js → chunk-7fgfzaah.js} +2 -2
- package/dist/{chunk-4wrddn8m.js → chunk-8623gte8.js} +9 -9
- package/dist/{chunk-mpmnbvy4.js → chunk-8cpqcn19.js} +5 -5
- package/dist/chunk-8nmc3rh7.js +2 -0
- package/dist/chunk-8pn7ah12.js +2 -0
- package/dist/chunk-8zwwmnpb.js +2 -0
- package/dist/chunk-98bgx3ws.js +2 -0
- package/dist/{chunk-car6nhfe.js → chunk-9n8t7v78.js} +2 -2
- package/dist/chunk-a4v8z93r.js +2 -0
- package/dist/chunk-a58w524e.js +2 -0
- package/dist/chunk-a6v6x2pg.js +2 -0
- package/dist/{chunk-krtkxnz6.js → chunk-admnvsmx.js} +2 -2
- package/dist/{chunk-hgy98n76.js → chunk-afrqm7w5.js} +4 -4
- package/dist/{chunk-t3a3wbjk.js → chunk-az9b4bj4.js} +2 -2
- package/dist/chunk-b62mr2kz.js +2 -0
- package/dist/chunk-b7vxb2y6.js +2 -0
- package/dist/chunk-bb20hnqd.js +2 -0
- package/dist/chunk-bc3sknxf.js +2 -0
- package/dist/{chunk-fphnst8a.js → chunk-bef0wr53.js} +5 -5
- package/dist/{chunk-cy60hmv2.js → chunk-bhzh7mj1.js} +1 -1
- package/dist/{chunk-jn6mdfrs.js → chunk-bxn4b0wm.js} +2 -2
- package/dist/{chunk-yscys65t.js → chunk-c7eew8qs.js} +1 -1
- package/dist/chunk-cbrbrkp1.js +2 -0
- package/dist/{chunk-fba71th7.js → chunk-cqkr291c.js} +7 -7
- package/dist/{chunk-mmdqdkbd.js → chunk-d6am6en8.js} +1 -1
- package/dist/chunk-d8djpp7f.js +2 -0
- package/dist/chunk-dk6t4h48.js +2 -0
- package/dist/chunk-dkbm7117.js +2 -0
- package/dist/chunk-e44bse67.js +2 -0
- package/dist/{chunk-kvafq9gy.js → chunk-e763qsg0.js} +2 -2
- package/dist/{chunk-pm241ehv.js → chunk-e7thwrt5.js} +2 -2
- package/dist/{chunk-wzv7k91a.js → chunk-e8we717q.js} +2 -2
- package/dist/{chunk-q0ycypnt.js → chunk-eazccp6e.js} +2 -2
- package/dist/{chunk-zqb294v2.js → chunk-egwtv5hp.js} +3 -3
- package/dist/chunk-ewnfgczq.js +2 -0
- package/dist/chunk-f1v5hvbt.js +2 -0
- package/dist/{chunk-anva219c.js → chunk-f1vvhbmw.js} +2 -2
- package/dist/{chunk-pwem4sed.js → chunk-fbnykfnv.js} +4 -4
- package/dist/{chunk-0vg0j7xa.js → chunk-fd7e162p.js} +3 -3
- package/dist/{chunk-fhrvxfq9.js → chunk-ff3j7jnf.js} +2 -2
- package/dist/{chunk-j2wcawmf.js → chunk-fw50vydb.js} +2 -2
- package/dist/{chunk-te82sjhy.js → chunk-fxk1psd8.js} +31 -31
- package/dist/chunk-g6epqcb3.js +2 -0
- package/dist/{chunk-9n3584wt.js → chunk-g8d24rfk.js} +2 -2
- package/dist/{chunk-ya6f7mt5.js → chunk-gjbnzn7k.js} +4 -4
- package/dist/chunk-gmvypdm8.js +2 -0
- package/dist/{chunk-4dfz7cdr.js → chunk-gz0j98dy.js} +5 -5
- package/dist/{chunk-csksn1kg.js → chunk-hjh5wt5f.js} +2 -2
- package/dist/chunk-hmgry6dn.js +2 -0
- package/dist/{chunk-s37af6rd.js → chunk-jafn7f7f.js} +2 -2
- package/dist/chunk-jbv1srnh.js +2 -0
- package/dist/{chunk-mv48q1p4.js → chunk-jdqmk5sv.js} +75 -75
- package/dist/{chunk-d4gy4yz0.js → chunk-jgvwzt1t.js} +2 -2
- package/dist/chunk-jhm1228j.js +4 -0
- package/dist/{chunk-k0arm18k.js → chunk-jtag68hg.js} +2 -2
- package/dist/chunk-jwtp4csj.js +20 -0
- package/dist/{chunk-9r999ees.js → chunk-jwwsxym6.js} +2 -2
- package/dist/chunk-jzynkjfc.js +2 -0
- package/dist/{chunk-n77xrpv9.js → chunk-k19ba3jz.js} +2 -2
- package/dist/chunk-k1qajhpx.js +2 -0
- package/dist/{chunk-tm8a2b69.js → chunk-kedgfk9z.js} +4 -4
- package/dist/{chunk-f9thwm8c.js → chunk-kq3h2rjq.js} +9 -9
- package/dist/chunk-ksxbfyef.js +3 -0
- package/dist/chunk-m28j4ym7.js +2 -0
- package/dist/{chunk-4nhbbcr9.js → chunk-m2rm2gxv.js} +5 -5
- package/dist/{chunk-v8p8t3t4.js → chunk-me16tftr.js} +1 -1
- package/dist/{chunk-bkefg64w.js → chunk-mh45hcsa.js} +5 -5
- package/dist/{chunk-279n7sde.js → chunk-mxazxwc4.js} +4 -4
- package/dist/chunk-mzembfxk.js +2 -0
- package/dist/{chunk-hpwtjb4a.js → chunk-mzes9ds7.js} +2 -2
- package/dist/{chunk-ynd2nfvs.js → chunk-mzg1wq86.js} +27 -27
- package/dist/chunk-ngzjwp2e.js +2 -0
- package/dist/chunk-nj9n0en9.js +2 -0
- package/dist/{chunk-w835crjw.js → chunk-nv5xhfwz.js} +2 -2
- package/dist/chunk-nyasqjnt.js +2 -0
- package/dist/{chunk-vw73gsxx.js → chunk-pa8xkctc.js} +7 -7
- package/dist/{chunk-ybq56wam.js → chunk-pb09xy77.js} +2 -2
- package/dist/chunk-pn0rmd8d.js +2 -0
- package/dist/chunk-pvx1hrqq.js +2 -0
- package/dist/chunk-q78dsejp.js +2 -0
- package/dist/chunk-q87hkwfg.js +3 -0
- package/dist/{chunk-fzkyk5j4.js → chunk-q93jcdgj.js} +8 -8
- package/dist/chunk-qe6631me.js +2 -0
- package/dist/{chunk-e8zpzt9s.js → chunk-qv52et0d.js} +1 -1
- package/dist/{chunk-4cd94cd5.js → chunk-qvwzaxdd.js} +5 -5
- package/dist/chunk-qw1f97s7.js +2 -0
- package/dist/chunk-rcn0yyh2.js +2 -0
- package/dist/{chunk-xfb7fdeq.js → chunk-rq9pqd4s.js} +10 -10
- package/dist/{chunk-7hp50cpd.js → chunk-s322kcw7.js} +6 -6
- package/dist/chunk-shy2hkvj.js +2 -0
- package/dist/{chunk-w7p34cr3.js → chunk-smve11g0.js} +1 -1
- package/dist/{chunk-7kc9xwht.js → chunk-snmq7yn4.js} +4 -4
- package/dist/{chunk-v4bqmzj9.js → chunk-sny8rqe8.js} +2 -2
- package/dist/chunk-t9h3e3bp.js +2 -0
- package/dist/{chunk-ctb1bj28.js → chunk-tjer45j7.js} +3 -3
- package/dist/{chunk-qxk9grjm.js → chunk-tk67pqaf.js} +3 -3
- package/dist/{chunk-h1f3dpvq.js → chunk-tpw435g0.js} +2 -2
- package/dist/chunk-ts9bvjzh.js +2 -0
- package/dist/chunk-tzvgjrp4.js +2 -0
- package/dist/{chunk-7tteg9bn.js → chunk-v8b1wz1b.js} +1 -1
- package/dist/{chunk-ma4ftg5p.js → chunk-va1hj69e.js} +5 -5
- package/dist/{chunk-r69en2jg.js → chunk-w7s3afam.js} +1 -1
- package/dist/chunk-w9aa8xte.js +2 -0
- package/dist/{chunk-zswtgwxg.js → chunk-wd4z5w4d.js} +1 -1
- package/dist/chunk-wegkgjmf.js +2 -0
- package/dist/chunk-wn065q3f.js +2 -0
- package/dist/{chunk-fbpqkrvb.js → chunk-wskdnfh9.js} +6 -6
- package/dist/{chunk-jr346anv.js → chunk-xhvw0t0f.js} +2 -2
- package/dist/{chunk-xn2gyhes.js → chunk-xz1csyq9.js} +10 -10
- package/dist/chunk-y2dtqrrz.js +2 -0
- package/dist/{chunk-2rxr5cj6.js → chunk-y67r0d0c.js} +9 -9
- package/dist/chunk-yss7n9db.js +2 -0
- package/dist/chunk-z6p0yxwd.js +2 -0
- package/dist/{chunk-5erremft.js → chunk-z703xzhy.js} +2 -2
- package/dist/chunk-zcpwc47w.js +2 -0
- package/dist/{chunk-33ph9zb2.js → chunk-zn9dp7yn.js} +5 -5
- package/dist/chunk-zsmrq1w3.js +2 -0
- package/dist/cli.js +18 -18
- package/dist/client-script-bundler.d.ts +21 -0
- package/dist/client-script-bundler.js +14 -0
- package/dist/component-client-factories.js +6 -5
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +8 -8
- package/dist/utils.js +3 -2
- package/package.json +5 -5
- package/dist/chunk-05f4tjsq.js +0 -2
- package/dist/chunk-0xwmweqm.js +0 -2
- package/dist/chunk-161ksm7f.js +0 -2
- package/dist/chunk-1p968nww.js +0 -2
- package/dist/chunk-2y20dvab.js +0 -2
- package/dist/chunk-33yeb861.js +0 -2
- package/dist/chunk-3pm6d9zj.js +0 -2
- package/dist/chunk-3wt0nh3p.js +0 -2
- package/dist/chunk-463zkecq.js +0 -2
- package/dist/chunk-5758n8sm.js +0 -2
- package/dist/chunk-5dykcrnv.js +0 -2
- package/dist/chunk-5ppe8d51.js +0 -2
- package/dist/chunk-5xcxc9f8.js +0 -2
- package/dist/chunk-6bm19d4k.js +0 -2
- package/dist/chunk-6w3gv9d6.js +0 -2
- package/dist/chunk-81z64a84.js +0 -2
- package/dist/chunk-8gsd2n0j.js +0 -2
- package/dist/chunk-8kqqxqyp.js +0 -2
- package/dist/chunk-8qe34jb8.js +0 -3
- package/dist/chunk-bk0arddt.js +0 -2
- package/dist/chunk-bz4bskx3.js +0 -2
- package/dist/chunk-c557w9e6.js +0 -2
- package/dist/chunk-cfmjtyzm.js +0 -2
- package/dist/chunk-ck9zengd.js +0 -2
- package/dist/chunk-cwt26rvt.js +0 -3
- package/dist/chunk-dbag44ta.js +0 -2
- package/dist/chunk-dee5mtdv.js +0 -2
- package/dist/chunk-dfcnaaym.js +0 -2
- package/dist/chunk-dm10y06z.js +0 -2
- package/dist/chunk-dw9vnhc4.js +0 -2
- package/dist/chunk-eegs2at0.js +0 -2
- package/dist/chunk-ehp792dy.js +0 -3
- package/dist/chunk-enxnw50k.js +0 -2
- package/dist/chunk-f858fazq.js +0 -2
- package/dist/chunk-fsg958xx.js +0 -2
- package/dist/chunk-ggthncvg.js +0 -2
- package/dist/chunk-gn1dmfdv.js +0 -2
- package/dist/chunk-gsn5vvw4.js +0 -2
- package/dist/chunk-hfcagm39.js +0 -2
- package/dist/chunk-hfe2byfx.js +0 -2
- package/dist/chunk-hmys6w75.js +0 -2
- package/dist/chunk-hqtj4ngq.js +0 -2
- package/dist/chunk-j3s5y2k5.js +0 -2
- package/dist/chunk-kez50h8a.js +0 -2
- package/dist/chunk-kfq4mwem.js +0 -2
- package/dist/chunk-knd3m4t4.js +0 -2
- package/dist/chunk-m3kc2a3v.js +0 -2
- package/dist/chunk-mjp2sp74.js +0 -2
- package/dist/chunk-mx79sfyr.js +0 -2
- package/dist/chunk-n6w82yf2.js +0 -2
- package/dist/chunk-ns5epsng.js +0 -2
- package/dist/chunk-p91288ce.js +0 -2
- package/dist/chunk-pesgcwrj.js +0 -20
- package/dist/chunk-pw6n7a9k.js +0 -2
- package/dist/chunk-q1z8edtn.js +0 -2
- package/dist/chunk-qccpfn5x.js +0 -2
- package/dist/chunk-syww37qd.js +0 -2
- package/dist/chunk-vbsr76qe.js +0 -2
- package/dist/chunk-vgaqznwt.js +0 -2
- package/dist/chunk-vw9h1x2m.js +0 -2
- package/dist/chunk-w165qe5q.js +0 -2
- package/dist/chunk-wz54wsm7.js +0 -2
- package/dist/chunk-x2vybq9n.js +0 -2
- package/dist/chunk-x4077p94.js +0 -2
- package/dist/chunk-z0qfspzg.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Tn}from"./chunk-
|
|
3
|
-
`}var Q=["media","crossorigin","integrity"];function Mn(t){let s=[];for(let e of D(t)){if(!/^<link\b/i.test(e))continue;let r=L(e);if(
|
|
4
|
-
`:""}import T from"path";var tt="stx-page-head:",et=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function nt(){let t=G()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-
|
|
2
|
+
import{Tn}from"./chunk-0z2gqttt.js";import{q,y,Dt,Lt,$r,g,ll,_i,W,A}from"./chunk-jdqmk5sv.js";import{rn}from"./chunk-252enthj.js";import{n}from"./chunk-75e4wzzs.js";import{G}from"./chunk-ym5qgw03.js";var X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function J(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)s.push({start:r.index,end:r.index+r[0].length});return s}function N(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function K(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},r=s,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let o=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];r=r.slice(o[0].length);continue}let c=r.match(/^#([\w-]+)/);if(c){e.id=c[1],r=r.slice(c[0].length);continue}let a=r.match(/^\.([\w-]+)/);if(a){e.className=a[1],r=r.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function Y(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function P(t,s="main"){let e=K(s);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=J(t),o;while((o=r.exec(t))!==null){if(N(o.index,i))continue;let c=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||X.has(c))continue;if(e.tag&&e.tag!==c)continue;if(!Y(a,e))continue;let l=o[0],f=o.index+l.length,u=new RegExp(`<(/?)${c}\\b([^>]*)>`,"gi");u.lastIndex=f;let d=1,h;while((h=u.exec(t))!==null){if(N(h.index,i))continue;let S=h[1]==="/";if(!S&&(h[2]||"").trimEnd().endsWith("/"))continue;if(d+=S?-1:1,d===0)return{openTag:l,openIndex:o.index,start:f,end:h.index,tagName:c}}return null}return null}var ht="private, no-store";function Yt(t){return t.replace(/&#(\d+);/g,(s,e)=>F(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>F(Number.parseInt(e,16),s)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function F(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function Te(t){return t.headers.get("X-STX-Router")==="true"}function Z(t,s){if(!t)return s;return t.split(",").some((r)=>r.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function j(t){return{Vary:Z(t,"X-STX-Router")}}function E(t){return t.replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function D(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return y(s,(r,i)=>(e.lastIndex=i,e.exec(r)?e.lastIndex:-1)).map(({token:r})=>r)}function L(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let r of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=r[1].toLowerCase();if(!(i in s))s[i]=r[2]??r[3]??r[4]??""}return s}function Nn(t){let s=[];for(let e of D(t)){if(/^<title\b/i.test(e)){s.push(`<title>${E(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let r=L(e);if(/^<meta\b/i.test(e)){let i=r.property?"property":"name",o=Yt(r[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${n(o)}" content="${E(r.content??"")}">`)}else{let i=Yt(r.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&r.hreflang)s.push(`<link rel="${i}" href="${E(r.href??"")}"${i==="alternate"?` hreflang="${E(r.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
|
|
3
|
+
`}var Q=["media","crossorigin","integrity"];function Mn(t){let s=[];for(let e of D(t)){if(!/^<link\b/i.test(e))continue;let r=L(e);if(Yt(r.rel??"").trim().toLowerCase()!=="stylesheet")continue;if(!r.href||"data-css"in r||"disabled"in r)continue;let i=Q.filter((o)=>(o in r)).map((o)=>` ${o}="${E(r[o])}"`).join("");s.push(`<link rel="stylesheet" href="${E(r.href)}"${i}>`)}return s.length?`<template data-stx-page-css="1">${s.join("")}</template>
|
|
4
|
+
`:""}import T from"path";var tt="stx-page-head:",et=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function nt(){let t=G()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-6m4v1tsq.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${r()}</script>`}catch{_[t]=""}return _[t]}async function ga(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let r=T.resolve(t,s);if(await Bun.file(r).exists())return r;return null}let e=T.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function wo(t,s){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let o=rn(e),c=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],l=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=l.exec(e))!==null)a.push(f[0]);let u=r;for(let p of o.server)u=u.replace(p.fullTag,"");for(let p of o.client)u=u.replace(p.fullTag,"");u=u.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(u=u.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!u.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:S,defaultConfig:R,loadStxConfig:b}=await import("./chunk-w9aa8xte.js"),k=await b(),m={__filename:t,__dirname:T.dirname(t)};for(let p of c){let C=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!p.includes("client")&&!p.includes('type="module"'))await S(C[1],m,t)}let x=await h(u,m,t,{...R,...k,...s},new Set),w=x.indexOf(d);if(w===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:x.substring(0,w),afterSlot:x.substring(w+d.length),filePath:t,shellScripts:c,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function Jr(t,s,e){let r,i="",o=s.match(et);if(o){s=s.replace(o[0],"");try{let u=Buffer.from(o[1],"base64").toString("utf8"),d=u.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)r=d[1].trim();i=u.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let c=e||r||"stx App",a=nt(),l="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
6
6
|
<head>
|
|
7
7
|
<meta charset="UTF-8">
|
|
@@ -20,14 +20,14 @@ ${t.shellScripts.filter((u)=>!u.includes("server")).join(`
|
|
|
20
20
|
${l}
|
|
21
21
|
${a}
|
|
22
22
|
</body>
|
|
23
|
-
</html>`}function
|
|
23
|
+
</html>`}function Ke(t,s={}){let e=t.trim();if(!Tn(e))return t;let r=[],i=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(i){let l=i[1],f=/<style\b[^>]*>[\s\S]*?<\/style>/gi,u;while((u=f.exec(l))!==null)r.push(u[0]);let d=l.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(d)r.push(d[0]);let h=l.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(h)r.push(h[0])}if(s.preserveHead&&i){let l=[],f=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,u;while((u=f.exec(i[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(u[0]))continue;l.push(u[0])}if(l.length>0)r.unshift(`<!--${tt}${Buffer.from(l.join(`
|
|
24
24
|
`),"utf8").toString("base64")}-->`)}let o=e.match(/<body\b[^>]*>/i),c=e.lastIndexOf("</body>");if(o&&c!==-1){let l=o.index+o[0].length,f=e.slice(l,c).trim();if(r.length>0)return r.join(`
|
|
25
25
|
`)+`
|
|
26
26
|
`+f;return f}let a=e;if(a=a.replace(/<!DOCTYPE\b[^>]*>/i,""),a=a.replace(/<html\b[^>]*>/i,""),a=a.replace(/<\/html\s*>/i,""),i)a=a.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
|
|
27
|
-
`));return a=a.replace(/<body\b[^>]*>/i,""),a=a.replace(/<\/body\s*>/i,""),a.trim()}var H=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function V(t,s,e,r){if(!H.test(s))return!1;let i=s.slice(0,s.indexOf(">")+1),o=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!o)return!0;let c=`data-stx-scope="${o}"`;for(let a=t.indexOf(c);a!==-1;a=t.indexOf(c,a+c.length))if(a>=e&&a<r)return!1;return!0}function ma(t){return
|
|
27
|
+
`));return a=a.replace(/<body\b[^>]*>/i,""),a=a.replace(/<\/body\s*>/i,""),a.trim()}var H=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function V(t,s,e,r){if(!H.test(s))return!1;let i=s.slice(0,s.indexOf(">")+1),o=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!o)return!0;let c=`data-stx-scope="${o}"`;for(let a=t.indexOf(c);a!==-1;a=t.indexOf(c,a+c.length))if(a>=e&&a<r)return!1;return!0}function ma(t){return Te(t)}function rt(t,s){let e=[],r=new Set;for(let i of y(t,q)){if(i.start>=s.start&&i.start<s.end)continue;let o=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",c=new Map;for(let f of o.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))c.set(f[1].toLowerCase(),f[2]??f[3]??f[4]??"");let a=c.get("src")?.trim(),l=c.get("type")?.trim().toLowerCase();if(!a||c.has("server")||l&&!["module","text/javascript","application/javascript"].includes(l))continue;if(c.has("data-stx-runtime")||c.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(a))continue;if(V(t,i.token,s.start,s.end)||r.has(i.token))continue;r.add(i.token),e.push(i.token)}return e}function Ge(t,s="main"){return!!P(t.trim(),s)}function $e(t,s="main",e=!1){let r=t.trim(),i=[],o=[],c=r.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(c){let x=c[1],w=/<style\b[^>]*>[\s\S]*?<\/style>/gi,p;while((p=w.exec(x))!==null)i.push(p[0]);let C=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((p=C.exec(x))!==null){if(H.test(p[0])||p[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(p[0]))continue;o.push(p[0])}}let a=P(r,s);if(!a)return(e?Nn(t)+Mn(t):"")+Ke(t);let l=rt(r,a),f=new Set(l),{tagName:u,start:d,end:h}=a,S=r.slice(d,h).trim(),R=[],b=r.match(/<body\b[^>]*>/i),k=r.lastIndexOf("</body>");if(b&&b.index!==void 0&&k!==-1){let w=[[b.index+b[0].length,a.openIndex],[h+`</${u}>`.length,k]],p=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[C,I]of w){if(C>=I)continue;let z=r.slice(C,I),v;p.lastIndex=0;while((v=p.exec(z))!==null){if(V(r,v[0],d,h))continue;R.push(v[0])}}}let m=[];if(e)m.push(Nn(t)+Mn(t));if(i.length>0)m.push(i.join(`
|
|
28
28
|
`));if(l.length>0)m.push(l.join(`
|
|
29
29
|
`));if(o.length>0)m.push(o.filter((x)=>!f.has(x)).join(`
|
|
30
30
|
`));if(R.length>0)m.push(R.filter((x)=>!f.has(x)).join(`
|
|
31
31
|
`));return m.push(S),m.join(`
|
|
32
|
-
`)}import O from"fs";import B from"path";function ha(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function ya(t,s){let e=B.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function ba(t){let s=B.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function st(t){let s=t.headers.get("content-type")||"",e={},r=(i,o)=>{let c=e[i];if(c===void 0)e[i]=o;else if(Array.isArray(c))c.push(o);else e[i]=[c,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,c]of i.entries())if(typeof c==="string")r(o,c);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())r(i,o);return e}return e}function vo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function U(t,s={}){let e=s.request,r=s.method??e?.method;if(!e||!vo(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await st(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let c=o,a=it(c.cookies),l=c.redirect;if(typeof l==="string"&&l)return{redirect:l,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:f,redirect:u,...d}=c;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function it(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){s.push(M(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function wa(t,s=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)r.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,o);return new Response(null,{status:303,headers:r})}async function Dn(t,s={}){let{html:e,context:r,redirect:i,cookies:o}=await ot(t,s),c=
|
|
33
|
-
export{
|
|
32
|
+
`)}import O from"fs";import B from"path";function ha(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function ya(t,s){let e=B.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function ba(t){let s=B.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function st(t){let s=t.headers.get("content-type")||"",e={},r=(i,o)=>{let c=e[i];if(c===void 0)e[i]=o;else if(Array.isArray(c))c.push(o);else e[i]=[c,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,c]of i.entries())if(typeof c==="string")r(o,c);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())r(i,o);return e}return e}function vo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function U(t,s={}){let e=s.request,r=s.method??e?.method;if(!e||!vo(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await st(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let c=o,a=it(c.cookies),l=c.redirect;if(typeof l==="string"&&l)return{redirect:l,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:f,redirect:u,...d}=c;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function it(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){s.push(M(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function wa(t,s=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)r.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,o);return new Response(null,{status:303,headers:r})}async function Dn(t,s={}){let{html:e,context:r,redirect:i,cookies:o}=await ot(t,s),c=Dt(r),a=Lt(r);if(i)return{html:e,redirect:i,cookies:o,status:c,headers:a};let{extractStreamBoundaries:l}=await import("./chunk-98bgx3ws.js"),f=l(r),u=t.streamTemplates;if(u&&Object.keys(u).length>0){let{processDirectives:d}=await import("./chunk-pvx1hrqq.js"),{defaultConfig:h}=await import("./chunk-pn0rmd8d.js"),S=r.streamBoundaries||{},R={...h,autoShell:!1},b=Object.keys(u).map((m)=>({id:m,render:async()=>{let x=typeof S[m]==="function"?await S[m]():void 0;return d(u[m],{...r,$boundary:x},t.sourceFile,R,new Set)}})),k=new Set(b.map((m)=>m.id));f=[...(f||[]).filter((m)=>!k.has(m.id)),...b]}return{html:e,boundaries:f&&f.length>0?f:void 0,cookies:o,status:c,headers:a}}async function ot(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!_i(t.html))return{html:t.html,context:e};for(let c of t.serverScriptContent)try{await g(c,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let r=await U(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(c)=>{let a=c.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),l=$r(e);if(!l)return a;let f=a.indexOf("</head>");return f<0?l+a:a.slice(0,f)+l+a.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!_i(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let o=new Map;for(let[c,a]of Object.entries(t.placeholders))if(a.expression)try{let l=A(a.expression,e);if(a.type==="raw")o.set(c,l!==void 0&&l!==null?String(l):"");else o.set(c,l!==void 0&&l!==null?W(String(l)):"")}catch(l){if(s.__stx_strict_hydration)throw l;o.set(c,"")}return{html:i(ll(t.html,o)),context:e,cookies:r.cookies}}
|
|
33
|
+
export{ht,Yt,Te,j,Nn,Mn,ga,wo,Jr,Ke,ma,Ge,$e,ha,ya,ba,vo,wa,Dn};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Vr}from"./chunk-
|
|
2
|
+
import{Vr}from"./chunk-e7thwrt5.js";import{existsSync as m,statSync as x}from"fs";import s from"path";var g=new Map;function M(r){let n=s.extname(r);if(n===".tsx")return"tsx";if(n===".jsx")return"jsx";if(n===".ts"||n===".mts"||n===".cts")return"ts";return"js"}async function j(r,n){let l=Object.entries(n).map(([e,t])=>[s.resolve(r,e),s.resolve(r,t)]),d=l.map(([e,t])=>{try{return`${e}\x00${t}\x00${x(t).mtimeMs}`}catch{return`${e}\x00${t}\x00-`}}).join(`
|
|
3
3
|
`),f=`${r}\x00${JSON.stringify(n)}`,o=g.get(f);if(o&&o.signature===d)return o.standIns;let a=new Map;for(let[e,t]of l){let c=s.relative(r,e);if(!m(e))throw Error(`webModules: ${c} does not exist`);if(!m(t))throw Error(`webModules: ${s.relative(r,t)}, the stand-in for ${c}, does not exist`);if(e===t)throw Error(`webModules: ${c} stands in for itself`);let p=await Bun.file(t).text(),u=new Bun.Transpiler({loader:M(t),target:"browser"});if(s.dirname(t)!==s.dirname(e)){let i=u.scanImports(p).find((h)=>/^\.\.?\//.test(h.path));if(i)throw Error(`webModules: ${s.relative(r,t)} imports ${i.path}, which would resolve from ${s.relative(r,s.dirname(e))||"."}; a stand-in imports relatively only from the directory of the module it replaces`)}let w=u.transformSync(p);for(let i of Vr(e))a.set(i,w)}return g.set(f,{signature:d,standIns:a}),a}export{j as loadWebModules};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ou,iu,au,cu,lu,uu,du,pu,fu,gu,Vm}from"./chunk-3b7q7d7j.js";export{ou as createIslandRegistry,Vm as default,gu as generateIslandManifest,au as generatePartialHydrationCSS,uu as hydrateAll,lu as hydrateByStrategy,cu as hydrateIsland,du as isHydrated,pu as onHydrated,iu as processPartialHydrationDirectives,fu as processStaticDirectives};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ko,xh,Sh}from"./chunk-fbnykfnv.js";import"./chunk-jwtp4csj.js";import"./chunk-qvwzaxdd.js";import"./chunk-mzes9ds7.js";import"./chunk-8623gte8.js";import"./chunk-s322kcw7.js";import"./chunk-wd4z5w4d.js";import"./chunk-1347hwt5.js";import"./chunk-tk67pqaf.js";import"./chunk-e763qsg0.js";import"./chunk-kedgfk9z.js";import"./chunk-pa8xkctc.js";import"./chunk-jwwsxym6.js";import"./chunk-jdqmk5sv.js";import"./chunk-qv52et0d.js";import"./chunk-sny8rqe8.js";import"./chunk-0z2gqttt.js";import"./chunk-xppm4cs4.js";import"./chunk-7fgfzaah.js";export{Sh as clearComposableCache,xh as getComposableScript,ko as listComposableModules};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{zh,Vf,Ze,gc,Hh,us,ds,ps}from"./chunk-rq9pqd4s.js";import"./chunk-71s4hpkj.js";import"./chunk-75e4wzzs.js";import"./chunk-me16tftr.js";import"./chunk-wd4z5w4d.js";import"./chunk-jdqmk5sv.js";import"./chunk-qv52et0d.js";import"./chunk-sny8rqe8.js";import"./chunk-0z2gqttt.js";import"./chunk-xppm4cs4.js";import"./chunk-7fgfzaah.js";export{Hh as clearOnceStore,gc as onceStore,Ze as partialsCache,us as processIncludes,ds as processStackPushDirectives,ps as processStackReplacements,zh as resetUnscopedSignalWarnings,Vf as topLevelElements};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function
|
|
3
|
-
export{
|
|
2
|
+
import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function Qf(o){return w.test(o)}async function ti(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if(Qf(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
|
|
3
|
+
export{Qf,ti};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{existsSync as x,realpathSync as b,statSync as y}from"fs";import f from"path";import k from"process";var E=/^[\w-]+(?:\/[\w-]+)*$/,j=/^[\w-]+$/;async function Hr(s,e){let n=f.resolve(s,e.dir);if(!e.languages?.length)throw Error("messages.languages must name at least one language");let a=new Map,r=new Map;for(let t of e.languages){if(!j.test(t))throw Error(`messages: "${t}" is not a language directory name`);let g=f.join(n,t);if(!x(g))throw Error(`messages: ${f.relative(s,g)} does not exist`);let o=new Map;for(let i of[...new Bun.Glob("**/*.{ts,js,mjs,json}").scanSync({cwd:g})].sort()){if(/\.(?:test|spec|d)\.[^.]+$/.test(i))continue;let l=i.replace(/\.[^./]+$/,"").split(f.sep).join("/");if(!E.test(l))throw Error(`messages: ${t}/${i} is not an area name`);if(o.has(l))throw Error(`messages: ${t}/${l} is defined twice`);let c=f.join(g,i),p=await import(c),m=Object.keys(p).filter((S)=>S!=="default");if(m.length)throw Error(`messages: ${t}/${i} exports ${m.join(", ")}; a message module exports its messages as default, and nothing else`);let u=p.default,d=u!==null&&typeof u==="object"&&!Array.isArray(u)?JSON.stringify(u):void 0;if(d===void 0||!Bun.deepEquals(JSON.parse(d),u,!0))throw Error(`messages: ${t}/${i} must export plain data (an object JSON can hold) as default`);o.set(l,d),a.set(c,{language:t,area:l})}r.set(t,o)}return{files:a,data:r}}function h(s,e){return`stx-messages:${s}:${e}`}function _(s,e){let n=JSON.stringify(h(s,e));return`var kept = globalThis.__stxMessages || (globalThis.__stxMessages = {});
|
|
3
|
-
export default kept[${n}] || (kept[${n}] = {});`}var M=new Map;function Vr(s){let e=[s];try{e.push(b(s))}catch{}for(let n of[...e])if(n.startsWith("/private/"))e.push(n.slice(8));return[...new Set(e)]}function
|
|
3
|
+
export default kept[${n}] || (kept[${n}] = {});`}var M=new Map;function Vr(s){let e=[s];try{e.push(b(s))}catch{}for(let n of[...e])if(n.startsWith("/private/"))e.push(n.slice(8));return[...new Set(e)]}function Zg(s,e=k.env){if(!s.messages||e.STX_PAGE_MESSAGES==="0")return!1;return e.STX_PAGE_MESSAGES==="1"||e.NODE_ENV==="production"}async function Qg(s,e){let n=f.resolve(s,e.dir),a=e.languages.map((c)=>{try{return`${c}:${y(f.join(n,c)).mtimeMs}`}catch{return`${c}:-`}}).join("|"),r=`${n}\x00${e.languages.join(",")}\x00${e.fallback??""}`,t=M.get(r);if(t&&t.signature===a)return t.messages;let g=await Hr(s,e),o=new Map;for(let[c,{language:p,area:m}]of g.files){let u=_(p,m);for(let d of Vr(c))o.set(d,u)}let i=e.fallback??e.languages[0];if(!e.languages.includes(i))throw Error(`messages.fallback "${i}" is not one of messages.languages`);let l={...g,stubs:o,languages:[...e.languages],fallback:i};return M.set(r,{signature:a,messages:l}),l}function em(...s){let e=new Set;for(let n of s){if(!n||!n.includes("stx-messages:"))continue;for(let a of n.matchAll(/stx-messages:[\w-]+:([\w/-]+)/g))e.add(a[1])}return e}function tm(s,e){let n=/<html\b[^>]*>/i.exec(s)?.[0]??"",a=/\slang\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(n),r=(a?a[1]??a[2]??a[3]??"":"").trim().toLowerCase(),t=new Map(e.languages.map((o)=>[o.toLowerCase(),o])),g=t.get(r)??t.get(r.split(/[-_]/)[0]??"");if(!g)return[...e.languages];return[...new Set([g,e.fallback])]}var w=new WeakMap;function nm(s,e,n){let a=[...n].sort(),r=w.get(s);if(!r)w.set(s,r=new Map);let t=`${e.join(",")}\x00${a.join(",")}`;if(r.has(t))return r.get(t);let g=P(s,e,a);return r.set(t,g),g}function P(s,e,n){let a=[];for(let r of e){let t=s.data.get(r);if(!t)continue;for(let g of n){let o=t.get(g);if(o!==void 0)a.push(`put(${JSON.stringify(h(r,g))},${JSON.stringify(o)})`)}}if(a.length===0)return null;return`;(function(){var kept=globalThis.__stxMessages||(globalThis.__stxMessages={}),filled=globalThis.__stxMessagesFilled||(globalThis.__stxMessagesFilled={});function put(key,json){if(filled[key])return;filled[key]=1;var into=kept[key]||(kept[key]={}),data=JSON.parse(json);for(var name in data)into[name]=data[name]}
|
|
4
4
|
${a.join(`;
|
|
5
5
|
`)};
|
|
6
6
|
})();`}
|
|
7
|
-
export{Hr,Vr,
|
|
7
|
+
export{Hr,Vr,Zg,Qg,em,tm,nm};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function
|
|
3
|
-
export{
|
|
2
|
+
var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function qt(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function io(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function Kt(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Ji(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function dt(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function Yi(e){console.log(` ${O("\u2139")} ${e}`)}function Zi(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function ao(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function Gt(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function Qi(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function Xt(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
|
|
3
|
+
export{qt,io,Kt,Ji,dt,Yi,Zi,ao,Gt,Qi,Xt};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{se}from"./chunk-
|
|
3
|
-
export{va,
|
|
2
|
+
import{se}from"./chunk-tpw435g0.js";import R from"fs";import g from"path";import C from"crypto";var S=new Set(["webp","avif","jpeg","png"]),T=new Set(["cover","contain","fill","inside","outside"]),q=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),k=4096,D=80,U="cover";async function va(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=A(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=R.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await R.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=C.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":se(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await L(),F=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,F),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(F),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function Xl(e){return async(t)=>await va(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function A(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!q.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??k,l=t.maxHeight??k,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!S.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...S].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??D;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||U;if(!T.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...T].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function L(){return await import("./chunk-6d74qdc6.js")}
|
|
3
|
+
export{va,Xl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{E}from"./chunk-
|
|
2
|
+
import{E}from"./chunk-jdqmk5sv.js";import{i}from"./chunk-mzg1wq86.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,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
|
|
3
3
|
${e.bold}${t[0]}${e.reset} - ${n.description}`),console.log(` Usage: ${e.cyan}${n.usage}${e.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${e.bold}Available Commands:${e.reset}
|
|
@@ -16,9 +16,9 @@ ${e.bold}Markdown:${e.reset}`),a.forEach((c)=>console.log(` ${e.blue}${c}${e.re
|
|
|
16
16
|
${e.bold}Other:${e.reset}`),d.forEach((c)=>console.log(` ${e.dim}${c}${e.reset}`));console.log()}},cat:{description:"Show file contents",usage:"cat <file>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!await Bun.file(n).exists()){console.log(`${e.red}Error: File not found: ${n}${e.reset}`);return}let s=(await Bun.file(n).text()).split(`
|
|
17
17
|
`);console.log(),s.forEach((l,a)=>{let d=String(a+1).padStart(3," ");console.log(`${e.dim}${d}${e.reset} ${l}`)}),console.log()}},load:{description:"Load context from JSON file",usage:"load <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a JSON file${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!await Bun.file(n).exists()){console.log(`${e.red}Error: File not found: ${n}${e.reset}`);return}try{let r=await Bun.file(n).text(),s=JSON.parse(r);o.context={...o.context,...s},console.log(`${e.green}\u2713${e.reset} Loaded ${Object.keys(s).length} variables from ${t[0]}`)}catch(r){console.log(`${e.red}Error parsing JSON:${e.reset}`,r)}}},save:{description:"Save context to JSON file",usage:"save <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file name${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);try{await Bun.write(n,JSON.stringify(o.context,null,2)),console.log(`${e.green}\u2713${e.reset} Context saved to ${t[0]}`)}catch(r){console.log(`${e.red}Error saving file:${e.reset}`,r)}}},history:{description:"Show command history",usage:"history [count]",handler:async(t,o)=>{let n=t[0]?Number.parseInt(t[0],10):20,r=o.history.slice(-n);if(r.length===0){console.log(`${e.dim}No history${e.reset}`);return}console.log(),r.forEach((s,l)=>{let a=String(o.history.length-r.length+l+1).padStart(3," ");console.log(`${e.dim}${a}${e.reset} ${s}`)}),console.log()}},exit:{description:"Exit interactive mode",usage:"exit",handler:async(t,o)=>{o.running=!1,console.log(`
|
|
18
18
|
${e.dim}Goodbye!${e.reset}
|
|
19
|
-
`)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let n=t.split(" "),r=n[0];if(n.length===1)return Object.keys(u).filter((s)=>s.startsWith(r));if(["render","cat","load","cd"].includes(r)){let s=n.slice(1).join(" "),l=g.dirname(s)||".",a=g.basename(s),d=g.resolve(o.cwd,l);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${r} ${l==="."?"":`${l}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(r)){let s=n[1]||"";return Object.keys(o.context).filter((l)=>l.startsWith(s)).map((l)=>`${r} ${l}`)}return[]}async function
|
|
19
|
+
`)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let n=t.split(" "),r=n[0];if(n.length===1)return Object.keys(u).filter((s)=>s.startsWith(r));if(["render","cat","load","cd"].includes(r)){let s=n.slice(1).join(" "),l=g.dirname(s)||".",a=g.basename(s),d=g.resolve(o.cwd,l);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${r} ${l==="."?"":`${l}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(r)){let s=n[1]||"";return Object.keys(o.context).filter((l)=>l.startsWith(s)).map((l)=>`${r} ${l}`)}return[]}async function sm(t={}){let o={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},n=y.createInterface({input:process.stdin,output:process.stdout,completer:(s)=>[h(s,o),s],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
22
|
`);let r=()=>{let s=o.cwd.replace(process.env.HOME||"","~");n.question(`${e.cyan}stx${e.reset} ${e.dim}${s}${e.reset} ${e.green}>${e.reset} `,async(l)=>{let a=l.trim();if(!a){if(o.running)r();return}o.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],c=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(c&&u[c])try{await u[c].handler(f,o)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(c)if(a.includes("{{")||a.includes("}}"))try{let m=await E(a,o.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${c}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${c}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(o.running)r();else n.close()})};n.on("SIGINT",()=>{console.log(`
|
|
23
23
|
${e.dim}(Use 'exit' to quit)${e.reset}`),r()}),r()}
|
|
24
|
-
export{
|
|
24
|
+
export{sm};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hs,Wf,Uo,qf}from"./chunk-mxazxwc4.js";import"./chunk-me16tftr.js";import"./chunk-8623gte8.js";import"./chunk-s322kcw7.js";import"./chunk-wd4z5w4d.js";import"./chunk-1347hwt5.js";import"./chunk-tk67pqaf.js";import"./chunk-e763qsg0.js";import"./chunk-kedgfk9z.js";import"./chunk-pa8xkctc.js";import"./chunk-jwwsxym6.js";import{Mt}from"./chunk-jdqmk5sv.js";import"./chunk-qv52et0d.js";import"./chunk-sny8rqe8.js";import"./chunk-0z2gqttt.js";import"./chunk-xppm4cs4.js";import"./chunk-7fgfzaah.js";export{qf as declareBareLoopHead,Mt as parseLoopBinding,Wf as processLoops,Uo as processLoopsAsync,hs as reportDeferredLoopWarnings};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{go,aa,Kr,mo,ho,On,Jt,ca,Gr,Xr,yo,bo,am,cm,mt}from"./chunk-y67r0d0c.js";export{mt as DeployError,aa as calculateSha1,Kr as collectDeployFiles,Xr as createDefaultNetlifyConfig,mo as createFileManifest,go as createNetlifyClient,am as deploy,Gr as detectProjectConfig,ho as filterRequiredFiles,On as formatSize,ca as generateNetlifyToml,Jt as getTotalSize,bo as hasNetlifyConfig,cm as initNetlify,yo as writeNetlifyConfig};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var l=new Map,u=new Map;function m(t){if(l.set(t.name,t),t.client)u.set(t.name,t.client)}function
|
|
3
|
-
export{
|
|
2
|
+
var l=new Map,u=new Map;function m(t){if(l.set(t.name,t),t.client)u.set(t.name,t.client)}function _t(t){return m(t),{name:t.name,hasEndTag:t.hasEndTag??!0,description:t.description,handler:async(r,o,a,s)=>{let n=f(o,t.defaults);if(t.validate){let e=t.validate(n);if(e!==!0){let d=typeof e==="string"?e:`Invalid parameters for @${t.name}`;throw Error(d)}}let i=r;if(t.transform)i=await t.transform(r,n,a,s);if(t.clientScript){let e=t.clientScript(n);i+=`<script>${e}</script>`}if(t.css){let e=t.css(n);i+=`<style>${e}</style>`}return i}}}function f(t,c){let r={...c};for(let o of t){let a=o.indexOf(":"),s=o.indexOf("="),n=a>=0&&(s<0||a<s)?a:s;if(n>=0){let i=o.slice(0,n).trim(),e=o.slice(n+1).trim();if(e==="true")e=!0;else if(e==="false")e=!1;else if(e==="null")e=null;else if(!Number.isNaN(Number(e)))e=Number(e);else if(typeof e==="string"&&e.startsWith("{"))try{e=JSON.parse(e)}catch{}r[i]=e}else{let i=Object.keys(r).filter((e)=>!c||!(e in c)).length;r[i===0?"value":`arg${i}`]=o}}return r}
|
|
3
|
+
export{_t};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
${l.trim()}`)}catch(l){console.warn(`[stx] Failed to load composable ${o}:`,l)}if(D.length===0||M.size===0)return
|
|
2
|
+
import{Ne,w,S,C,Z}from"./chunk-jdqmk5sv.js";import{k}from"./chunk-7fgfzaah.js";import{I,An}from"./chunk-xppm4cs4.js";import{a}from"./chunk-1347hwt5.js";import{be,an,cn,ln}from"./chunk-jwtp4csj.js";import{St}from"./chunk-8623gte8.js";import{bt,Wn,Qt,ue}from"./chunk-jhm1228j.js";import{T,Rn}from"./chunk-ym5qgw03.js";import h from"path";var v=new Map,A=new Map,E=w(64),F=new Map,Y=["composables","functions"];function H(e){let s=h.basename(e,".ts");return s==="index"||s==="types"||e.endsWith(".d.ts")}async function ee(e){if(e)return h.resolve(e);let s=`<default>:${process.cwd()}`,r=F.get(s);if(r!==void 0)return r;let t=await te();if(t!==null)F.set(s,t);return t}async function te(){let e=await a(),s=e.root||process.cwd(),r=e.composablesDir;if(r)return h.resolve(s,r);for(let t of Y){let n=h.resolve(s,t);try{let c=new Bun.Glob("**/*.ts");for await(let i of c.scan({cwd:n,absolute:!0}))if(!H(i))return n}catch{}}return null}async function W(e){let s=Array.isArray(e)?e:e?[h.resolve(e)]:(await a())._layerComposableDirs??[await ee()].filter((t)=>!!t),r=new Map;for(let t of s){let n=new Bun.Glob("**/*.ts");try{for await(let c of n.scan({cwd:t,absolute:!0})){let i=h.relative(t,c);if(!H(c)&&!r.has(i))r.set(i,c)}}catch{}}return{key:s.join("\x00"),files:[...r.values()].sort()}}async function ko(e){let{files:s}=await W(e),r=Z({loader:"ts",target:"browser",define:C()}),t=[];for(let n of s)try{let c=await Bun.file(n).text(),i=r.scan(c).exports.filter((u)=>u!=="default");if(i.length>0)t.push({file:n,names:i})}catch{}return t}function ne(e,s){return new RegExp(`\\b${s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(e)}function R(e,s){let r=new Set(e.match(/\w+/g)),t=new Set;for(let n of s)if(/^\w+$/.test(n)?r.has(n):ne(e,n))t.add(n);return t}var J=w(64);function X(e,s){let r=S(e,s.size),t=J.get(r);if(t)return t;let n;try{n=Ne(e,s)}catch{n=R(e,s)}let c=[...e.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...e.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let i of c)for(let u of i[1].split(",")){let f=u.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(f&&s.has(f))n.add(f)}return J.set(r,n),n}function se(e){return!e||/^(?:module|(?:text|application)\/(?:java|ecma)script|application\/stx-[\w-]+)$/i.test(e)}var L=w(256);function oe(e,s){let r=new Set(s),t="",n=0,c=new Set;for(let i of e.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi)){t+=e.slice(n,i.index),n=i.index+i[0].length;let u=i[1]??"",f=i[2]??"",d=/\btype\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(u),m=d?(d[1]??d[2]??d[3]??"").trim():void 0;if(!se(m)){if(!/json/i.test(m??""))t+=` ${f} `;continue}let y=R(f,r);if(y.size===0)continue;let _=S(f,[...y].sort().join(",")),b=L.get(_);if(!b)b=X(f,y),L.set(_,b);for(let B of b)c.add(B)}t+=e.slice(n);for(let i of R(t,r))c.add(i);return c}function ie(e,s,r){let t=new Map;for(let{file:f,names:d}of e)for(let m of d)if(!t.has(m))t.set(m,f);let n=new Set(t.keys()),c=(f)=>{let d=[];for(let m of X(f,n))d.push(t.get(m));return d},i=new Set,u=r.flatMap((f,d)=>d===0?[...oe(f,t.keys())].map((m)=>t.get(m)):c(f));while(u.length>0){let f=[];for(let d of u){if(i.has(d))continue;i.add(d);for(let m of c(s.get(d)??""))if(!i.has(m))f.push(m)}u=f}return i}async function xh(e,s,r,t){let{key:n,files:c}=await W(e);if(!n)return null;let i=()=>[...new Set([...c,...c.flatMap((o)=>be(o))])],u=bt(i());if(c.length===0)return ue(v,n,u,""),null;c.sort();let f=Z({loader:"ts",target:"browser",define:C()}),d=Qt(A,n,u);if(!d){let o=new Map,l=[];for(let p of c)try{let x=await Bun.file(p).text();o.set(p,x);let g=f.scan(x).exports.filter((V)=>V!=="default");if(g.length>0)l.push({file:p,names:g})}catch{o.set(p,"")}d=ue(A,n,u,{codeByFile:o,modules:l})}let{codeByFile:m,modules:y}=d,_;if(s===void 0)_=new Set(c);else{let o=r?[s,...r]:[s],l=S(o.join("\x00"),n,o.length,u),p=E.get(l);if(_=p??ie(y,m,o),!p)E.set(l,_)}if(_.size===0)return null;let b=c.filter((o)=>_.has(o)),B=()=>{if(!t)return;for(let o of b)t.push(o,...be(o))},N=`${n}\x00${b.join("\x00")}\x00${cn()}`,P=Qt(v,N,u);if(P!==void 0)return B(),P||null;let D=[],M=new Set,U=new Set;for(let o of b)try{let l=m.get(o)??await Bun.file(o).text(),p=h.basename(o,".ts");for(let g of l.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(g[1])U.add(g[1]);let x=[];try{for(let g of f.scan(l).exports)if(g!=="default")M.add(g),x.push(g)}catch{}if(l=I(l),an(l))l=await ln(l,o,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:x}),l=St(l);l=An(l),l=l.replace(/^export\s+(default\s+)?/gm,""),l=f.transformSync(l),D.push(`// Composable: ${p}
|
|
3
|
+
${l.trim()}`)}catch(l){console.warn(`[stx] Failed to load composable ${o}:`,l)}if(D.length===0||M.size===0)return ue(v,N,u,""),null;let q=[...M].map((o)=>` try { if (!(${JSON.stringify(o)} in __c)) __c[${JSON.stringify(o)}] = ${o}; } catch (e) {}`).join(`
|
|
4
4
|
`),z=JSON.stringify([...M]),j=D.join(`
|
|
5
5
|
|
|
6
6
|
`),Q=k.filter((o)=>!U.has(o)&&new RegExp(`\\b${o}\\b`).test(j)).map((o)=>`var ${o} = __stx[${JSON.stringify(o)}];`).join(`
|
|
@@ -29,5 +29,5 @@ ${q}
|
|
|
29
29
|
window[__n] = __c[__n];
|
|
30
30
|
__published[__n] = true;
|
|
31
31
|
}
|
|
32
|
-
})();`,G=T()?Rn(O):O;return u=
|
|
33
|
-
export{ko,
|
|
32
|
+
})();`,G=T()?Rn(O):O;return u=bt(i()),ue(v,N,u,G),B(),G}function Sh(){v.clear(),Wn(),A.clear(),E.clear(),F.clear()}
|
|
33
|
+
export{ko,xh,Sh};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{E}from"./chunk-
|
|
3
|
-
`)}catch{return""}})}function
|
|
4
|
-
`)}catch{return""}})}function
|
|
2
|
+
import{E}from"./chunk-jdqmk5sv.js";import{de}from"./chunk-1z2am28h.js";function g(e,t){let r={};for(let n of e)r[n]=de(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=de(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function _a(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=de(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:V}}var mu=_a;class Un{rules=[];defaultValue="";addRule(e){let t=new Un;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new Un;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new Un;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var Um=new Un;function hu(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>E(c,{...t,message:l},r)).join(`
|
|
3
|
+
`)}catch{return""}})}function yu(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>E(c,{...t,message:l},r)).join(`
|
|
4
|
+
`)}catch{return""}})}function bu(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function Wm(e,t,r){let n=e;return n=hu(n,t,r),n=yu(n,t,r),n=bu(n,t,r),n}export{_a,mu,Un,Um,hu,yu,bu,Wm};
|
|
@@ -298,5 +298,5 @@ catch (error) {
|
|
|
298
298
|
init();
|
|
299
299
|
}
|
|
300
300
|
})();
|
|
301
|
-
</script>`}var
|
|
302
|
-
export{
|
|
301
|
+
</script>`}var Bg={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Fg={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},zg={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},Hg={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},oo=[Bg,Fg,zg,Hg];function Ey(t){return[...t,...oo]}
|
|
302
|
+
export{Bg,Fg,zg,Hg,oo,Ey};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import d from"fs";import l from"path";function
|
|
2
|
+
import d from"fs";import l from"path";function $l(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Rl(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function Al(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function Og(n,s){let e=$l(n),a=s&&d.existsSync(s)?Rl(s):[];return Al([...e,...a])}function Ng(n){let s=[];s.push(`
|
|
3
3
|
=== PWA Audit Report ===
|
|
4
4
|
`);let e=n.score>=90?"32":n.score>=70?"33":"31";s.push(`Score: \x1B[${e}m${n.score}/100\x1B[0m`),s.push(`Passed: ${n.passed} | Failed: ${n.failed} | Warnings: ${n.warnings}
|
|
5
5
|
`);let a=["required","recommended","optional"];for(let t of a){let c=n.checks.filter((o)=>o.category===t);if(c.length===0)continue;s.push(`
|
|
6
6
|
${t.toUpperCase()}:`);for(let o of c){let u=o.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(s.push(` ${u} ${o.name}: ${o.message}`),o.details)s.push(` ${o.details}`)}}return s.push(""),s.join(`
|
|
7
7
|
`)}
|
|
8
|
-
export{
|
|
8
|
+
export{$l,Rl,Al,Og,Ng};
|