@stacksjs/stx 0.2.530 → 0.2.532
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-35j1evvy.js → chunk-03wggzg8.js} +3 -3
- package/dist/chunk-08emfsq3.js +2 -0
- package/dist/{chunk-2twfqcxm.js → chunk-0dqxnx20.js} +2 -2
- package/dist/chunk-0p9pwd61.js +2 -0
- package/dist/chunk-0pebjkzx.js +18 -0
- package/dist/{chunk-f1n4e4jy.js → chunk-0wvsfs4s.js} +2 -2
- package/dist/chunk-0zmv31nc.js +2 -0
- package/dist/{chunk-c322rrge.js → chunk-12e4a0ab.js} +2 -2
- package/dist/chunk-12v4d123.js +2 -0
- package/dist/{chunk-2m5mx0x8.js → chunk-15r72kw7.js} +1 -1
- package/dist/{chunk-gvngrxvb.js → chunk-1945hk44.js} +1 -1
- package/dist/chunk-28xtazwz.js +2 -0
- package/dist/{chunk-y8h823cb.js → chunk-292vew7b.js} +36 -36
- package/dist/chunk-2936t942.js +2 -0
- package/dist/chunk-29qwmthc.js +2 -0
- package/dist/chunk-2a4szpje.js +3 -0
- package/dist/{chunk-8m3k43d3.js → chunk-2dzd2h15.js} +7 -7
- package/dist/{chunk-0rt5ec7a.js → chunk-2jk0vceh.js} +4 -4
- package/dist/{chunk-ktvr45qg.js → chunk-2qbvsvwc.js} +2 -2
- package/dist/chunk-2y6tzn6d.js +3 -0
- package/dist/{chunk-csbft3wz.js → chunk-31c1g3rt.js} +3 -3
- package/dist/chunk-323cxa69.js +2 -0
- package/dist/chunk-375zp0vr.js +2 -0
- package/dist/{chunk-21rm5kv6.js → chunk-38w14qs7.js} +2 -2
- package/dist/{chunk-raqbqt1r.js → chunk-3vvppnws.js} +6 -6
- package/dist/chunk-3w49r16x.js +2 -0
- package/dist/chunk-3zyvhf4p.js +2 -0
- package/dist/chunk-458etq5a.js +4 -0
- package/dist/chunk-4cmqjmqr.js +3 -0
- package/dist/{chunk-37nybpw1.js → chunk-4gt0r98p.js} +65 -14
- package/dist/{chunk-3x9d58f4.js → chunk-4xxhprts.js} +11 -11
- package/dist/{chunk-4drgbkga.js → chunk-587ehsxn.js} +2 -2
- package/dist/{chunk-5tyes97j.js → chunk-5tj6expd.js} +2 -2
- package/dist/{chunk-kzztmawd.js → chunk-664503e6.js} +6 -6
- package/dist/{chunk-hkjqqx92.js → chunk-6abvk7vj.js} +3 -3
- package/dist/{chunk-ba88n1j7.js → chunk-6v1gwdbv.js} +2 -2
- package/dist/{chunk-y0c1srgj.js → chunk-7s14bthq.js} +5 -5
- package/dist/{chunk-2etevws0.js → chunk-7tabykst.js} +2 -2
- package/dist/{chunk-zw029e7n.js → chunk-7wfh2hqy.js} +4 -4
- package/dist/chunk-7ybgfk0m.js +3 -0
- package/dist/chunk-8bcvb86w.js +2 -0
- package/dist/chunk-8gmb3k1p.js +2 -0
- package/dist/{chunk-v2zxxjqn.js → chunk-90wh9zzy.js} +6 -6
- package/dist/{chunk-d8ramz4s.js → chunk-9a73re8k.js} +2 -2
- package/dist/{chunk-p4gbvge6.js → chunk-9pztpvvk.js} +1 -1
- package/dist/chunk-9skdekv5.js +2 -0
- package/dist/{chunk-7p0zerfj.js → chunk-9sqjmd9a.js} +10 -10
- package/dist/{chunk-czmw5xsd.js → chunk-9w2vmfha.js} +2 -2
- package/dist/chunk-9xq5yer8.js +2 -0
- package/dist/chunk-a15yzfc6.js +2 -0
- package/dist/{chunk-2hc5mbw8.js → chunk-azb58ven.js} +2 -2
- package/dist/{chunk-869wyw0j.js → chunk-b7xdk1g4.js} +6 -6
- package/dist/{chunk-9mjy16pw.js → chunk-bpr4bkde.js} +2 -2
- package/dist/chunk-cp4dr9ch.js +2 -0
- package/dist/{chunk-6t0rq51y.js → chunk-d2r8t40y.js} +2 -2
- package/dist/chunk-d4155ec5.js +2 -0
- package/dist/{chunk-6k7spr38.js → chunk-d7x6n702.js} +7 -7
- package/dist/chunk-dd31q423.js +2 -0
- package/dist/{chunk-qhg55cvv.js → chunk-ee4wwr89.js} +5 -5
- package/dist/{chunk-f5pmyxtn.js → chunk-ennxrn5g.js} +5 -5
- package/dist/{chunk-xevnx24r.js → chunk-er031j13.js} +2 -2
- package/dist/chunk-f2q5bckn.js +2 -0
- package/dist/chunk-fhx35529.js +2 -0
- package/dist/chunk-frw35d2v.js +2 -0
- package/dist/chunk-fyxydww2.js +4 -0
- package/dist/{chunk-nzk14k6w.js → chunk-g060jncp.js} +7 -7
- package/dist/{chunk-x1tzt7yc.js → chunk-g12j8ahm.js} +4 -4
- package/dist/chunk-g5t10z04.js +2837 -0
- package/dist/{chunk-x9mzfq3p.js → chunk-grb3kfya.js} +1 -1
- package/dist/{chunk-3cn7973z.js → chunk-gsxb0ry9.js} +1 -1
- package/dist/{chunk-619j0mnz.js → chunk-gvw8wh29.js} +5 -5
- package/dist/{chunk-e6y6s7q8.js → chunk-gxfnmjzp.js} +2 -2
- package/dist/chunk-h1y5q942.js +2 -0
- package/dist/chunk-h791c7sb.js +2 -0
- package/dist/chunk-h88jcr3k.js +2 -0
- package/dist/chunk-heq5c0gd.js +2 -0
- package/dist/{chunk-ravc60z0.js → chunk-hp1tnxzb.js} +8 -8
- package/dist/chunk-hpeg9erh.js +3 -0
- package/dist/chunk-j3b24e77.js +2 -0
- package/dist/{chunk-vrrqnp5k.js → chunk-j8pacd7m.js} +5 -5
- package/dist/{chunk-346zc43s.js → chunk-jjwg83xv.js} +1 -1
- package/dist/chunk-jpck8nm5.js +2 -0
- package/dist/{chunk-58jyc7kp.js → chunk-kg77xs08.js} +3 -3
- package/dist/{chunk-1te1s9fa.js → chunk-khwj964t.js} +4 -4
- package/dist/{chunk-299xbyhn.js → chunk-kwvexxey.js} +4 -4
- package/dist/chunk-ky25egh1.js +2 -0
- package/dist/{chunk-w6ys6eq4.js → chunk-m2v04c6v.js} +93 -93
- package/dist/chunk-m4d99a9r.js +2 -0
- package/dist/chunk-ndv44bgs.js +2 -0
- package/dist/chunk-ng2sdph7.js +2 -0
- package/dist/{chunk-yh3p86qa.js → chunk-p8qr0q85.js} +2 -2
- package/dist/{chunk-6k4f583z.js → chunk-p8yh7mgr.js} +2 -2
- package/dist/chunk-pkfwxp9n.js +2 -0
- package/dist/chunk-pr5q4wev.js +2 -0
- package/dist/{chunk-fk45zc1b.js → chunk-q6e45gnw.js} +5 -5
- package/dist/chunk-qs3p7sc6.js +2 -0
- package/dist/{chunk-wqxdx2td.js → chunk-r6gxy92f.js} +2 -2
- package/dist/chunk-rchwwcxy.js +2 -0
- package/dist/chunk-rk4mttds.js +2 -0
- package/dist/chunk-rma3bv36.js +2 -0
- package/dist/chunk-rp5a91ak.js +2 -0
- package/dist/{chunk-hhys3aaa.js → chunk-rs46hksk.js} +2 -2
- package/dist/{chunk-wn5zjs5m.js → chunk-rtk6n3vh.js} +3 -3
- package/dist/chunk-rwn3b21z.js +3 -0
- package/dist/chunk-sp5x96rn.js +2 -0
- package/dist/chunk-st79dqpz.js +2 -0
- package/dist/{chunk-8g1fx4mg.js → chunk-stbsqy7e.js} +2 -2
- package/dist/chunk-t2mjeezd.js +2 -0
- package/dist/chunk-t61j834x.js +2 -0
- package/dist/{chunk-s19r6qe3.js → chunk-t6769zcy.js} +55 -55
- package/dist/chunk-t94z65ry.js +2 -0
- package/dist/{chunk-0ytm2ecf.js → chunk-tkeabv04.js} +16 -16
- package/dist/{chunk-1e7g79x4.js → chunk-v1m9nrn9.js} +1 -1
- package/dist/chunk-v2vg5jqq.js +2 -0
- package/dist/{chunk-07abr1v4.js → chunk-vg8thz41.js} +3 -3
- package/dist/chunk-vmfw4svt.js +2 -0
- package/dist/chunk-w6ecbk3y.js +2 -0
- package/dist/chunk-wbv6vjhm.js +2 -0
- package/dist/chunk-wfbr3txe.js +2 -0
- package/dist/{chunk-1v6yyvxf.js → chunk-wk85dz07.js} +3 -3
- package/dist/chunk-wpnv0naj.js +2 -0
- package/dist/chunk-wwny5dk9.js +2 -0
- package/dist/chunk-wzymzex7.js +2 -0
- package/dist/chunk-x55avrcf.js +2 -0
- package/dist/{chunk-hbwmmt91.js → chunk-xab6b4mt.js} +2 -2
- package/dist/{chunk-fd795e6s.js → chunk-xb0785wp.js} +2 -2
- package/dist/{chunk-1s7qdv2h.js → chunk-xcfhy5bj.js} +3 -3
- package/dist/{chunk-b0zz4dbx.js → chunk-xdtz2v5r.js} +3 -3
- package/dist/chunk-xmwd2xm6.js +2 -0
- package/dist/chunk-xtknewf7.js +2 -0
- package/dist/{chunk-wm5b2y65.js → chunk-y4qks0bd.js} +2 -2
- package/dist/{chunk-1h4z3xpy.js → chunk-y7ds4qyb.js} +3 -3
- package/dist/{chunk-p8c5g5n2.js → chunk-yn3kp3qy.js} +5 -5
- package/dist/chunk-yts2745t.js +2 -0
- package/dist/chunk-zah67v44.js +2 -0
- package/dist/chunk-zpdq0kx1.js +2 -0
- package/dist/chunk-zpf9he2x.js +2 -0
- package/dist/chunk-zpftj8s8.js +2 -0
- package/dist/{chunk-xpvvne6r.js → chunk-zzphh8g9.js} +9 -9
- package/dist/cli.js +62 -62
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/image-optimization/processor.js +6 -8
- package/dist/native/runtime/native-host.js +4 -1
- package/dist/native-build.js +12 -7
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +13 -13
- package/dist/temp-dir.d.ts +52 -0
- package/dist/temp-dir.js +140 -0
- package/package.json +5 -5
- package/dist/chunk-088jh5zy.js +0 -2
- package/dist/chunk-089x96rp.js +0 -2
- package/dist/chunk-0fad6jf4.js +0 -2
- package/dist/chunk-0fna7gd0.js +0 -2
- package/dist/chunk-0ksq0e6s.js +0 -2
- package/dist/chunk-2bwhc8ea.js +0 -2
- package/dist/chunk-2fb4yx25.js +0 -4
- package/dist/chunk-2y82wf9d.js +0 -3
- package/dist/chunk-3bsnte2s.js +0 -2
- package/dist/chunk-3j02tj5n.js +0 -2
- package/dist/chunk-3j9de8yh.js +0 -2
- package/dist/chunk-3v2bf157.js +0 -2
- package/dist/chunk-62ry3ta3.js +0 -2
- package/dist/chunk-62s4jb6m.js +0 -2
- package/dist/chunk-6dd0zr74.js +0 -2
- package/dist/chunk-87zse67b.js +0 -2
- package/dist/chunk-9hx4s11k.js +0 -2
- package/dist/chunk-9z76qhdm.js +0 -2
- package/dist/chunk-a0pq8xg4.js +0 -2
- package/dist/chunk-ad0czgpa.js +0 -2
- package/dist/chunk-axjzqh7v.js +0 -2
- package/dist/chunk-bday3eyq.js +0 -2
- package/dist/chunk-c2243par.js +0 -2
- package/dist/chunk-csy2m03w.js +0 -2
- package/dist/chunk-d3qdcdz9.js +0 -2
- package/dist/chunk-dvph69ej.js +0 -2
- package/dist/chunk-e1c9gypy.js +0 -2
- package/dist/chunk-eadr1eph.js +0 -2
- package/dist/chunk-eh3nvr2g.js +0 -2
- package/dist/chunk-f3nxd8z8.js +0 -2
- package/dist/chunk-fanmabb0.js +0 -2
- package/dist/chunk-fjd5ka6v.js +0 -2
- package/dist/chunk-fq5xecrx.js +0 -2
- package/dist/chunk-g25n9e8z.js +0 -2
- package/dist/chunk-g7ey7mtw.js +0 -3
- package/dist/chunk-gaz311xs.js +0 -2
- package/dist/chunk-ggb57j6c.js +0 -3
- package/dist/chunk-hmk2x1t8.js +0 -2
- package/dist/chunk-j1tbfabt.js +0 -2
- package/dist/chunk-jftv278d.js +0 -2
- package/dist/chunk-jj8ssn0d.js +0 -3
- package/dist/chunk-jkd0c82m.js +0 -2
- package/dist/chunk-jw536pve.js +0 -2
- package/dist/chunk-jwx0h9qb.js +0 -2
- package/dist/chunk-k4p80n25.js +0 -2
- package/dist/chunk-kpvr93cb.js +0 -2
- package/dist/chunk-kxa069d6.js +0 -2
- package/dist/chunk-pkwed7dt.js +0 -2
- package/dist/chunk-pq5nywkf.js +0 -2
- package/dist/chunk-qfm2gy40.js +0 -2
- package/dist/chunk-r37sf7ys.js +0 -18
- package/dist/chunk-rnnead1w.js +0 -2
- package/dist/chunk-szbvewf8.js +0 -2
- package/dist/chunk-t2yrb7pt.js +0 -2
- package/dist/chunk-tjjvphx3.js +0 -2
- package/dist/chunk-tsdjwe93.js +0 -2
- package/dist/chunk-v70hfs6d.js +0 -2
- package/dist/chunk-vp37585y.js +0 -2
- package/dist/chunk-vr0fb0x1.js +0 -2
- package/dist/chunk-w5kx0qzg.js +0 -2
- package/dist/chunk-wy36z6qp.js +0 -2
- package/dist/chunk-wyxjsx4k.js +0 -2837
- package/dist/chunk-x7a4c0x1.js +0 -2
- package/dist/chunk-y0a89hgw.js +0 -2
- package/dist/chunk-y4b60ke0.js +0 -2
- package/dist/chunk-yn2d8x8m.js +0 -3
- package/dist/chunk-yqh6dny3.js +0 -2
- package/dist/chunk-z4f2msjp.js +0 -2
- package/dist/chunk-zmdyr321.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Me,U}from"./chunk-458etq5a.js";import{Oo}from"./chunk-0pebjkzx.js";import{p}from"./chunk-2a4szpje.js";var kd=`
|
|
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 Eo(e={}){let{debug:a=!1,timeout:r=30000}=e;return`
|
|
469
469
|
<script>
|
|
470
470
|
(function() {
|
|
471
471
|
'use strict';
|
|
@@ -931,23 +931,23 @@ else if (data.type === 'event' && data.method) {
|
|
|
931
931
|
}
|
|
932
932
|
})();
|
|
933
933
|
</script>
|
|
934
|
-
`.replace("debug: false,",`debug: ${
|
|
934
|
+
`.replace("debug: false,",`debug: ${a},`).replace("timeout: 30000",`timeout: ${r}`)}function Cd(){return!1}function Ed(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 Eo(t)})}function To(e,a={}){if(e.includes("__craftBridgeInitialized"))return e;let r=Eo(a);if(e.includes("</head>"))return e.replace("</head>",`${r}
|
|
935
935
|
</head>`);if(e.includes("<body"))return e.replace(/(<body[^>]*>)/,`$1
|
|
936
|
-
${
|
|
937
|
-
<input type="checkbox" class="craft-checkbox" ${
|
|
938
|
-
<span class="craft-checkbox-label">${
|
|
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,
|
|
936
|
+
${r}`);return r+e}var Vr={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
|
+
<input type="checkbox" class="craft-checkbox" ${r} ${i}>
|
|
938
|
+
<span class="craft-checkbox-label">${a||e.label||""}</span>
|
|
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}>
|
|
940
940
|
<div class="craft-modal-content">
|
|
941
941
|
${i?`<div class="craft-modal-header"><h2>${i}</h2></div>`:""}
|
|
942
|
-
<div class="craft-modal-body">${
|
|
942
|
+
<div class="craft-modal-body">${a}</div>
|
|
943
943
|
</div>
|
|
944
|
-
</dialog>`}},tabs:{nativeType:"craft-tabs",fallbackTag:"div",fallbackClasses:"craft-tabs",nativeProps:["activeTab","tabs"]},accordion:{nativeType:"craft-accordion",fallbackTag:"details",fallbackClasses:"craft-accordion",nativeProps:["open","title"],render:(e,
|
|
944
|
+
</dialog>`}},tabs:{nativeType:"craft-tabs",fallbackTag:"div",fallbackClasses:"craft-tabs",nativeProps:["activeTab","tabs"]},accordion:{nativeType:"craft-accordion",fallbackTag:"details",fallbackClasses:"craft-accordion",nativeProps:["open","title"],render:(e,a)=>{let r=e.open?"open":"",i=e.title||"Details";return`<details class="craft-accordion" ${r}>
|
|
945
945
|
<summary class="craft-accordion-header">${i}</summary>
|
|
946
|
-
<div class="craft-accordion-content">${
|
|
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,
|
|
946
|
+
<div class="craft-accordion-content">${a}</div>
|
|
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
|
-
<div class="craft-alert-content">${
|
|
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,
|
|
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:j},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:H},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:V},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:W},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||""}">`}},_o=`
|
|
951
951
|
<style id="craft-component-styles">
|
|
952
952
|
/* Craft Component Base Styles */
|
|
953
953
|
.craft-button {
|
|
@@ -1365,7 +1365,7 @@ ${a}`);return a+e}var zr={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
1367
|
</style>
|
|
1368
|
-
`,
|
|
1368
|
+
`,Td=`
|
|
1369
1369
|
<script id="craft-component-runtime">
|
|
1370
1370
|
(function() {
|
|
1371
1371
|
if (window.__stxCraftComponentRuntime) return;
|
|
@@ -1469,7 +1469,7 @@ ${a}`);return a+e}var zr={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
1469
1469
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
1470
1470
|
})();
|
|
1471
1471
|
</script>
|
|
1472
|
-
`;function $o(e,
|
|
1472
|
+
`;function $o(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,89 +2934,89 @@ ${a}`);return a+e}var zr={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(),r
|
|
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]||Vr[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 d=ee(n,t,c);if(["input","hr","br","img"].includes(t.fallbackTag))return`<${t.fallbackTag} ${d}>`;return`<${t.fallbackTag} ${d}>${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,d=n??c;if(s.startsWith(":"))a[t]=d;else if(s.startsWith("@"))a[`on${t.charAt(0).toUpperCase()}${t.slice(1)}`]=d;else if(d===void 0)a[t]=!0;else a[t]=d}return a}function j(e,a){let r=I(String(e.id||`craft-sidebar-${K(a||JSON.stringify(e))}`)),i=Q(e.spaces)||Y(a),s=i.length?[]:X(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)||""),d={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},l=String(e.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),b=Number(e.width||e.sidebarWidth||286),f=e.native===!1||e.native==="false"?"false":"true",x=d.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${C(d.searchPlaceholder)}"></div>`:"",u;if(i.length)u=G(i,t,c);else if(s.length)u=s.map((m)=>D(m,c)).join("");else u=a;return`<aside class="${h(l)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${h(r)}" data-native="${f}" 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(
|
|
2941
|
+
<script type="application/json" data-craft-sidebar-config="${h(r)}">${Z(d)}</script>`}function H(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
|
-
${
|
|
2944
|
-
</section>`}function V(e,
|
|
2945
|
-
${
|
|
2946
|
-
${
|
|
2947
|
-
</section>`}function W(e,
|
|
2943
|
+
${a}
|
|
2944
|
+
</section>`}function V(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
|
+
${r?`<div class="craft-sidebar-section-title">${C(r)}</div>`:""}
|
|
2946
|
+
${a}
|
|
2947
|
+
</section>`}function W(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),d=J(t);a.push({id:n,header:c,title:c,items:d})}return a}function J(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 Y(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 Q(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 G(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
|
-
${t.sections.map((n)=>D(n,
|
|
2949
|
+
${t.sections.map((n)=>D(n,r)).join("")}
|
|
2950
2950
|
</section>`).join("")}</div>
|
|
2951
|
-
<div class="craft-sidebar-space-switcher">${i}</div>`}function X(e){if(!e)return;if(Array.isArray(e))return e;if(typeof e!=="string")return;try{let
|
|
2952
|
-
<div class="craft-sidebar-section-title">${C(
|
|
2953
|
-
${e.items.map((i)=>O(i,i.id===
|
|
2954
|
-
</section>`}function O(e,
|
|
2955
|
-
${e.icon?`<span class="craft-sidebar-item-icon" data-icon="${h(e.icon)}"${
|
|
2951
|
+
<div class="craft-sidebar-space-switcher">${i}</div>`}function X(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 D(e,a){let r=e.header||e.title||e.id;return`<section class="craft-sidebar-section" data-section-id="${h(e.id)}">
|
|
2952
|
+
<div class="craft-sidebar-section-title">${C(r)}</div>
|
|
2953
|
+
${e.items.map((i)=>O(i,i.id===a)).join("")}
|
|
2954
|
+
</section>`}function O(e,a){let r=e.tintColor?` style="--craft-sidebar-icon-color:${h(e.tintColor)}"`:"";return`<button class="craft-sidebar-item" type="button" data-item-id="${h(e.id)}" data-selected="${a?"true":"false"}">
|
|
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 K(e){let
|
|
2959
|
-
</head>`)}let n=e.name||te(e.input,".stx"),c=e.version||"1.0.0",
|
|
2960
|
-
`)}else{let S=o(
|
|
2958
|
+
</button>`}function I(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function K(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 _d(e,a){Vr[e]=a}function $d(){return{...Vr}}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";async function Ro(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 Oo(e.input,{context:e.context,options:{isDev:!1}});if(t=To(t,{debug:e.verbose}),t=$o(t),!t.includes("craft-component-styles")){if(t.includes("</head>"))t=t.replace("</head>",`${_o}
|
|
2959
|
+
</head>`)}let n=e.name||te(e.input,".stx"),c=e.version||"1.0.0",d=e.craftPath||await fe();if(!d)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: ${d}`);let l;switch(r){case"macos":l=await ie(t,n,c,s,i,e,d);break;case"windows":l=await oe(t,n,c,s,i,e,d);break;case"linux":l=await ce(t,n,c,s,i,e,d);break;case"ios":l=await de(t,n,c,s,e,d);break;case"android":l=await le(t,n,c,s,e,d);break;default:l={success:!1,target:r,format:i,error:`Unsupported target: ${r}`}}return l.duration=Date.now()-a,l}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,"")}`,d=o(i,`${a}.app`),l=o(d,"Contents"),b=o(l,"MacOS"),f=o(l,"Resources");v(b,{recursive:!0}),v(f,{recursive:!0});let x=o(f,"index.html");await Bun.write(x,e);let u="";if(t.sidebar?.enabled&&t.sidebar?.config)u=o(f,"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(f,"craft.json"),`${JSON.stringify(w,null,2)}
|
|
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
|
-
${[`--title "${t.window?.title||
|
|
2966
|
-
`,
|
|
2967
|
-
${i}`.match(/(\d+)\.(\d+)\.(\d+)/);if(!t)return!1;let[n,c,
|
|
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(f,"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(l,"Info.plist"),ne(M)),s==="dmg"){let S=o(i,`${a}-${r}.dmg`),w=await ue(d,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:d}}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,d]=t.slice(1).map(Number);if(n>0||c>0)return!0;return d>=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>
|
|
2971
|
-
${Object.entries(e).map(([
|
|
2971
|
+
${Object.entries(e).map(([r,i])=>{let s=typeof i==="boolean"?`<${i}/>`:typeof i==="number"?`<integer>${i}</integer>`:`<string>${_(String(i))}</string>`;return` <key>${_(r)}</key>
|
|
2972
2972
|
${s}`}).join(`
|
|
2973
2973
|
`)}
|
|
2974
2974
|
</dict>
|
|
2975
2975
|
</plist>
|
|
2976
|
-
`}async function oe(e,r,
|
|
2976
|
+
`}async function oe(e,a,r,i,s,t,n){let c=o(i,a);v(c,{recursive:!0});let d=o(c,"index.html");await Bun.write(d,e),k(n,o(c,"craft.exe"));let l=`@echo off
|
|
2977
2977
|
set DIR=%~dp0
|
|
2978
2978
|
"%DIR%craft.exe" --html-file "%DIR%index.html" ^
|
|
2979
|
-
--title "${t.window?.title||
|
|
2979
|
+
--title "${t.window?.title||a}" ^
|
|
2980
2980
|
--width ${t.window?.width||1200} ^
|
|
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,`${
|
|
2984
|
+
`;if(await Bun.write(o(c,`${a}.bat`),l),s==="zip"){let b=o(i,`${a}-${r}-windows.zip`),f=await be(c,b);if(!f.success)return{success:!1,target:"windows",format:"zip",error:f.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 d=o(c,"index.html");await Bun.write(d,e);let l=o(c,"craft");k(n,l),T(l,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" \\
|
|
2988
|
-
--title "${t.window?.title||
|
|
2988
|
+
--title "${t.window?.title||a}" \\
|
|
2989
2989
|
--width ${t.window?.width||1200} \\
|
|
2990
2990
|
--height ${t.window?.height||800} \\
|
|
2991
2991
|
${t.systemTray?"--system-tray":""} \\
|
|
2992
2992
|
${t.devTools?"":"--no-devtools"}
|
|
2993
|
-
`,
|
|
2993
|
+
`,f=o(c,a.toLowerCase());await Bun.write(f,b),T(f,493);let x=`[Desktop Entry]
|
|
2994
2994
|
Type=Application
|
|
2995
|
-
Name=${
|
|
2996
|
-
Exec=${
|
|
2995
|
+
Name=${a}
|
|
2996
|
+
Exec=${f}
|
|
2997
2997
|
Terminal=false
|
|
2998
2998
|
Categories=Utility;
|
|
2999
|
-
`;if(await Bun.write(o(c,`${
|
|
3000
|
-
`)[0];if(
|
|
3001
|
-
exec /usr/share/${
|
|
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=Me("deb");try{let c=o(n,"pkg"),d=o(c,"DEBIAN"),l=o(c,"usr","bin"),b=o(c,"usr","share","applications"),f=o(c,"usr","share",r.toLowerCase());v(d,{recursive:!0}),v(l,{recursive:!0}),v(b,{recursive:!0}),v(f,{recursive:!0});let x=p("fs").readdirSync(e);for(let g of x)k(o(e,g),o(f,g));let u=`#!/bin/bash
|
|
3001
|
+
exec /usr/share/${r.toLowerCase()}/${r.toLowerCase()} "$@"`;p("fs").writeFileSync(o(l,r.toLowerCase()),u),T(o(l,r.toLowerCase()),493);let m=`Package: ${r.toLowerCase()}
|
|
3002
3002
|
Version: ${i}
|
|
3003
3003
|
Section: utils
|
|
3004
3004
|
Priority: optional
|
|
3005
3005
|
Architecture: amd64
|
|
3006
3006
|
Depends: libgtk-3-0, libwebkit2gtk-4.0-37
|
|
3007
3007
|
Maintainer: ${s.author||"Unknown"}
|
|
3008
|
-
Description: ${s.description||
|
|
3009
|
-
`;
|
|
3008
|
+
Description: ${s.description||r}
|
|
3009
|
+
`;p("fs").writeFileSync(o(d,"control"),m);let y=E("dpkg-deb",["--build",c,a]);y.on("close",(g)=>{if(U(n),g===0)t({success:!0});else t({success:!1,error:`dpkg-deb exited with code ${g}`})}),y.on("error",(g)=>{U(n),t({success:!1,error:g.message})})}catch(c){U(n),t({success:!1,error:c.message})}})}async function me(e,a,r,i){return new Promise((s)=>{let t=Me("appimage");try{let n=o(t,`${r}.AppDir`),c=o(n,"usr"),d=o(c,"bin"),l=o(c,"share");v(d,{recursive:!0}),v(l,{recursive:!0});let b=o(l,r.toLowerCase());v(b,{recursive:!0});let f=p("fs").readdirSync(e);for(let g of f)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
|
-
exec "\${HERE}/usr/share/${
|
|
3014
|
-
`;
|
|
3013
|
+
exec "\${HERE}/usr/share/${r.toLowerCase()}/${r.toLowerCase()}" "$@"
|
|
3014
|
+
`;p("fs").writeFileSync(o(n,"AppRun"),x),T(o(n,"AppRun"),493);let u=`[Desktop Entry]
|
|
3015
3015
|
Type=Application
|
|
3016
|
-
Name=${
|
|
3017
|
-
Exec=${
|
|
3016
|
+
Name=${r}
|
|
3017
|
+
Exec=${r.toLowerCase()}
|
|
3018
3018
|
Terminal=false
|
|
3019
3019
|
Categories=Utility;
|
|
3020
|
-
Icon=${
|
|
3021
|
-
`;
|
|
3022
|
-
export{
|
|
3020
|
+
Icon=${r.toLowerCase()}
|
|
3021
|
+
`;p("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(p("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(U(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)=>{U(t),s({success:!1,error:`appimagetool not found: ${g.message}`})})}catch(n){U(t),s({success:!1,error:n.message})}})}function Ao(){return[P()]}function Po(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:Ro,getAvailableTargets:Ao,getAvailableFormats:Po,detectPlatform:P},Rd=he;
|
|
3022
|
+
export{kd,Eo,Cd,Ed,To,Vr,_o,Td,$o,_d,$d,Ro,Ao,Po,Rd};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{O}from"./chunk-7ybgfk0m.js";var t={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603};function N(e){for(let[r,n]of Object.entries(t))if(n===e)return r;return}import ee from"path";var re={showRelativePaths:!1,enableAutoRecovery:O(),logRecoveryWarnings:!0},L={...re};function R(){return{...L}}function k(e){if(!L.showRelativePaths||!e)return e;let r=L.baseDir||process.cwd();try{let n=ee.relative(r,e);return n.startsWith("..")?e:n}catch{return e}}class v extends Error{code;filePath;line;column;context;numericCode;constructor(e,r,n,o,s,a,f){super(e);this.code=r;this.filePath=n;this.line=o;this.column=s;this.context=a;if(this.name="StxError",this.numericCode=f||t.EVALUATION_ERROR,this.filePath)this.filePath=k(this.filePath)}}class G extends v{constructor(e,r,n,o,s,a){super(e,"stx_RUNTIME_ERROR",r,n,o,s,a||t.EVALUATION_ERROR);this.name="StxRuntimeError"}}class wn extends v{constructor(e,r,n,o,s,a){super(e,"stx_FILE_ERROR",r,n,o,s,a||t.FILE_NOT_FOUND);this.name="StxFileError"}}class cr extends v{isFatal=!0;constructor(e,r,n,o,s,a){super(e,"stx_VALIDATION_ERROR",r,n,o,s,a||t.DOM_API_VIOLATION);this.name="StxValidationError"}}function U(e){let{type:r,message:n,code:o,filePath:s,line:a,column:f,template:g,offset:d,snippet:m,suggestion:p,format:h="text"}=e,E=a,x=f;if(!E&&g&&d!==void 0){let z=ce(g,d);E=z.line,x=z.column}let y=s?k(s):void 0,K=o?N(o):void 0,w={type:r,code:o,codeName:K,message:n,filePath:y,line:E,column:x,snippet:m,suggestion:p,timestamp:new Date().toISOString()},S;switch(h){case"html":S=oe(w);break;case"json":S=JSON.stringify(w,null,2);break;case"console":S=ie(w,g,d);break;case"text":default:S=te(w,g,d);break}return{formatted:S,data:w}}function te(e,r,n){let o=[],s=e.code?` [${e.codeName||e.code}]`:"";if(o.push(`[${e.type} Error${s}]`),e.filePath){let a=e.filePath;if(e.line){if(a+=`:${e.line}`,e.column)a+=`:${e.column}`}o.push(`at ${a}`)}if(o.push(`
|
|
3
3
|
${e.message}`),r&&e.line){let a=se(r,e.line,2);if(a)o.push(`
|
|
4
4
|
${a}`)}if(e.snippet)o.push(`
|
|
5
5
|
Snippet: ${e.snippet}`);if(e.suggestion)o.push(`
|
|
6
|
-
Suggestion: ${e.suggestion}`);return o.join(" ")}function oe(e){let r=e.code?` [${e.code}]`:"",n=e.filePath?` in ${e.filePath}${e.line?`:${e.line}`:""}`:"",o=`<!-- [${e.type} Error${r}]${n}: ${M(e.message)}`;if(e.suggestion)o+=` | Suggestion: ${M(e.suggestion)}`;return o+=" -->",o}function ie(e,r,n){let
|
|
7
|
-
\x1B[90mat\x1B[0m ${h}`)}if(
|
|
6
|
+
Suggestion: ${e.suggestion}`);return o.join(" ")}function oe(e){let r=e.code?` [${e.code}]`:"",n=e.filePath?` in ${e.filePath}${e.line?`:${e.line}`:""}`:"",o=`<!-- [${e.type} Error${r}]${n}: ${M(e.message)}`;if(e.suggestion)o+=` | Suggestion: ${M(e.suggestion)}`;return o+=" -->",o}function ie(e,r,n){let m=[],p=e.code?` [${e.codeName||e.code}]`:"";if(m.push(`\x1B[1m${"\x1B[31m"}\u2501\u2501\u2501 ${e.type} Error${p} \u2501\u2501\u2501${"\x1B[0m"}`),e.filePath){let h=`\x1B[36m${e.filePath}\x1B[0m`;if(e.line){if(h+=`\x1B[90m:${e.line}\x1B[0m`,e.column)h+=`\x1B[90m:${e.column}\x1B[0m`}m.push(`
|
|
7
|
+
\x1B[90mat\x1B[0m ${h}`)}if(m.push(`
|
|
8
8
|
|
|
9
|
-
${e.message}`),r&&e.line){let h=ae(r,e.line,2);if(h)
|
|
9
|
+
${e.message}`),r&&e.line){let h=ae(r,e.line,2);if(h)m.push(`
|
|
10
10
|
|
|
11
11
|
\x1B[90mContext:\x1B[0m
|
|
12
|
-
${h}`)}if(e.suggestion)
|
|
12
|
+
${h}`)}if(e.suggestion)m.push(`
|
|
13
13
|
|
|
14
|
-
\x1B[33mSuggestion:\x1B[0m ${e.suggestion}`);return
|
|
15
|
-
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),
|
|
16
|
-
`),s=Math.max(0,r-n-1),a=Math.min(o.length-1,r+n-1),
|
|
14
|
+
\x1B[33mSuggestion:\x1B[0m ${e.suggestion}`);return m.push(`
|
|
15
|
+
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),m.join("")}function se(e,r,n){let o=e.split(`
|
|
16
|
+
`),s=Math.max(0,r-n-1),a=Math.min(o.length-1,r+n-1),f=[];for(let g=s;g<=a;g++){let d=(g+1).toString().padStart(4),m=g===r-1?">":" ";f.push(`${m}${d} | ${o[g]}`)}return f.join(`
|
|
17
17
|
`)}function ae(e,r,n){let o=e.split(`
|
|
18
|
-
`),s=Math.max(0,r-n-1),a=Math.min(o.length-1,r+n-1),
|
|
18
|
+
`),s=Math.max(0,r-n-1),a=Math.min(o.length-1,r+n-1),f="\x1B[90m",g="\x1B[31m",d="\x1B[0m",m=[];for(let p=s;p<=a;p++){let h=(p+1).toString().padStart(4),E=p===r-1,x=E?"\x1B[31m>\x1B[0m":" ",y=E?`\x1B[31m${o[p]}\x1B[0m`:`\x1B[90m${o[p]}\x1B[0m`;m.push(`${x}\x1B[90m${h}\x1B[0m | ${y}`)}return m.join(`
|
|
19
19
|
`)}function M(e){return e.replace(/--/g,"- -").replace(/>/g,">")}function ce(e,r){let o=e.substring(0,r).split(`
|
|
20
|
-
`);return{line:o.length,column:o[o.length-1].length}}function i(e,r,n){return U({type:e,message:r,code:n,format:"html"}).formatted}async function
|
|
21
|
-
@end${
|
|
20
|
+
`);return{line:o.length,column:o[o.length-1].length}}function i(e,r,n){return U({type:e,message:r,code:n,format:"html"}).formatted}async function ne(e,r,n){try{return await e()}catch(o){if(n&&o instanceof Error)n(o);return r}}var Ns={isEnabled(){return R().enableAutoRecovery},fixCommonSyntaxErrors(e){let r=R();if(!r.enableAutoRecovery)return{fixed:e,fixes:[]};let n=e,o=[],s=(n.match(/\{\{/g)||[]).length,a=(n.match(/\}\}/g)||[]).length;if(s>a){let g=s-a;n+="}}".repeat(g),o.push(`Added ${g} missing closing braces '}}'`)}let f=["if","foreach","for","switch","section"];for(let g of f){let d=(n.match(new RegExp(`@${g}\\b`,"g"))||[]).length,m=(n.match(new RegExp(`@end${g}\\b`,"g"))||[]).length;if(d>m){let p=d-m;for(let h=0;h<p;h++)n+=`
|
|
21
|
+
@end${g}`;o.push(`Added ${p} missing @end${g}`)}}if(o.length>0&&r.logRecoveryWarnings)console.warn("[stx] Auto-recovery applied fixes:"),o.forEach((g)=>console.warn(` - ${g}`)),console.warn(" Consider fixing these issues in your template.");return{fixed:n,fixes:o}},createFallbackContent(e,r){if(O())return`<!-- ${e} failed: ${r.message} -->`;return"<!-- stx rendering error -->"}};class I{errors=[];maxErrors;enableFileLogging;logFilePath;logFormat;maxFileSize;maxLogFiles;minLevel;writeQueue=Promise.resolve();constructor(e={}){this.maxErrors=e.maxErrors??1000,this.enableFileLogging=e.enableFileLogging??!1,this.logFilePath=e.logFilePath??".stx/errors.log",this.logFormat=e.logFormat??"json",this.maxFileSize=e.maxFileSize??10485760,this.maxLogFiles=e.maxLogFiles??5,this.minLevel=e.minLevel??"all"}configure(e){if(e.maxErrors!==void 0)this.maxErrors=e.maxErrors;if(e.enableFileLogging!==void 0)this.enableFileLogging=e.enableFileLogging;if(e.logFilePath!==void 0)this.logFilePath=e.logFilePath;if(e.logFormat!==void 0)this.logFormat=e.logFormat;if(e.maxFileSize!==void 0)this.maxFileSize=e.maxFileSize;if(e.maxLogFiles!==void 0)this.maxLogFiles=e.maxLogFiles;if(e.minLevel!==void 0)this.minLevel=e.minLevel}log(e,r,n="error"){let o={timestamp:new Date,error:e,context:r,level:n};if(this.errors.push(o),this.errors.length>this.maxErrors)this.errors=this.errors.slice(-this.maxErrors);if(this.enableFileLogging&&this.shouldLog(n))this.writeToFile(o)}shouldLog(e){if(this.minLevel==="all")return!0;if(this.minLevel==="warning")return e==="error"||e==="warning";if(this.minLevel==="error")return e==="error";return!0}formatEntry(e){if(this.logFormat==="json")return JSON.stringify({timestamp:e.timestamp.toISOString(),level:e.level||"error",type:e.error.constructor.name,message:e.error.message,stack:e.error.stack,context:e.context});let r=[`[${e.timestamp.toISOString()}] [${(e.level||"error").toUpperCase()}] ${e.error.constructor.name}: ${e.error.message}`];if(e.error.stack)r.push(` Stack: ${e.error.stack.split(`
|
|
22
22
|
`).slice(1).join(`
|
|
23
23
|
`)}`);if(e.context)r.push(` Context: ${JSON.stringify(e.context)}`);return r.join(`
|
|
24
24
|
`)}writeToFile(e){this.writeQueue=this.writeQueue.then(async()=>{try{let r=await import("fs"),n=await import("path"),o=n.dirname(this.logFilePath);if(!r.existsSync(o))r.mkdirSync(o,{recursive:!0});await this.rotateIfNeeded(r);let s=`${this.formatEntry(e)}
|
|
25
|
-
`;r.appendFileSync(this.logFilePath,s,"utf-8")}catch(r){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",r)}})}async rotateIfNeeded(e){try{if(!e.existsSync(this.logFilePath))return;if(e.statSync(this.logFilePath).size<this.maxFileSize)return;for(let n=this.maxLogFiles-1;n>=1;n--){let o=`${this.logFilePath}.${n}`,s=`${this.logFilePath}.${n+1}`;if(e.existsSync(o))if(n>=this.maxLogFiles-1)e.unlinkSync(o);else e.renameSync(o,s)}if(this.maxLogFiles<=1)e.writeFileSync(this.logFilePath,"");else e.renameSync(this.logFilePath,`${this.logFilePath}.1`)}catch(r){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",r)}}getRecentErrors(e=10){return this.errors.slice(-e)}getErrorsByType(e){return this.errors.filter((r)=>r.error.constructor.name===e)}getErrorsByLevel(e){return this.errors.filter((r)=>r.level===e)}clear(){this.errors.length=0}async clearLogFile(){try{let e=await import("fs");if(e.existsSync(this.logFilePath))e.writeFileSync(this.logFilePath,"","utf-8")}catch(e){if(process.env.STX_DEBUG==="true")console.error("Failed to clear error log:",e)}}getStats(){let e={},r={error:0,warning:0,info:0};for(let n of this.errors){let o=n.error.constructor.name;e[o]=(e[o]||0)+1;let s=n.level||"error";r[s]=(r[s]||0)+1}return{total:this.errors.length,byType:e,byLevel:r}}async exportToFile(e,r="json"){let n=await import("fs"),o=await import("path"),s=o.dirname(e);if(!n.existsSync(s))n.mkdirSync(s,{recursive:!0});if(r==="json"){let a=this.errors.map((
|
|
25
|
+
`;r.appendFileSync(this.logFilePath,s,"utf-8")}catch(r){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",r)}})}async rotateIfNeeded(e){try{if(!e.existsSync(this.logFilePath))return;if(e.statSync(this.logFilePath).size<this.maxFileSize)return;for(let n=this.maxLogFiles-1;n>=1;n--){let o=`${this.logFilePath}.${n}`,s=`${this.logFilePath}.${n+1}`;if(e.existsSync(o))if(n>=this.maxLogFiles-1)e.unlinkSync(o);else e.renameSync(o,s)}if(this.maxLogFiles<=1)e.writeFileSync(this.logFilePath,"");else e.renameSync(this.logFilePath,`${this.logFilePath}.1`)}catch(r){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",r)}}getRecentErrors(e=10){return this.errors.slice(-e)}getErrorsByType(e){return this.errors.filter((r)=>r.error.constructor.name===e)}getErrorsByLevel(e){return this.errors.filter((r)=>r.level===e)}clear(){this.errors.length=0}async clearLogFile(){try{let e=await import("fs");if(e.existsSync(this.logFilePath))e.writeFileSync(this.logFilePath,"","utf-8")}catch(e){if(process.env.STX_DEBUG==="true")console.error("Failed to clear error log:",e)}}getStats(){let e={},r={error:0,warning:0,info:0};for(let n of this.errors){let o=n.error.constructor.name;e[o]=(e[o]||0)+1;let s=n.level||"error";r[s]=(r[s]||0)+1}return{total:this.errors.length,byType:e,byLevel:r}}async exportToFile(e,r="json"){let n=await import("fs"),o=await import("path"),s=o.dirname(e);if(!n.existsSync(s))n.mkdirSync(s,{recursive:!0});if(r==="json"){let a=this.errors.map((f)=>({timestamp:f.timestamp.toISOString(),level:f.level||"error",type:f.error.constructor.name,message:f.error.message,stack:f.error.stack,context:f.context}));n.writeFileSync(e,JSON.stringify(a,null,2),"utf-8")}else{let a=this.errors.map((f)=>this.formatEntry(f));n.writeFileSync(e,a.join(`
|
|
26
26
|
|
|
27
|
-
`),"utf-8")}}async flush(){await this.writeQueue}}var P=new I,
|
|
28
|
-
`)}};var le={maxSanitizeDepth:10,allowBracketNotation:!1},
|
|
27
|
+
`),"utf-8")}}async flush(){await this.writeQueue}}var P=new I,Pt={isDevelopment(){return O()},logDetailedError(e,r){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",e.message),console.error("Stack:",e.stack),r)console.error("Context:",r);console.error("========================")},createErrorReport(e,r){let n=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${e.message}`,`Type: ${e.constructor.name}`,`Stack: ${e.stack}`];if(r)n.push(`Context: ${JSON.stringify(r,null,2)}`);return n.push("========================"),n.join(`
|
|
28
|
+
`)}};var le={maxSanitizeDepth:10,allowBracketNotation:!1},X={...le};var C=/\bnew\s+/,F="__stx_safe_ctors",H=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,C,/\bdelete\s+/,/\bthis\b/],ue=new Set(["eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",F]),q=new Set(["__proto__","constructor","prototype"]),ge=/[\w)\]]\s*\[\s*['"]/;function J(e){let r="",n=[],o=null,s=!1;for(let a=0;a<e.length;a++){let f=e[a];if(s){s=!1;continue}if(f==="\\"&&o){s=!0;continue}if(o){if(o==="`"&&f==="$"&&a+1<e.length&&e[a+1]==="{"){let g=1;a+=2;while(a<e.length&&g>0){if(e[a]==="{")g++;else if(e[a]==="}")g--;if(g>0)r+=e[a],n.push(a),a++}continue}if(f===o)o=null;continue}if(f==='"'||f==="'"||f==="`"){o=f;continue}r+=f,n.push(a)}return{text:r,map:n}}function fe(e){return J(e).text}var Y=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],Z=(()=>{let e={Date,URL,URLSearchParams},r=Intl;for(let n of Y)if(typeof r[n]==="function")e[`Intl_${n}`]=r[n];return Object.freeze(Object.assign(Object.create(null),e))})(),me=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,j=/(?<![\w$])new(?![\w$])/g,B=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${Y.join(",")}}() are allowed`;function pe(e){let{text:r,map:n}=J(e),o=[];j.lastIndex=0;let s;while((s=j.exec(r))!==null){let f=s.index;if(/(?<!\.)\.\s*$/.test(r.slice(0,f)))continue;let g=me.exec(r.slice(f)),d=g?.[3],m=!g?null:d?`Intl_${d}`:g[2];if(!g||!m||!(m in Z))throw new b(`matched /${C.source}/; ${B}`,e);let p=f+g[0].length,h=n[f],E=n[p-1]+1;if(e.slice(h,E)!==r.slice(f,p))throw new b(`matched /${C.source}/; ${B}`,e);let x=h+3+g[1].length;o.push({start:x,end:x+g[2].length,key:m})}let a=e;for(let f=o.length-1;f>=0;f--){let g=o[f];a=`${a.slice(0,g.start)}${F}.${g.key}${a.slice(g.end)}`}return{source:a,usesSafeConstructors:o.length>0}}class b extends Error{rule;expression;constructor(e,r,n){super(n??`Potentially unsafe expression (${e}): ${r}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=r}}function vn(e){try{return T(e),null}catch(r){return r instanceof b?r.rule:r instanceof Error?r.message:String(r)}}function de(e,r){let n=/[$A-Z_a-z][$\w]*/g,o;while((o=n.exec(e))!==null){let s=o[0],a=e[o.index-1];if(ue.has(s))throw new b(`matched /\\b${s}\\b/; identifier ${s}`,r);if(a==="."&&q.has(s))throw new b(`matched /.${s}/; property ${s}`,r)}}function he(e){let r=/\[\s*(['"])(.*?)\1\s*\]/g,n;while((n=r.exec(e))!==null){let o=n[2];if(!q.has(o))continue;let s=e.slice(0,n.index).match(/\S(?=\s*$)/)?.[0],a=e.slice(n.index+n[0].length).match(/^\s*(\S)/)?.[1];if(!((s==="{"||s===",")&&a===":"))throw new b(`bracket key ${n[2]}`,e)}}function T(e){let r=e.trim(),n=fe(r);de(n,r),he(r);for(let o of H){if(o===C)continue;if(o.test(n))throw new b(`matched /${o.source}/`,r)}if(!X.allowBracketNotation&&ge.test(r))throw new b("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",r,`Bracket notation with strings not allowed: ${r}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return pe(r)}function Ls(e){return T(e),e.trim()}function js(e){let r={};r.Math=Math,r.JSON=JSON,r.Date=Date,r.String=String,r.Number=Number,r.Boolean=Boolean,r.Array=Array,r.parseInt=Number.parseInt,r.parseFloat=Number.parseFloat,r.isNaN=Number.isNaN,r.isFinite=Number.isFinite,r.encodeURIComponent=encodeURIComponent,r.decodeURIComponent=decodeURIComponent;for(let[n,o]of Object.entries(e)){if(n.startsWith("__")||H.some((s)=>s.test(n)))continue;if(o&&typeof o==="object"&&!Array.isArray(o))r[n]=A(o);else r[n]=o}return r}function A(e,r=0){if(r>=X.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((o)=>A(o,r+1));if(e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error)return e;let n={};for(let[o,s]of Object.entries(e)){if(o.startsWith("__")||o==="constructor"||o==="prototype")continue;if(s&&typeof s==="object")n[o]=A(s,r+1);else n[o]=s}return n}function c(e,r){try{let n=js(r),o=Object.keys(n),s=Object.values(n);return l(e,o)(...s)}catch{return}}function u(e){try{return Ls(e),!0}catch{return!1}}function D(e,r){try{let n=c(e,r);if(n&&typeof n==="object"&&!Array.isArray(n))return n;return{}}catch{return{}}}var Q=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),Ee=2000,_=new Map;function V(e,r){let n=`${e.join(",")}\x00${r}`,o=_.get(n);if(o)return o;let s=Function(...e,r);if(_.size>=Ee)_.clear();return _.set(n,s),s}function ke(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var xe=/^[A-Za-z_$][\w$]*$/;function et(e){return xe.test(e)&&!Q.has(e)}function l(e,r){let{source:n,usesSafeConstructors:o}=T(e),s=[];for(let m=0;m<r.length;m++){if(!et(r[m]))continue;if(r[m]===F)continue;s.push({key:r[m],index:m})}s.sort((m,p)=>m.key.localeCompare(p.key));let a=s.map((m)=>m.key),f=s.map((m)=>m.index),g=`
|
|
29
29
|
'use strict';
|
|
30
30
|
try {
|
|
31
31
|
return ${n};
|
|
@@ -36,5 +36,5 @@ catch (e) {
|
|
|
36
36
|
}
|
|
37
37
|
throw e;
|
|
38
38
|
}
|
|
39
|
-
`;return be(o?(
|
|
40
|
-
export{t,
|
|
39
|
+
`;return be(o?(m)=>{let p=V([F,...a,...m],g);return(...h)=>p(Z,...h)}:(m)=>V([...a,...m],g),a,r,s,f)}function be(e,r,n,o,s){let a=e([]),f=o.every((d,m)=>d.index===m);if(r.length===n.length&&f)return W(a,r,e);return W((...d)=>{let m=Array(s.length);for(let p=0;p<s.length;p++)m[p]=d[s[p]];return a(...m)},r,e,(d)=>{a=e(d)})}function W(e,r,n,o){let a=/^(\w+) is not defined$/,f=e,g=[],d=new Set(r);return(...m)=>{for(let p=0;p<=8;p++)try{return f(...m)}catch(h){let E=h instanceof Error?h.message:"",x=a.exec(E);if(!(h instanceof ReferenceError)||!x)return;let y=x[1];if(d.has(y)||Q.has(y))return;if(d.add(y),g.push(y),o)o(g);else f=n(g)}return}}function lr(e){let r=e.trim(),n=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let o of n)if(o.test(r))return!1;return!0}
|
|
40
|
+
export{t,G,wn,cr,i,ne,Ns,P,Pt,vn,Ls,js,c,u,D,ke,et,l,lr};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{s}from"./chunk-
|
|
2
|
+
import{s}from"./chunk-7wfh2hqy.js";function y(e,n,i=240){return e.slice(n,n+i)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(e)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(e)||/\b(?:const|let|var)\s+alert\s*=/.test(e)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(e,n)=>{let i=e.indexOf("(",n);if(i===-1)return!0;let o=e.slice(i+1,e.indexOf(")",i)+1);return!/\b(?:location|search|href|url)\b/i.test(o)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(e,n)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(y(e,n,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(e,n)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(y(e,n))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(e)=>/setTimeout\s*\(/.test(e)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],C=["confirm","tooltip",...v.map((e)=>e.rule)];function g(e,n){let i=1;for(let o=0;o<n;o++)if(e[o]===`
|
|
3
3
|
`)i++;return i}function b(e,n){let i=e.lastIndexOf(`
|
|
4
4
|
`,n)+1,o=e.indexOf(`
|
|
5
5
|
`,n);return e.slice(i,o===-1?e.length:o).trim().slice(0,120)}function S(e,n){let i=e.slice(0,n),o=i.lastIndexOf("function"),l=i.lastIndexOf("=>"),r=Math.max(o,l);if(r===-1)return!1;let t=e.slice(Math.max(0,r-120),r);return/\basync\b[^;{}]*$/.test(t)}function k(e){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(e)||/\b(?:const|let|var)\s+confirm\s*=/.test(e)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(e)}function A(e,n,i){if(k(e))return e;let o=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,l=m(e),r="",t=0,a;while((a=o.exec(l))!==null){let c=a.index+a[1].length,u=g(e,c),d=b(e,c);if(/stxConfirm\s*\($/.test(e.slice(0,c+8)))continue;let p=S(e,c);if(i.push({file:n,line:u,rule:"confirm",applied:p,snippet:d,reason:p?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),p)r+=e.slice(t,c)+"await stxConfirm(",t=c+(a[0].length-a[1].length)}return r+e.slice(t)}function E(e,n,i){let o=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,l=R(e),r="",t=0,a;while((a=o.exec(l))!==null){let[c,u,d,p]=a,h=g(e,a.index),f=b(e,a.index),w=u.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(w)){i.push({file:n,line:h,rule:"tooltip",applied:!1,snippet:f,reason:`\`title\` on <${w}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test(u)||p.trim()===""){i.push({file:n,line:h,rule:"tooltip",applied:!1,snippet:f,reason:/\bx-tooltip[=\s]/.test(u)?"already has x-tooltip":"empty title"});continue}i.push({file:n,line:h,rule:"tooltip",applied:!0,snippet:f}),r+=e.slice(t,a.index)+`${u} x-tooltip=${d}${p}${d} title=${d}${p}${d}`,t=a.index+c.length}return r+e.slice(t)}function R(e){return e.replace(/<!--[\s\S]*?-->/g,(n)=>n.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(n)=>n.replace(/[^\n]/g," "))}function F(e){let n=(i)=>i.replace(/[^\n]/g," ");return e.replace(/\/\*[\s\S]*?\*\//g,n).replace(/\/\/[^\n]*/g,n)}function m(e,n=!1){let i=R(e);return(n?F(i):s(i)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(l,r)=>/\bclient\b/i.test(r)?l:l.replace(/[^\n]/g," "))}function O(e,n,i,o){let l=m(e),r=m(e,!0);for(let t of v){if(!i.includes(t.rule))continue;if(t.requires&&!t.requires(e))continue;t.pattern.lastIndex=0;let a,c=/['"]/.test(t.pattern.source)?r:l;t.pattern.lastIndex=0;while((a=t.pattern.exec(c))!==null){if(t.reject?.(e,a.index))continue;o.push({file:n,line:g(e,a.index),rule:t.rule,applied:!1,snippet:b(e,a.index),reason:`${t.primitive} \u2014 ${t.why}`})}}}function q(e,n={}){let i=n.rules??C,o=n.file??"<source>",l=[];O(e,o,i,l);let r=e;if(i.includes("confirm"))r=A(r,o,l);if(i.includes("tooltip"))r=E(r,o,l);l.sort((c,u)=>c.line-u.line);let t=new Set,a=l.filter((c)=>{let u=`${c.rule}:${c.line}`;if(t.has(u))return!1;return t.add(u),!0});return{code:r,findings:a}}var x=new Set(["confirm","tooltip"]);function I(e,n){if(e.length===0)return"No hand-rolled equivalents found.";let i=e.filter((t)=>t.applied),o=e.filter((t)=>!t.applied&&x.has(t.rule)),l=e.filter((t)=>!t.applied&&!x.has(t.rule)),r=[];if(i.length>0){r.push(n?`Rewrote ${i.length} site(s):`:`Would rewrite ${i.length} site(s) (pass --fix):`);for(let t of i)r.push(` ${t.file}:${t.line} [${t.rule}] ${t.snippet}`)}if(o.length>0){r.push("",`Needs a human \u2014 ${o.length} site(s):`);for(let t of o)r.push(` ${t.file}:${t.line} [${t.rule}] ${t.snippet}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ae,Ja,Vo,yt,bt,Pd,Uo,wt,tn,Ya,Za,Qa,ec,vt,tc}from"./chunk-664503e6.js";import"./chunk-ee4wwr89.js";import"./chunk-azb58ven.js";import"./chunk-g5t10z04.js";import"./chunk-kg77xs08.js";import"./chunk-bpr4bkde.js";import"./chunk-kwvexxey.js";import"./chunk-y4qks0bd.js";import"./chunk-p8yh7mgr.js";import"./chunk-2dzd2h15.js";import"./chunk-9sqjmd9a.js";import"./chunk-tkeabv04.js";import"./chunk-6v1gwdbv.js";import"./chunk-5tj6expd.js";import"./chunk-4gt0r98p.js";import"./chunk-gxfnmjzp.js";export{tn as MODULE_SPECIFIER_PREFIX,vt as bundleClientScript,bt as clearBundleFailures,ae as clientBundleDependencies,yt as getBundleFailures,wt as hasUserImports,Za as normalizeRegistrySpecifiers,ec as queueClientBundleBuild,Vo as recordBundleFailure,Ya as registryIdForPath,Uo as resolveBundlerFallback,Qa as rewriteRegistryImports,Pd as setBundlerFallbackMode,Ja as shouldLogBundlerDiagnostics,tc as tempBuildName};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ie,ht}from"./chunk-6abvk7vj.js";import{me}from"./chunk-7ybgfk0m.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
|
|
3
3
|
maxEntries: ${o},
|
|
4
4
|
${u?`maxAgeSeconds: ${u},`:""}
|
|
5
5
|
purgeOnQuotaError: true,
|
|
@@ -17,7 +17,7 @@ registerRoute(
|
|
|
17
17
|
],`:""}
|
|
18
18
|
})
|
|
19
19
|
);`)}return c.join(`
|
|
20
|
-
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?
|
|
20
|
+
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?ie(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?ie(t,e):null,l=s?ht(s):"[]",o=k(n.modules),u=d(e);return`/**
|
|
21
21
|
* Service Worker - Generated by stx with Workbox
|
|
22
22
|
* Cache Version: ${n.cacheVersion}
|
|
23
23
|
*
|
|
@@ -41,7 +41,7 @@ importScripts('https://storage.googleapis.com/workbox-cdn/releases/7.0.0/workbox
|
|
|
41
41
|
// build's transpiler folds that particular read to a constant, so every
|
|
42
42
|
// published copy of stx emitted "debug: true" and no app could turn Workbox's
|
|
43
43
|
// logging off in production however it set NODE_ENV (see ../env.ts).
|
|
44
|
-
workbox.setConfig({ debug: ${!
|
|
44
|
+
workbox.setConfig({ debug: ${!me()} });
|
|
45
45
|
|
|
46
46
|
// Extract modules from workbox global
|
|
47
47
|
${o}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rl}from"./chunk-xb0785wp.js";import"./chunk-hp1tnxzb.js";import"./chunk-ee4wwr89.js";import"./chunk-g5t10z04.js";import"./chunk-kg77xs08.js";import"./chunk-bpr4bkde.js";import"./chunk-kwvexxey.js";import"./chunk-y4qks0bd.js";import"./chunk-p8yh7mgr.js";import"./chunk-2dzd2h15.js";import"./chunk-9sqjmd9a.js";import"./chunk-tkeabv04.js";import"./chunk-6v1gwdbv.js";import"./chunk-5tj6expd.js";import"./chunk-4gt0r98p.js";import"./chunk-gxfnmjzp.js";export{rl as startProductionServer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Oe,Gt,cd}from"./chunk-3vvppnws.js";import{V,Mn,Jt,Fr,zr,Nn,ld,dd,ud,Yt,Zt,Hr,Ln,pd}from"./chunk-0wvsfs4s.js";import"./chunk-5tj6expd.js";export{Fr as batch,cd as default,Mn as derived,Jt as effect,Oe as generateSignalsRuntime,Gt as generateSignalsRuntimeDev,Zt as isDerived,Yt as isSignal,Nn as onDestroy,zr as onMount,Ln as peek,ud as pendingLifecycleCounts,dd as runDestroyCallbacks,ld as runMountCallbacks,V as state,Hr as untrack,pd as useOptimistic};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{zn,rc,Od,sc,Md,oc,Hn,b,Ct,be,ic,ns,ac,Nd,K,cc,Ld,x,jd}from"./chunk-g5t10z04.js";import"./chunk-kg77xs08.js";import"./chunk-bpr4bkde.js";import"./chunk-kwvexxey.js";import"./chunk-y4qks0bd.js";import"./chunk-p8yh7mgr.js";import"./chunk-2dzd2h15.js";import"./chunk-9sqjmd9a.js";import"./chunk-tkeabv04.js";import"./chunk-6v1gwdbv.js";import"./chunk-5tj6expd.js";import"./chunk-4gt0r98p.js";import"./chunk-gxfnmjzp.js";export{cc as applyFilters,Md as clearCustomFilters,ic as clientLoopScopes,zn as defaultFilters,b as escapeHtml,Ct as escapeHtmlValue,x as evaluateExpression,oc as findMustacheEnd,sc as getAllFilters,ac as interpolateScriptAttributes,ns as interpolateScriptExpressions,Nd as interpolateScriptsInTemplate,K as processExpressions,rc as registerFilter,Od as registerFilters,Hn as replaceInterpolations,Ld as resetRejectedExpressionWarnings,jd as unescapeHtml,be as usesSignalsInScript};
|