@stacksjs/stx 0.2.611 → 0.2.613
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-3v862v2c.js → chunk-06bwys2z.js} +1 -1
- package/dist/{chunk-2pgvbe5x.js → chunk-0zx1400y.js} +4 -4
- package/dist/{chunk-n05hxy7w.js → chunk-1bqtsjry.js} +3 -3
- package/dist/chunk-1gyrk0qv.js +2 -0
- package/dist/{chunk-0ff64x1p.js → chunk-1q3e1w2y.js} +3 -3
- package/dist/chunk-1v40w4qr.js +2 -0
- package/dist/chunk-1xzxmnsd.js +2 -0
- package/dist/{chunk-pmpqzqq8.js → chunk-27h4ndsg.js} +2 -2
- package/dist/chunk-2a1sgnxf.js +2 -0
- package/dist/{chunk-w0h27sf8.js → chunk-2bagpncj.js} +2 -2
- package/dist/{chunk-g22q68ds.js → chunk-2bcp699b.js} +2 -2
- package/dist/{chunk-65jsp5fd.js → chunk-34a1jdhq.js} +2 -2
- package/dist/{chunk-dtt7k0bz.js → chunk-34tbh570.js} +2 -2
- package/dist/chunk-37n8rf75.js +2 -0
- package/dist/{chunk-pm1gnjs5.js → chunk-3a60b9an.js} +3 -3
- package/dist/{chunk-x8y7yqwh.js → chunk-3cg5mrtq.js} +7 -7
- package/dist/chunk-3fb3m640.js +2 -0
- package/dist/{chunk-vyjwag3f.js → chunk-3hzr66vn.js} +9 -9
- package/dist/chunk-3njhzgqa.js +2 -0
- package/dist/{chunk-fgrjv29d.js → chunk-3vbv4gxx.js} +6 -6
- package/dist/chunk-42er5gwc.js +2 -0
- package/dist/{chunk-jsktg3ab.js → chunk-45gz1yff.js} +5 -5
- package/dist/{chunk-z79gnz6z.js → chunk-4h62y8dn.js} +1 -1
- package/dist/{chunk-wdy6y0fq.js → chunk-5fxh7fc3.js} +2 -2
- package/dist/{chunk-cjrfazzb.js → chunk-5hqkfqne.js} +11 -12
- package/dist/chunk-5mw7qawr.js +2 -0
- package/dist/{chunk-3wmt7ykt.js → chunk-5pa5bbzv.js} +2 -2
- package/dist/{chunk-hj49vk9e.js → chunk-5vs12p6m.js} +6 -6
- package/dist/chunk-6jjbmfy0.js +2 -0
- package/dist/chunk-6kqmr5z1.js +2 -0
- package/dist/chunk-6pg74bkj.js +2 -0
- package/dist/{chunk-wa26bn4s.js → chunk-6rd762vj.js} +3 -3
- package/dist/{chunk-cjvq46n8.js → chunk-6ta850w8.js} +2 -2
- package/dist/{chunk-nd8yx3qq.js → chunk-71wntraa.js} +10 -10
- package/dist/chunk-792sscsk.js +2 -0
- package/dist/{chunk-39fqkzyb.js → chunk-83h5ydvw.js} +3 -3
- package/dist/{chunk-n1qr6n92.js → chunk-8jqdb1qr.js} +6 -6
- package/dist/{chunk-961nvcxw.js → chunk-8vdsewsa.js} +4 -4
- package/dist/chunk-8xp2r8s0.js +2 -0
- package/dist/chunk-97ht3bw3.js +2 -0
- package/dist/{chunk-5vnx8dmz.js → chunk-99rfdydy.js} +2 -2
- package/dist/{chunk-xh98677z.js → chunk-araay35m.js} +5 -5
- package/dist/chunk-awvbp2t4.js +2 -0
- package/dist/{chunk-ydz9j0d3.js → chunk-azj2cj8h.js} +2 -2
- package/dist/chunk-b3g8zzc6.js +2 -0
- package/dist/chunk-bdn21f8c.js +2 -0
- package/dist/chunk-bemx44n4.js +2 -0
- package/dist/{chunk-34x22hbs.js → chunk-bm632aaj.js} +1 -1
- package/dist/chunk-c6vb28zd.js +2 -0
- package/dist/chunk-cjm2d6w1.js +2 -0
- package/dist/{chunk-9nh7vxk1.js → chunk-ctf9gd40.js} +3 -3
- package/dist/{chunk-pyqrj2wk.js → chunk-d16jgsyv.js} +3 -3
- package/dist/chunk-dcdmr6cp.js +2 -0
- package/dist/{chunk-8f616tym.js → chunk-dcs87qta.js} +2 -2
- package/dist/{chunk-7g47wdd9.js → chunk-dq58tn5x.js} +3 -3
- package/dist/chunk-e5t4xhfk.js +2 -0
- package/dist/{chunk-aw79nm5c.js → chunk-edmpxcrh.js} +15 -15
- package/dist/{chunk-pkgmyg4r.js → chunk-ehq5j4tb.js} +2 -2
- package/dist/{chunk-exwjabr5.js → chunk-ejqt0kh2.js} +1 -1
- package/dist/chunk-ekd11w9t.js +2 -0
- package/dist/chunk-fdkr055a.js +2 -0
- package/dist/chunk-fq4xjy4k.js +2 -0
- package/dist/chunk-gv3se08t.js +2 -0
- package/dist/chunk-h476qqq9.js +2 -0
- package/dist/{chunk-n4f3fzp5.js → chunk-h74p4zay.js} +73 -73
- package/dist/chunk-hx2fc5dt.js +2 -0
- package/dist/chunk-j2gvr4n6.js +2 -0
- package/dist/{chunk-9dx519z6.js → chunk-j6nn0c5r.js} +1 -1
- package/dist/chunk-j7vjfzjx.js +2 -0
- package/dist/chunk-jahkmmhh.js +2 -0
- package/dist/{chunk-vep8d57h.js → chunk-jpe8pt9m.js} +2 -2
- package/dist/{chunk-e98jqwnf.js → chunk-jrsvbztw.js} +1 -1
- package/dist/{chunk-znwnacwz.js → chunk-jwxppaj3.js} +5 -5
- package/dist/{chunk-h3tzc41t.js → chunk-k0kajwdw.js} +2 -2
- package/dist/{chunk-qqenm7pg.js → chunk-k1hpxgzq.js} +5 -5
- package/dist/{chunk-s5s1w8na.js → chunk-kt9ksp8w.js} +2 -2
- package/dist/{chunk-t61vdbje.js → chunk-ktvr45qg.js} +6 -6
- package/dist/chunk-m0x9gfx5.js +2 -0
- package/dist/chunk-m85kmqbn.js +2 -0
- package/dist/chunk-mf6mqs9k.js +2 -0
- package/dist/chunk-mg9931y0.js +2 -0
- package/dist/chunk-mheh85ph.js +2 -0
- package/dist/{chunk-8211vr9v.js → chunk-mkss8wbh.js} +5 -5
- package/dist/{chunk-gk4c8d1c.js → chunk-mm8jdb4p.js} +2 -2
- package/dist/{chunk-r4xnqag4.js → chunk-mqky9h29.js} +2 -2
- package/dist/{chunk-2y0qy214.js → chunk-n1zyt21h.js} +2 -2
- package/dist/chunk-n5acpvq3.js +2 -0
- package/dist/chunk-nk0cn3yq.js +2 -0
- package/dist/{chunk-9n7ehv7w.js → chunk-nmh4pn44.js} +2 -2
- package/dist/chunk-nvewemvh.js +2 -0
- package/dist/chunk-p1t8mm9b.js +2 -0
- package/dist/chunk-pv73vnyj.js +2 -0
- package/dist/{chunk-2z56183d.js → chunk-pw0b0an6.js} +4 -4
- package/dist/{chunk-h7y89m22.js → chunk-q3a13hvc.js} +2 -2
- package/dist/{chunk-9kzdk4na.js → chunk-q4t49t6z.js} +3 -3
- package/dist/{chunk-pc15w7bb.js → chunk-qxr7e0y2.js} +2 -2
- package/dist/{chunk-cwxkgbck.js → chunk-qzfq8342.js} +1 -1
- package/dist/{chunk-6yrjyrc2.js → chunk-r9z467kx.js} +5 -5
- package/dist/chunk-rbwhdwa9.js +2 -0
- package/dist/chunk-rgg6kr7r.js +2 -0
- package/dist/chunk-rw3kgv2q.js +2 -0
- package/dist/{chunk-hxzy2t7r.js → chunk-s9jgsp0a.js} +8 -8
- package/dist/{chunk-999d4sns.js → chunk-t1cbac58.js} +4 -4
- package/dist/{chunk-gbk2dbt1.js → chunk-t4rxr1zj.js} +3 -3
- package/dist/chunk-t7h714ne.js +2 -0
- package/dist/{chunk-70n1t4ht.js → chunk-t8akfx99.js} +7 -7
- package/dist/{chunk-eg5yfnrn.js → chunk-temrpzxj.js} +26 -26
- package/dist/chunk-th9t5vks.js +2 -0
- package/dist/chunk-tkw5mr0k.js +2 -0
- package/dist/chunk-tq5nzr99.js +2 -0
- package/dist/{chunk-z7ezxqmg.js → chunk-trhr4gzz.js} +5 -5
- package/dist/{chunk-zatgmkx7.js → chunk-twmq5m6r.js} +2 -2
- package/dist/{chunk-wyndxr8w.js → chunk-vxa0h3yy.js} +4 -4
- package/dist/{chunk-ewsd3apq.js → chunk-wn3d4gd6.js} +2 -2
- package/dist/chunk-wq6b8qgz.js +2 -0
- package/dist/chunk-wr42shpx.js +2 -0
- package/dist/{chunk-xap2cbkd.js → chunk-x7jmchd5.js} +5 -5
- package/dist/chunk-x81g1v5x.js +2 -0
- package/dist/{chunk-d17mhbz9.js → chunk-xeqysa9z.js} +213 -213
- package/dist/{chunk-f8tts10s.js → chunk-xz7h73ra.js} +1 -1
- package/dist/{chunk-74j18qk0.js → chunk-y8h823cb.js} +28 -28
- package/dist/chunk-yn2d8x8m.js +3 -0
- package/dist/chunk-ywf6pa29.js +2 -0
- package/dist/{chunk-gn75qghq.js → chunk-ywxg3f9s.js} +2 -2
- package/dist/chunk-yxksngda.js +2 -0
- package/dist/chunk-yytfje8a.js +2 -0
- package/dist/{chunk-3d658f6n.js → chunk-zb191qdx.js} +5 -5
- package/dist/{chunk-tk50q4zs.js → chunk-zde9mef4.js} +3 -3
- package/dist/chunk-zxvqjzr2.js +2 -0
- package/dist/cli.js +46 -46
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/loops.js +4 -3
- package/dist/native/compiler/render-screen.js +7 -0
- package/dist/pwa.js +3 -3
- package/dist/safe-evaluator.d.ts +16 -0
- package/dist/safe-evaluator.js +10 -4
- package/dist/ssg.js +6 -6
- package/package.json +5 -5
- package/dist/chunk-02dcqhzy.js +0 -2
- package/dist/chunk-0gpjks6k.js +0 -2
- package/dist/chunk-1239cnda.js +0 -2
- package/dist/chunk-1qx531pp.js +0 -2
- package/dist/chunk-24tx4ysv.js +0 -2
- package/dist/chunk-2h8xmmtk.js +0 -2
- package/dist/chunk-2pkx524z.js +0 -2
- package/dist/chunk-2y80c34h.js +0 -2
- package/dist/chunk-4j3fmxeg.js +0 -2
- package/dist/chunk-5f330rrj.js +0 -2
- package/dist/chunk-5ys7azpj.js +0 -2
- package/dist/chunk-64vnwrkw.js +0 -2
- package/dist/chunk-7446n6a3.js +0 -2
- package/dist/chunk-76ebcf61.js +0 -2
- package/dist/chunk-7aa4qncj.js +0 -2
- package/dist/chunk-7awf2gqs.js +0 -2
- package/dist/chunk-84f8tft8.js +0 -2
- package/dist/chunk-8t8wf1w2.js +0 -2
- package/dist/chunk-9mmy9m0y.js +0 -2
- package/dist/chunk-9vxdjpn5.js +0 -2
- package/dist/chunk-brbybne9.js +0 -2
- package/dist/chunk-cg8hg6cs.js +0 -3
- package/dist/chunk-cwvazqab.js +0 -2
- package/dist/chunk-f19bzr36.js +0 -2
- package/dist/chunk-fa0aa98d.js +0 -2
- package/dist/chunk-fjx1sbg2.js +0 -2
- package/dist/chunk-g24kapd5.js +0 -2
- package/dist/chunk-gvv4d0tp.js +0 -2
- package/dist/chunk-h3fr7c5y.js +0 -2
- package/dist/chunk-hwt7pyqt.js +0 -2
- package/dist/chunk-jp1xjh1f.js +0 -2
- package/dist/chunk-jrccxnbt.js +0 -2
- package/dist/chunk-jv3rdes9.js +0 -2
- package/dist/chunk-k36ve5ct.js +0 -2
- package/dist/chunk-k5vytrbx.js +0 -2
- package/dist/chunk-k7vg01vv.js +0 -2
- package/dist/chunk-kayh4pcw.js +0 -2
- package/dist/chunk-myg6gz76.js +0 -2
- package/dist/chunk-myqhdz1w.js +0 -2
- package/dist/chunk-n6tspwf9.js +0 -2
- package/dist/chunk-nfdma5hp.js +0 -2
- package/dist/chunk-ng819bkf.js +0 -2
- package/dist/chunk-pnyxqze0.js +0 -2
- package/dist/chunk-qa5c5x2n.js +0 -2
- package/dist/chunk-r8a96bbd.js +0 -2
- package/dist/chunk-sakagfdq.js +0 -2
- package/dist/chunk-sj0bkdy8.js +0 -2
- package/dist/chunk-v6xk1q66.js +0 -2
- package/dist/chunk-vfk3vn6j.js +0 -2
- package/dist/chunk-w1szscbz.js +0 -2
- package/dist/chunk-wb9rbwb1.js +0 -2
- package/dist/chunk-wkx2m2br.js +0 -2
- package/dist/chunk-x73w6v8m.js +0 -2
- package/dist/chunk-yagzr2ry.js +0 -2
- package/dist/chunk-yda8t21j.js +0 -2
- package/dist/chunk-yydx0sfy.js +0 -2
- package/dist/chunk-zg0z8qt6.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,i}from"./chunk-
|
|
2
|
+
import{t,i}from"./chunk-k1hpxgzq.js";import{it,at,ct,be,Re,_,xr,On,we}from"./chunk-s9jgsp0a.js";var I=/(?<![\w$@])@meta\s*\(/g,C=/(?<![\w$@])@metaTag\s*\(/g,k=/(?<![\w$@])@structuredData\s*\(/g,N=/(?<![\w$@])@seo\s*\(/g;function D(e,r){return(n)=>_(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function j(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function Ws(e,r,n,g){if(!e.includes("@meta"))return e;let a=it(e,I,(s,c)=>{let o=On(at(s),r);if(o.kind==="tag")return j(o.tag);if(o.kind==="empty")return"";return _("Meta",c,o.message,n,o.code)},D("Meta",n));return a=it(a,C,(s,c)=>{let o=ct(s,r);if(!o.ok)return _("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!Re(o.value))return _("MetaTag",c,`expected an object such as { name, content }, got ${be(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return _("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${l(u.name)}"`;if(u.property)p+=` property="${l(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${l(u.httpEquiv)}"`;return p+=` content="${l(u.content)}">`,p},D("MetaTag",n)),a}function v(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(Re(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(Re))return e.map(r);return null}function A(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function qs(e,r,n){if(!e.includes("@structuredData"))return e;return it(e,k,(g,a)=>{let s=ct(g,r);if(!s.ok)return _("StructuredData",a,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=v(s.value);if(!c)return _("StructuredData",a,`expected an object or an array of objects, got ${be(s.value)}`,n,t.TYPE_ERROR);try{return A(c)}catch(o){let u=o instanceof Error?o.message:String(o);return _("StructuredData",a,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},D("StructuredData",n))}var L=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),R={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Gs(e,r,n,g){if(!e.includes("@seo"))return e;return it(e,N,(a,s)=>{if(!a.trim())return _("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=ct(a,r);if(!c.ok)return _("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!Re(c.value))return _("SEO",s,`expected an object such as { title, description }, got ${be(c.value)}`,n,t.TYPE_ERROR);try{return q(c.value,s,n)}catch(o){let u=o instanceof Error?o.message:String(o);return _("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},D("SEO",n))}function b(e,r,n,g){let a=e[r];if(a===void 0||a===null||a===!1)return;if(Re(a))return a;xr(n,`${r} must be an object, got ${be(a)}; its tags were left out`,g);return}function q(e,r,n){let g=Object.keys(e).filter((o)=>!L.has(o));if(g.length>0){let o=g.map((u)=>R[u]?`${u} (use ${R[u]})`:u).join(", ");xr(r,`@seo does not read ${o}; ${g.length===1?"it was":"they were"} ignored`,n)}let a="";if(e.title)a+=`<title>${l(e.title)}</title>
|
|
3
3
|
`,a+=`<meta name="title" content="${l(e.title)}">
|
|
4
4
|
`;if(e.description)a+=`<meta name="description" content="${l(e.description)}">
|
|
5
5
|
`;if(e.keywords){let o=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;a+=`<meta name="keywords" content="${l(o)}">
|
|
@@ -25,7 +25,7 @@ import{t,i}from"./chunk-qqenm7pg.js";import{it,at,ct,be,Re,_,xr,On,we}from"./chu
|
|
|
25
25
|
`}if(c.site)a+=`<meta name="twitter:site" content="${l(c.site)}">
|
|
26
26
|
`;if(c.creator)a+=`<meta name="twitter:creator" content="${l(c.creator)}">
|
|
27
27
|
`}if(e.structuredData!==void 0&&e.structuredData!==null){let o=v(e.structuredData);if(o)a+=`${A(o)}
|
|
28
|
-
`;else xr(r,`structuredData must be an object or an array of objects, got ${be(e.structuredData)}; it was left out`,n)}return a.trim()}function
|
|
28
|
+
`;else xr(r,`structuredData must be an object or an array of objects, got ${be(e.structuredData)}; it was left out`,n)}return a.trim()}function Ks(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let g=r.__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 s=e.includes("<title>")||e.includes("</title>"),c=M(e),o=V(c),u=U(c),p="";if(r.title)p=r.title;else if(r.meta&&r.meta.title)p=r.meta.title;else if(o)p=o;else if(n.seo?.defaultConfig?.title)p=n.seo.defaultConfig.title;else p=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=s?"":`
|
|
29
29
|
<meta name="title" content="${l(p)}">`,E=G(c)?"":`
|
|
30
30
|
<meta name="description" content="${l(m)}">`,y=`
|
|
31
31
|
<!-- stx SEO Tags -->${f}${E}
|
|
@@ -43,7 +43,7 @@ import{t,i}from"./chunk-qqenm7pg.js";import{it,at,ct,be,Re,_,xr,On,we}from"./chu
|
|
|
43
43
|
${y}
|
|
44
44
|
`),h;return h.replace(/<head[^>]*>/,`$&
|
|
45
45
|
${y}
|
|
46
|
-
`)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function x(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?x(r[1].trim()):""}function O(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return O(e).length>0}function U(e){for(let r of O(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return x(g)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var br={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let a=On(r,n??{});if(a.kind==="error")return _("Meta",`@meta(${r.join(", ")})`,a.message,g,a.code);if(a.kind==="empty")return"";if(n)n.__stx_runtime_head=we(n.__stx_runtime_head??{},{meta:[a.tag]});return""},hasEndTag:!1},vr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return i("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let a=JSON.parse(e);if(!a["@context"])a["@context"]="https://schema.org";if(!a["@type"])return i("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return A(a)}catch(a){let s=a instanceof Error?a.message:String(a);return i("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function
|
|
46
|
+
`)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function x(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?x(r[1].trim()):""}function O(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return O(e).length>0}function U(e){for(let r of O(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return x(g)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var br={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let a=On(r,n??{});if(a.kind==="error")return _("Meta",`@meta(${r.join(", ")})`,a.message,g,a.code);if(a.kind==="empty")return"";if(n)n.__stx_runtime_head=we(n.__stx_runtime_head??{},{meta:[a.tag]});return""},hasEndTag:!1},vr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return i("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let a=JSON.parse(e);if(!a["@context"])a["@context"]="https://schema.org";if(!a["@type"])return i("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return A(a)}catch(a){let s=a instanceof Error?a.message:String(a);return i("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function wd(){return[br,vr]}function xd(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:a=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,""),o=(m)=>m.startsWith("http")?m:`${c}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=o(m.loc),f=m.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),E=m.changefreq||g,y=m.priority??a,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(o(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
|
${u.join(`
|
|
55
55
|
`)}
|
|
56
|
-
</urlset>`}function
|
|
56
|
+
</urlset>`}function Sd(e,r){let n=r.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((s)=>{let c=s.startsWith("http")?s:`${n}${s.startsWith("/")?"":"/"}${s}`;return` <sitemap>
|
|
59
59
|
<loc>${T(c)}</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 kd(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,a=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let o of c.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let p=o.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}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}a.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return a.sort((o,u)=>o.loc.localeCompare(u.loc)),a}function wr(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
|
|
64
|
+
`).trim()}function Cd(e){return wr({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
65
|
+
export{Ws,qs,Gs,Ks,br,vr,wd,xd,Sd,kd,wr,Cd};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ve,K}from"./chunk-
|
|
2
|
+
import{Ve,K}from"./chunk-dcs87qta.js";import{Yo}from"./chunk-3vbv4gxx.js";import{d}from"./chunk-yn2d8x8m.js";import{existsSync as z,mkdirSync as v,copyFileSync as k,chmodSync as T}from"fs";import{join as o,basename as te}from"path";import{spawn as E,execSync as ae}from"child_process";import{homedir as B,platform as re}from"os";var Bu=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -465,7 +465,7 @@ else if (data.type === 'event' && data.method) {
|
|
|
465
465
|
}
|
|
466
466
|
})();
|
|
467
467
|
</script>
|
|
468
|
-
`;function
|
|
468
|
+
`;function Ho(e={}){let{debug:a=!1,timeout:r=30000}=e;return`
|
|
469
469
|
<script>
|
|
470
470
|
(function() {
|
|
471
471
|
'use strict';
|
|
@@ -931,9 +931,9 @@ else if (data.type === 'event' && data.method) {
|
|
|
931
931
|
}
|
|
932
932
|
})();
|
|
933
933
|
</script>
|
|
934
|
-
`.replace("debug: false,",`debug: ${a},`).replace("timeout: 30000",`timeout: ${r}`)}function
|
|
934
|
+
`.replace("debug: false,",`debug: ${a},`).replace("timeout: 30000",`timeout: ${r}`)}function Fu(){return!1}function zu(e,a={}){let r=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(r,(i,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 Ho(t)})}function Vo(e,a={}){if(e.includes("__craftBridgeInitialized"))return e;let r=Ho(a);if(e.includes("</head>"))return e.replace("</head>",`${r}
|
|
935
935
|
</head>`);if(e.includes("<body"))return e.replace(/(<body[^>]*>)/,`$1
|
|
936
|
-
${r}`);return r+e}var
|
|
936
|
+
${r}`);return r+e}var os={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,a)=>{let r=e.checked?"checked":"",i=e.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
|
|
937
937
|
<input type="checkbox" class="craft-checkbox" ${r} ${i}>
|
|
938
938
|
<span class="craft-checkbox-label">${a||e.label||""}</span>
|
|
939
939
|
</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,a)=>{let r=e.min??0,i=e.max??100,s=e.step??1,t=e.value??50,n=e.disabled?"disabled":"";return`<input type="range" class="craft-slider" min="${r}" max="${i}" step="${s}" value="${t}" ${n}>`}},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,a)=>{let r=e.size||40,i=e.src,s=String(e.alt||""),t=e.fallback||(s?s.charAt(0).toUpperCase():"?");if(i)return`<img class="craft-avatar" src="${i}" alt="${s}" style="width:${r}px;height:${r}px;border-radius:50%">`;return`<div class="craft-avatar craft-avatar-fallback" style="width:${r}px;height:${r}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,a)=>{let r=Number(e.value)||0,i=Number(e.max)||100;return`<div class="craft-progress"><div class="craft-progress-bar" style="width:${Math.min(100,Math.max(0,r/i*100))}%"></div></div>`}},spinner:{nativeType:"craft-spinner",fallbackTag:"div",fallbackClasses:"craft-spinner",nativeProps:["size"],render:(e,a)=>{let r=e.size||24;return`<div class="craft-spinner" style="width:${r}px;height:${r}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,a)=>{let r=e.open?"open":"",i=e.title||"";return`<dialog class="craft-modal" ${r}>
|
|
@@ -947,7 +947,7 @@ ${r}`);return r+e}var ss={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
947
947
|
</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,a)=>{let r=e.variant||"info",i=e.title||"";return`<div class="craft-alert craft-alert-${r}" role="alert">
|
|
948
948
|
${i?`<div class="craft-alert-title">${i}</div>`:""}
|
|
949
949
|
<div class="craft-alert-content">${a}</div>
|
|
950
|
-
</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,a)=>{let r=e.content||"",i=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${r}" data-position="${i}">${a}</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:U},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:j},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:H},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:V},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,a)=>`<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,a)=>{let r=e.value||"",i=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${r}" min="${i}" max="${s}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(e,a)=>`<input type="time" class="craft-time-picker" value="${e.value||""}">`}},
|
|
950
|
+
</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,a)=>{let r=e.content||"",i=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${r}" data-position="${i}">${a}</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:U},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:j},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:H},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:V},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,a)=>`<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,a)=>{let r=e.value||"",i=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${r}" min="${i}" max="${s}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(e,a)=>`<input type="time" class="craft-time-picker" value="${e.value||""}">`}},Uo=`
|
|
951
951
|
<style id="craft-component-styles">
|
|
952
952
|
/* Craft Component Base Styles */
|
|
953
953
|
.craft-button {
|
|
@@ -1365,7 +1365,7 @@ ${r}`);return r+e}var ss={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
1367
|
</style>
|
|
1368
|
-
`,
|
|
1368
|
+
`,Hu=`
|
|
1369
1369
|
<script id="craft-component-runtime">
|
|
1370
1370
|
(function() {
|
|
1371
1371
|
if (window.__stxCraftComponentRuntime) return;
|
|
@@ -1469,7 +1469,7 @@ ${r}`);return r+e}var ss={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
1469
1469
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
1470
1470
|
})();
|
|
1471
1471
|
</script>
|
|
1472
|
-
`;function
|
|
1472
|
+
`;function Wo(e,a={}){let{classPrefix:r="craft"}=a;if(!e.includes("craft-component-styles"))if(e.includes("</head>"))e=e.replace("</head>",`${`
|
|
1473
1473
|
<style id="craft-component-styles">
|
|
1474
1474
|
/* Craft Component Base Styles */
|
|
1475
1475
|
.craft-button {
|
|
@@ -2934,17 +2934,17 @@ ${r}`);return r+e}var ss={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
2934
2934
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
2935
2935
|
})();
|
|
2936
2936
|
</script>
|
|
2937
|
-
`;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(i,s,t)=>R("sidebar",s,t.trim(),a,r)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(i,s)=>R("sidebar",s,"",a,r)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(i,s,t)=>R(s,t,"",a,r)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(i,s,t,n)=>R(s,t,n.trim(),a,r)),e}function R(e,a,r,i,s){let t=i.components?.[e]||
|
|
2937
|
+
`;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(i,s,t)=>R("sidebar",s,t.trim(),a,r)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(i,s)=>R("sidebar",s,"",a,r)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(i,s,t)=>R(s,t,"",a,r)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(i,s,t,n)=>R(s,t,n.trim(),a,r)),e}function R(e,a,r,i,s){let t=i.components?.[e]||os[e];if(!t)return console.warn(`[stx] Unknown Craft component: @craft-${e}`),`<div class="${s}-unknown" data-component="${e}">${r}</div>`;let n=A(a),c=[t.fallbackClasses||`${s}-${e}`];if(n.class)c.push(n.class),delete n.class;if(t.render)return n.__fallbackClasses=c.join(" "),t.render(n,r);let l=ee(n,t,c);if(["input","hr","br","img"].includes(t.fallbackTag))return`<${t.fallbackTag} ${l}>`;return`<${t.fallbackTag} ${l}>${r}</${t.fallbackTag}>`}function A(e){let a={},r=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,i;while((i=r.exec(e))!==null){let[s,t,n,c]=i,l=n??c;if(s.startsWith(":"))a[t]=l;else if(s.startsWith("@"))a[`on${t.charAt(0).toUpperCase()}${t.slice(1)}`]=l;else if(l===void 0)a[t]=!0;else a[t]=l}return a}function U(e,a){let r=I(String(e.id||`craft-sidebar-${X(a||JSON.stringify(e))}`)),i=Y(e.spaces)||J(a),s=i.length?[]:G(e.sections)||F(a),t=String(e.selectedSpace||i[0]?.id||""),n=i.find((m)=>m.id===t)||i[0],c=String(e.selectedItem||e.selected||(i.length?n?.sections[0]?.items[0]?.id:s[0]?.items[0]?.id)||""),l={id:r,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:c,sections:s,spaces:i,selectedSpace:t||void 0},f=String(e.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),b=Number(e.width||e.sidebarWidth||286),p=e.native===!1||e.native==="false"?"false":"true",x=l.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${C(l.searchPlaceholder)}"></div>`:"",u;if(i.length)u=Q(i,t,c);else if(s.length)u=s.map((m)=>D(m,c)).join("");else u=a;return`<aside class="${h(f)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${h(r)}" data-native="${p}" style="--craft-sidebar-width:${b}px">
|
|
2938
2938
|
${x}
|
|
2939
|
-
${
|
|
2939
|
+
${u}
|
|
2940
2940
|
</aside>
|
|
2941
|
-
<script type="application/json" data-craft-sidebar-config="${h(r)}">${Z(
|
|
2941
|
+
<script type="application/json" data-craft-sidebar-config="${h(r)}">${Z(l)}</script>`}function j(e,a){let r=I(String(e.id||e.label||"space"));return`<section class="craft-sidebar-space" data-craft="craft-sidebar-space" data-space-id="${h(r)}">
|
|
2942
2942
|
${e.label?`<div class="craft-sidebar-space-title">${C(String(e.label))}</div>`:""}
|
|
2943
2943
|
${a}
|
|
2944
2944
|
</section>`}function H(e,a){let r=String(e.header||e.title||"");return`<section class="craft-sidebar-section" data-craft="craft-sidebar-section" data-section-id="${h(String(e.id||"section"))}">
|
|
2945
2945
|
${r?`<div class="craft-sidebar-section-title">${C(r)}</div>`:""}
|
|
2946
2946
|
${a}
|
|
2947
|
-
</section>`}function V(e,a){let r={id:String(e.id||I(String(e.label||a||"item"))),label:String(e.label||a||""),icon:e.icon?String(e.icon):void 0,badge:e.badge?String(e.badge):void 0,tintColor:e.tintColor?String(e.tintColor):void 0};return O(r,String(e.selected||"")==="true")}function F(e){let a=[],r=/<@craft-sidebar-section\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-section>)/g,i;while((i=r.exec(e))!==null){let s=A(i[1]||""),t=i[2]||"",n=String(s.id||I(String(s.header||s.title||`section-${a.length+1}`))),c=String(s.header||s.title||n),
|
|
2947
|
+
</section>`}function V(e,a){let r={id:String(e.id||I(String(e.label||a||"item"))),label:String(e.label||a||""),icon:e.icon?String(e.icon):void 0,badge:e.badge?String(e.badge):void 0,tintColor:e.tintColor?String(e.tintColor):void 0};return O(r,String(e.selected||"")==="true")}function F(e){let a=[],r=/<@craft-sidebar-section\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-section>)/g,i;while((i=r.exec(e))!==null){let s=A(i[1]||""),t=i[2]||"",n=String(s.id||I(String(s.header||s.title||`section-${a.length+1}`))),c=String(s.header||s.title||n),l=W(t);a.push({id:n,header:c,title:c,items:l})}return a}function W(e){let a=[],r=/<@craft-sidebar-item\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-item>)/g,i;while((i=r.exec(e))!==null){let s=A(i[1]||""),t=String(s.label||(i[2]||"").replace(/<[^>]*>/g,"").trim()),n=String(s.id||I(t||`item-${a.length+1}`));a.push({id:n,label:t,icon:s.icon?String(s.icon):void 0,badge:s.badge?String(s.badge):void 0,tintColor:s.tintColor?String(s.tintColor):void 0})}return a}function J(e){let a=[],r=/<@craft-sidebar-space\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-space>)/g,i;while((i=r.exec(e))!==null){let s=A(i[1]||""),t=i[2]||"",n=String(s.label||s.title||`Space ${a.length+1}`);a.push({id:String(s.id||I(n)),label:n,icon:s.icon?String(s.icon):void 0,tint:s.tint?String(s.tint):void 0,sections:F(t)})}return a}function Y(e){if(!e)return;if(Array.isArray(e))return e;if(typeof e!=="string")return;try{let a=JSON.parse(e);return Array.isArray(a)?a:void 0}catch{return}}function Q(e,a,r){let i=e.map((t)=>`<button class="craft-sidebar-space-tab" type="button" data-space-target="${h(t.id)}" data-selected="${t.id===a?"true":"false"}" title="${h(t.label||t.id)}">${t.icon?`<span class="craft-sidebar-item-icon" data-icon="${h(t.icon)}"></span>`:C((t.label||t.id).charAt(0))}</button>`).join("");return`<div class="craft-sidebar-spaces">${e.map((t)=>`<section class="craft-sidebar-space" data-space-id="${h(t.id)}" data-selected="${t.id===a?"true":"false"}">
|
|
2948
2948
|
${t.label?`<div class="craft-sidebar-space-title">${C(t.label)}</div>`:""}
|
|
2949
2949
|
${t.sections.map((n)=>D(n,r)).join("")}
|
|
2950
2950
|
</section>`).join("")}</div>
|
|
@@ -2955,16 +2955,16 @@ ${r}`);return r+e}var ss={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
2955
2955
|
${e.icon?`<span class="craft-sidebar-item-icon" data-icon="${h(e.icon)}"${r}></span>`:""}
|
|
2956
2956
|
<span class="craft-sidebar-item-label">${C(e.label)}</span>
|
|
2957
2957
|
${e.badge?`<span class="craft-sidebar-item-badge">${C(e.badge)}</span>`:""}
|
|
2958
|
-
</button>`}function I(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function X(e){let a=5381;for(let r=0;r<e.length;r++)a=a*33^e.charCodeAt(r);return(a>>>0).toString(36)}function C(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return C(e).replace(/`/g,"`")}function Z(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ee(e,a,r){let i=[];i.push(`class="${r.join(" ")}"`),i.push(`data-craft="${a.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)i.push(s);else if(t!==!1&&t!==void 0&&t!==null){let n=String(t).replace(/"/g,""");i.push(`${s}="${n}"`)}return i.join(" ")}function
|
|
2959
|
-
</head>`)}let n=e.name||te(e.input,".stx"),c=e.version||"1.0.0",
|
|
2958
|
+
</button>`}function I(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function X(e){let a=5381;for(let r=0;r<e.length;r++)a=a*33^e.charCodeAt(r);return(a>>>0).toString(36)}function C(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return C(e).replace(/`/g,"`")}function Z(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ee(e,a,r){let i=[];i.push(`class="${r.join(" ")}"`),i.push(`data-craft="${a.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)i.push(s);else if(t!==!1&&t!==void 0&&t!==null){let n=String(t).replace(/"/g,""");i.push(`${s}="${n}"`)}return i.join(" ")}function Vu(e,a){os[e]=a}function Uu(){return{...os}}async function qo(e){let a=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||P(),format:e.format||"app",error:`Input file not found: ${e.input}`};let r=e.target||P(),i=e.format||pe(r),s=e.output||o(process.cwd(),"dist","native");if(!z(s))v(s,{recursive:!0});let t=await Yo(e.input,{context:e.context,options:{isDev:!1}});if(t=Vo(t,{debug:e.verbose}),t=Wo(t),!t.includes("craft-component-styles")){if(t.includes("</head>"))t=t.replace("</head>",`${Uo}
|
|
2959
|
+
</head>`)}let n=e.name||te(e.input,".stx"),c=e.version||"1.0.0",l=e.craftPath||await fe();if(!l)return{success:!1,target:r,format:i,error:"Craft binary not found. Please install Craft or specify craftPath."};if(e.verbose)console.log(`\uD83D\uDCE6 Building native app for ${r}...`),console.log(` Input: ${e.input}`),console.log(` Output: ${s}`),console.log(` Craft: ${l}`);let f;switch(r){case"macos":f=await ie(t,n,c,s,i,e,l);break;case"windows":f=await oe(t,n,c,s,i,e,l);break;case"linux":f=await ce(t,n,c,s,i,e,l);break;case"ios":f=await de(t,n,c,s,e,l);break;case"android":f=await le(t,n,c,s,e,l);break;default:f={success:!1,target:r,format:i,error:`Unsupported target: ${r}`}}return f.duration=Date.now()-a,f}catch(r){return{success:!1,target:e.target||P(),format:e.format||"app",error:r.message,duration:Date.now()-a}}}async function ie(e,a,r,i,s,t,n){let c=t.bundleId||`com.stx.${a.toLowerCase().replace(/[^a-z0-9]/g,"")}`,l=o(i,`${a}.app`),f=o(l,"Contents"),b=o(f,"MacOS"),p=o(f,"Resources");v(b,{recursive:!0}),v(p,{recursive:!0});let x=o(p,"index.html");await Bun.write(x,e);let u="";if(t.sidebar?.enabled&&t.sidebar?.config)u=o(p,"sidebar-config.json"),await Bun.write(u,JSON.stringify(t.sidebar.config));let m=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",y=t.menubarOnly??t.systemTray;if((t.bundleStyle||(await se(n)?"executable":"launcher"))==="executable"){let S=o(b,a);k(n,S),T(S,493);let w={html:"index.html",title:t.window?.title||a,width:t.window?.width||1200,height:t.window?.height||800,devTools:Boolean(t.devTools)};if(y)w.menubarOnly=!0;else if(t.systemTray)w.systemTray=!0;if(t.window?.frameless)w.frameless=!0;if(t.window?.transparent)w.transparent=!0;if(t.window?.alwaysOnTop)w.alwaysOnTop=!0;if(t.window?.resizable===!1)w.resizable=!1;await Bun.write(o(p,"craft.json"),`${JSON.stringify(w,null,2)}
|
|
2960
2960
|
`)}else{let S=o(b,"craft");k(n,S),T(S,493);let w=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",L=`#!/bin/bash
|
|
2961
2961
|
set -euo pipefail
|
|
2962
2962
|
DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
|
2963
2963
|
RESOURCES="$DIR/../Resources"
|
|
2964
2964
|
exec "$DIR/craft" --html-file "$RESOURCES/index.html" \\
|
|
2965
2965
|
${[`--title "${t.window?.title||a}"`,`--width ${t.window?.width||1200}`,`--height ${t.window?.height||800}`,y?"--menubar-only":t.systemTray?"--system-tray":"",t.devTools?"":"--no-devtools",t.window?.frameless?"--frameless":"",t.window?.transparent?"--transparent":"",t.window?.alwaysOnTop?"--always-on-top":"",t.window?.resizable===!1?"--no-resize":"",w].filter(Boolean).join(" \\\n ")}
|
|
2966
|
-
`,q=o(b,a);await Bun.write(q,L),T(q,493)}let N=Boolean(t.icon&&await Bun.file(t.icon).exists());if(N)k(t.icon,o(
|
|
2967
|
-
${i}`.match(/(\d+)\.(\d+)\.(\d+)/);if(!t)return!1;let[n,c,
|
|
2966
|
+
`,q=o(b,a);await Bun.write(q,L),T(q,493)}let N=Boolean(t.icon&&await Bun.file(t.icon).exists());if(N)k(t.icon,o(p,"AppIcon.icns"));let M={CFBundleExecutable:a,CFBundleIdentifier:c,CFBundleName:a,CFBundleDisplayName:a,CFBundleShortVersionString:r,CFBundleVersion:r,CFBundlePackageType:"APPL",CFBundleSignature:"????",LSMinimumSystemVersion:t.minimumSystemVersion||"13.0",NSHighResolutionCapable:!0,NSSupportsAutomaticGraphicsSwitching:!0,LSUIElement:t.menubarOnly??Boolean(t.systemTray),...N?{CFBundleIconFile:"AppIcon"}:{},...t.category?{LSApplicationCategoryType:t.category}:{},...t.copyright?{NSHumanReadableCopyright:t.copyright}:{},...t.infoPlist||{}};if(await Bun.write(o(f,"Info.plist"),ne(M)),s==="dmg"){let S=o(i,`${a}-${r}.dmg`),w=await ue(l,S,a);if(!w.success)return{success:!1,target:"macos",format:"dmg",error:w.error};return{success:!0,target:"macos",format:"dmg",outputPath:S}}return{success:!0,target:"macos",format:"app",outputPath:l}}async function se(e){try{let a=Bun.spawn([e,"--version"],{stdout:"pipe",stderr:"pipe"}),[r,i]=await Promise.all([new Response(a.stdout).text(),new Response(a.stderr).text()]);await a.exited;let t=`${r}
|
|
2967
|
+
${i}`.match(/(\d+)\.(\d+)\.(\d+)/);if(!t)return!1;let[n,c,l]=t.slice(1).map(Number);if(n>0||c>0)return!0;return l>=57}catch{return!1}}function _(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function ne(e){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
2968
2968
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
2969
2969
|
<plist version="1.0">
|
|
2970
2970
|
<dict>
|
|
@@ -2973,7 +2973,7 @@ ${Object.entries(e).map(([r,i])=>{let s=typeof i==="boolean"?`<${i}/>`:typeof i=
|
|
|
2973
2973
|
`)}
|
|
2974
2974
|
</dict>
|
|
2975
2975
|
</plist>
|
|
2976
|
-
`}async function oe(e,a,r,i,s,t,n){let c=o(i,a);v(c,{recursive:!0});let
|
|
2976
|
+
`}async function oe(e,a,r,i,s,t,n){let c=o(i,a);v(c,{recursive:!0});let l=o(c,"index.html");await Bun.write(l,e),k(n,o(c,"craft.exe"));let f=`@echo off
|
|
2977
2977
|
set DIR=%~dp0
|
|
2978
2978
|
"%DIR%craft.exe" --html-file "%DIR%index.html" ^
|
|
2979
2979
|
--title "${t.window?.title||a}" ^
|
|
@@ -2981,7 +2981,7 @@ set DIR=%~dp0
|
|
|
2981
2981
|
--height ${t.window?.height||800} ^
|
|
2982
2982
|
${t.systemTray?"--system-tray":""} ^
|
|
2983
2983
|
${t.devTools?"":"--no-devtools"}
|
|
2984
|
-
`;if(await Bun.write(o(c,`${a}.bat`),
|
|
2984
|
+
`;if(await Bun.write(o(c,`${a}.bat`),f),s==="zip"){let b=o(i,`${a}-${r}-windows.zip`),p=await be(c,b);if(!p.success)return{success:!1,target:"windows",format:"zip",error:p.error};return{success:!0,target:"windows",format:"zip",outputPath:b}}return{success:!0,target:"windows",format:"app",outputPath:c}}async function ce(e,a,r,i,s,t,n){let c=o(i,a);v(c,{recursive:!0});let l=o(c,"index.html");await Bun.write(l,e);let f=o(c,"craft");k(n,f),T(f,493);let b=`#!/bin/bash
|
|
2985
2985
|
set -euo pipefail
|
|
2986
2986
|
DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
|
2987
2987
|
exec "$DIR/craft" --html-file "$DIR/index.html" \\
|
|
@@ -2990,15 +2990,15 @@ exec "$DIR/craft" --html-file "$DIR/index.html" \\
|
|
|
2990
2990
|
--height ${t.window?.height||800} \\
|
|
2991
2991
|
${t.systemTray?"--system-tray":""} \\
|
|
2992
2992
|
${t.devTools?"":"--no-devtools"}
|
|
2993
|
-
`,
|
|
2993
|
+
`,p=o(c,a.toLowerCase());await Bun.write(p,b),T(p,493);let x=`[Desktop Entry]
|
|
2994
2994
|
Type=Application
|
|
2995
2995
|
Name=${a}
|
|
2996
|
-
Exec=${
|
|
2996
|
+
Exec=${p}
|
|
2997
2997
|
Terminal=false
|
|
2998
2998
|
Categories=Utility;
|
|
2999
|
-
`;if(await Bun.write(o(c,`${a.toLowerCase()}.desktop`),x),s==="deb"){let
|
|
3000
|
-
`)[0];if(r&&await Bun.file(r).exists())return r}catch{}return null}function P(){switch(re()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function pe(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 ue(e,a,r){return new Promise((i)=>{let s=E("hdiutil",["create","-volname",r,"-srcfolder",e,"-ov","-format","UDZO",a]);s.on("close",(t)=>{if(t===0)i({success:!0});else i({success:!1,error:`hdiutil exited with code ${t}`})}),s.on("error",(t)=>{i({success:!1,error:t.message})})})}async function be(e,a){return new Promise((r)=>{let i=E("zip",["-r",a,"."],{cwd:e});i.on("close",(s)=>{if(s===0)r({success:!0});else r({success:!1,error:`zip exited with code ${s}`})}),i.on("error",(s)=>{r({success:!1,error:s.message})})})}async function ge(e,a,r,i,s){return new Promise((t)=>{let n=Ve("deb");try{let c=o(n,"pkg"),
|
|
3001
|
-
exec /usr/share/${r.toLowerCase()}/${r.toLowerCase()} "$@"`;
|
|
2999
|
+
`;if(await Bun.write(o(c,`${a.toLowerCase()}.desktop`),x),s==="deb"){let u=o(i,`${a.toLowerCase()}_${r}_amd64.deb`),m=await ge(c,u,a,r,t);if(!m.success)return{success:!1,target:"linux",format:"deb",error:m.error};return{success:!0,target:"linux",format:"deb",outputPath:u}}if(s==="appimage"){let u=o(i,`${a}-${r}-x86_64.AppImage`),m=await me(c,u,a,t);if(!m.success)return{success:!1,target:"linux",format:"appimage",error:m.error};return{success:!0,target:"linux",format:"appimage",outputPath:u}}return{success:!0,target:"linux",format:"app",outputPath:c}}async function de(e,a,r,i,s,t){return{success:!1,target:"ios",format:"ipa",error:`iOS build requires Xcode and additional setup. Use 'stx init:ios ${a}' to create an iOS project.`}}async function le(e,a,r,i,s,t){return{success:!1,target:"android",format:"apk",error:`Android build requires Android SDK and additional setup. Use 'stx init:android ${a}' to create an Android project.`}}async function fe(){if(process.env.CRAFT_BIN&&await Bun.file(process.env.CRAFT_BIN).exists())return process.env.CRAFT_BIN;let e=[o(process.cwd(),"../../craft/packages/zig/zig-out/bin/craft"),o(process.cwd(),"../craft/packages/zig/zig-out/bin/craft"),o(B(),"Code/Tools/craft/packages/zig/zig-out/bin/craft"),o(B(),"Code/craft/packages/zig/zig-out/bin/craft"),"/usr/local/bin/craft","/usr/bin/craft",o(B(),".local/bin/craft"),o(process.env.LOCALAPPDATA||"","craft","craft.exe"),o(process.env.PROGRAMFILES||"","craft","craft.exe")];for(let a of e)if(await Bun.file(a).exists())return a;try{let r=ae("which craft 2>/dev/null || where craft 2>nul",{encoding:"utf-8"}).trim().split(`
|
|
3000
|
+
`)[0];if(r&&await Bun.file(r).exists())return r}catch{}return null}function P(){switch(re()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function pe(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 ue(e,a,r){return new Promise((i)=>{let s=E("hdiutil",["create","-volname",r,"-srcfolder",e,"-ov","-format","UDZO",a]);s.on("close",(t)=>{if(t===0)i({success:!0});else i({success:!1,error:`hdiutil exited with code ${t}`})}),s.on("error",(t)=>{i({success:!1,error:t.message})})})}async function be(e,a){return new Promise((r)=>{let i=E("zip",["-r",a,"."],{cwd:e});i.on("close",(s)=>{if(s===0)r({success:!0});else r({success:!1,error:`zip exited with code ${s}`})}),i.on("error",(s)=>{r({success:!1,error:s.message})})})}async function ge(e,a,r,i,s){return new Promise((t)=>{let n=Ve("deb");try{let c=o(n,"pkg"),l=o(c,"DEBIAN"),f=o(c,"usr","bin"),b=o(c,"usr","share","applications"),p=o(c,"usr","share",r.toLowerCase());v(l,{recursive:!0}),v(f,{recursive:!0}),v(b,{recursive:!0}),v(p,{recursive:!0});let x=d("fs").readdirSync(e);for(let g of x)k(o(e,g),o(p,g));let u=`#!/bin/bash
|
|
3001
|
+
exec /usr/share/${r.toLowerCase()}/${r.toLowerCase()} "$@"`;d("fs").writeFileSync(o(f,r.toLowerCase()),u),T(o(f,r.toLowerCase()),493);let m=`Package: ${r.toLowerCase()}
|
|
3002
3002
|
Version: ${i}
|
|
3003
3003
|
Section: utils
|
|
3004
3004
|
Priority: optional
|
|
@@ -3006,17 +3006,17 @@ Architecture: amd64
|
|
|
3006
3006
|
Depends: libgtk-3-0, libwebkit2gtk-4.0-37
|
|
3007
3007
|
Maintainer: ${s.author||"Unknown"}
|
|
3008
3008
|
Description: ${s.description||r}
|
|
3009
|
-
`;
|
|
3009
|
+
`;d("fs").writeFileSync(o(l,"control"),m);let y=E("dpkg-deb",["--build",c,a]);y.on("close",(g)=>{if(K(n),g===0)t({success:!0});else t({success:!1,error:`dpkg-deb exited with code ${g}`})}),y.on("error",(g)=>{K(n),t({success:!1,error:g.message})})}catch(c){K(n),t({success:!1,error:c.message})}})}async function me(e,a,r,i){return new Promise((s)=>{let t=Ve("appimage");try{let n=o(t,`${r}.AppDir`),c=o(n,"usr"),l=o(c,"bin"),f=o(c,"share");v(l,{recursive:!0}),v(f,{recursive:!0});let b=o(f,r.toLowerCase());v(b,{recursive:!0});let p=d("fs").readdirSync(e);for(let g of p)k(o(e,g),o(b,g));let x=`#!/bin/bash
|
|
3010
3010
|
SELF=$(readlink -f "$0")
|
|
3011
3011
|
HERE=\${SELF%/*}
|
|
3012
3012
|
export PATH="\${HERE}/usr/bin:\${PATH}"
|
|
3013
3013
|
exec "\${HERE}/usr/share/${r.toLowerCase()}/${r.toLowerCase()}" "$@"
|
|
3014
|
-
`;
|
|
3014
|
+
`;d("fs").writeFileSync(o(n,"AppRun"),x),T(o(n,"AppRun"),493);let u=`[Desktop Entry]
|
|
3015
3015
|
Type=Application
|
|
3016
3016
|
Name=${r}
|
|
3017
3017
|
Exec=${r.toLowerCase()}
|
|
3018
3018
|
Terminal=false
|
|
3019
3019
|
Categories=Utility;
|
|
3020
3020
|
Icon=${r.toLowerCase()}
|
|
3021
|
-
`;
|
|
3022
|
-
export{
|
|
3021
|
+
`;d("fs").writeFileSync(o(n,`${r.toLowerCase()}.desktop`),u);let m=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(d("fs").writeFileSync(o(n,`${r.toLowerCase()}.png`),m),i.icon&&z(i.icon))k(i.icon,o(n,`${r.toLowerCase()}.png`));let y=E("appimagetool",[n,a],{env:{...process.env,ARCH:"x86_64"}});y.on("close",(g)=>{if(K(t),g===0)T(a,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${g}. Install from https://appimage.github.io/appimagetool/`})}),y.on("error",(g)=>{K(t),s({success:!1,error:`appimagetool not found: ${g.message}`})})}catch(n){K(t),s({success:!1,error:n.message})}})}function Go(){return[P()]}function Ko(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 he={buildNative:qo,getAvailableTargets:Go,getAvailableFormats:Ko,detectPlatform:P},Wu=he;
|
|
3022
|
+
export{Bu,Ho,Fu,zu,Vo,os,Uo,Hu,Wo,Vu,Uu,qo,Go,Ko,Wu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{sr,wc,Ju,xc,Yu,Sc,or,b,Nt,Ce,kc,vs,Cc,Zu,Y,_c,Qu,x,ed}from"./chunk-xeqysa9z.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-kt9ksp8w.js";import"./chunk-nmh4pn44.js";import"./chunk-t8akfx99.js";import"./chunk-s9jgsp0a.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-5hqkfqne.js";import"./chunk-mm8jdb4p.js";export{_c as applyFilters,Yu as clearCustomFilters,kc as clientLoopScopes,sr as defaultFilters,b as escapeHtml,Nt as escapeHtmlValue,x as evaluateExpression,Sc as findMustacheEnd,xc as getAllFilters,Cc as interpolateScriptAttributes,vs as interpolateScriptExpressions,Zu as interpolateScriptsInTemplate,Y as processExpressions,wc as registerFilter,Ju as registerFilters,or as replaceInterpolations,Qu as resetRejectedExpressionWarnings,ed as unescapeHtml,Ce as usesSignalsInScript};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{J,ms,hs,vc,Ot,ci,ys,li,Xu,Se,bn,ke}from"./chunk-xeqysa9z.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import{Fi,s}from"./chunk-6rd762vj.js";import"./chunk-0zx1400y.js";import"./chunk-kt9ksp8w.js";import"./chunk-nmh4pn44.js";import"./chunk-t8akfx99.js";import"./chunk-s9jgsp0a.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-5hqkfqne.js";import"./chunk-mm8jdb4p.js";export{J as BROWSER_CORE_IMPORTS,vc as STX_AUTO_IMPORTS,ms as extractAndStripCssImports,Se as extractBridgeData,Fi as findInterpolationEnd,li as generateAutoImportDestructuring,Xu as generateBrowserAutoImportDestructuring,bn as generateServerDataBridge,Ot as injectBrowserCoreAutoImports,ke as processClientScript,ys as referencesName,hs as renderVendorStyleTags,s as stripCommentsAndLiterals,ci as transformAutoImports};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Bt,jc,Bc,Fc,zc,Hc,u,Vc,Ps,Uc,$i,Ri}from"./chunk-xeqysa9z.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-kt9ksp8w.js";import"./chunk-nmh4pn44.js";import"./chunk-t8akfx99.js";import"./chunk-s9jgsp0a.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-5hqkfqne.js";import"./chunk-mm8jdb4p.js";export{Bt as STX_ENGINE_BINDING_NAMES,Ps as convertToCommonJS,$i as extractScriptFromTemplate,u as extractVariables,Ri as hasVariables,Vc as isCompleteImport,Hc as isMissingBindingFailure,Fc as isModuleResolutionFailure,zc as isSyntaxFailure,Uc as splitDeclaration,jc as stripTypeScript,Bc as withoutStxReferrer};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Q}from"./chunk-
|
|
3
|
-
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function ds(s,l,o={}){let i=Pt(s,o);await
|
|
4
|
-
`)}`);let p=e.outputs.find((c)=>c.kind==="entry-point");if(!p)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await p.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),p),f.push({...t,filePath:n})}return f}function E(s,l){let o=s.map((i)=>({route:i,...Q(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,p=(r)=>r.replace(/:\w+/g,":param"),u=t.filter((r)=>p(r.route.pattern)===p(e)),n=i.method,c=u.find((r)=>r.route.method===n)??(n==="HEAD"?u.find((r)=>r.route.method==="GET"):void 0);if(!c){let r=new Set(u.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=c.regex.exec(f),g=Object.create(null);try{c.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await l(c.route);if(typeof r!=="function")throw Error(`API endpoint ${c.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function
|
|
5
|
-
`));let c=n.outputs.find((d)=>d.kind==="entry-point");if(!c||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${u.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await c.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function
|
|
6
|
-
export{Pt,
|
|
2
|
+
import{Q}from"./chunk-5hqkfqne.js";import{ye,C}from"./chunk-nmh4pn44.js";import{zi}from"./chunk-0zx1400y.js";import{a}from"./chunk-6ta850w8.js";import v from"fs";import m from"path";import{pathToFileURL as I}from"url";var P=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],R=new Set;function Pt(s,l={}){let o=m.resolve(s,l.dir??"server/api"),i=[],f=new Map;if(!v.existsSync(o))return i;let t=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:o})).sort();for(let e of t){if(e.endsWith(".d.ts"))continue;let u=e.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),n=u.pop(),c=n.lastIndexOf("."),d=c>=0?n.slice(c+1):"get",g=d.toUpperCase();if(!P.includes(g)||d!==d.toLowerCase())throw Error(`Unsupported API method suffix in ${e}; use ${P.map((A)=>A.toLowerCase()).join(", ")}`);if(c>=0)n=n.slice(0,c);if(n!=="index")u.push(n);let r=new Set,h=u.map((A,j)=>{let y=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(A);if(y){if(r.has(y[2])||y[1]&&j!==u.length-1)throw Error(`Invalid API parameter in ${e}`);return r.add(y[2]),`:${y[2]}${y[1]?"*":""}`}if(!/^[\w-]+$/.test(A))throw Error(`Unsupported API path segment ${A} in ${e}`);return A}),w=`/api${h.length?`/${h.join("/")}`:""}`,S=`${g} ${w.replace(/:\w+/g,":param")}`;if(f.has(S))throw Error(`Ambiguous API route ${g} ${w}: ${f.get(S)} and ${e}`);f.set(S,e);let x=m.join(o,e);R.add(m.resolve(x)),R.add(v.realpathSync(x)),i.push({pattern:w,method:g,filePath:x})}return i.sort((e,p)=>{let u=e.pattern.split("/"),n=p.pattern.split("/"),c=(d)=>d?.endsWith("*")?0:d?.startsWith(":")?1:2;for(let d=0;d<Math.max(u.length,n.length);d++){let g=c(n[d])-c(u[d]);if(g)return g}return e.pattern.localeCompare(p.pattern)||e.method.localeCompare(p.method)})}async function us(s,l){let o=a(s,"api-types.d.ts"),i=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let t of l){let e=`./${m.relative(m.dirname(o),t.filePath).replace(/\\/g,"/")}`,{params:p}=Q(t.pattern);i.push(` ${JSON.stringify(`${t.method} ${t.pattern}`)}: { params: { ${p.map((u)=>`${JSON.stringify(u)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(e)}).default>> }`)}i.push(" }","}","export {}","");let f=i.join(`
|
|
3
|
+
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function ds(s,l,o={}){let i=Pt(s,o);await us(s,i);let f=[];for(let t of i){let e=await Bun.build({entrypoints:[t.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!e.success)throw Error(`API build failed for ${t.filePath}: ${e.logs.join(`
|
|
4
|
+
`)}`);let p=e.outputs.find((c)=>c.kind==="entry-point");if(!p)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await p.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),p),f.push({...t,filePath:n})}return f}function E(s,l){let o=s.map((i)=>({route:i,...Q(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,p=(r)=>r.replace(/:\w+/g,":param"),u=t.filter((r)=>p(r.route.pattern)===p(e)),n=i.method,c=u.find((r)=>r.route.method===n)??(n==="HEAD"?u.find((r)=>r.route.method==="GET"):void 0);if(!c){let r=new Set(u.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=c.regex.exec(f),g=Object.create(null);try{c.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await l(c.route);if(typeof r!=="function")throw Error(`API endpoint ${c.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function ps(s,l){return E(l,async(o)=>(await import(I(m.resolve(s,o.filePath)).href)).default)}async function Ku(s,l){if(!l)return async()=>null;let o=l===!0?{}:l,i=Pt(s,o);return await us(s,i),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=Pt(s,o);await us(s,t);let{loadStxConfig:e}=await import("./chunk-yytfje8a.js"),p=C((await e(s)).runtimeConfig);return await ye(p,()=>E(t,async(u)=>{let n=await Bun.build({entrypoints:[u.filePath],target:"bun",format:"esm",splitting:!1});if(!n.success)throw Error(n.logs.join(`
|
|
5
|
+
`));let c=n.outputs.find((d)=>d.kind==="entry-point");if(!c||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${u.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await c.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function gs(s,l,o){if(zi(s))return!0;let i=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(i.test(m.basename(s)))return!0;try{if(i.test(m.basename(v.realpathSync(s))))return!0}catch{}if(R.has(m.resolve(s)))return!0;if(!o)return!1;let f=m.resolve(l,typeof o==="object"?o.dir??"server/api":"server/api"),t=(p)=>{try{return v.realpathSync(p)}catch{return m.resolve(p)}},e=t(s);return[f,m.resolve(l,"server"),m.resolve(l,".output/server")].some((p)=>{let u=t(p);return e===u||e.startsWith(`${u}${m.sep}`)})}
|
|
6
|
+
export{Pt,us,ds,ps,Ku,gs};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function E(){let{NODE_ENV:n}=process.env;return n==="production"}function N(){let{STX_DEBUG:n}=process.env;return!E()||n==="true"}function Ln(){let{NODE_ENV:n}=process.env;return n==="test"}function
|
|
3
|
-
export{E,N,Ln,
|
|
2
|
+
function E(){let{NODE_ENV:n}=process.env;return n==="production"}function N(){let{STX_DEBUG:n}=process.env;return!E()||n==="true"}function Ln(){let{NODE_ENV:n}=process.env;return n==="test"}function to(n){return n==="compile"||E()}function jn(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
|
|
3
|
+
export{E,N,Ln,to,jn};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function
|
|
2
|
+
var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function hu(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
|
|
3
3
|
<div class="stx-async-component" data-async-id="${e}" data-component="${i}" data-status="pending">
|
|
4
4
|
<div class="stx-async-loading" data-async-loading="${e}">
|
|
5
5
|
${c}
|
|
@@ -226,7 +226,7 @@ catch (error) {
|
|
|
226
226
|
loadComponent();
|
|
227
227
|
})();
|
|
228
228
|
</script>
|
|
229
|
-
`}function
|
|
229
|
+
`}function yu(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function bu(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function vu(){return`
|
|
230
230
|
/* STX Async Component Styles */
|
|
231
231
|
.stx-async-component {
|
|
232
232
|
position: relative;
|
|
@@ -300,7 +300,7 @@ catch (error) {
|
|
|
300
300
|
background-size: 200% 100%;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
`}function
|
|
303
|
+
`}function wu(){return`
|
|
304
304
|
// STX Async Component Runtime
|
|
305
305
|
(function() {
|
|
306
306
|
if (typeof window === 'undefined') return;
|
|
@@ -355,4 +355,4 @@ catch (error) {
|
|
|
355
355
|
console.log('[stx] Async component runtime initialized');
|
|
356
356
|
})();
|
|
357
357
|
`}
|
|
358
|
-
export{
|
|
358
|
+
export{hu,yu,bu,vu,wu};
|
|
@@ -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 yt(){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
|
|
3
|
-
export{yt,
|
|
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 yt(){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 Or(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 bt(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 co(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function De(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function lo(e){console.log(` ${O("\u2139")} ${e}`)}function uo(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 Dr(){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 vt(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 po(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 wt(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{yt,Or,bt,co,De,lo,uo,Dr,vt,po,wt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pt,us,ds,ps,Ku,gs}from"./chunk-trhr4gzz.js";import"./chunk-0zx1400y.js";import"./chunk-nmh4pn44.js";import"./chunk-5hqkfqne.js";export{ds as buildServerApi,Ku as createServerApi,Pt as discoverServerApi,us as generateApiTypes,gs as isServerApiSource,ps as productionApiDispatcher};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import S from"fs";import _ from"path";function
|
|
2
|
+
import S from"fs";import _ from"path";function jr(e){let{token:t,baseUrl:i="https://api.netlify.com/api/v1"}=e;async function s(n,r,l={}){let p=`${i}${r}`,f={Authorization:`Bearer ${t}`,"User-Agent":"stx-deploy/1.0"},u;if(l.rawBody)f["Content-Type"]=l.contentType||"application/octet-stream",u=l.rawBody;else if(l.body)f["Content-Type"]="application/json",u=JSON.stringify(l.body);let o=await fetch(p,{method:n,headers:f,body:u});if(!o.ok){let g=Error(`Netlify API error: ${o.status} ${o.statusText}`);g.status=o.status;try{let b=await o.json();g.message=b.message||g.message,g.code=b.code,g.details=b}catch{}throw g}let a=await o.text();if(!a)return{};return JSON.parse(a)}return{async getSite(n){return s("GET",`/sites/${n}`)},async listSites(){return s("GET","/sites")},async createSite(n){let r={};if(n)r.name=n;return s("POST","/sites",{body:r})},async createDeploy(n,r){let l={files:r.files,draft:r.draft??!0,async:r.async??!0};if(r.title)l.title=r.title;if(r.branch)l.branch=r.branch;if(r.functions)l.functions=r.functions;return s("POST",`/sites/${n}/deploys`,{body:l})},async uploadFile(n,r,l){let p=r.startsWith("/")?r.slice(1):r;await s("PUT",`/deploys/${n}/files/${p}`,{rawBody:l,contentType:"application/octet-stream"})},async uploadFiles(n,r){let p=[...r],f=async()=>{while(p.length>0){let o=p.shift();if(o)await this.uploadFile(n,o.path,o.content)}},u=Array.from({length:Math.min(5,r.length)},()=>f());await Promise.all(u)},async getDeploy(n){return s("GET",`/deploys/${n}`)},async waitForDeploy(n,r={}){let{timeout:l=300000,pollInterval:p=2000,onProgress:f}=r,u=Date.now();while(!0){let o=await this.getDeploy(n);if(f)f(o);if(o.state==="ready")return o;if(o.state==="error"){let a=Error(`Deploy failed: ${o.error_message||"Unknown error"}`);throw a.status=500,a.details=o,a}if(Date.now()-u>l){let a=Error(`Deploy timed out after ${l}ms`);throw a.status=408,a.details=o,a}await new Promise((a)=>setTimeout(a,p))}},async lockDeploy(n){return s("POST",`/deploys/${n}/lock`)},async unlockDeploy(n){return s("POST",`/deploys/${n}/unlock`)}}}async function wo(e){let t=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(t)).map((s)=>s.toString(16).padStart(2,"0")).join("")}async function qn(e,t={}){let{ignore:i=["node_modules",".git",".env*","*.map"]}=t,s=[],n=new Bun.Glob("**/*");for await(let r of n.scan({cwd:e,onlyFiles:!0,dot:!1})){if(i.some((a)=>{if(a.includes("*"))return new RegExp(`^${a.replace(/\*/g,".*")}$`).test(r);return r.includes(a)}))continue;let p=`${e}/${r}`,u=await Bun.file(p).arrayBuffer(),o=await wo(u);s.push({path:r,content:new Uint8Array(u),sha1:o})}return s}function Br(e){let t={};for(let i of e)t[`/${i.path}`]=i.sha1;return t}function Fr(e,t){let i=new Set(t.map((s)=>s.startsWith("/")?s.slice(1):s));return e.filter((s)=>i.has(s.path))}function Gt(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;if(e<1073741824)return`${(e/1048576).toFixed(1)} MB`;return`${(e/1073741824).toFixed(1)} GB`}function xt(e){return e.reduce((t,i)=>t+i.content.byteLength,0)}import m from"fs";import y from"path";function xo(e){let t=[];if(t.push("[build]"),t.push(` command = "${d(e.build.command)}"`),t.push(` publish = "${d(e.build.publish)}"`),e.build.functions)t.push(` functions = "${d(e.build.functions)}"`);if(e.build.edge_functions)t.push(` edge_functions = "${d(e.build.edge_functions)}"`);if(e.build.environment&&Object.keys(e.build.environment).length>0){t.push(""),t.push("[build.environment]");for(let[i,s]of Object.entries(e.build.environment))t.push(` ${i} = "${d(s)}"`)}if(e.functions){if(t.push(""),t.push("[functions]"),e.functions.directory)t.push(` directory = "${d(e.functions.directory)}"`);if(e.functions.node_bundler)t.push(` node_bundler = "${e.functions.node_bundler}"`);if(e.functions.external_node_modules&&e.functions.external_node_modules.length>0)t.push(` external_node_modules = [${e.functions.external_node_modules.map((i)=>`"${i}"`).join(", ")}]`)}if(e.edge_functions&&e.edge_functions.length>0){t.push("");for(let i of e.edge_functions)t.push("[[edge_functions]]"),t.push(` function = "${d(i.function)}"`),t.push(` path = "${d(i.path)}"`)}if(e.redirects&&e.redirects.length>0){t.push("");for(let i of e.redirects){if(t.push("[[redirects]]"),t.push(` from = "${d(i.from)}"`),t.push(` to = "${d(i.to)}"`),i.status!==void 0)t.push(` status = ${i.status}`);if(i.force!==void 0)t.push(` force = ${i.force}`);if(i.conditions&&Object.keys(i.conditions).length>0){t.push(" [redirects.conditions]");for(let[s,n]of Object.entries(i.conditions))t.push(` ${s} = "${d(n)}"`)}}}if(e.headers&&e.headers.length>0){t.push("");for(let i of e.headers){t.push("[[headers]]"),t.push(` for = "${d(i.for)}"`),t.push(" [headers.values]");for(let[s,n]of Object.entries(i.values))t.push(` ${s} = "${d(n)}"`)}}if(e.plugins&&e.plugins.length>0){t.push("");for(let i of e.plugins)if(t.push("[[plugins]]"),t.push(` package = "${d(i.package)}"`),i.inputs&&Object.keys(i.inputs).length>0){t.push(" [plugins.inputs]");for(let[s,n]of Object.entries(i.inputs))if(typeof n==="string")t.push(` ${s} = "${d(n)}"`);else if(typeof n==="boolean"||typeof n==="number")t.push(` ${s} = ${n}`)}}if(e.context&&Object.keys(e.context).length>0)for(let[i,s]of Object.entries(e.context)){if(t.push(""),t.push(`[context.${i}]`),s.command)t.push(` command = "${d(s.command)}"`);if(s.publish)t.push(` publish = "${d(s.publish)}"`);if(s.environment&&Object.keys(s.environment).length>0){t.push(` [context.${i}.environment]`);for(let[n,r]of Object.entries(s.environment))t.push(` ${n} = "${d(r)}"`)}}return t.join(`
|
|
3
3
|
`)+`
|
|
4
|
-
`}function d(e){return e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}async function Gn(e){let t={framework:"stx",buildCommand:"bun run build",outputDir:"dist"},i=y.join(e,"package.json");if(await Bun.file(i).exists())try{let u=JSON.parse(await Bun.file(i).text());if(u.scripts?.build)t.buildCommand="bun run build";let o={...u.dependencies,...u.devDependencies};if(o["@stacksjs/stx"]||o.stx)t.framework="stx"}catch{}let s=y.join(e,"stx.config.ts"),n=y.join(e,".config","stx.config.ts");if(await Bun.file(s).exists()||await Bun.file(n).exists())t.framework="stx";let r=["dist","build","out","public",".output"];for(let u of r){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.outputDir=u;break}}let l=["functions","netlify/functions","api"];for(let u of l){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.functionsDir=u;break}}let p=y.join(e,"netlify","edge-functions");if(m.existsSync(p))t.edgeFunctionsDir="netlify/edge-functions";let f=y.join(e,t.outputDir||"dist");if(m.existsSync(f)){let u=m.existsSync(y.join(f,"index.html")),o=m.readdirSync(f).filter((a)=>a.endsWith(".html"));t.isSPA=u&&o.length===1}return t}function Kn(e={}){let t={build:{command:e.buildCommand||"bun run build",publish:e.outputDir||"dist"}};if(e.functionsDir)t.build.functions=e.functionsDir,t.functions={directory:e.functionsDir,node_bundler:"esbuild"};if(e.edgeFunctionsDir)t.build.edge_functions=e.edgeFunctionsDir;if(t.headers=[{for:"/*",values:{"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin"}},{for:"/assets/*",values:{"Cache-Control":"public, max-age=31536000, immutable"}}],e.isSPA!==!1)t.redirects=[{from:"/*",to:"/index.html",status:200}];return t.context={production:{environment:{NODE_ENV:"production"}},"deploy-preview":{environment:{NODE_ENV:"development"}}},t}async function
|
|
4
|
+
`}function d(e){return e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}async function Gn(e){let t={framework:"stx",buildCommand:"bun run build",outputDir:"dist"},i=y.join(e,"package.json");if(await Bun.file(i).exists())try{let u=JSON.parse(await Bun.file(i).text());if(u.scripts?.build)t.buildCommand="bun run build";let o={...u.dependencies,...u.devDependencies};if(o["@stacksjs/stx"]||o.stx)t.framework="stx"}catch{}let s=y.join(e,"stx.config.ts"),n=y.join(e,".config","stx.config.ts");if(await Bun.file(s).exists()||await Bun.file(n).exists())t.framework="stx";let r=["dist","build","out","public",".output"];for(let u of r){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.outputDir=u;break}}let l=["functions","netlify/functions","api"];for(let u of l){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.functionsDir=u;break}}let p=y.join(e,"netlify","edge-functions");if(m.existsSync(p))t.edgeFunctionsDir="netlify/edge-functions";let f=y.join(e,t.outputDir||"dist");if(m.existsSync(f)){let u=m.existsSync(y.join(f,"index.html")),o=m.readdirSync(f).filter((a)=>a.endsWith(".html"));t.isSPA=u&&o.length===1}return t}function Kn(e={}){let t={build:{command:e.buildCommand||"bun run build",publish:e.outputDir||"dist"}};if(e.functionsDir)t.build.functions=e.functionsDir,t.functions={directory:e.functionsDir,node_bundler:"esbuild"};if(e.edgeFunctionsDir)t.build.edge_functions=e.edgeFunctionsDir;if(t.headers=[{for:"/*",values:{"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin"}},{for:"/assets/*",values:{"Cache-Control":"public, max-age=31536000, immutable"}}],e.isSPA!==!1)t.redirects=[{from:"/*",to:"/index.html",status:200}];return t.context={production:{environment:{NODE_ENV:"production"}},"deploy-preview":{environment:{NODE_ENV:"development"}}},t}async function zr(e,t){let i=await Gn(e),s=t||Kn(i),n=xo(s),r=y.join(e,"netlify.toml");return await Bun.write(r,n),r}function Hr(e){return m.existsSync(y.join(e,"netlify.toml"))}async function vl(e={}){let t=Date.now(),i=[],s=e.cwd||process.cwd(),n=(c)=>{i.push(c)},r=(c)=>{if(e.onProgress)e.onProgress(c)},l=_.resolve(s,e.directory||"dist"),p=e.token||process.env.NETLIFY_AUTH_TOKEN,f=e.siteId||process.env.NETLIFY_SITE_ID;if(!p)throw new je(`No Netlify auth token found.
|
|
5
5
|
|
|
6
6
|
To deploy to Netlify:
|
|
7
7
|
1. Create account at https://app.netlify.com
|
|
@@ -19,12 +19,12 @@ Find your site ID at: https://app.netlify.com/sites/YOUR_SITE/settings/general`,
|
|
|
19
19
|
|
|
20
20
|
Run \`stx build\` first or specify a different directory with --directory`,"NO_BUILD_DIR");if(!(S.readdirSync(l).length>0))throw new je(`Build directory is empty: ${l}
|
|
21
21
|
|
|
22
|
-
Run \`stx build\` to generate files`,"EMPTY_BUILD_DIR");if(e.dryRun){r({stage:"collect",message:"Collecting files..."});let c=await qn(l),w=xt(c);return n(`Would deploy ${c.length} files (${Gt(w)})`),n(`From: ${l}`),n(`To: Site ${f}`),n(`Mode: ${e.production?"production":"draft"}`),{success:!0,url:`https://${f}.netlify.app (dry-run)`,deployId:"dry-run",logs:i,duration:Date.now()-t,filesUploaded:c.length,totalSize:w}}let o=
|
|
22
|
+
Run \`stx build\` to generate files`,"EMPTY_BUILD_DIR");if(e.dryRun){r({stage:"collect",message:"Collecting files..."});let c=await qn(l),w=xt(c);return n(`Would deploy ${c.length} files (${Gt(w)})`),n(`From: ${l}`),n(`To: Site ${f}`),n(`Mode: ${e.production?"production":"draft"}`),{success:!0,url:`https://${f}.netlify.app (dry-run)`,deployId:"dry-run",logs:i,duration:Date.now()-t,filesUploaded:c.length,totalSize:w}}let o=jr({token:p});r({stage:"collect",message:"Verifying site..."});try{let c=await o.getSite(f);n(`Deploying to: ${c.name} (${c.url})`)}catch(c){if(c.status===404)throw new je(`Site not found: ${f}
|
|
23
23
|
|
|
24
|
-
Check your site ID or create a new site at https://app.netlify.com`,"SITE_NOT_FOUND");throw c}r({stage:"collect",message:"Collecting files..."});let a=await qn(l),g=xt(a);if(n(`Found ${a.length} files (${Gt(g)})`),a.length===0)throw new je(`No files found in ${l}`,"NO_FILES");let b=
|
|
24
|
+
Check your site ID or create a new site at https://app.netlify.com`,"SITE_NOT_FOUND");throw c}r({stage:"collect",message:"Collecting files..."});let a=await qn(l),g=xt(a);if(n(`Found ${a.length} files (${Gt(g)})`),a.length===0)throw new je(`No files found in ${l}`,"NO_FILES");let b=Br(a);r({stage:"upload",message:"Creating deploy...",percent:0});let D=await o.createDeploy(f,{title:e.message||"Deploy from stx CLI",draft:!e.production,files:b});n(`Created deploy: ${D.id}`);let h=Fr(a,D.required||[]);if(n(`Uploading ${h.length} files...`),h.length>0){let c=0,w=xt(h);for(let x of h){await o.uploadFile(D.id,x.path,x.content),c++;let C=Math.round(c/h.length*100);r({stage:"upload",message:`Uploading: ${x.path}`,percent:C,details:{uploaded:c,total:h.length}})}n(`Uploaded ${Gt(w)}`)}else n("All files already on CDN (no upload needed)");r({stage:"process",message:"Processing deploy..."});let N=await o.waitForDeploy(D.id,{onProgress:(c)=>{r({stage:"process",message:`Status: ${c.state}`,details:c})}}),P=Date.now()-t;if(r({stage:"done",message:"Deploy complete!"}),n(`Deploy complete in ${(P/1000).toFixed(1)}s`),n(`URL: ${N.deploy_ssl_url}`),e.production)n(`Site: ${N.ssl_url}`);if(e.open){let c=e.production?N.ssl_url:N.deploy_ssl_url;I(c)}return{success:!0,url:N.deploy_ssl_url,siteUrl:e.production?N.ssl_url:void 0,deployId:N.id,logs:i,duration:P,filesUploaded:h.length,totalSize:xt(h)}}async function wl(e={}){let t=e.directory||process.cwd(),i;if(Hr(t))i=_.join(t,"netlify.toml");else{let s=await Gn(t);i=await zr(t,Kn(s))}if(e.siteId){let s=_.join(t,".env.local"),n="";if(await Bun.file(s).exists()){if(n=await Bun.file(s).text(),n=n.split(`
|
|
25
25
|
`).filter((r)=>!r.startsWith("NETLIFY_SITE_ID=")).join(`
|
|
26
26
|
`),n&&!n.endsWith(`
|
|
27
27
|
`))n+=`
|
|
28
28
|
`}n+=`NETLIFY_SITE_ID=${e.siteId}
|
|
29
29
|
`,await Bun.write(s,n)}return{configPath:i,siteId:e.siteId}}class je extends Error{code;constructor(e,t){super(e);this.name="DeployError",this.code=t}}function I(e){let t=process.platform,i=t==="darwin"?"open":t==="win32"?"start":"xdg-open";Bun.spawn([i,e],{stdio:["ignore","ignore","ignore"]})}
|
|
30
|
-
export{
|
|
30
|
+
export{jr,wo,qn,Br,Fr,Gt,xt,xo,Gn,Kn,zr,Hr,vl,wl,je};
|