@stacksjs/stx 0.2.889 → 0.2.891

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.
Files changed (194) hide show
  1. package/dist/{chunk-1n33yrar.js → chunk-062qfv99.js} +2 -2
  2. package/dist/chunk-08kcxz79.js +2 -0
  3. package/dist/chunk-0fyh29m1.js +2 -0
  4. package/dist/{chunk-2a5g80mq.js → chunk-0jdz31q1.js} +3 -3
  5. package/dist/{chunk-mhxg6j6s.js → chunk-0jkj8thz.js} +1 -1
  6. package/dist/{chunk-nbdscgvj.js → chunk-0t31rf3v.js} +6 -6
  7. package/dist/chunk-0w578pgv.js +3 -0
  8. package/dist/{chunk-f3cyghnb.js → chunk-0yxvz6qz.js} +4 -4
  9. package/dist/chunk-0zynd3x0.js +2 -0
  10. package/dist/chunk-10c7pg5h.js +2 -0
  11. package/dist/{chunk-cz1sdes5.js → chunk-115bb91s.js} +2 -2
  12. package/dist/chunk-12m3qagv.js +2 -0
  13. package/dist/{chunk-1gyxxfdf.js → chunk-12nmmdnp.js} +1 -1
  14. package/dist/chunk-1a7a8cjs.js +2 -0
  15. package/dist/chunk-1ph2yhfn.js +3 -0
  16. package/dist/{chunk-mt8edb75.js → chunk-1vp0h7d6.js} +57 -57
  17. package/dist/{chunk-me4yq8c2.js → chunk-29cw0fcr.js} +2 -2
  18. package/dist/chunk-2eq3aret.js +2 -0
  19. package/dist/chunk-3b3mkgpj.js +3 -0
  20. package/dist/{chunk-snv80b1b.js → chunk-3bsz7zj3.js} +2 -2
  21. package/dist/chunk-3ngbdap1.js +2 -0
  22. package/dist/chunk-3t30a2nx.js +2 -0
  23. package/dist/{chunk-eyx92t9n.js → chunk-41z7f41b.js} +2 -2
  24. package/dist/chunk-484x27q5.js +2 -0
  25. package/dist/{chunk-87g5xmmr.js → chunk-4f3456ht.js} +14 -14
  26. package/dist/{chunk-sjjw6y49.js → chunk-4r6hbjx7.js} +4 -4
  27. package/dist/chunk-4ts8qztg.js +2 -0
  28. package/dist/{chunk-700m927w.js → chunk-5zs5hrgz.js} +2 -2
  29. package/dist/{chunk-0ncafcs2.js → chunk-67j2m620.js} +3 -3
  30. package/dist/{chunk-bwx6w87c.js → chunk-6aq1pv9a.js} +1 -1
  31. package/dist/chunk-6kkatcka.js +2 -0
  32. package/dist/{chunk-cgfjrgfw.js → chunk-6kt9wxja.js} +11 -11
  33. package/dist/{chunk-kx09v9ya.js → chunk-70paeznz.js} +9 -9
  34. package/dist/{chunk-48rwqchc.js → chunk-7d2j41e3.js} +9 -9
  35. package/dist/{chunk-b15c4g3e.js → chunk-8ay5r808.js} +6 -6
  36. package/dist/{chunk-njpva3zq.js → chunk-8hdp4ark.js} +1 -1
  37. package/dist/chunk-8res5m9x.js +2 -0
  38. package/dist/{chunk-zf68afyh.js → chunk-8y39f6z3.js} +3 -3
  39. package/dist/{chunk-4akw3bym.js → chunk-90qwzwsm.js} +1 -1
  40. package/dist/{chunk-ch9028z3.js → chunk-9f8fda1j.js} +1 -1
  41. package/dist/chunk-9w6k311w.js +1322 -0
  42. package/dist/chunk-9zhpv03v.js +2 -0
  43. package/dist/{chunk-q9tc9rdv.js → chunk-a0aqs5a8.js} +2 -2
  44. package/dist/chunk-a5d5qveh.js +2 -0
  45. package/dist/{chunk-6gtecbe7.js → chunk-a7bqrjm5.js} +2 -2
  46. package/dist/{chunk-7hpca9c7.js → chunk-aasgawa9.js} +5 -5
  47. package/dist/{chunk-3dqfjpz4.js → chunk-ac3e6nhg.js} +29 -29
  48. package/dist/chunk-arr79m90.js +2 -0
  49. package/dist/{chunk-58qzyyyv.js → chunk-b0jk94wx.js} +3 -3
  50. package/dist/{chunk-mctzpw0w.js → chunk-b18vpz6p.js} +4 -4
  51. package/dist/chunk-bsbd6y64.js +2 -0
  52. package/dist/{chunk-ymqm898x.js → chunk-bvqgq18r.js} +2 -2
  53. package/dist/chunk-cf527twj.js +2 -0
  54. package/dist/chunk-cgrg6xzg.js +2 -0
  55. package/dist/{chunk-vc432a0w.js → chunk-dm069acv.js} +9 -9
  56. package/dist/{chunk-ranjkpc8.js → chunk-e16ef18k.js} +1 -1
  57. package/dist/chunk-e28czxw3.js +2 -0
  58. package/dist/{chunk-p8shtje2.js → chunk-e5md1cck.js} +45 -45
  59. package/dist/chunk-essd43ad.js +2 -0
  60. package/dist/chunk-fs7tv867.js +20 -0
  61. package/dist/chunk-fsk3rk2x.js +2 -0
  62. package/dist/{chunk-zwwhpxp7.js → chunk-g5nfqzfh.js} +2 -2
  63. package/dist/{chunk-6pz5gq6v.js → chunk-gcjqxvbb.js} +25 -21
  64. package/dist/{chunk-2gn2nc2j.js → chunk-gk0h2hp7.js} +1 -1
  65. package/dist/{chunk-9d91h636.js → chunk-gwayvyg5.js} +2 -2
  66. package/dist/{chunk-bqtj62ys.js → chunk-gydvy8a3.js} +7 -7
  67. package/dist/{chunk-eceeqy74.js → chunk-gzc16hs8.js} +2 -2
  68. package/dist/{chunk-xy8smv5e.js → chunk-h7yme97q.js} +2 -2
  69. package/dist/chunk-h87pjzn7.js +2 -0
  70. package/dist/chunk-hq03mwtw.js +2 -0
  71. package/dist/chunk-j9kejcrx.js +2 -0
  72. package/dist/chunk-jhbz5w30.js +2 -0
  73. package/dist/chunk-k0mndyb4.js +2 -0
  74. package/dist/{chunk-hm9d40yf.js → chunk-k89gbytd.js} +2 -2
  75. package/dist/{chunk-51720m79.js → chunk-kd7k31x3.js} +9 -9
  76. package/dist/{chunk-t0ttxayz.js → chunk-kfbw96c5.js} +2 -2
  77. package/dist/chunk-kh3sxa3j.js +2 -0
  78. package/dist/{chunk-mjp1z9kz.js → chunk-khm56bfm.js} +1 -1
  79. package/dist/chunk-kr4z3633.js +2 -0
  80. package/dist/{chunk-6pdy7ajr.js → chunk-kvz7ad7p.js} +1 -1
  81. package/dist/{chunk-nkyff7v6.js → chunk-kxewj557.js} +27 -27
  82. package/dist/chunk-mbpz45v9.js +2 -0
  83. package/dist/{chunk-b6bf0t02.js → chunk-mhrnjaka.js} +4 -4
  84. package/dist/{chunk-mw7hacm3.js → chunk-mxf6cfbg.js} +23 -23
  85. package/dist/{chunk-pctf14yw.js → chunk-n64zbwzr.js} +1 -1
  86. package/dist/{chunk-eqffvse2.js → chunk-n6q1d66k.js} +1 -1
  87. package/dist/chunk-nd0f11at.js +2 -0
  88. package/dist/{chunk-3hsv6ejp.js → chunk-neg6ckjg.js} +7 -7
  89. package/dist/{chunk-kbbbpae2.js → chunk-nq60tjkz.js} +2 -2
  90. package/dist/{chunk-6kyqejnq.js → chunk-nvre22sw.js} +22 -22
  91. package/dist/{chunk-967ydrq4.js → chunk-p3hbsrk9.js} +2 -2
  92. package/dist/chunk-p9cwapm8.js +2 -0
  93. package/dist/{chunk-w82nk19t.js → chunk-ph4tgp9g.js} +1 -1
  94. package/dist/{chunk-kj43fbzm.js → chunk-phx820py.js} +1 -1
  95. package/dist/{chunk-5ssv10ep.js → chunk-pjpf21y9.js} +1 -1
  96. package/dist/{chunk-7212fwzz.js → chunk-psykt348.js} +2 -2
  97. package/dist/{chunk-pz554g43.js → chunk-pvm48tse.js} +3 -3
  98. package/dist/{chunk-zek9t5za.js → chunk-pwpge9bj.js} +2 -2
  99. package/dist/{chunk-0k437z3q.js → chunk-qn45rk5n.js} +1 -1
  100. package/dist/{chunk-95sd8h5g.js → chunk-qrk535j6.js} +6 -6
  101. package/dist/{chunk-446tb2th.js → chunk-rc7djca5.js} +49 -49
  102. package/dist/{chunk-55tc5w32.js → chunk-sh7a0g09.js} +2 -2
  103. package/dist/chunk-sydgagr1.js +2 -0
  104. package/dist/chunk-tspqdt8e.js +2 -0
  105. package/dist/chunk-v6gkjg5f.js +3 -0
  106. package/dist/chunk-vm57848v.js +2 -0
  107. package/dist/{chunk-ankap9pc.js → chunk-vya7cck4.js} +1 -1
  108. package/dist/{chunk-hgf7bc50.js → chunk-w8djc4qb.js} +9 -9
  109. package/dist/chunk-wg6fmren.js +4 -0
  110. package/dist/chunk-wwb6c5rr.js +2 -0
  111. package/dist/chunk-x691tnkx.js +2 -0
  112. package/dist/{chunk-mgh5rst1.js → chunk-x9036mfd.js} +2 -2
  113. package/dist/{chunk-brzjass3.js → chunk-xc5esqcb.js} +2 -2
  114. package/dist/{chunk-5kqezrjt.js → chunk-xvprhdcb.js} +1 -1
  115. package/dist/chunk-y7qm1m0e.js +2 -0
  116. package/dist/{chunk-m95sygv4.js → chunk-ye6ev3qp.js} +1 -1
  117. package/dist/{chunk-s93yh7ed.js → chunk-ypyezjr0.js} +2 -2
  118. package/dist/{chunk-4kmg6g5n.js → chunk-yv797v6e.js} +9 -9
  119. package/dist/{chunk-cmg9x1ka.js → chunk-z012vpdz.js} +3 -3
  120. package/dist/{chunk-dymck524.js → chunk-z6ndrx2p.js} +5 -5
  121. package/dist/{chunk-2nqmw4dv.js → chunk-z8sv926e.js} +1 -1
  122. package/dist/{chunk-s0mf56y1.js → chunk-z92e297r.js} +4 -4
  123. package/dist/chunk-zd21ntcm.js +2 -0
  124. package/dist/{chunk-6c1vm6bs.js → chunk-zkwkhesc.js} +2 -2
  125. package/dist/{chunk-hpzje67q.js → chunk-zwqkbk2m.js} +2 -2
  126. package/dist/chunk-zxjdfgdx.js +3 -0
  127. package/dist/cli.js +28 -28
  128. package/dist/client/signals-timer-runtime.js +4 -0
  129. package/dist/component-contract.d.ts +1 -0
  130. package/dist/component-contract.js +6 -4
  131. package/dist/component-library.js +217 -60
  132. package/dist/component-renderer.js +23 -10
  133. package/dist/composition-api.d.ts +7 -1
  134. package/dist/craft-entry.js +2 -2
  135. package/dist/craft.js +2 -2
  136. package/dist/emits-declaration.d.ts +9 -0
  137. package/dist/emits-declaration.js +64 -0
  138. package/dist/native/prop-names.js +7 -2
  139. package/dist/native/runtime/craft-bridge.js +29 -2
  140. package/dist/native/runtime/craft.d.ts +32 -0
  141. package/dist/native/runtime/native-host.js +27 -11
  142. package/dist/props-declaration.d.ts +2 -0
  143. package/dist/props-declaration.js +25 -0
  144. package/dist/pwa.js +3 -3
  145. package/dist/ssg.js +28 -28
  146. package/package.json +5 -5
  147. package/stx.d.ts +2 -1
  148. package/dist/chunk-0g9cceht.js +0 -2
  149. package/dist/chunk-0rpj5t80.js +0 -2
  150. package/dist/chunk-2ba4zfa0.js +0 -2
  151. package/dist/chunk-2wkpksg1.js +0 -2
  152. package/dist/chunk-3yjyjq0m.js +0 -2
  153. package/dist/chunk-444haxxa.js +0 -2
  154. package/dist/chunk-4rvfeee5.js +0 -2
  155. package/dist/chunk-5aa83bpm.js +0 -2
  156. package/dist/chunk-67rppc5v.js +0 -2
  157. package/dist/chunk-77c89d23.js +0 -2
  158. package/dist/chunk-79vbkez0.js +0 -2
  159. package/dist/chunk-8354mzpd.js +0 -2
  160. package/dist/chunk-8ygf6jnt.js +0 -2
  161. package/dist/chunk-94mpe1ny.js +0 -3
  162. package/dist/chunk-9n5h4sqc.js +0 -3
  163. package/dist/chunk-9ztn7w4y.js +0 -2
  164. package/dist/chunk-asnd03sr.js +0 -2
  165. package/dist/chunk-b0b5yr97.js +0 -2
  166. package/dist/chunk-b0e7dgv8.js +0 -3
  167. package/dist/chunk-b7jj45bz.js +0 -2
  168. package/dist/chunk-dzqfv801.js +0 -3
  169. package/dist/chunk-ery4tty7.js +0 -20
  170. package/dist/chunk-evwrxsxd.js +0 -3
  171. package/dist/chunk-fdqdz018.js +0 -2
  172. package/dist/chunk-g6ap4085.js +0 -2
  173. package/dist/chunk-gz9pknbw.js +0 -1204
  174. package/dist/chunk-hjb4c8g2.js +0 -2
  175. package/dist/chunk-jhbj9ja2.js +0 -2
  176. package/dist/chunk-k9abxnpa.js +0 -2
  177. package/dist/chunk-mvavjydq.js +0 -2
  178. package/dist/chunk-qqng9545.js +0 -2
  179. package/dist/chunk-rjm515e2.js +0 -2
  180. package/dist/chunk-rye4b2x3.js +0 -2
  181. package/dist/chunk-ryj8139z.js +0 -2
  182. package/dist/chunk-s9b809n2.js +0 -2
  183. package/dist/chunk-sb67wg5x.js +0 -2
  184. package/dist/chunk-sqwx2g02.js +0 -2
  185. package/dist/chunk-tbh7r1wh.js +0 -2
  186. package/dist/chunk-tpyekw0q.js +0 -2
  187. package/dist/chunk-v2627s75.js +0 -2
  188. package/dist/chunk-v98n53nk.js +0 -2
  189. package/dist/chunk-w34vvhm7.js +0 -2
  190. package/dist/chunk-wbmx0rge.js +0 -2
  191. package/dist/chunk-yjwa7ktk.js +0 -2
  192. package/dist/chunk-z47p2gx8.js +0 -2
  193. package/dist/chunk-z6kw6sct.js +0 -4
  194. package/dist/chunk-zhywjwdr.js +0 -2
