@stacksjs/stx 0.2.898 → 0.2.899
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-qe0t0m38.js → chunk-0b57fgpn.js} +4 -4
- package/dist/chunk-0f2d61b3.js +2 -0
- package/dist/{chunk-pjj54ddk.js → chunk-0gc1hez6.js} +3 -3
- package/dist/chunk-0ht6exrv.js +2 -0
- package/dist/{chunk-t3zmfh8w.js → chunk-150cz8qq.js} +7 -7
- package/dist/chunk-1pbghytr.js +2 -0
- package/dist/chunk-1tb18a92.js +2 -0
- package/dist/{chunk-dvjv4c3a.js → chunk-2sz1kh9m.js} +1 -1
- package/dist/chunk-2vqamyay.js +2 -0
- package/dist/chunk-36mz0nwv.js +2 -0
- package/dist/{chunk-q4dcchrt.js → chunk-3k4rteax.js} +13 -13
- package/dist/chunk-3m37fzvh.js +2 -0
- package/dist/chunk-3my2eef2.js +2 -0
- package/dist/{chunk-qcbj1m21.js → chunk-40fpt0r6.js} +10 -10
- package/dist/{chunk-khm56bfm.js → chunk-46khhke2.js} +1 -1
- package/dist/{chunk-4wh71ddp.js → chunk-472w7t7p.js} +2 -2
- package/dist/{chunk-bjmkyead.js → chunk-4e28p8vf.js} +6 -6
- package/dist/{chunk-bgfs3mbg.js → chunk-4hk1mjtv.js} +5 -5
- package/dist/chunk-4jtewn1v.js +2 -0
- package/dist/chunk-4s6w89m2.js +2 -0
- package/dist/{chunk-dd074gp5.js → chunk-4wd5sn16.js} +7 -7
- package/dist/{chunk-1bft48gk.js → chunk-50wjk5ap.js} +2 -2
- package/dist/{chunk-ch9028z3.js → chunk-54x7h3sb.js} +1 -1
- package/dist/chunk-5astk182.js +2 -0
- package/dist/{chunk-3b3mkgpj.js → chunk-5g5khx0m.js} +2 -2
- package/dist/{chunk-zf68afyh.js → chunk-5gnt3qtn.js} +3 -3
- package/dist/{chunk-80ky40mm.js → chunk-5jrpzepc.js} +2 -2
- package/dist/{chunk-q0y8gv18.js → chunk-5mrt1enm.js} +2 -2
- package/dist/{chunk-wg6fmren.js → chunk-5tm1pvt3.js} +2 -2
- package/dist/chunk-5tvse0vw.js +2 -0
- package/dist/{chunk-ytjn0gq2.js → chunk-5yvgzh6n.js} +2 -2
- package/dist/{chunk-n6q1d66k.js → chunk-65g78sge.js} +1 -1
- package/dist/chunk-65rx54n6.js +2 -0
- package/dist/{chunk-x5bn2svk.js → chunk-67pq803s.js} +2 -2
- package/dist/{chunk-neg6ckjg.js → chunk-68r2zs20.js} +4 -4
- package/dist/{chunk-2s0q8mjx.js → chunk-6hjcqaqr.js} +2 -2
- package/dist/chunk-70ez3njv.js +2 -0
- package/dist/chunk-726w7fm2.js +2 -0
- package/dist/{chunk-xy8smv5e.js → chunk-73ebyhqq.js} +2 -2
- package/dist/chunk-73nazfe5.js +2 -0
- package/dist/{chunk-vk2jy6mn.js → chunk-7b3dqeyr.js} +2 -2
- package/dist/{chunk-whcrca58.js → chunk-7nn5s0c3.js} +30 -30
- package/dist/{chunk-062qfv99.js → chunk-7pfhr4nk.js} +2 -2
- package/dist/chunk-7r294vc9.js +2 -0
- package/dist/chunk-7rn7w53f.js +2 -0
- package/dist/{chunk-5v4e2a02.js → chunk-7z1hqp86.js} +4 -4
- package/dist/chunk-81qvg3yd.js +2 -0
- package/dist/{chunk-e16ef18k.js → chunk-83hs9905.js} +2 -2
- package/dist/chunk-8a9gmbxa.js +2 -0
- package/dist/chunk-8jvwapq3.js +2 -0
- package/dist/{chunk-g8p4sjy4.js → chunk-8rgy17fj.js} +8 -8
- package/dist/{chunk-ns2d6pb9.js → chunk-8v2hsn4d.js} +3 -3
- package/dist/{chunk-y1d3j2j7.js → chunk-8xb09hnn.js} +4 -4
- package/dist/{chunk-xmg6bmh6.js → chunk-945zygwa.js} +13 -13
- package/dist/{chunk-pvm48tse.js → chunk-9ejk9mwk.js} +2 -2
- package/dist/{chunk-bw2m1e7g.js → chunk-9hwg13ec.js} +5 -5
- package/dist/{chunk-ezpk14gs.js → chunk-9jpsxqaf.js} +1 -1
- package/dist/{chunk-0vrt55pp.js → chunk-9m45t60c.js} +80 -80
- package/dist/{chunk-jm9rbxj4.js → chunk-9n5san33.js} +14 -14
- package/dist/chunk-9vafweyd.js +3 -0
- package/dist/{chunk-zwqkbk2m.js → chunk-9w7whtbx.js} +2 -2
- package/dist/{chunk-1ph2yhfn.js → chunk-arfpzf17.js} +2 -2
- package/dist/chunk-avqxkbrd.js +2 -0
- package/dist/{chunk-htx5yezj.js → chunk-ayady5ws.js} +2 -2
- package/dist/{chunk-051r7ebx.js → chunk-b6ctdvdf.js} +6 -6
- package/dist/{chunk-taeqm3nc.js → chunk-becs8132.js} +5 -5
- package/dist/chunk-bmwcgmev.js +2 -0
- package/dist/{chunk-67j2m620.js → chunk-bzd387yx.js} +4 -4
- package/dist/{chunk-mhrnjaka.js → chunk-c0x9wyj7.js} +4 -4
- package/dist/chunk-cgqpn3e2.js +2 -0
- package/dist/chunk-cp82351f.js +2 -0
- package/dist/chunk-cvxg2rc1.js +2 -0
- package/dist/{chunk-v8ewgs1y.js → chunk-d1bwb2kz.js} +3 -3
- package/dist/{chunk-05x1rd86.js → chunk-de61k0ab.js} +2 -2
- package/dist/chunk-dj8fyaea.js +2 -0
- package/dist/chunk-dmc91qke.js +2 -0
- package/dist/{chunk-mr34w48c.js → chunk-e0bwzxfd.js} +6 -6
- package/dist/{chunk-w2qct5kq.js → chunk-e4xd1ca7.js} +1 -1
- package/dist/{chunk-3jxmnnef.js → chunk-e5q1ammf.js} +3 -3
- package/dist/{chunk-xvncq3m5.js → chunk-eb5cma4b.js} +2 -2
- package/dist/{chunk-3bsz7zj3.js → chunk-eb5v9npc.js} +2 -2
- package/dist/{chunk-aj5tsksz.js → chunk-edpsk4bg.js} +5 -5
- package/dist/{chunk-6kn2vwtn.js → chunk-eka2e4cm.js} +4 -4
- package/dist/{chunk-pnmafbv5.js → chunk-ern5hyvr.js} +1 -1
- package/dist/{chunk-41z7f41b.js → chunk-esm0pnpz.js} +2 -2
- package/dist/chunk-fe1wmmr5.js +2 -0
- package/dist/{chunk-r5ecgcx2.js → chunk-ffytbb4x.js} +5 -5
- package/dist/{chunk-vf4ejngv.js → chunk-fksmr50h.js} +6 -6
- package/dist/{chunk-nw2zjwcg.js → chunk-fsxk5fsh.js} +8 -8
- package/dist/{chunk-htvft92j.js → chunk-ft9h5qbs.js} +4 -4
- package/dist/chunk-fznzn35q.js +2 -0
- package/dist/{chunk-s94gqce0.js → chunk-g065d7p7.js} +2 -2
- package/dist/{chunk-rf0smj4c.js → chunk-g32hc78c.js} +2 -2
- package/dist/{chunk-nq60tjkz.js → chunk-gnf1e5q7.js} +2 -2
- package/dist/{chunk-bj8pv8m9.js → chunk-gq3gttt5.js} +21 -21
- package/dist/chunk-h2gnz7ja.js +2 -0
- package/dist/chunk-hc8ks7y3.js +2 -0
- package/dist/{chunk-cphc60zw.js → chunk-hdfhaddy.js} +2 -2
- package/dist/{chunk-t0ttxayz.js → chunk-hnjeqxqy.js} +2 -2
- package/dist/chunk-hpqvq1r9.js +2 -0
- package/dist/chunk-hs2a040z.js +2 -0
- package/dist/{chunk-xdrp6d7e.js → chunk-javb4e3b.js} +5 -5
- package/dist/chunk-jq49238b.js +2 -0
- package/dist/chunk-jr3fmkq7.js +2 -0
- package/dist/chunk-k2fw6paw.js +2 -0
- package/dist/chunk-k352spys.js +2 -0
- package/dist/{chunk-1knk403z.js → chunk-k3566kgd.js} +2 -2
- package/dist/{chunk-cmg9x1ka.js → chunk-k3ytyhkr.js} +3 -3
- package/dist/chunk-k79dvx67.js +2 -0
- package/dist/chunk-km1k3c4e.js +2 -0
- package/dist/chunk-kvjbpbmw.js +2 -0
- package/dist/chunk-mhv84p0x.js +2 -0
- package/dist/{chunk-ykax1thr.js → chunk-mjqsz20a.js} +2 -2
- package/dist/chunk-mmtyp5z4.js +2 -0
- package/dist/{chunk-8hwfdwgn.js → chunk-mry67rsk.js} +6 -6
- package/dist/{chunk-ksmn19qw.js → chunk-n3fgrsva.js} +2 -2
- package/dist/{chunk-jnwj14eq.js → chunk-n8xjqsze.js} +3 -3
- package/dist/{chunk-p3hbsrk9.js → chunk-nc5d3a5r.js} +5 -5
- package/dist/chunk-p4hm5srd.js +2 -0
- package/dist/{chunk-0jkj8thz.js → chunk-p89rpak1.js} +1 -1
- package/dist/{chunk-hxws025y.js → chunk-p92272k0.js} +2 -2
- package/dist/{chunk-bh2j50cy.js → chunk-pd31ge72.js} +6 -6
- package/dist/chunk-pjpy86c3.js +3 -0
- package/dist/chunk-psyqrxg0.js +2 -0
- package/dist/chunk-q4yq72wh.js +2 -0
- package/dist/{chunk-5xq6eky7.js → chunk-q6p96qq7.js} +7 -7
- package/dist/{chunk-115bb91s.js → chunk-qs0zk04y.js} +2 -2
- package/dist/{chunk-ta07gj66.js → chunk-qt2mr3f0.js} +31 -16
- package/dist/{chunk-a0aqs5a8.js → chunk-qykbjg3z.js} +2 -2
- package/dist/chunk-qzx6h6af.js +2 -0
- package/dist/{chunk-g5nfqzfh.js → chunk-r0az4z6d.js} +2 -2
- package/dist/{chunk-b9npgke0.js → chunk-r9n86na1.js} +39 -39
- package/dist/{chunk-zy97etqx.js → chunk-rapr0m13.js} +3 -3
- package/dist/{chunk-j1cgj6z2.js → chunk-rrpfn9rr.js} +1 -1
- package/dist/chunk-ryp47rwp.js +2 -0
- package/dist/{chunk-3qk8vf9m.js → chunk-t14bn66j.js} +3 -3
- package/dist/chunk-t9j000tb.js +2 -0
- package/dist/{chunk-7h52e87j.js → chunk-tga3nrn6.js} +5 -5
- package/dist/chunk-tgwwa872.js +2 -0
- package/dist/chunk-v0r6zb87.js +2 -0
- package/dist/{chunk-n0jfwsz1.js → chunk-v5v6w6rn.js} +2 -2
- package/dist/{chunk-9rjgq8k4.js → chunk-vbmvft7g.js} +1 -1
- package/dist/{chunk-kk2p2tgv.js → chunk-vfctk20v.js} +3 -3
- package/dist/{chunk-66qfr6b0.js → chunk-vgvxs1ag.js} +2 -2
- package/dist/{chunk-rb2zbdqd.js → chunk-vw7crz0z.js} +4 -4
- package/dist/chunk-vxtna1b1.js +2 -0
- package/dist/chunk-x43x2c6v.js +2 -0
- package/dist/chunk-xqx8t9w5.js +2 -0
- package/dist/{chunk-sh7a0g09.js → chunk-xr1s56k5.js} +3 -3
- package/dist/chunk-y10eaxgc.js +2 -0
- package/dist/chunk-ytk4f2j9.js +2 -0
- package/dist/chunk-z33r3pzy.js +2 -0
- package/dist/chunk-zcys6b06.js +2 -0
- package/dist/chunk-zkr42285.js +2 -0
- package/dist/chunk-zpwh9bpc.js +2 -0
- package/dist/chunk-zrs22j09.js +2 -0
- package/dist/chunk-zw6tgr0s.js +2 -0
- package/dist/cli.js +19 -19
- package/dist/client/signals-scope-disposal-runtime.js +18 -3
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dynamic-components.js +47 -25
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +4 -4
- package/package.json +5 -5
- package/dist/chunk-0hgetg3j.js +0 -2
- package/dist/chunk-0k437z3q.js +0 -2
- package/dist/chunk-0yh33smh.js +0 -2
- package/dist/chunk-0yycygry.js +0 -2
- package/dist/chunk-1a7a8cjs.js +0 -2
- package/dist/chunk-1p4q6t48.js +0 -2
- package/dist/chunk-1z6pqvmf.js +0 -2
- package/dist/chunk-2nqmw4dv.js +0 -2
- package/dist/chunk-2shw0j2q.js +0 -2
- package/dist/chunk-35j7gaj5.js +0 -2
- package/dist/chunk-3hd73qqj.js +0 -2
- package/dist/chunk-4akw3bym.js +0 -2
- package/dist/chunk-4d85str1.js +0 -2
- package/dist/chunk-53kcqdjj.js +0 -2
- package/dist/chunk-5eq2e6p3.js +0 -2
- package/dist/chunk-690518hw.js +0 -2
- package/dist/chunk-732gb689.js +0 -2
- package/dist/chunk-80xzjxah.js +0 -2
- package/dist/chunk-8cs8jckk.js +0 -2
- package/dist/chunk-9afkttvz.js +0 -2
- package/dist/chunk-a0jhmkpd.js +0 -2
- package/dist/chunk-a1s0tfcd.js +0 -3
- package/dist/chunk-a2bstyq1.js +0 -2
- package/dist/chunk-ah8az9vv.js +0 -2
- package/dist/chunk-arr79m90.js +0 -2
- package/dist/chunk-cgxmgjk4.js +0 -2
- package/dist/chunk-cp5x6kx1.js +0 -2
- package/dist/chunk-e28czxw3.js +0 -2
- package/dist/chunk-e8szp5wa.js +0 -2
- package/dist/chunk-essd43ad.js +0 -2
- package/dist/chunk-f60k8j9m.js +0 -2
- package/dist/chunk-fsehzmg8.js +0 -2
- package/dist/chunk-fsk3rk2x.js +0 -2
- package/dist/chunk-g0p2n9tm.js +0 -2
- package/dist/chunk-g5axctr0.js +0 -2
- package/dist/chunk-ggnhr4r3.js +0 -2
- package/dist/chunk-hk241gt2.js +0 -2
- package/dist/chunk-hmpmvf5c.js +0 -2
- package/dist/chunk-j1ncsbk2.js +0 -2
- package/dist/chunk-j9kejcrx.js +0 -2
- package/dist/chunk-jhbz5w30.js +0 -2
- package/dist/chunk-jvc2qb1n.js +0 -2
- package/dist/chunk-jytqf6p6.js +0 -2
- package/dist/chunk-k4x680e3.js +0 -2
- package/dist/chunk-kfdmm240.js +0 -2
- package/dist/chunk-mx5twaps.js +0 -2
- package/dist/chunk-nd2bhjdw.js +0 -2
- package/dist/chunk-qfxy34d4.js +0 -2
- package/dist/chunk-qwt94yh2.js +0 -2
- package/dist/chunk-rarsjcs4.js +0 -2
- package/dist/chunk-rryzw9x7.js +0 -2
- package/dist/chunk-ryj1srqn.js +0 -2
- package/dist/chunk-s5j4fpdr.js +0 -2
- package/dist/chunk-snkbn5y8.js +0 -2
- package/dist/chunk-tbh7r1wh.js +0 -2
- package/dist/chunk-tsz03zc9.js +0 -2
- package/dist/chunk-v3jyb8k6.js +0 -2
- package/dist/chunk-wbp6jgcr.js +0 -2
- package/dist/chunk-x6565mhk.js +0 -2
- package/dist/chunk-x8yne6s5.js +0 -2
- package/dist/chunk-xwgdcc7w.js +0 -2
- package/dist/chunk-z4tdnfxd.js +0 -2
- package/dist/chunk-zrbyvyn2.js +0 -2
- package/dist/chunk-zxjdfgdx.js +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function M(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return M(e.replace(/^\//,""))}function
|
|
3
|
-
`),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function
|
|
4
|
-
`))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),G=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function Dt(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&G.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function Se(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function Tr(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Us(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return Se(a,t)}import X from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(X.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function B(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...B(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class $r{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=B(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:j,params:O}=Se(g,{page:!0}),T=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:j,params:O,filePath:h,isDynamic:O.length>0,layout:T.length>0?T[T.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");_i(this.routes,s),Ci(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function Ws(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function qs(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function vg(e){k=e.replace(/\/$/,"")}function xg(e,t,a={}){f[e]={path:t,name:e,params:a}}function Sg(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function Rr(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function kg(){for(let e of Object.keys(f))delete f[e];k=""}import F from"fs";import q from"path";function _g(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Cg(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function Eg(e,t={}){return{handler:e,mode:t.mode??"universal"}}function P(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function Jc(e,t){let a=e.headers.get("cookie")||"",r=P(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function Yc(){return{get(e){if(typeof document>"u")return;return P(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return P(document.cookie)}}}function Zc(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function Ei(e,t){v.set(e,t)}function Qc(e){return v.get(e)}function Tg(e){return v.has(e)}function Lt(){v.clear()}function jt(){return Array.from(v.keys())}async function Bt(e,t="middleware"){let a=q.resolve(e,t);if(!F.existsSync(a))return;let r=F.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=q.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")Ei(o,s);else if(typeof s==="function")Ei(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function K(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function Ft(e,t,a,r=""){return{path:e,params:t,query:K(r),fullPath:r?`${e}?${r}`:e,meta:a}}function zt(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?Jc(a,i):Yc(),storage:Zc(),state:{},request:a,responseHeaders:i}}async function Ht(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=Qc(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function Ks(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function pt(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||Ks(n)}}var A,C;function W(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function U(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0,syntax:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").replace(/<\/script/gi,"<\\/script").trim()}catch{return e}}function H(){return`
|
|
2
|
+
import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function M(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return M(e.replace(/^\//,""))}function Ci(e,t){let a=e.filter((i)=>!b(i.pattern)),r=["// Auto-generated by STX - do not edit"];if(a.length===0)r.push("// No page routes found \u2014 route paths stay typed as string.","export {}","");else{r.push("declare module '@stacksjs/stx' {"," interface KnownRoutes {");for(let i of a){let c=[];for(let l of i.params){let d=i.pattern.includes(`:${l}?`)?"?":"";c.push(`${l}${d}: string`)}let s=c.join("; ");r.push(` '${i.pattern}': { ${s} }`)}r.push(" }","}","","export {}","")}let n=r.join(`
|
|
3
|
+
`),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function Ei(e,t,a){let r=process.cwd(),n=w.relative(r,a),o=e.filter((c)=>!b(c.pattern)),i=["// Auto-generated by stx \u2014 do not edit",`// Source: ${n||"pages"}/`,"","export const routes = ["];for(let c of o){let s=w.relative(r,c.filePath).replace(/\\/g,"/"),l=JSON.stringify(c.params),d=c.layout?`, layout: '${w.relative(r,c.layout).replace(/\\/g,"/")}'`:"";i.push(` { pattern: '${c.pattern}', filePath: '${s}', isDynamic: ${c.isDynamic}, params: ${l}${d} },`)}i.push("] as const",""),i.push("export type RouteName = typeof routes[number]['pattern']",""),p.mkdirSync(t,{recursive:!0}),p.writeFileSync(w.join(t,"routes.ts"),i.join(`
|
|
4
|
+
`))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),G=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function Dt(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&G.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function Se(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function $r(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Ws(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return Se(a,t)}import X from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(X.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function B(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...B(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class Rr{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=B(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:j,params:O}=Se(g,{page:!0}),T=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:j,params:O,filePath:h,isDynamic:O.length>0,layout:T.length>0?T[T.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");Ci(this.routes,s),Ei(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function qs(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function Ks(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function xg(e){k=e.replace(/\/$/,"")}function Sg(e,t,a={}){f[e]={path:t,name:e,params:a}}function kg(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function Ar(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function _g(){for(let e of Object.keys(f))delete f[e];k=""}import F from"fs";import q from"path";function Cg(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Eg(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function Tg(e,t={}){return{handler:e,mode:t.mode??"universal"}}function P(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function Yc(e,t){let a=e.headers.get("cookie")||"",r=P(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function Zc(){return{get(e){if(typeof document>"u")return;return P(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return P(document.cookie)}}}function Qc(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function Ti(e,t){v.set(e,t)}function el(e){return v.get(e)}function $g(e){return v.has(e)}function Lt(){v.clear()}function jt(){return Array.from(v.keys())}async function Bt(e,t="middleware"){let a=q.resolve(e,t);if(!F.existsSync(a))return;let r=F.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=q.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")Ti(o,s);else if(typeof s==="function")Ti(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function K(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function Ft(e,t,a,r=""){return{path:e,params:t,query:K(r),fullPath:r?`${e}?${r}`:e,meta:a}}function zt(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?Yc(a,i):Zc(),storage:Qc(),state:{},request:a,responseHeaders:i}}async function Ht(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=el(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function Gs(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function pt(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||Gs(n)}}var A,C;function W(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function U(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0,syntax:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").replace(/<\/script/gi,"<\\/script").trim()}catch{return e}}function H(){return`
|
|
5
5
|
;(function(){
|
|
6
6
|
'use strict';
|
|
7
7
|
var ROUTER_REV=8;
|
|
@@ -4218,4 +4218,4 @@ else {
|
|
|
4218
4218
|
|
|
4219
4219
|
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',init);else init();
|
|
4220
4220
|
})();
|
|
4221
|
-
`}function ft(){if(A)return A;return A=U(W(H()),!0),A}function
|
|
4221
|
+
`}function ft(){if(A)return A;return A=U(W(H()),!0),A}function Rg(){if(C)return C;return C=U(H()),C}export{Ci,Ei,Dt,Se,$r,Ws,Rr,qs,Ks,xg,Sg,kg,Ar,_g,Cg,Eg,Tg,Yc,Zc,Qc,Ti,el,$g,Lt,jt,Bt,Ft,zt,Ht,Gs,pt,ft,Rg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hg,gy,my,hy,yy,yg,bg,by,wy,yi,vy,Cr,Er,Ls}from"./chunk-g065d7p7.js";import{gt}from"./chunk-zkwkhesc.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{yy as __setSignalsGeneratorsForTest,gt as cacheEngineFingerprint,Er as cacheTemplate,Cr as checkCache,vy as clearDevCaches,bg as getCachedRouterScript,yg as getCachedSignalsRuntime,by as getServeClientAsset,yi as getServeModuleBundle,Ls as hashFilePath,my as invalidateFileCache,hy as invalidateFileCacheByDir,gy as readFileCached,wy as registerServeModuleBundle,hg as templateCache};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
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
|
|
3
|
-
export default kept[${a}] || (kept[${a}] = {});`}var w=new Map;function
|
|
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 ns(s,e){let a=f.resolve(s,e.dir);if(!e.languages?.length)throw Error("messages.languages must name at least one language");let n=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(a,t);if(!x(g))throw Error(`messages: ${f.relative(s,g)} does not exist`);let o=new Map;for(let l of[...new Bun.Glob("**/*.{ts,js,mjs,json}").scanSync({cwd:g})].sort()){if(/\.(?:test|spec|d)\.[^.]+$/.test(l))continue;let c=l.replace(/\.[^./]+$/,"").split(f.sep).join("/");if(!E.test(c))throw Error(`messages: ${t}/${l} is not an area name`);if(o.has(c))throw Error(`messages: ${t}/${c} is defined twice`);let d=f.join(g,l),i=await import(d),m=Object.keys(i).filter((M)=>M!=="default");if(m.length)throw Error(`messages: ${t}/${l} exports ${m.join(", ")}; a message module exports its messages as default, and nothing else`);let u=i.default,p=u!==null&&typeof u==="object"&&!Array.isArray(u)?JSON.stringify(u):void 0;if(p===void 0||!Bun.deepEquals(JSON.parse(p),u,!0))throw Error(`messages: ${t}/${l} must export plain data (an object JSON can hold) as default`);o.set(c,p),n.set(d,{language:t,area:c})}r.set(t,o)}return{files:n,data:r}}function S(s,e){return`stx-messages:${s}:${e}`}function _(s,e){let a=JSON.stringify(S(s,e));return`var kept = globalThis.__stxMessages || (globalThis.__stxMessages = {});
|
|
3
|
+
export default kept[${a}] || (kept[${a}] = {});`}var w=new Map;function rs(s){let e=[s];try{e.push(b(s))}catch{}for(let a of[...e])if(a.startsWith("/private/"))e.push(a.slice(8));return[...new Set(e)]}function bm(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 wm(s,e){let a=f.resolve(s,e.dir),n=e.languages.map((i)=>{try{return`${i}:${y(f.join(a,i)).mtimeMs}`}catch{return`${i}:-`}}).join("|"),r=`${a}\x00${e.languages.join(",")}\x00${e.fallback??""}\x00${JSON.stringify(e.preload??[])}`,t=w.get(r);if(t&&t.signature===n)return t.messages;let g=await ns(s,e),o=new Map;for(let[i,{language:m,area:u}]of g.files){let p=_(m,u);for(let M of rs(i))o.set(M,p)}let l=e.fallback??e.languages[0];if(!e.languages.includes(l))throw Error(`messages.fallback "${l}" is not one of messages.languages`);let c=e.preload==="all"?[...e.languages]:[...e.preload??[]];for(let i of c)if(!e.languages.includes(i))throw Error(`messages.preload "${i}" is not one of messages.languages`);let d={...g,stubs:o,languages:[...e.languages],fallback:l,preload:c};return w.set(r,{signature:n,messages:d}),d}function vm(...s){let e=new Set;for(let a of s){if(!a||!a.includes("stx-messages:"))continue;for(let n of a.matchAll(/stx-messages:[\w-]+:([\w/-]+)/g))e.add(n[1])}return e}function xm(s,e){let a=/<html\b[^>]*>/i.exec(s)?.[0]??"",n=/\slang\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(a),r=(n?n[1]??n[2]??n[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,...e.preload??[]])]}var h=new WeakMap;function Sm(s,e,a){let n=[...a].sort(),r=h.get(s);if(!r)h.set(s,r=new Map);let t=`${e.join(",")}\x00${n.join(",")}`;if(r.has(t))return r.get(t);let g=P(s,e,n);return r.set(t,g),g}function P(s,e,a){let n=[];for(let r of e){let t=s.data.get(r);if(!t)continue;for(let g of a){let o=t.get(g);if(o!==void 0)n.push(`put(${JSON.stringify(S(r,g))},${JSON.stringify(o)})`)}}if(n.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
|
${n.join(`;
|
|
5
5
|
`)};
|
|
6
6
|
})();`}
|
|
7
|
-
export{
|
|
7
|
+
export{ns,rs,bm,wm,vm,xm,Sm};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{n,u,Yt,Zt,Qt,Qe,wt,H,
|
|
2
|
+
import{n,u,Yt,Zt,Qt,Qe,wt,H,ho,Gr,et}from"./chunk-945zygwa.js";var O=/(?<![\w$@])@meta\s*\(/g,I=/(?<![\w$@])@metaTag\s*\(/g,C=/(?<![\w$@])@structuredData\s*\(/g,k=/(?<![\w$@])@seo\s*\(/g;function _(e,t){return(r)=>H(e,r,"the call has no closing parenthesis",t,n.INVALID_DIRECTIVE_SYNTAX)}function N(e){return"property"in e?`<meta property="${c(e.property)}" content="${c(e.content)}">`:`<meta name="${c(e.name)}" content="${c(e.content)}">`}function xi(e,t,r,g){if(!e.includes("@meta"))return e;let i=Yt(e,O,(a,o)=>{let s=Gr(Zt(a),t);if(s.kind==="tag")return N(s.tag);if(s.kind==="empty")return"";return H("Meta",o,s.message,r,s.code)},_("Meta",r));return i=Yt(i,I,(a,o)=>{let s=Qt(a,t);if(!s.ok)return H("MetaTag",o,s.message,r,s.code);if(s.value===void 0||s.value===null)return"";if(!wt(s.value))return H("MetaTag",o,`expected an object such as { name, content }, got ${Qe(s.value)}`,r,n.TYPE_ERROR);let l=s.value;if(!l.name&&!l.property&&!l.httpEquiv)return H("MetaTag",o,"the tag needs a name, property or httpEquiv",r,n.INVALID_DIRECTIVE_SYNTAX);if(l.content===void 0||l.content===null||l.content===""||l.content===!1)return"";let p="<meta";if(l.name)p+=` name="${c(l.name)}"`;if(l.property)p+=` property="${c(l.property)}"`;if(l.httpEquiv)p+=` http-equiv="${c(l.httpEquiv)}"`;return p+=` content="${c(l.content)}">`,p},_("MetaTag",r)),i}function b(e){let t=(r)=>r["@context"]?{...r}:{...r,"@context":"https://schema.org"};if(wt(e))return t(e);if(Array.isArray(e)&&e.length>0&&e.every(wt))return e.map(t);return null}function E(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function Si(e,t,r){if(!e.includes("@structuredData"))return e;return Yt(e,C,(g,i)=>{let a=Qt(g,t);if(!a.ok)return H("StructuredData",i,a.message,r,a.code);if(a.value===void 0||a.value===null)return"";let o=b(a.value);if(!o)return H("StructuredData",i,`expected an object or an array of objects, got ${Qe(a.value)}`,r,n.TYPE_ERROR);try{return E(o)}catch(s){let l=s instanceof Error?s.message:String(s);return H("StructuredData",i,`the data cannot be written as JSON: ${l}`,r,n.EVALUATION_ERROR)}},_("StructuredData",r))}var j=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),A={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function ki(e,t,r,g){if(!e.includes("@seo"))return e;return Yt(e,k,(i,a)=>{if(!i.trim())return H("SEO",a,"expected an object: @seo({ title, description }) or @seo(seoVariable)",r,n.INVALID_DIRECTIVE_SYNTAX);let o=Qt(i,t);if(!o.ok)return H("SEO",a,o.message,r,o.code);if(o.value===void 0||o.value===null)return"";if(!wt(o.value))return H("SEO",a,`expected an object such as { title, description }, got ${Qe(o.value)}`,r,n.TYPE_ERROR);try{return L(o.value,a,r)}catch(s){let l=s instanceof Error?s.message:String(s);return H("SEO",a,`Error processing @seo directive: ${l}`,r,n.EVALUATION_ERROR)}},_("SEO",r))}function R(e,t,r,g){let i=e[t];if(i===void 0||i===null||i===!1)return;if(wt(i))return i;ho(r,`${t} must be an object, got ${Qe(i)}; its tags were left out`,g);return}function L(e,t,r){let g=Object.keys(e).filter((s)=>!j.has(s));if(g.length>0){let s=g.map((l)=>A[l]?`${l} (use ${A[l]})`:l).join(", ");ho(t,`@seo does not read ${s}; ${g.length===1?"it was":"they were"} ignored`,r)}let i="";if(e.title)i+=`<title>${c(e.title)}</title>
|
|
3
3
|
`,i+=`<meta name="title" content="${c(e.title)}">
|
|
4
4
|
`;if(e.description)i+=`<meta name="description" content="${c(e.description)}">
|
|
5
5
|
`;if(e.keywords){let s=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;i+=`<meta name="keywords" content="${c(s)}">
|
|
@@ -25,7 +25,7 @@ import{n,u,Yt,Zt,Qt,Qe,wt,H,mo,Kr,et}from"./chunk-xmg6bmh6.js";var O=/(?<![\w$@]
|
|
|
25
25
|
`}if(o.site)i+=`<meta name="twitter:site" content="${c(o.site)}">
|
|
26
26
|
`;if(o.creator)i+=`<meta name="twitter:creator" content="${c(o.creator)}">
|
|
27
27
|
`}if(e.structuredData!==void 0&&e.structuredData!==null){let s=b(e.structuredData);if(s)i+=`${E(s)}
|
|
28
|
-
`;else
|
|
28
|
+
`;else ho(t,`structuredData must be an object or an array of objects, got ${Qe(e.structuredData)}; it was left out`,r)}return i.trim()}function _i(e,t,r){if(r.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||t.__stx_seo_staged===!0||r.skipDefaultSeoTags===!0)return e;let g=t.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let a=e.includes("<title>")||e.includes("</title>"),o=q(e),s=M(o),l=G(o),p="";if(t.title)p=t.title;else if(t.meta&&t.meta.title)p=t.meta.title;else if(s)p=s;else if(r.seo?.defaultConfig?.title)p=r.seo.defaultConfig.title;else p=r.defaultTitle||"stx Project";let m="";if(t.description)m=t.description;else if(t.meta&&t.meta.description)m=t.meta.description;else if(l)m=l;else if(r.seo?.defaultConfig?.description)m=r.seo.defaultConfig.description;else m=r.defaultDescription||"A website built with stx templating engine";let d="";if(t.image)d=t.image;else if(t.meta&&t.meta.image)d=t.meta.image;else if(t.openGraph&&t.openGraph.image)d=t.openGraph.image;else if(r.seo?.defaultImage)d=r.seo.defaultImage;else if(r.defaultImage)d=r.defaultImage;let f=a?"":`
|
|
29
29
|
<meta name="title" content="${c(p)}">`,D=V(o)?"":`
|
|
30
30
|
<meta name="description" content="${c(m)}">`,y=`
|
|
31
31
|
<!-- stx SEO Tags -->${f}${D}
|
|
@@ -43,7 +43,7 @@ import{n,u,Yt,Zt,Qt,Qe,wt,H,mo,Kr,et}from"./chunk-xmg6bmh6.js";var O=/(?<![\w$@]
|
|
|
43
43
|
${y}
|
|
44
44
|
`),h;return h.replace(/<head[^>]*>/,`$&
|
|
45
45
|
${y}
|
|
46
|
-
`)}function q(e){let t=e.search(/<\/head\s*>/i);return t===-1?e:e.slice(0,t)}function v(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function M(e){let t=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return t?v(t[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((t)=>/\sname\s*=\s*["']description["']/i.test(t))}function V(e){return x(e).length>0}function G(e){for(let t of x(e)){let r=t.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(r?.[1]??r?.[2]??"").trim();if(g)return v(g)}return""}function c(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var
|
|
46
|
+
`)}function q(e){let t=e.search(/<\/head\s*>/i);return t===-1?e:e.slice(0,t)}function v(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function M(e){let t=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return t?v(t[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((t)=>/\sname\s*=\s*["']description["']/i.test(t))}function V(e){return x(e).length>0}function G(e){for(let t of x(e)){let r=t.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(r?.[1]??r?.[2]??"").trim();if(g)return v(g)}return""}function c(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Hs={name:"meta",rawParams:!0,handler:(e,t,r,g)=>{let i=Gr(t,r??{});if(i.kind==="error")return H("Meta",`@meta(${t.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(r)r.__stx_runtime_head=et(r.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Vs={name:"structuredData",handler:(e,t,r,g)=>{if(e.trim()==="")return u("StructuredData","structuredData directive requires JSON-LD content",n.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return u("StructuredData","structuredData requires @type property",n.INVALID_DIRECTIVE_SYNTAX);return E(i)}catch(i){let a=i instanceof Error?i.message:String(i);return u("StructuredData",a,n.EVALUATION_ERROR)}},hasEndTag:!0};function ky(){return[Hs,Vs]}function _y(e,t){let{baseUrl:r,defaultChangefreq:g="weekly",defaultPriority:i=0.5,includeLastmod:a=!0}=t,o=r.replace(/\/$/,""),s=(m)=>m.startsWith("http")?m:`${o}${m.startsWith("/")?"":"/"}${m}`,l=e.map((m)=>{let d=s(m.loc),f=m.lastmod||(a?new Date().toISOString().split("T")[0]:void 0),D=m.changefreq||g,y=m.priority??i,h=` <url>
|
|
47
47
|
<loc>${T(d)}</loc>`;for(let w of m.alternates??[])h+=`
|
|
48
48
|
<xhtml:link rel="alternate" hreflang="${T(w.hreflang)}" href="${T(s(w.href))}"/>`;if(f)h+=`
|
|
49
49
|
<lastmod>${f}</lastmod>`;return h+=`
|
|
@@ -53,13 +53,13 @@ ${y}
|
|
|
53
53
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((m)=>m.alternates?.length)?' xmlns:xhtml="http://www.w3.org/1999/xhtml"':""}>
|
|
54
54
|
${l.join(`
|
|
55
55
|
`)}
|
|
56
|
-
</urlset>`}function
|
|
56
|
+
</urlset>`}function Cy(e,t){let r=t.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
|
|
57
57
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
58
58
|
${e.map((a)=>{let o=a.startsWith("http")?a:`${r}${a.startsWith("/")?"":"/"}${a}`;return` <sitemap>
|
|
59
59
|
<loc>${T(o)}</loc>
|
|
60
60
|
<lastmod>${g}</lastmod>
|
|
61
61
|
</sitemap>`}).join(`
|
|
62
62
|
`)}
|
|
63
|
-
</sitemapindex>`}async function
|
|
64
|
-
`).trim()}function
|
|
65
|
-
export{
|
|
63
|
+
</sitemapindex>`}async function Ey(e,t){let{extensions:r=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=t,i=[],a=r.length===1?`*${r[0]}`:`*{${r.join(",")}}`,o=new Bun.Glob(`**/${a}`);for await(let s of o.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return s.includes(f.slice(1));return s.startsWith(f)||s.includes(`/${f}`)}))continue;let p=s.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${s}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}i.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return i.sort((s,l)=>s.loc.localeCompare(l.loc)),i}function Us(e){let t=[];for(let r of e.rules){if(t.push(`User-agent: ${r.userAgent}`),r.allow)for(let g of r.allow)t.push(`Allow: ${g}`);if(r.disallow)for(let g of r.disallow)t.push(`Disallow: ${g}`);if(r.crawlDelay!==void 0)t.push(`Crawl-delay: ${r.crawlDelay}`);t.push("")}if(e.sitemap){let r=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of r)t.push(`Sitemap: ${g}`)}if(e.host)t.push(`Host: ${e.host}`);return t.join(`
|
|
64
|
+
`).trim()}function Ty(e){return Us({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
65
|
+
export{xi,Si,ki,_i,Hs,Vs,ky,_y,Cy,Ey,Us,Ty};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ht,Ag,Pg,Ig,Og,Ng,y,Mg,Fi,Dg,wl,vl}from"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{ht as STX_ENGINE_BINDING_NAMES,Fi as convertToCommonJS,wl as extractScriptFromTemplate,y as extractVariables,vl as hasVariables,Mg as isCompleteImport,Ng as isMissingBindingFailure,Ig as isModuleResolutionFailure,Og as isSyntaxFailure,Dg as splitDeclaration,Ag as stripTypeScript,Pg as withoutStxReferrer};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{c}from"./chunk-
|
|
2
|
+
import{c}from"./chunk-p92272k0.js";function r(){return`<script data-stx-scoped data-stx-x-element-runtime data-stx-run="always">
|
|
3
3
|
(function() {
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Jf,Yf,Te,Zf,Ec,mn,hn,ty,Tc,yn,mr,Qf,eg,tg,ks,ng,rg,$c,bn,sg,wn,Rc,ny}from"./chunk-7z1hqp86.js";import"./chunk-becs8132.js";import"./chunk-qs0zk04y.js";import"./chunk-65g78sge.js";import"./chunk-40fpt0r6.js";import"./chunk-rapr0m13.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{mr as MODULE_SPECIFIER_PREFIX,$c as assertBundleBuildCanSettle,Jf as bundleCacheDir,Yf as bundleCacheEntryLimit,ny as bundleClientEntriesSplit,wn as bundleClientScript,hn as clearBundleFailures,Te as clientBundleDependencies,mn as getBundleFailures,yn as hasUserImports,rg as isWithinBundlerCallback,bn as moduleSubstitutionKey,eg as normalizeRegistrySpecifiers,sg as queueClientBundleBuild,Ec as recordBundleFailure,Qf as registryIdForPath,Tc as resolveBundlerFallback,tg as rewriteRegistryImports,ty as setBundlerFallbackMode,Zf as shouldLogBundlerDiagnostics,Rc as tempBuildName,ks as withModuleSubstitutes,ng as withinBundlerCallback};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Dh,Fo,Lh,jh,Bh,Fh}from"./chunk-ft9h5qbs.js";import"./chunk-7z1hqp86.js";import"./chunk-becs8132.js";import"./chunk-qs0zk04y.js";import"./chunk-8rgy17fj.js";import"./chunk-e0bwzxfd.js";import"./chunk-vbmvft7g.js";import"./chunk-65g78sge.js";import"./chunk-40fpt0r6.js";import"./chunk-rapr0m13.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{Fh as clearStoreCache,Dh as getStoreScript,Bh as getStoreScriptFor,jh as pageStoresAll,Fo as storesRead,Lh as storesReadInFiles};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{bs,ws}from"./chunk-7nn5s0c3.js";import{x}from"./chunk-9m45t60c.js";import{a}from"./chunk-40fpt0r6.js";import{ot,fe}from"./chunk-9ejk9mwk.js";import{xc}from"./chunk-javb4e3b.js";import{W}from"./chunk-a7bqrjm5.js";import{w}from"./chunk-v6gkjg5f.js";import{f}from"./chunk-p92272k0.js";import{existsSync as z,mkdirSync as C,copyFileSync as I,chmodSync as B,rmSync as xe}from"fs";import{join as c,basename as ye,resolve as K}from"path";import{spawn as _}from"child_process";import{platform as Se}from"os";function O(e,r,i){let n=new RegExp(`</${r}\\s*>`,"iy"),s=x(e,(t,o)=>(n.lastIndex=o,n.exec(t)?n.lastIndex:-1))[0];return s?e.slice(0,s.start)+i+e.slice(s.start):null}var Vu=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -468,9 +468,9 @@ else if (data.type === 'event' && data.method) {
|
|
|
468
468
|
}
|
|
469
469
|
})();
|
|
470
470
|
</script>
|
|
471
|
-
`;function
|
|
471
|
+
`;function Ka(e={}){let{debug:r=!1,timeout:i=30000}=e;return Vu.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${i}`)}function Jh(){return!1}function Yh(e,r={}){let i=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(i,(n,s)=>{let t={};if(s)try{t=JSON.parse(s.replace(/'/g,'"'))}catch{try{t=Function(`return ${s}`)()}catch{console.warn(`[stx] Invalid @craft config: ${s}`)}}return Ka(t)})}function Ga(e,r={}){if(e.includes("__craftBridgeInitialized"))return e;let i=Ka(r),n=O(e,"head",`${i}
|
|
472
472
|
`);if(n!==null)return n;let s=W(e);if(s){let t=s.index+s.tag.length;return e.slice(0,t)+`
|
|
473
|
-
${i}`+e.slice(t)}return i+e}var
|
|
473
|
+
${i}`+e.slice(t)}return i+e}var Wo={button:{nativeType:"craft-button",fallbackTag:"button",fallbackClasses:"craft-button",nativeProps:["variant","size","disabled","loading"]},"text-input":{nativeType:"craft-text-input",fallbackTag:"input",fallbackClasses:"craft-text-input",nativeProps:["placeholder","value","type","disabled","readonly"]},textarea:{nativeType:"craft-textarea",fallbackTag:"textarea",fallbackClasses:"craft-textarea",nativeProps:["placeholder","value","rows","disabled","readonly"]},checkbox:{nativeType:"craft-checkbox",fallbackTag:"input",fallbackClasses:"craft-checkbox",nativeProps:["checked","disabled","label"],render:(e,r)=>{let i=e.checked?"checked":"",n=e.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
|
|
474
474
|
<input type="checkbox" class="craft-checkbox" ${i} ${n}>
|
|
475
475
|
<span class="craft-checkbox-label">${r||e.label||""}</span>
|
|
476
476
|
</label>`}},radio:{nativeType:"craft-radio",fallbackTag:"input",fallbackClasses:"craft-radio",nativeProps:["checked","disabled","name","value","label"]},select:{nativeType:"craft-select",fallbackTag:"select",fallbackClasses:"craft-select",nativeProps:["value","disabled","options","placeholder"]},slider:{nativeType:"craft-slider",fallbackTag:"input",fallbackClasses:"craft-slider",nativeProps:["value","min","max","step","disabled"],render:(e,r)=>{let i=e.min??0,n=e.max??100,s=e.step??1,t=e.value??50,o=e.disabled?"disabled":"";return`<input type="range" class="craft-slider" min="${i}" max="${n}" step="${s}" value="${t}" ${o}>`}},label:{nativeType:"craft-label",fallbackTag:"span",fallbackClasses:"craft-label",nativeProps:["text","for"]},badge:{nativeType:"craft-badge",fallbackTag:"span",fallbackClasses:"craft-badge",nativeProps:["variant","size"]},avatar:{nativeType:"craft-avatar",fallbackTag:"div",fallbackClasses:"craft-avatar",nativeProps:["src","alt","size","fallback"],render:(e,r)=>{let i=e.size||40,n=e.src,s=String(e.alt||""),t=e.fallback||(s?s.charAt(0).toUpperCase():"?");if(n)return`<img class="craft-avatar" src="${n}" alt="${s}" style="width:${i}px;height:${i}px;border-radius:50%">`;return`<div class="craft-avatar craft-avatar-fallback" style="width:${i}px;height:${i}px;border-radius:50%;display:flex;align-items:center;justify-content:center">${t}</div>`}},progress:{nativeType:"craft-progress",fallbackTag:"div",fallbackClasses:"craft-progress",nativeProps:["value","max","variant"],render:(e,r)=>{let i=Number(e.value)||0,n=Number(e.max)||100;return`<div class="craft-progress"><div class="craft-progress-bar" style="width:${Math.min(100,Math.max(0,i/n*100))}%"></div></div>`}},spinner:{nativeType:"craft-spinner",fallbackTag:"div",fallbackClasses:"craft-spinner",nativeProps:["size"],render:(e,r)=>{let i=e.size||24;return`<div class="craft-spinner" style="width:${i}px;height:${i}px"></div>`}},card:{nativeType:"craft-card",fallbackTag:"div",fallbackClasses:"craft-card",nativeProps:["title","subtitle","variant"]},modal:{nativeType:"craft-modal",fallbackTag:"dialog",fallbackClasses:"craft-modal",nativeProps:["open","title","closable","size"],render:(e,r)=>{let i=e.open?"open":"",n=e.title||"";return`<dialog class="craft-modal" ${i}>
|
|
@@ -484,7 +484,7 @@ ${i}`+e.slice(t)}return i+e}var Uo={button:{nativeType:"craft-button",fallbackTa
|
|
|
484
484
|
</details>`}},divider:{nativeType:"craft-divider",fallbackTag:"hr",fallbackClasses:"craft-divider",nativeProps:["orientation","variant"]},table:{nativeType:"craft-table",fallbackTag:"table",fallbackClasses:"craft-table",nativeProps:["columns","rows","sortable","selectable"]},list:{nativeType:"craft-list",fallbackTag:"ul",fallbackClasses:"craft-list",nativeProps:["items","selectable"]},tree:{nativeType:"craft-tree",fallbackTag:"div",fallbackClasses:"craft-tree",nativeProps:["nodes","expandable","selectable"]},alert:{nativeType:"craft-alert",fallbackTag:"div",fallbackClasses:"craft-alert",nativeProps:["variant","title","dismissible"],render:(e,r)=>{let i=e.variant||"info",n=e.title||"";return`<div class="craft-alert craft-alert-${i}" role="alert">
|
|
485
485
|
${n?`<div class="craft-alert-title">${n}</div>`:""}
|
|
486
486
|
<div class="craft-alert-content">${r}</div>
|
|
487
|
-
</div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(e,r)=>{let i=e.content||"",n=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${i}" data-position="${n}">${r}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections","spaces","selectedSpace"],render:re},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:ae},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:ie},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:ne},pagination:{nativeType:"craft-pagination",fallbackTag:"nav",fallbackClasses:"craft-pagination",nativeProps:["total","page","pageSize"]},"code-editor":{nativeType:"craft-code-editor",fallbackTag:"textarea",fallbackClasses:"craft-code-editor",nativeProps:["value","language","theme","readonly","lineNumbers"]},"file-browser":{nativeType:"craft-file-browser",fallbackTag:"div",fallbackClasses:"craft-file-browser",nativeProps:["path","showHidden","selectable"]},"color-picker":{nativeType:"craft-color-picker",fallbackTag:"input",fallbackClasses:"craft-color-picker",nativeProps:["value","format"],render:(e,r)=>`<input type="color" class="craft-color-picker" value="${e.value||"#000000"}">`},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(e,r)=>{let i=e.value||"",n=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${i}" min="${n}" max="${s}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(e,r)=>`<input type="time" class="craft-time-picker" value="${e.value||""}">`}},
|
|
487
|
+
</div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(e,r)=>{let i=e.content||"",n=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${i}" data-position="${n}">${r}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections","spaces","selectedSpace"],render:re},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:ae},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:ie},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:ne},pagination:{nativeType:"craft-pagination",fallbackTag:"nav",fallbackClasses:"craft-pagination",nativeProps:["total","page","pageSize"]},"code-editor":{nativeType:"craft-code-editor",fallbackTag:"textarea",fallbackClasses:"craft-code-editor",nativeProps:["value","language","theme","readonly","lineNumbers"]},"file-browser":{nativeType:"craft-file-browser",fallbackTag:"div",fallbackClasses:"craft-file-browser",nativeProps:["path","showHidden","selectable"]},"color-picker":{nativeType:"craft-color-picker",fallbackTag:"input",fallbackClasses:"craft-color-picker",nativeProps:["value","format"],render:(e,r)=>`<input type="color" class="craft-color-picker" value="${e.value||"#000000"}">`},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(e,r)=>{let i=e.value||"",n=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${i}" min="${n}" max="${s}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(e,r)=>`<input type="time" class="craft-time-picker" value="${e.value||""}">`}},ys=`
|
|
488
488
|
<style id="craft-component-styles">
|
|
489
489
|
/* Craft Component Base Styles */
|
|
490
490
|
.craft-button {
|
|
@@ -902,7 +902,7 @@ ${i}`+e.slice(t)}return i+e}var Uo={button:{nativeType:"craft-button",fallbackTa
|
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
904
|
</style>
|
|
905
|
-
`,
|
|
905
|
+
`,Xa=`
|
|
906
906
|
<script id="craft-component-runtime">
|
|
907
907
|
(function() {
|
|
908
908
|
if (window.__stxCraftComponentRuntime) return;
|
|
@@ -1006,9 +1006,9 @@ ${i}`+e.slice(t)}return i+e}var Uo={button:{nativeType:"craft-button",fallbackTa
|
|
|
1006
1006
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
1007
1007
|
})();
|
|
1008
1008
|
</script>
|
|
1009
|
-
`;function
|
|
1010
|
-
`)??
|
|
1011
|
-
`)??e+
|
|
1009
|
+
`;function Ja(e,r={}){let{classPrefix:i="craft"}=r;if(!e.includes("craft-component-styles"))e=O(e,"head",`${ys}
|
|
1010
|
+
`)??ys+e;if(!e.includes("craft-component-runtime"))e=O(e,"body",`${Xa}
|
|
1011
|
+
`)??e+Xa;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(n,s,t)=>N("sidebar",s,t.trim(),r,i)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(n,s)=>N("sidebar",s,"",r,i)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(n,s,t)=>N(s,t,"",r,i)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(n,s,t,o)=>N(s,t,o.trim(),r,i)),e}function N(e,r,i,n,s){let t=n.components?.[e]||Wo[e];if(!t)return console.warn(`[stx] Unknown Craft component: @craft-${e}`),`<div class="${s}-unknown" data-component="${e}">${i}</div>`;let o=F(r),d=[t.fallbackClasses||`${s}-${e}`];if(o.class)d.push(o.class),delete o.class;if(t.render)return o.__fallbackClasses=d.join(" "),t.render(o,i);let p=be(o,t,d);if(["input","hr","br","img"].includes(t.fallbackTag))return`<${t.fallbackTag} ${p}>`;return`<${t.fallbackTag} ${p}>${i}</${t.fallbackTag}>`}function F(e){let r={},i=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,n;while((n=i.exec(e))!==null){let[s,t,o,d]=n,p=o??d;if(s.startsWith(":"))r[t]=p;else if(s.startsWith("@"))r[`on${t.charAt(0).toUpperCase()}${t.slice(1)}`]=p;else if(p===void 0)r[t]=!0;else r[t]=p}return r}function re(e,r){let i=R(String(e.id||`craft-sidebar-${pe(r||JSON.stringify(e))}`)),n=ce(e.spaces)||oe(r),s=n.length?[]:le(e.sections)||j(r),t=String(e.selectedSpace||n[0]?.id||""),o=n.find((y)=>y.id===t)||n[0],d=String(e.selectedItem||e.selected||(n.length?o?.sections[0]?.items[0]?.id:s[0]?.items[0]?.id)||""),p={id:i,variant:String(e.variant||"desktop"),material:String(e.material||"sidebar"),backgroundEffect:String(e.backgroundEffect||"shimmer"),allowsVibrancy:e.allowsVibrancy!==!1&&e.allowsVibrancy!=="false",materialOpacity:Number(e.materialOpacity??0.68),materialDarkOpacity:e.materialDarkOpacity===void 0?void 0:Number(e.materialDarkOpacity),minWidth:e.minWidth===void 0?240:Number(e.minWidth),maxWidth:e.maxWidth===void 0?340:Number(e.maxWidth),canCollapse:e.canCollapse!==!1&&e.canCollapse!=="false",searchPlaceholder:e.searchPlaceholder?String(e.searchPlaceholder):void 0,selectedItem:d,sections:s,spaces:n,selectedSpace:t||void 0},u=String(e.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),l=Number(e.width||e.sidebarWidth||286),b=e.native===!1||e.native==="false"?"false":"true",g=p.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${P(p.searchPlaceholder)}"></div>`:"",m;if(n.length)m=de(n,t,d);else if(s.length)m=s.map((y)=>L(y,d)).join("");else m=r;return`<aside class="${S(u)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${S(i)}" data-native="${b}" style="--craft-sidebar-width:${l}px">
|
|
1012
1012
|
${g}
|
|
1013
1013
|
${m}
|
|
1014
1014
|
</aside>
|
|
@@ -1029,7 +1029,7 @@ ${i}`+e.slice(t)}return i+e}var Uo={button:{nativeType:"craft-button",fallbackTa
|
|
|
1029
1029
|
${e.icon?`<span class="craft-sidebar-item-icon" data-icon="${S(e.icon)}"${i}></span>`:""}
|
|
1030
1030
|
<span class="craft-sidebar-item-label">${P(e.label)}</span>
|
|
1031
1031
|
${e.badge?`<span class="craft-sidebar-item-badge">${P(e.badge)}</span>`:""}
|
|
1032
|
-
</button>`}function R(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function pe(e){let r=5381;for(let i=0;i<e.length;i++)r=r*33^e.charCodeAt(i);return(r>>>0).toString(36)}function P(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function S(e){return P(e).replace(/`/g,"`")}function ue(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function be(e,r,i){let n=[];n.push(`class="${i.join(" ")}"`),n.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)n.push(s);else if(t!==!1&&t!==void 0&&t!==null){let o=String(t).replace(/"/g,""");n.push(`${s}="${o}"`)}return n.join(" ")}function
|
|
1032
|
+
</button>`}function R(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function pe(e){let r=5381;for(let i=0;i<e.length;i++)r=r*33^e.charCodeAt(i);return(r>>>0).toString(36)}function P(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function S(e){return P(e).replace(/`/g,"`")}function ue(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function be(e,r,i){let n=[];n.push(`class="${i.join(" ")}"`),n.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)n.push(s);else if(t!==!1&&t!==void 0&&t!==null){let o=String(t).replace(/"/g,""");n.push(`${s}="${o}"`)}return n.join(" ")}function Zh(e,r){Wo[e]=r}function Qh(){return{...Wo}}import{chmodSync as ge,copyFileSync as me,mkdtempSync as V,rmSync as we,writeFileSync as J}from"fs";import{tmpdir as Q}from"os";import{join as D}from"path";function he(e){let r=Bun.spawnSync(["/usr/bin/plutil","-extract","Entitlements","xml1","-o","-","-"],{stdin:e});if(r.exitCode!==0)throw Error(`Could not extract the macOS profile entitlements: ${r.stderr.toString().trim()||r.stdout.toString().trim()}`);let i=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-","-"],{stdin:r.stdout});if(i.exitCode!==0)throw Error(`Could not convert the macOS profile entitlements: ${i.stderr.toString().trim()||i.stdout.toString().trim()}`);let n=JSON.parse(i.stdout.toString());if(!n||typeof n!=="object"||Array.isArray(n))throw Error("The macOS profile entitlements must be a dictionary.");return n}function ve(e,r){let i=D(r,"Contents","embedded.provisionprofile");me(e,i),ge(i,420)}async function Y(e,r=[],i={}){if(process.platform!=="darwin")return;let n=i.entitlements,s;try{if(i.provisioningProfile){if(!i.identity||i.identity==="-")throw Error("A provisioning profile requires a signing identity.");let u=Bun.spawnSync(["/usr/bin/security","cms","-D","-i",i.provisioningProfile]);if(u.exitCode!==0)throw Error("Could not decode the macOS provisioning profile.");let l=he(u.stdout),b={};if(i.entitlements){let g=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-",i.entitlements]);if(g.exitCode!==0)throw Error("Could not read the app entitlements plist.");b=JSON.parse(g.stdout.toString())}for(let g of["com.apple.application-identifier","com.apple.developer.team-identifier"])if(l[g])b[g]=l[g];if(s=V(D(Q(),"stx-entitlements-")),n=D(s,"entitlements.plist"),J(n,JSON.stringify(b)),Bun.spawnSync(["/usr/bin/plutil","-convert","xml1",n]).exitCode!==0)throw Error("Could not generate the provisioned app entitlements.");ve(i.provisioningProfile,e)}let t;if(r.length){let u=!1;if(n){let l=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-",n]);if(l.exitCode!==0)throw Error("Could not read native parent entitlements.");u=JSON.parse(l.stdout.toString())["com.apple.security.app-sandbox"]===!0}if(s??=V(D(Q(),"stx-entitlements-")),t=D(s,"helper.entitlements.plist"),J(t,JSON.stringify({"com.apple.security.cs.allow-jit":!0,...u?{"com.apple.security.app-sandbox":!0,"com.apple.security.inherit":!0}:{}})),Bun.spawnSync(["/usr/bin/plutil","-convert","xml1",t]).exitCode!==0)throw Error("Could not generate native helper entitlements.")}for(let u of[...r,e]){let l=i.hardenedRuntime?["--options","runtime"]:[];if(u===e&&n)l.push("--entitlements",n);if(u!==e&&t)l.push("--entitlements",t);let b=i.identity&&i.identity!=="-"?"--timestamp":"--timestamp=none",g=Bun.spawn(["/usr/bin/codesign","--force","--sign",i.identity||"-",b,...l,u],{stdout:"pipe",stderr:"pipe"}),[m,y]=await Promise.all([new Response(g.stderr).text(),g.exited]);if(y!==0)throw Error(`Could not sign native bundle ${u}: ${m.trim()}`)}let o=Bun.spawn(["/usr/bin/codesign","--verify","--strict",e],{stdout:"pipe",stderr:"pipe"}),[d,p]=await Promise.all([new Response(o.stderr).text(),o.exited]);if(p!==0)throw Error(`Invalid native bundle signature: ${d.trim()}`)}finally{if(s)we(s,{recursive:!0,force:!0})}}var G=(e)=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");function X(e){let r=new Set,i=(n,s,t)=>{if(typeof n==="string")return`${s}<string>${G(n)}</string>`;if(typeof n==="boolean")return`${s}<${n}/>`;if(typeof n==="number"){if(!Number.isFinite(n))throw TypeError(`Non-finite Info.plist number at ${t}`);let o=Number.isSafeInteger(n)?"integer":"real";return`${s}<${o}>${n}</${o}>`}if(n!==null&&typeof n==="object"){let o=Array.isArray(n);if(!o&&Object.getPrototypeOf(n)!==Object.prototype&&Object.getPrototypeOf(n)!==null)throw TypeError(`Unsupported Info.plist value at ${t}`);if(r.has(n))throw TypeError(`Cyclic Info.plist value at ${t}`);r.add(n);try{let d=o?"array":"dict",p=`${s} `,u=o?Array.from(n,(l,b)=>i(l,p,`${t}[${b}]`)):Object.entries(n).map(([l,b])=>`${p}<key>${G(l)}</key>
|
|
1033
1033
|
${i(b,p,`${t}.${l}`)}`);return u.length?`${s}<${d}>
|
|
1034
1034
|
${u.join(`
|
|
1035
1035
|
`)}
|
|
@@ -1038,7 +1038,7 @@ ${s}</${d}>`:`${s}<${d}/>`}finally{r.delete(n)}}throw TypeError(`Unsupported Inf
|
|
|
1038
1038
|
<plist version="1.0">
|
|
1039
1039
|
${i(e,"","infoPlist")}
|
|
1040
1040
|
</plist>
|
|
1041
|
-
`}async function
|
|
1041
|
+
`}async function Ya(e){if(e.window?.cornerRadius!==void 0&&(!Number.isFinite(e.window.cornerRadius)||e.window.cornerRadius<0||e.window.cornerRadius>128))throw Error("Native window cornerRadius must be between 0 and 128");let r=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||q(),format:e.format||"app",error:`Input file not found: ${e.input}`};let i=e.target||q(),n=e.format||Re(i);if(e.backend&&i!=="macos")throw Error("Native backend bundles currently support macOS only.");if(e.backend&&!z(K(e.backend.entry)))throw Error(`Native backend not found: ${e.backend.entry}`);let s=e.output||c(process.cwd(),"dist","native");if(!z(s))C(s,{recursive:!0});let t=await a(process.cwd()),o=await xc(e.input,{context:e.context,options:{...t,isDev:!1},injectCSS:!0});if(o=Ga(o,{debug:e.verbose}),o=Ja(o),!o.includes("craft-component-styles")){if(o.includes("</head>"))o=f(o,ys)}let d=e.name||ye(e.input,".stx"),p=e.version||"1.0.0",u=e.craftPath||Za(e.runtimeProfile);if(!u)return{success:!1,target:i,format:n,error:"Craft native binary not found on PATH. Run pantry install craft, or specify craftPath for framework development."};if(e.runtimeProfile==="webview"){if(i!=="macos")throw Error("The webview runtime profile is currently available on macOS only.");let b=Bun.spawnSync([u,"--runtime-profile"],{stdout:"pipe",stderr:"pipe",timeout:1e4});if(b.exitCode!==0||b.stdout.toString().trim()!=="webview")throw Error("The requested Craft webview runtime is unavailable. Upgrade Craft with Pantry before building.")}if(u=bs(e.craftPath,e.runtimeProfile),e.verbose)console.log(`\uD83D\uDCE6 Building native app for ${i}...`),console.log(` Input: ${e.input}`),console.log(` Output: ${s}`),console.log(` Craft: ${u}`);let l;switch(i){case"macos":l=await Ce(o,d,p,s,n,e,u);break;case"windows":l=await Te(o,d,p,s,n,e,u);break;case"linux":l=await Pe(o,d,p,s,n,e,u);break;case"ios":l=await Ie(o,d,p,s,e,u);break;case"android":l=await Be(o,d,p,s,e,u);break;default:l={success:!1,target:i,format:n,error:`Unsupported target: ${i}`}}return l.duration=Date.now()-r,l}catch(i){return{success:!1,target:e.target||q(),format:e.format||"app",error:i.message,duration:Date.now()-r}}}async function Ce(e,r,i,n,s,t,o){let d=t.bundleId||`com.stx.${r.toLowerCase().replace(/[^a-z0-9]/g,"")}`,p=c(n,`${r}.app`),u=c(p,"Contents"),l=c(u,"MacOS"),b=c(u,"Resources");xe(p,{recursive:!0,force:!0}),C(l,{recursive:!0}),C(b,{recursive:!0});let g=c(b,"index.html");await Bun.write(g,e);let m="";if(t.sidebar?.enabled&&t.sidebar?.config)m=c(b,"sidebar-config.json"),await Bun.write(m,JSON.stringify(t.sidebar.config));let y=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",T=t.menubarOnly??t.systemTray,v=t.bundleStyle||(await $e(o)?"executable":"launcher");if(t.backend){if(!await ke(o))throw Error("This Craft runtime does not support bundled backends. Upgrade Craft before building this app.");I(o,c(l,r)),B(c(l,r),493);let k=ot("native-backend");try{let h=c(k,"launcher.ts"),M=c(import.meta.dir,"native-backend"+(import.meta.path.endsWith(".ts")?".ts":".js"));await Bun.write(h,`import { runNativeBackend } from ${JSON.stringify(M)}
|
|
1042
1042
|
import * as backend from ${JSON.stringify(K(t.backend.entry))}
|
|
1043
1043
|
await runNativeBackend({ html: ${JSON.stringify(e)}, fetch: backend.default, shutdown: Reflect.get(backend, "shutdown"),
|
|
1044
1044
|
maxRequestBodySize: ${t.backend.maxRequestBodySize??33554432} })
|
|
@@ -1075,7 +1075,7 @@ Name=${r}
|
|
|
1075
1075
|
Exec=${b}
|
|
1076
1076
|
Terminal=false
|
|
1077
1077
|
Categories=Utility;
|
|
1078
|
-
`;if(await Bun.write(c(d,`${r.toLowerCase()}.desktop`),g),s==="deb"){let m=c(n,`${r.toLowerCase()}_${i}_amd64.deb`),y=await De(d,m,r,i,t);if(!y.success)return{success:!1,target:"linux",format:"deb",error:y.error};return{success:!0,target:"linux",format:"deb",outputPath:m}}if(s==="appimage"){let m=c(n,`${r}-${i}-x86_64.AppImage`),y=await qe(d,m,r,t);if(!y.success)return{success:!1,target:"linux",format:"appimage",error:y.error};return{success:!0,target:"linux",format:"appimage",outputPath:m}}return{success:!0,target:"linux",format:"app",outputPath:d}}async function Ie(e,r,i,n,s,t){return{success:!1,target:"ios",format:"ipa",error:`iOS build requires Xcode and additional setup. Use 'stx init:ios ${r}' to create an iOS project.`}}async function Be(e,r,i,n,s,t){return{success:!1,target:"android",format:"apk",error:`Android build requires Android SDK and additional setup. Use 'stx init:android ${r}' to create an Android project.`}}function
|
|
1078
|
+
`;if(await Bun.write(c(d,`${r.toLowerCase()}.desktop`),g),s==="deb"){let m=c(n,`${r.toLowerCase()}_${i}_amd64.deb`),y=await De(d,m,r,i,t);if(!y.success)return{success:!1,target:"linux",format:"deb",error:y.error};return{success:!0,target:"linux",format:"deb",outputPath:m}}if(s==="appimage"){let m=c(n,`${r}-${i}-x86_64.AppImage`),y=await qe(d,m,r,t);if(!y.success)return{success:!1,target:"linux",format:"appimage",error:y.error};return{success:!0,target:"linux",format:"appimage",outputPath:m}}return{success:!0,target:"linux",format:"app",outputPath:d}}async function Ie(e,r,i,n,s,t){return{success:!1,target:"ios",format:"ipa",error:`iOS build requires Xcode and additional setup. Use 'stx init:ios ${r}' to create an iOS project.`}}async function Be(e,r,i,n,s,t){return{success:!1,target:"android",format:"apk",error:`Android build requires Android SDK and additional setup. Use 'stx init:android ${r}' to create an Android project.`}}function Za(e="full"){let r=process.env.CRAFT_BIN;if(r){if(!z(r))throw Error(`CRAFT_BIN points to a missing file: ${r}`);return r}return Bun.which(e==="webview"?"craft-webview":"craft",{PATH:process.env.PATH??"",cwd:process.cwd()})}function q(){switch(Se()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function Re(e){switch(e){case"macos":return"app";case"windows":return"zip";case"linux":return"appimage";case"ios":return"ipa";case"android":return"apk";default:return"app"}}async function Ee(e,r,i){return ws({appBundlePath:e,outputPath:r,volumeName:i})}async function Oe(e,r){return new Promise((i)=>{let n=_("zip",["-r",r,"."],{cwd:e});n.on("close",(s)=>{if(s===0)i({success:!0});else i({success:!1,error:`zip exited with code ${s}`})}),n.on("error",(s)=>{i({success:!1,error:s.message})})})}async function De(e,r,i,n,s){return new Promise((t)=>{let o=ot("deb");try{let d=c(o,"pkg"),p=c(d,"DEBIAN"),u=c(d,"usr","bin"),l=c(d,"usr","share","applications"),b=c(d,"usr","share",i.toLowerCase());C(p,{recursive:!0}),C(u,{recursive:!0}),C(l,{recursive:!0}),C(b,{recursive:!0});let g=w("fs").readdirSync(e);for(let v of g)I(c(e,v),c(b,v));let m=`#!/bin/bash
|
|
1079
1079
|
exec /usr/share/${i.toLowerCase()}/${i.toLowerCase()} "$@"`;w("fs").writeFileSync(c(u,i.toLowerCase()),m),B(c(u,i.toLowerCase()),493);let y=`Package: ${i.toLowerCase()}
|
|
1080
1080
|
Version: ${n}
|
|
1081
1081
|
Section: utils
|
|
@@ -1096,5 +1096,5 @@ Exec=${i.toLowerCase()}
|
|
|
1096
1096
|
Terminal=false
|
|
1097
1097
|
Categories=Utility;
|
|
1098
1098
|
Icon=${i.toLowerCase()}
|
|
1099
|
-
`;w("fs").writeFileSync(c(o,`${i.toLowerCase()}.desktop`),m);let y=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(w("fs").writeFileSync(c(o,`${i.toLowerCase()}.png`),y),n.icon&&z(n.icon))I(n.icon,c(o,`${i.toLowerCase()}.png`));let T=_("appimagetool",[o,r],{env:{...process.env,ARCH:"x86_64"}});T.on("close",(v)=>{if(fe(t),v===0)B(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${v}. Install from https://appimage.github.io/appimagetool/`})}),T.on("error",(v)=>{fe(t),s({success:!1,error:`appimagetool not found: ${v.message}`})})}catch(o){fe(t),s({success:!1,error:o.message})}})}function
|
|
1100
|
-
export{
|
|
1099
|
+
`;w("fs").writeFileSync(c(o,`${i.toLowerCase()}.desktop`),m);let y=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(w("fs").writeFileSync(c(o,`${i.toLowerCase()}.png`),y),n.icon&&z(n.icon))I(n.icon,c(o,`${i.toLowerCase()}.png`));let T=_("appimagetool",[o,r],{env:{...process.env,ARCH:"x86_64"}});T.on("close",(v)=>{if(fe(t),v===0)B(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${v}. Install from https://appimage.github.io/appimagetool/`})}),T.on("error",(v)=>{fe(t),s({success:!1,error:`appimagetool not found: ${v.message}`})})}catch(o){fe(t),s({success:!1,error:o.message})}})}function Qa(){return[q()]}function ec(e){switch(e){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var Ae={buildNative:Ya,getAvailableTargets:Qa,getAvailableFormats:ec,detectPlatform:q},ey=Ae;
|
|
1100
|
+
export{Vu,Ka,Jh,Yh,Ga,Wo,ys,Xa,Ja,Zh,Qh,Ya,Za,Qa,ec,ey};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Nm}from"./chunk-mjqsz20a.js";import"./chunk-4wd5sn16.js";import"./chunk-qt2mr3f0.js";import"./chunk-9jpsxqaf.js";import"./chunk-becs8132.js";import"./chunk-r9n86na1.js";import"./chunk-fsxk5fsh.js";import"./chunk-q6p96qq7.js";import"./chunk-de61k0ab.js";import"./chunk-eka2e4cm.js";import"./chunk-9vafweyd.js";import"./chunk-8v2hsn4d.js";import"./chunk-5jrpzepc.js";import"./chunk-8rgy17fj.js";import"./chunk-e0bwzxfd.js";import"./chunk-vbmvft7g.js";import"./chunk-g065d7p7.js";import"./chunk-65g78sge.js";import"./chunk-40fpt0r6.js";import"./chunk-rapr0m13.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{Nm as buildForProduction};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Cm}from"./chunk-vgvxs1ag.js";import"./chunk-40fpt0r6.js";import"./chunk-rapr0m13.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{Cm as buildApp};
|