@@ -1,30 +1,30 @@
1
1
  // @bun
2
- import S from"fs";import _ from"path";function Ao(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 Ea(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 is(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 Ea(u);s.push({path:r,content:new Uint8Array(u),sha1:o})}return s}function Po(e){let t={};for(let i of e)t[`/${i.path}`]=i.sha1;return t}function Io(e,t){let i=new Set(t.map((s)=>s.startsWith("/")?s.slice(1):s));return e.filter((s)=>i.has(s.path))}function Vn(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 sn(e){return e.reduce((t,i)=>t+i.content.byteLength,0)}import m from"fs";import y from"path";function Ta(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(`
2
+ import S from"fs";import _ from"path";function Ao(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 Ea(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 is(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 Ea(u);s.push({path:r,content:new Uint8Array(u),sha1:o})}return s}function Po(e){let t={};for(let i of e)t[`/${i.path}`]=i.sha1;return t}function Io(e,t){let i=new Set(t.map((s)=>s.startsWith("/")?s.slice(1):s));return e.filter((s)=>i.has(s.path))}function Vn(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 an(e){return e.reduce((t,i)=>t+i.content.byteLength,0)}import m from"fs";import y from"path";function Ta(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 as(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 cs(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 Oo(e,t){let i=await as(e),s=t||cs(i),n=Ta(s),r=y.join(e,"netlify.toml");return await Bun.write(r,n),r}function No(e){return m.existsSync(y.join(e,"netlify.toml"))}async function Em(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 _t(`No Netlify auth token found.
4
+ `}function d(e){return e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}async function as(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 cs(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 Oo(e,t){let i=await as(e),s=t||cs(i),n=Ta(s),r=y.join(e,"netlify.toml");return await Bun.write(r,n),r}function No(e){return m.existsSync(y.join(e,"netlify.toml"))}async function Em(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 Et(`No Netlify auth token found.
5
5
 
6
6
  To deploy to Netlify:
7
7
  1. Create account at https://app.netlify.com
8
8
  2. Get token at https://app.netlify.com/user/applications#personal-access-tokens
9
9
  3. Set NETLIFY_AUTH_TOKEN environment variable
10
10
 
11
- export NETLIFY_AUTH_TOKEN=your_token_here`,"NO_TOKEN");if(!f)throw new _t(`No Netlify site ID found.
11
+ export NETLIFY_AUTH_TOKEN=your_token_here`,"NO_TOKEN");if(!f)throw new Et(`No Netlify site ID found.
12
12
 
13
13
  Either:
14
14
  1. Set NETLIFY_SITE_ID environment variable
15
15
  2. Pass --site-id option
16
16
  3. Run \`stx deploy --init\` to set up
17
17
 
18
- Find your site ID at: https://app.netlify.com/sites/YOUR_SITE/settings/general`,"NO_SITE_ID");if(!S.existsSync(l))throw new _t(`Build directory not found: ${l}
18
+ Find your site ID at: https://app.netlify.com/sites/YOUR_SITE/settings/general`,"NO_SITE_ID");if(!S.existsSync(l))throw new Et(`Build directory not found: ${l}
19
19
 
20
- Run \`stx build\` first or specify a different directory with --directory`,"NO_BUILD_DIR");if(!(S.readdirSync(l).length>0))throw new _t(`Build directory is empty: ${l}
20
+ Run \`stx build\` first or specify a different directory with --directory`,"NO_BUILD_DIR");if(!(S.readdirSync(l).length>0))throw new Et(`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 is(l),w=sn(c);return n(`Would deploy ${c.length} files (${Vn(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=Ao({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 _t(`Site not found: ${f}
22
+ Run \`stx build\` to generate files`,"EMPTY_BUILD_DIR");if(e.dryRun){r({stage:"collect",message:"Collecting files..."});let c=await is(l),w=an(c);return n(`Would deploy ${c.length} files (${Vn(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=Ao({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 Et(`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 is(l),g=sn(a);if(n(`Found ${a.length} files (${Vn(g)})`),a.length===0)throw new _t(`No files found in ${l}`,"NO_FILES");let b=Po(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=Io(a,D.required||[]);if(n(`Uploading ${h.length} files...`),h.length>0){let c=0,w=sn(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 ${Vn(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:sn(h)}}async function Tm(e={}){let t=e.directory||process.cwd(),i;if(No(t))i=_.join(t,"netlify.toml");else{let s=await as(t);i=await Oo(t,cs(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(`
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 is(l),g=an(a);if(n(`Found ${a.length} files (${Vn(g)})`),a.length===0)throw new Et(`No files found in ${l}`,"NO_FILES");let b=Po(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=Io(a,D.required||[]);if(n(`Uploading ${h.length} files...`),h.length>0){let c=0,w=an(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 ${Vn(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:an(h)}}async function Tm(e={}){let t=e.directory||process.cwd(),i;if(No(t))i=_.join(t,"netlify.toml");else{let s=await as(t);i=await Oo(t,cs(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
- `,await Bun.write(s,n)}return{configPath:i,siteId:e.siteId}}class _t 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{Ao,Ea,is,Po,Io,Vn,sn,Ta,as,cs,Oo,No,Em,Tm,_t};
29
+ `,await Bun.write(s,n)}return{configPath:i,siteId:e.siteId}}class Et 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{Ao,Ea,is,Po,Io,Vn,an,Ta,as,cs,Oo,No,Em,Tm,Et};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as Hm}from"ts-broadcasting";import{Broadcast as Vm,BroadcastServer as Um}from"ts-broadcasting";var e=null,u=[];function Nm(){return e}async function Mm(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Dm(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function Lm(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();gu(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function gu(n,t,r){if(!i())return;s.send(n,t,r)}function jm(n,t,r){if(!i())return;s.toUser(n,t,r)}function Bm(n,t,r){if(!i())return;s.toUsers(n,t,r)}function Fm(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function zm(n,t,r){if(!i())return;s.presence(n,t,r)}
3
- export{Nm,Mm,Dm,Lm,gu,jm,Bm,Fm,zm,Hm,Vm,Um};
2
+ import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as Hm}from"ts-broadcasting";import{Broadcast as Um,BroadcastServer as Vm}from"ts-broadcasting";var e=null,u=[];function Nm(){return e}async function Mm(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Dm(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function Lm(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();gu(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function gu(n,t,r){if(!i())return;s.send(n,t,r)}function jm(n,t,r){if(!i())return;s.toUser(n,t,r)}function Bm(n,t,r){if(!i())return;s.toUsers(n,t,r)}function Fm(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function zm(n,t,r){if(!i())return;s.presence(n,t,r)}
3
+ export{Nm,Mm,Dm,Lm,gu,jm,Bm,Fm,zm,Hm,Um,Vm};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{dh,Ua,Bu,ph,fh,gh,mh,hh,Fu,zu,yh,bh,wh,vh}from"./chunk-aasgawa9.js";import"./chunk-1vp0h7d6.js";import"./chunk-dm069acv.js";import"./chunk-7d2j41e3.js";import"./chunk-05x1rd86.js";import"./chunk-w8djc4qb.js";import"./chunk-0w578pgv.js";import"./chunk-z6ndrx2p.js";import"./chunk-xvprhdcb.js";import"./chunk-yv797v6e.js";import"./chunk-gydvy8a3.js";import"./chunk-n64zbwzr.js";import"./chunk-gwayvyg5.js";import"./chunk-n6q1d66k.js";import"./chunk-e5md1cck.js";import"./chunk-b0jk94wx.js";import"./chunk-q0y8gv18.js";import"./chunk-rb2zbdqd.js";import"./chunk-qrk535j6.js";import"./chunk-gzc16hs8.js";import"./chunk-9w6k311w.js";import"./chunk-ypyezjr0.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{Bu as SUSPENSE_RESOLVER_RUNTIME,Ua as buildSuspenseResolveScript,hh as createStreamRenderer,gh as extractStreamBoundaries,vh as generateHydrationRuntime,zu as islandDirective,bh as processSectionDirectives,fh as processStreamDirectives,yh as registerStreamingDirectives,ph as renderStreamingPage,dh as streamTemplate,mh as streamTemplateSimple,wh as streamToResponse,Fu as streamingSuspenseDirective};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{t}from"./chunk-3hsv6ejp.js";function y(e,i,s=240){return e.slice(i,i+s)}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,i)=>{let s=e.indexOf("(",i);if(s===-1)return!0;let o=e.slice(s+1,e.indexOf(")",s)+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,i)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(y(e,i,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,i)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(y(e,i))},{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,i){let s=1;for(let o=0;o<i;o++)if(e[o]===`
2
+ import{t}from"./chunk-neg6ckjg.js";function y(e,i,s=240){return e.slice(i,i+s)}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,i)=>{let s=e.indexOf("(",i);if(s===-1)return!0;let o=e.slice(s+1,e.indexOf(")",s)+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,i)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(y(e,i,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,i)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(y(e,i))},{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,i){let s=1;for(let o=0;o<i;o++)if(e[o]===`
3
3
  `)s++;return s}function b(e,i){let s=e.lastIndexOf(`
4
4
  `,i)+1,o=e.indexOf(`
5
5
  `,i);return e.slice(s,o===-1?e.length:o).trim().slice(0,120)}function S(e,i){let s=e.slice(0,i),o=s.lastIndexOf("function"),l=s.lastIndexOf("=>"),r=Math.max(o,l);if(r===-1)return!1;let n=e.slice(Math.max(0,r-120),r);return/\basync\b[^;{}]*$/.test(n)}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,i,s){if(k(e))return e;let o=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,l=m(e),r="",n=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(s.push({file:i,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(n,c)+"await stxConfirm(",n=c+(a[0].length-a[1].length)}return r+e.slice(n)}function E(e,i,s){let o=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,l=R(e),r="",n=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)){s.push({file:i,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()===""){s.push({file:i,line:h,rule:"tooltip",applied:!1,snippet:f,reason:/\bx-tooltip[=\s]/.test(u)?"already has x-tooltip":"empty title"});continue}s.push({file:i,line:h,rule:"tooltip",applied:!0,snippet:f}),r+=e.slice(n,a.index)+`${u} x-tooltip=${d}${p}${d} title=${d}${p}${d}`,n=a.index+c.length}return r+e.slice(n)}function R(e){return e.replace(/<!--[\s\S]*?-->/g,(i)=>i.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(i)=>i.replace(/[^\n]/g," "))}function F(e){let i=(s)=>s.replace(/[^\n]/g," ");return e.replace(/\/\*[\s\S]*?\*\//g,i).replace(/\/\/[^\n]*/g,i)}function m(e,i=!1){let s=R(e);return(i?F(s):t(s)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(l,r)=>/\bclient\b/i.test(r)?l:l.replace(/[^\n]/g," "))}function O(e,i,s,o){let l=m(e),r=m(e,!0);for(let n of v){if(!s.includes(n.rule))continue;if(n.requires&&!n.requires(e))continue;n.pattern.lastIndex=0;let a,c=/['"]/.test(n.pattern.source)?r:l;n.pattern.lastIndex=0;while((a=n.pattern.exec(c))!==null){if(n.reject?.(e,a.index))continue;o.push({file:i,line:g(e,a.index),rule:n.rule,applied:!1,snippet:b(e,a.index),reason:`${n.primitive} \u2014 ${n.why}`})}}}function q(e,i={}){let s=i.rules??C,o=i.file??"<source>",l=[];O(e,o,s,l);let r=e;if(s.includes("confirm"))r=A(r,o,l);if(s.includes("tooltip"))r=E(r,o,l);l.sort((c,u)=>c.line-u.line);let n=new Set,a=l.filter((c)=>{let u=`${c.rule}:${c.line}`;if(n.has(u))return!1;return n.add(u),!0});return{code:r,findings:a}}var x=new Set(["confirm","tooltip"]);function I(e,i){if(e.length===0)return"No hand-rolled equivalents found.";let s=e.filter((n)=>n.applied),o=e.filter((n)=>!n.applied&&x.has(n.rule)),l=e.filter((n)=>!n.applied&&!x.has(n.rule)),r=[];if(s.length>0){r.push(i?`Rewrote ${s.length} site(s):`:`Would rewrite ${s.length} site(s) (pass --fix):`);for(let n of s)r.push(` ${n.file}:${n.line} [${n.rule}] ${n.snippet}`)}if(o.length>0){r.push("",`Needs a human \u2014 ${o.length} site(s):`);for(let n of o)r.push(` ${n.file}:${n.line} [${n.rule}] ${n.snippet}
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{_m}from"./chunk-8hdp4ark.js";import"./chunk-e5md1cck.js";import"./chunk-b0jk94wx.js";import"./chunk-q0y8gv18.js";import"./chunk-rb2zbdqd.js";import"./chunk-qrk535j6.js";import"./chunk-gzc16hs8.js";import"./chunk-9w6k311w.js";import"./chunk-ypyezjr0.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{_m as buildApp};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{P}from"./chunk-gz9pknbw.js";import{i}from"./chunk-mt8edb75.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
2
+ import{P}from"./chunk-9w6k311w.js";import{i}from"./chunk-1vp0h7d6.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
3
3
  ${e.bold}${t[0]}${e.reset} - ${n.description}`),console.log(` Usage: ${e.cyan}${n.usage}${e.reset}
4
4
  `)}else{console.log(`
5
5
  ${e.bold}Available Commands:${e.reset}