@stacksjs/stx 0.2.577 → 0.2.578

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 (209) hide show
  1. package/dist/chunk-0047meje.js +2 -0
  2. package/dist/chunk-00p22wzr.js +3 -0
  3. package/dist/{chunk-z33z3rr4.js → chunk-0k5faspy.js} +6 -6
  4. package/dist/{chunk-wwhxgvr8.js → chunk-0vnngvy1.js} +4 -4
  5. package/dist/{chunk-7a0ewpz0.js → chunk-101ekf6y.js} +2 -2
  6. package/dist/{chunk-t79xnvzr.js → chunk-117xss52.js} +2 -2
  7. package/dist/chunk-1cat8kdj.js +2 -0
  8. package/dist/chunk-1dwnp35v.js +2 -0
  9. package/dist/{chunk-5vw8493b.js → chunk-1r1maqep.js} +3 -3
  10. package/dist/{chunk-zak5xare.js → chunk-1v1mew46.js} +1 -1
  11. package/dist/chunk-2dnr5qfk.js +2 -0
  12. package/dist/{chunk-1swmxkdt.js → chunk-2rx9d75e.js} +2 -2
  13. package/dist/chunk-2v73cjbc.js +2 -0
  14. package/dist/chunk-3akgppsy.js +2 -0
  15. package/dist/{chunk-8efe5vpm.js → chunk-3e3dpp7w.js} +3 -3
  16. package/dist/{chunk-vnsby98n.js → chunk-3qrrv6af.js} +1 -1
  17. package/dist/{chunk-fkbthywg.js → chunk-3wy8q3aq.js} +5 -5
  18. package/dist/chunk-3x6p9me0.js +2 -0
  19. package/dist/{chunk-tybk9hw9.js → chunk-43h8q2cm.js} +9 -9
  20. package/dist/{chunk-pqkb1m5x.js → chunk-4rkvwm6v.js} +5 -5
  21. package/dist/{chunk-bks1fe5e.js → chunk-4srg0qbv.js} +1 -1
  22. package/dist/chunk-4t67wmcg.js +2 -0
  23. package/dist/chunk-51zn42jy.js +2 -0
  24. package/dist/chunk-5702x95v.js +2 -0
  25. package/dist/{chunk-4z21afpp.js → chunk-5db5sxy3.js} +2 -2
  26. package/dist/{chunk-r4w1cye7.js → chunk-5kh5ehfh.js} +2 -2
  27. package/dist/chunk-5pgbsc3a.js +2 -0
  28. package/dist/chunk-60c2bsh9.js +2 -0
  29. package/dist/{chunk-vw1rmevt.js → chunk-620szfcp.js} +3 -3
  30. package/dist/{chunk-6rfm6b1c.js → chunk-6w2yqtrd.js} +2 -2
  31. package/dist/{chunk-37d52q0d.js → chunk-6z3e1tyz.js} +1 -1
  32. package/dist/{chunk-nskvepjv.js → chunk-71sdgv7e.js} +5 -5
  33. package/dist/chunk-79v4d9qh.js +2 -0
  34. package/dist/{chunk-qfb34r6k.js → chunk-7hkc96de.js} +6 -6
  35. package/dist/chunk-7pp2vx1g.js +2 -0
  36. package/dist/chunk-84f9dnq5.js +2 -0
  37. package/dist/chunk-8tq5x4z8.js +2 -0
  38. package/dist/{chunk-gjp2jxrp.js → chunk-8v19753h.js} +1 -1
  39. package/dist/chunk-8zm6tkqb.js +2 -0
  40. package/dist/{chunk-1dg5qxg9.js → chunk-9jh2ake5.js} +5 -5
  41. package/dist/chunk-a1z36dt5.js +2 -0
  42. package/dist/{chunk-7hr63cp5.js → chunk-ah9xyss2.js} +2 -2
  43. package/dist/chunk-atsf1fe0.js +2 -0
  44. package/dist/{chunk-x5xwe5nr.js → chunk-ayy9mmrw.js} +7 -7
  45. package/dist/chunk-b8qd6h1q.js +2 -0
  46. package/dist/{chunk-vde4mtfr.js → chunk-be2ba3hj.js} +2 -2
  47. package/dist/{chunk-pxk0tpw2.js → chunk-bj29pwm0.js} +3 -3
  48. package/dist/{chunk-gpb22a8n.js → chunk-c0h2eqe0.js} +2 -2
  49. package/dist/{chunk-agk478t4.js → chunk-c0s3k64c.js} +2 -2
  50. package/dist/{chunk-bctjmaxg.js → chunk-c1r7zq0q.js} +41 -41
  51. package/dist/{chunk-32gycb72.js → chunk-cb2pyg5t.js} +2 -2
  52. package/dist/chunk-ccxs40xy.js +2 -0
  53. package/dist/{chunk-7j9m4d7x.js → chunk-cdgwkzms.js} +3 -3
  54. package/dist/{chunk-6c2y9h5h.js → chunk-cnknvvwm.js} +1 -1
  55. package/dist/chunk-cp442y7a.js +2 -0
  56. package/dist/chunk-d4en5d3s.js +2 -0
  57. package/dist/chunk-dh80d57p.js +2 -0
  58. package/dist/{chunk-je0cttam.js → chunk-djft0m5h.js} +2 -2
  59. package/dist/chunk-dpn1pmxj.js +2 -0
  60. package/dist/chunk-dtcc09x1.js +2 -0
  61. package/dist/{chunk-sf7z2ar9.js → chunk-dvgvvy5b.js} +3 -3
  62. package/dist/chunk-dyqte1xq.js +2 -0
  63. package/dist/chunk-e4n4v022.js +2 -0
  64. package/dist/chunk-efgk2xv1.js +2 -0
  65. package/dist/{chunk-h1n43e5n.js → chunk-ev5f79mg.js} +5 -5
  66. package/dist/{chunk-1wkpxa58.js → chunk-eww6sdzz.js} +2 -2
  67. package/dist/{chunk-34fajf1n.js → chunk-faghmmrs.js} +139 -139
  68. package/dist/chunk-fj70wq7k.js +2 -0
  69. package/dist/chunk-g2fw68zm.js +2 -0
  70. package/dist/{chunk-szfkkbve.js → chunk-g4crr86j.js} +3 -3
  71. package/dist/{chunk-xh0808cd.js → chunk-h0a2s340.js} +2 -2
  72. package/dist/chunk-hcgm37dy.js +2 -0
  73. package/dist/chunk-hd2bn5q7.js +2 -0
  74. package/dist/{chunk-5dm4k229.js → chunk-hzfhn2vr.js} +2 -2
  75. package/dist/{chunk-6wz6f8d5.js → chunk-j1nqnmcd.js} +4 -4
  76. package/dist/{chunk-1c8sdf9a.js → chunk-jpqkm8tm.js} +2 -2
  77. package/dist/{chunk-550q827h.js → chunk-jtbzmbzz.js} +4 -4
  78. package/dist/chunk-k7jqkt93.js +2 -0
  79. package/dist/{chunk-wvk932dp.js → chunk-k9th7hc4.js} +4 -4
  80. package/dist/chunk-kp0hg06s.js +15 -0
  81. package/dist/{chunk-kskyfss0.js → chunk-ktyctev3.js} +2 -2
  82. package/dist/{chunk-xk2v20xe.js → chunk-m8tm44rq.js} +2 -2
  83. package/dist/chunk-mhjwtkx9.js +2 -0
  84. package/dist/chunk-mqy7g74k.js +2 -0
  85. package/dist/chunk-mxe21m6q.js +2 -0
  86. package/dist/chunk-ne03tfje.js +2 -0
  87. package/dist/{chunk-3gqrv02t.js → chunk-nrfh7gaa.js} +3 -3
  88. package/dist/chunk-p2sns0bn.js +2 -0
  89. package/dist/chunk-pjrh71sn.js +122 -0
  90. package/dist/{chunk-jgrtvs81.js → chunk-pmpb34md.js} +5 -5
  91. package/dist/chunk-q2a58n2a.js +2 -0
  92. package/dist/{chunk-5xwmkxkk.js → chunk-qazn64pm.js} +1 -1
  93. package/dist/{chunk-7bwkeake.js → chunk-qccgncp2.js} +6 -6
  94. package/dist/{chunk-1edvsndv.js → chunk-qdyp2zqf.js} +2 -2
  95. package/dist/chunk-rr8a7d4q.js +11 -0
  96. package/dist/{chunk-mr9c2ej6.js → chunk-s12bnv32.js} +2 -2
  97. package/dist/chunk-s1sycp43.js +2 -0
  98. package/dist/chunk-s932zfjz.js +2 -0
  99. package/dist/chunk-sp46w7z9.js +2 -0
  100. package/dist/{chunk-tasjpnbf.js → chunk-sv5nvfmb.js} +2 -2
  101. package/dist/chunk-sy1bk1ry.js +2 -0
  102. package/dist/chunk-t48ws5j0.js +2 -0
  103. package/dist/{chunk-sn3htx1z.js → chunk-t4g2fptt.js} +6 -6
  104. package/dist/{chunk-d8ek63nc.js → chunk-t8wpzqs4.js} +1 -1
  105. package/dist/{chunk-bpdsdbvg.js → chunk-ta3wn842.js} +2 -2
  106. package/dist/chunk-thbc9gtj.js +2 -0
  107. package/dist/chunk-tn9v10q2.js +2 -0
  108. package/dist/chunk-tpd5nwa3.js +2 -0
  109. package/dist/chunk-tpt4bgs5.js +2 -0
  110. package/dist/{chunk-n829xbbq.js → chunk-tszkg6sj.js} +2 -2
  111. package/dist/chunk-v8p5p2kp.js +2 -0
  112. package/dist/chunk-v9jd283e.js +2 -0
  113. package/dist/{chunk-4xvbc0mb.js → chunk-vpdx7qr3.js} +2 -2
  114. package/dist/chunk-vq0cb1m9.js +2 -0
  115. package/dist/chunk-vx75fb0d.js +33 -0
  116. package/dist/{chunk-pveafhzg.js → chunk-w3rmepwy.js} +2 -2
  117. package/dist/{chunk-xsxh7h8z.js → chunk-wg2w7zmt.js} +2 -2
  118. package/dist/chunk-wgkxgsqx.js +2 -0
  119. package/dist/{chunk-707n4pbz.js → chunk-wwj8zbzc.js} +5 -5
  120. package/dist/{chunk-p3xkj7pm.js → chunk-xpnpg967.js} +2 -2
  121. package/dist/chunk-y1bppxgw.js +2 -0
  122. package/dist/{chunk-1w9ngqpv.js → chunk-y8q1n7hx.js} +10 -10
  123. package/dist/{chunk-vmetcczm.js → chunk-yfq2v7x5.js} +6 -6
  124. package/dist/{chunk-h72befy4.js → chunk-yhpyqsbr.js} +4 -4
  125. package/dist/{chunk-n0kw3q6p.js → chunk-yk3fbzx5.js} +4 -4
  126. package/dist/chunk-yv5rwthv.js +2 -0
  127. package/dist/{chunk-mp99h8wh.js → chunk-yy3ser06.js} +5 -5
  128. package/dist/chunk-yygze2s0.js +2 -0
  129. package/dist/chunk-z1r4tdqy.js +2 -0
  130. package/dist/chunk-z732tf98.js +2 -0
  131. package/dist/{chunk-haeb904b.js → chunk-zk2xk0wd.js} +2 -2
  132. package/dist/chunk-zv288w4e.js +2 -0
  133. package/dist/{chunk-j4zyq2ap.js → chunk-zz02hwec.js} +11 -11
  134. package/dist/cli.js +19 -19
  135. package/dist/client-script-bundler.d.ts +12 -0
  136. package/dist/client-script-bundler.js +19 -5
  137. package/dist/composable-loader.js +2 -2
  138. package/dist/craft-entry.js +2 -2
  139. package/dist/craft.js +2 -2
  140. package/dist/native/compiler/bundle.d.ts +22 -0
  141. package/dist/native/compiler/bundle.js +164 -20
  142. package/dist/pwa.js +3 -3
  143. package/dist/ssg.js +3 -3
  144. package/dist/store-loader.js +7 -7
  145. package/package.json +5 -5
  146. package/dist/chunk-08a98yqt.js +0 -2
  147. package/dist/chunk-0q5s55km.js +0 -2
  148. package/dist/chunk-181m21rg.js +0 -2
  149. package/dist/chunk-194qgkc9.js +0 -2
  150. package/dist/chunk-1nbn56jw.js +0 -2
  151. package/dist/chunk-2ry2pfpe.js +0 -2
  152. package/dist/chunk-3bj1w990.js +0 -2
  153. package/dist/chunk-4a12azrb.js +0 -2
  154. package/dist/chunk-6aq3sm83.js +0 -2
  155. package/dist/chunk-6fpynp8q.js +0 -2
  156. package/dist/chunk-6q3yszw9.js +0 -74
  157. package/dist/chunk-6ryab0yy.js +0 -2
  158. package/dist/chunk-6sasxbv9.js +0 -2
  159. package/dist/chunk-6w9km7qb.js +0 -2
  160. package/dist/chunk-7kh4p06d.js +0 -2
  161. package/dist/chunk-7xrrzqh7.js +0 -2
  162. package/dist/chunk-7y73q42g.js +0 -11
  163. package/dist/chunk-8jaw6exk.js +0 -2
  164. package/dist/chunk-98r9jk2b.js +0 -2
  165. package/dist/chunk-9dgygz8d.js +0 -2
  166. package/dist/chunk-a51f04an.js +0 -2
  167. package/dist/chunk-aa52jhak.js +0 -2
  168. package/dist/chunk-ambynnzb.js +0 -2
  169. package/dist/chunk-ampr3fpv.js +0 -2
  170. package/dist/chunk-asbq9cgs.js +0 -2
  171. package/dist/chunk-bbdg3sqq.js +0 -33
  172. package/dist/chunk-bmtsb5mr.js +0 -2
  173. package/dist/chunk-c8rd3573.js +0 -2
  174. package/dist/chunk-d4b8cgvt.js +0 -2
  175. package/dist/chunk-d7skqhrc.js +0 -2
  176. package/dist/chunk-ensp20xk.js +0 -2
  177. package/dist/chunk-f1zyc84x.js +0 -2
  178. package/dist/chunk-f2y8bwdd.js +0 -2
  179. package/dist/chunk-g9vtny6q.js +0 -2
  180. package/dist/chunk-hcsrj8z6.js +0 -3
  181. package/dist/chunk-hj1bntaa.js +0 -2
  182. package/dist/chunk-hwy3aw5v.js +0 -2
  183. package/dist/chunk-hyafyqy6.js +0 -2
  184. package/dist/chunk-j75hqvgt.js +0 -2
  185. package/dist/chunk-j83ax407.js +0 -2
  186. package/dist/chunk-k3hfwve1.js +0 -2
  187. package/dist/chunk-ktc1ecsm.js +0 -2
  188. package/dist/chunk-mbmbaj0m.js +0 -2
  189. package/dist/chunk-nd3qttxh.js +0 -2
  190. package/dist/chunk-ndc1bmj7.js +0 -2
  191. package/dist/chunk-nn462qm9.js +0 -2
  192. package/dist/chunk-nr07vxm2.js +0 -2
  193. package/dist/chunk-q7a5pwaz.js +0 -2
  194. package/dist/chunk-qx6tr8mr.js +0 -2
  195. package/dist/chunk-r51vyhms.js +0 -2
  196. package/dist/chunk-s68bqf62.js +0 -2
  197. package/dist/chunk-s6sf70ty.js +0 -2
  198. package/dist/chunk-svavrmxb.js +0 -2
  199. package/dist/chunk-sw7mvg9p.js +0 -2
  200. package/dist/chunk-tz40t18m.js +0 -2
  201. package/dist/chunk-v1k0bdsg.js +0 -2
  202. package/dist/chunk-vd10tty0.js +0 -2
  203. package/dist/chunk-vqkzhd19.js +0 -2
  204. package/dist/chunk-w1yft5gg.js +0 -2
  205. package/dist/chunk-w6sa921x.js +0 -2
  206. package/dist/chunk-y120qq1a.js +0 -15
  207. package/dist/chunk-zcw74jmk.js +0 -2
  208. package/dist/chunk-zxvndwaz.js +0 -2
  209. package/dist/chunk-zzr0p4bb.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var c=0;function l(){return`suspense-${++c}-${Date.now().toString(36)}`}function ed(s,n={},t){let e=/@suspense(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@endsuspense/gi;return s.replace(e,(r,i,o,d)=>{let u=l(),a=p(i||"");return f(u,o.trim(),d.trim(),a)})}function p(s){let n={},t=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,e;while((e=t.exec(s))!==null){let r=e[1],i=e[2]||e[3],o=e[4];switch(r){case"id":n.id=i;break;case"timeout":n.timeout=o?parseInt(o,10):void 0;break}}return n}function f(s,n,t,e){let r=e.timeout||30000,i=e.id||s;return`
2
+ var c=0;function l(){return`suspense-${++c}-${Date.now().toString(36)}`}function nd(s,n={},t){let e=/@suspense(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@endsuspense/gi;return s.replace(e,(r,i,o,d)=>{let u=l(),a=p(i||"");return f(u,o.trim(),d.trim(),a)})}function p(s){let n={},t=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,e;while((e=t.exec(s))!==null){let r=e[1],i=e[2]||e[3],o=e[4];switch(r){case"id":n.id=i;break;case"timeout":n.timeout=o?parseInt(o,10):void 0;break}}return n}function f(s,n,t,e){let r=e.timeout||30000,i=e.id||s;return`
3
3
  <div class="stx-suspense" data-suspense-id="${s}" data-custom-id="${i}" data-status="pending">
4
4
  <div class="stx-suspense-fallback" data-suspense-fallback="${s}">
5
5
  ${t}
@@ -189,7 +189,7 @@ else {
189
189
  }, 0);
190
190
  })();
191
191
  </script>
192
- `}function td(s,n,t){return{id:s,fallback:t,content:n}}async function nd(s){let n=s.map((e)=>`
192
+ `}function rd(s,n,t){return{id:s,fallback:t,content:n}}async function sd(s){let n=s.map((e)=>`
193
193
  <div id="stx-ssr-suspense-${e.id}" class="stx-ssr-suspense">
194
194
  ${e.fallback}
195
195
  </div>
@@ -214,7 +214,7 @@ else {
214
214
  }
215
215
  })();
216
216
  </script>
217
- `}}return{initial:n,streaming:t()}}function rd(){return`
217
+ `}}return{initial:n,streaming:t()}}function od(){return`
218
218
  /* STX Suspense Styles */
219
219
  .stx-suspense {
220
220
  position: relative;
@@ -270,7 +270,7 @@ else {
270
270
  background-size: 200% 100%;
271
271
  }
272
272
  }
273
- `}function sd(){return`
273
+ `}function id(){return`
274
274
  // STX Suspense Runtime
275
275
  (function() {
276
276
  if (typeof window === 'undefined') return;
@@ -338,4 +338,4 @@ else {
338
338
  console.log('[stx] Suspense runtime initialized');
339
339
  })();
340
340
  `}
341
- export{ed,td,nd,rd,sd};
341
+ export{nd,rd,sd,od,id};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Rl}from"./chunk-tszkg6sj.js";import"./chunk-faghmmrs.js";import"./chunk-cdgwkzms.js";import"./chunk-ah9xyss2.js";import"./chunk-jtbzmbzz.js";import"./chunk-eww6sdzz.js";import"./chunk-be2ba3hj.js";import"./chunk-ayy9mmrw.js";import"./chunk-43h8q2cm.js";import"./chunk-7hkc96de.js";import"./chunk-vpdx7qr3.js";import"./chunk-zk2xk0wd.js";import"./chunk-yhpyqsbr.js";import"./chunk-qdyp2zqf.js";export{Rl as buildApp};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function Wc(o){return w.test(o)}async function Rs(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if(Wc(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
3
- export{Wc,Rs};
2
+ import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function Gc(o){return w.test(o)}async function Ps(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if(Gc(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
3
+ export{Gc,Ps};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Wr,Wl,ql}from"./chunk-vx75fb0d.js";import"./chunk-kp0hg06s.js";import"./chunk-yy3ser06.js";import"./chunk-ktyctev3.js";import"./chunk-faghmmrs.js";import"./chunk-cdgwkzms.js";import"./chunk-ah9xyss2.js";import"./chunk-jtbzmbzz.js";import"./chunk-eww6sdzz.js";import"./chunk-be2ba3hj.js";import"./chunk-ayy9mmrw.js";import"./chunk-43h8q2cm.js";import"./chunk-7hkc96de.js";import"./chunk-vpdx7qr3.js";import"./chunk-zk2xk0wd.js";import"./chunk-yhpyqsbr.js";import"./chunk-qdyp2zqf.js";export{ql as clearComposableCache,Wl as getComposableScript,Wr as listComposableModules};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{t,i}from"./chunk-qfb34r6k.js";import{Ze,Qe,et,ge,ke,_,lr,xn,he}from"./chunk-tybk9hw9.js";var I=/(?<![\w$@])@meta\s*\(/g,C=/(?<![\w$@])@metaTag\s*\(/g,k=/(?<![\w$@])@structuredData\s*\(/g,N=/(?<![\w$@])@seo\s*\(/g;function D(e,r){return(n)=>_(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function j(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function Os(e,r,n,g){if(!e.includes("@meta"))return e;let a=Ze(e,I,(s,c)=>{let o=xn(Qe(s),r);if(o.kind==="tag")return j(o.tag);if(o.kind==="empty")return"";return _("Meta",c,o.message,n,o.code)},D("Meta",n));return a=Ze(a,C,(s,c)=>{let o=et(s,r);if(!o.ok)return _("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!ke(o.value))return _("MetaTag",c,`expected an object such as { name, content }, got ${ge(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return _("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${l(u.name)}"`;if(u.property)p+=` property="${l(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${l(u.httpEquiv)}"`;return p+=` content="${l(u.content)}">`,p},D("MetaTag",n)),a}function v(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(ke(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(ke))return e.map(r);return null}function A(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function Ds(e,r,n){if(!e.includes("@structuredData"))return e;return Ze(e,k,(g,a)=>{let s=et(g,r);if(!s.ok)return _("StructuredData",a,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=v(s.value);if(!c)return _("StructuredData",a,`expected an object or an array of objects, got ${ge(s.value)}`,n,t.TYPE_ERROR);try{return A(c)}catch(o){let u=o instanceof Error?o.message:String(o);return _("StructuredData",a,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},D("StructuredData",n))}var L=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),R={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Ms(e,r,n,g){if(!e.includes("@seo"))return e;return Ze(e,N,(a,s)=>{if(!a.trim())return _("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=et(a,r);if(!c.ok)return _("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!ke(c.value))return _("SEO",s,`expected an object such as { title, description }, got ${ge(c.value)}`,n,t.TYPE_ERROR);try{return q(c.value,s,n)}catch(o){let u=o instanceof Error?o.message:String(o);return _("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},D("SEO",n))}function b(e,r,n,g){let a=e[r];if(a===void 0||a===null||a===!1)return;if(ke(a))return a;lr(n,`${r} must be an object, got ${ge(a)}; its tags were left out`,g);return}function q(e,r,n){let g=Object.keys(e).filter((o)=>!L.has(o));if(g.length>0){let o=g.map((u)=>R[u]?`${u} (use ${R[u]})`:u).join(", ");lr(r,`@seo does not read ${o}; ${g.length===1?"it was":"they were"} ignored`,n)}let a="";if(e.title)a+=`<title>${l(e.title)}</title>
2
+ import{t,i}from"./chunk-7hkc96de.js";import{Ze,Qe,et,ge,ke,_,dr,Sn,he}from"./chunk-43h8q2cm.js";var I=/(?<![\w$@])@meta\s*\(/g,C=/(?<![\w$@])@metaTag\s*\(/g,k=/(?<![\w$@])@structuredData\s*\(/g,N=/(?<![\w$@])@seo\s*\(/g;function D(e,r){return(n)=>_(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function j(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function Ms(e,r,n,g){if(!e.includes("@meta"))return e;let a=Ze(e,I,(s,c)=>{let o=Sn(Qe(s),r);if(o.kind==="tag")return j(o.tag);if(o.kind==="empty")return"";return _("Meta",c,o.message,n,o.code)},D("Meta",n));return a=Ze(a,C,(s,c)=>{let o=et(s,r);if(!o.ok)return _("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!ke(o.value))return _("MetaTag",c,`expected an object such as { name, content }, got ${ge(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return _("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${l(u.name)}"`;if(u.property)p+=` property="${l(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${l(u.httpEquiv)}"`;return p+=` content="${l(u.content)}">`,p},D("MetaTag",n)),a}function v(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(ke(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(ke))return e.map(r);return null}function A(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function Ns(e,r,n){if(!e.includes("@structuredData"))return e;return Ze(e,k,(g,a)=>{let s=et(g,r);if(!s.ok)return _("StructuredData",a,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=v(s.value);if(!c)return _("StructuredData",a,`expected an object or an array of objects, got ${ge(s.value)}`,n,t.TYPE_ERROR);try{return A(c)}catch(o){let u=o instanceof Error?o.message:String(o);return _("StructuredData",a,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},D("StructuredData",n))}var L=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),R={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Ls(e,r,n,g){if(!e.includes("@seo"))return e;return Ze(e,N,(a,s)=>{if(!a.trim())return _("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=et(a,r);if(!c.ok)return _("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!ke(c.value))return _("SEO",s,`expected an object such as { title, description }, got ${ge(c.value)}`,n,t.TYPE_ERROR);try{return q(c.value,s,n)}catch(o){let u=o instanceof Error?o.message:String(o);return _("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},D("SEO",n))}function b(e,r,n,g){let a=e[r];if(a===void 0||a===null||a===!1)return;if(ke(a))return a;dr(n,`${r} must be an object, got ${ge(a)}; its tags were left out`,g);return}function q(e,r,n){let g=Object.keys(e).filter((o)=>!L.has(o));if(g.length>0){let o=g.map((u)=>R[u]?`${u} (use ${R[u]})`:u).join(", ");dr(r,`@seo does not read ${o}; ${g.length===1?"it was":"they were"} ignored`,n)}let a="";if(e.title)a+=`<title>${l(e.title)}</title>
3
3
  `,a+=`<meta name="title" content="${l(e.title)}">
4
4
  `;if(e.description)a+=`<meta name="description" content="${l(e.description)}">
5
5
  `;if(e.keywords){let o=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;a+=`<meta name="keywords" content="${l(o)}">
@@ -25,7 +25,7 @@ import{t,i}from"./chunk-qfb34r6k.js";import{Ze,Qe,et,ge,ke,_,lr,xn,he}from"./chu
25
25
  `}if(c.site)a+=`<meta name="twitter:site" content="${l(c.site)}">
26
26
  `;if(c.creator)a+=`<meta name="twitter:creator" content="${l(c.creator)}">
27
27
  `}if(e.structuredData!==void 0&&e.structuredData!==null){let o=v(e.structuredData);if(o)a+=`${A(o)}
28
- `;else lr(r,`structuredData must be an object or an array of objects, got ${ge(e.structuredData)}; it was left out`,n)}return a.trim()}function Ns(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let g=r.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let s=e.includes("<title>")||e.includes("</title>"),c=M(e),o=V(c),u=U(c),p="";if(r.title)p=r.title;else if(r.meta&&r.meta.title)p=r.meta.title;else if(o)p=o;else if(n.seo?.defaultConfig?.title)p=n.seo.defaultConfig.title;else p=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=s?"":`
28
+ `;else dr(r,`structuredData must be an object or an array of objects, got ${ge(e.structuredData)}; it was left out`,n)}return a.trim()}function js(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let g=r.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let s=e.includes("<title>")||e.includes("</title>"),c=M(e),o=V(c),u=U(c),p="";if(r.title)p=r.title;else if(r.meta&&r.meta.title)p=r.meta.title;else if(o)p=o;else if(n.seo?.defaultConfig?.title)p=n.seo.defaultConfig.title;else p=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=s?"":`
29
29
  <meta name="title" content="${l(p)}">`,E=G(c)?"":`
30
30
  <meta name="description" content="${l(m)}">`,y=`
31
31
  <!-- stx SEO Tags -->${f}${E}
@@ -43,7 +43,7 @@ import{t,i}from"./chunk-qfb34r6k.js";import{Ze,Qe,et,ge,ke,_,lr,xn,he}from"./chu
43
43
  ${y}
44
44
  `),h;return h.replace(/<head[^>]*>/,`$&
45
45
  ${y}
46
- `)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function x(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?x(r[1].trim()):""}function O(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return O(e).length>0}function U(e){for(let r of O(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return x(g)}return""}function l(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var ir={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let a=xn(r,n??{});if(a.kind==="error")return _("Meta",`@meta(${r.join(", ")})`,a.message,g,a.code);if(a.kind==="empty")return"";if(n)n.__stx_runtime_head=he(n.__stx_runtime_head??{},{meta:[a.tag]});return""},hasEndTag:!1},ar={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return i("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let a=JSON.parse(e);if(!a["@context"])a["@context"]="https://schema.org";if(!a["@type"])return i("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return A(a)}catch(a){let s=a instanceof Error?a.message:String(a);return i("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function lu(){return[ir,ar]}function du(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:a=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,""),o=(m)=>m.startsWith("http")?m:`${c}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=o(m.loc),f=m.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),E=m.changefreq||g,y=m.priority??a,h=` <url>
46
+ `)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function x(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?x(r[1].trim()):""}function O(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return O(e).length>0}function U(e){for(let r of O(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return x(g)}return""}function l(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var ar={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let a=Sn(r,n??{});if(a.kind==="error")return _("Meta",`@meta(${r.join(", ")})`,a.message,g,a.code);if(a.kind==="empty")return"";if(n)n.__stx_runtime_head=he(n.__stx_runtime_head??{},{meta:[a.tag]});return""},hasEndTag:!1},cr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return i("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let a=JSON.parse(e);if(!a["@context"])a["@context"]="https://schema.org";if(!a["@type"])return i("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return A(a)}catch(a){let s=a instanceof Error?a.message:String(a);return i("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function uu(){return[ar,cr]}function pu(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:a=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,""),o=(m)=>m.startsWith("http")?m:`${c}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=o(m.loc),f=m.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),E=m.changefreq||g,y=m.priority??a,h=` <url>
47
47
  <loc>${T(d)}</loc>`;for(let w of m.alternates??[])h+=`
48
48
  <xhtml:link rel="alternate" hreflang="${T(w.hreflang)}" href="${T(o(w.href))}"/>`;if(f)h+=`
49
49
  <lastmod>${f}</lastmod>`;return h+=`
@@ -53,13 +53,13 @@ ${y}
53
53
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((m)=>m.alternates?.length)?' xmlns:xhtml="http://www.w3.org/1999/xhtml"':""}>
54
54
  ${u.join(`
55
55
  `)}
56
- </urlset>`}function uu(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
56
+ </urlset>`}function fu(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
57
57
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
58
58
  ${e.map((s)=>{let c=s.startsWith("http")?s:`${n}${s.startsWith("/")?"":"/"}${s}`;return` <sitemap>
59
59
  <loc>${T(c)}</loc>
60
60
  <lastmod>${g}</lastmod>
61
61
  </sitemap>`}).join(`
62
62
  `)}
63
- </sitemapindex>`}async function pu(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,a=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let o of c.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let p=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}a.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return a.sort((o,u)=>o.loc.localeCompare(u.loc)),a}function cr(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
64
- `).trim()}function fu(e){return cr({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
65
- export{Os,Ds,Ms,Ns,ir,ar,lu,du,uu,pu,cr,fu};
63
+ </sitemapindex>`}async function gu(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,a=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let o of c.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let p=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}a.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return a.sort((o,u)=>o.loc.localeCompare(u.loc)),a}function lr(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
64
+ `).trim()}function mu(e){return lr({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
65
+ export{Ms,Ns,Ls,js,ar,cr,uu,pu,fu,gu,lr,mu};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ua,mo,fl,pa,fa,gl,ml}from"./chunk-y8q1n7hx.js";import"./chunk-vx75fb0d.js";import"./chunk-kp0hg06s.js";import"./chunk-yy3ser06.js";import"./chunk-ktyctev3.js";import{We,kc}from"./chunk-faghmmrs.js";import"./chunk-cdgwkzms.js";import"./chunk-ah9xyss2.js";import"./chunk-jtbzmbzz.js";import"./chunk-eww6sdzz.js";import"./chunk-be2ba3hj.js";import"./chunk-ayy9mmrw.js";import"./chunk-43h8q2cm.js";import"./chunk-7hkc96de.js";import"./chunk-vpdx7qr3.js";import"./chunk-zk2xk0wd.js";import"./chunk-yhpyqsbr.js";import"./chunk-qdyp2zqf.js";export{ua as buildVirtualSource,We as extractScriptBlocks,kc as extractTemplateExpressions,pa as findRuntimeTypeDeclarations,fa as findStxModuleDeclarations,ml as formatTypecheckDiagnostics,fl as sourcePathFor,gl as typecheckStxFiles,mo as virtualPathFor};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function fe(n,f){return m.run(n,f)}function Pt(){return m.getStore()}function or(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Is(){return or().public}function C(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function d(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Ye(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+d(f)+s.slice(g)}
3
- export{fe,Pt,or,Is,C,Ye};
2
+ import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function fe(n,f){return m.run(n,f)}function It(){return m.getStore()}function ir(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Ds(){return ir().public}function C(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function d(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Ye(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+d(f)+s.slice(g)}
3
+ export{fe,It,ir,Ds,C,Ye};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function zo(e){let t={pages:0,assets:0,bytesInlined:0},n=R.join(e,S),i=new Set;for(let s of k(e)){let r=y.readFileSync(s,"utf8"),{html:o,assets:g,bytesInlined:u}=I(r);if(o===r)continue;for(let c of g){if(i.has(c.filename))continue;i.add(c.filename),y.mkdirSync(n,{recursive:!0}),y.writeFileSync(R.join(n,c.filename),c.contents),t.assets++}y.writeFileSync(s,o),t.bytesInlined+=u,t.pages++}return t}import h from"fs";import T from"path";var L=1024,N=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,_=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function B(e){return Bun.hash(e).toString(16).slice(0,8)}function C(e){let t=[],n=(i)=>{for(let s of h.readdirSync(i,{withFileTypes:!0})){let r=T.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(h.existsSync(e))n(e);return t}function O(e,t){let n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!n)return;return n[2]??n[3]??n[4]??""}function H(e,t,n){if(n.length<L)return!1;if(/\b(?:src|href)\s*=/i.test(t))return!1;if(e.toLowerCase()==="script"){if(!_.has((O(t,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function D(e){let t=[];for(let n of e.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))t.push([n.index,n.index+n[0].length]);return t}function Ho(e){let t={pages:0,assets:0,bytesInlined:0},n=C(e);if(n.length<2)return t;let i=new Map,s=new Map;for(let a of n){let f=h.readFileSync(a,"utf8");i.set(a,f);let M=D(f);for(let d of f.matchAll(N)){let[x,p,l,m]=d;if(!H(p,l,m))continue;if(M.some(([j,A])=>d.index>=j&&d.index<A))continue;let w=`${p.toLowerCase()}\x00${m}`,b=s.get(w);if(b)b.push({file:a,whole:x,tag:p,attrs:l,body:m});else s.set(w,[{file:a,whole:x,tag:p,attrs:l,body:m}])}}let r=[...s.values()].filter((a)=>new Set(a.map((f)=>f.file)).size>1);if(r.length===0)return t;let o=T.join(e,S),g=new Map(i),u=new Map,c=[];for(let a of r){let{tag:f,body:M}=a[0],d=f.toLowerCase()==="script",x=`${d?"chunk":"style"}.${B(M)}.${d?"js":"css"}`;c.push({filename:x,contents:M,contentType:d?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let p=`/${S}/${x}`;for(let l of a){let m=d?`<script${l.attrs} src="${p}"></script>`:`<link${l.attrs} rel="stylesheet" href="${p}">`,w=g.get(l.file),b=w.replace(l.whole,()=>m);if(b===w)continue;g.set(l.file,b),u.set(l.file,(u.get(l.file)??0)+l.body.length)}}h.mkdirSync(o,{recursive:!0});for(let a of c)h.writeFileSync(T.join(o,a.filename),a.contents),t.assets++;for(let[a,f]of g){if(f===i.get(a))continue;h.writeFileSync(a,f),t.pages++,t.bytesInlined+=u.get(a)??0}return t}import E from"fs";import v from"path";var K="layout-types.d.ts";function P(e){let t=[],n=(i,s)=>{let r;try{r=E.readdirSync(i,{withFileTypes:!0})}catch{return}for(let o of r){if(o.name.startsWith("."))continue;let g=v.join(i,o.name);if(o.isDirectory())n(g,s?`${s}/${o.name}`:o.name);else if(o.isFile()&&o.name.endsWith(".stx")&&o.name!=="_layout.stx"){let u=o.name.slice(0,-4);t.push(s?`${s}/${u}`:u)}}};return n(e,""),t.sort()}function W(e){let t=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(e.length===0)return t.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),t.join(`
2
+ import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function Uo(e){let t={pages:0,assets:0,bytesInlined:0},n=R.join(e,S),i=new Set;for(let s of k(e)){let r=y.readFileSync(s,"utf8"),{html:o,assets:g,bytesInlined:u}=I(r);if(o===r)continue;for(let c of g){if(i.has(c.filename))continue;i.add(c.filename),y.mkdirSync(n,{recursive:!0}),y.writeFileSync(R.join(n,c.filename),c.contents),t.assets++}y.writeFileSync(s,o),t.bytesInlined+=u,t.pages++}return t}import h from"fs";import T from"path";var L=1024,N=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,_=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function B(e){return Bun.hash(e).toString(16).slice(0,8)}function C(e){let t=[],n=(i)=>{for(let s of h.readdirSync(i,{withFileTypes:!0})){let r=T.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(h.existsSync(e))n(e);return t}function O(e,t){let n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!n)return;return n[2]??n[3]??n[4]??""}function H(e,t,n){if(n.length<L)return!1;if(/\b(?:src|href)\s*=/i.test(t))return!1;if(e.toLowerCase()==="script"){if(!_.has((O(t,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function D(e){let t=[];for(let n of e.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))t.push([n.index,n.index+n[0].length]);return t}function Vo(e){let t={pages:0,assets:0,bytesInlined:0},n=C(e);if(n.length<2)return t;let i=new Map,s=new Map;for(let a of n){let f=h.readFileSync(a,"utf8");i.set(a,f);let M=D(f);for(let d of f.matchAll(N)){let[x,p,l,m]=d;if(!H(p,l,m))continue;if(M.some(([j,A])=>d.index>=j&&d.index<A))continue;let w=`${p.toLowerCase()}\x00${m}`,b=s.get(w);if(b)b.push({file:a,whole:x,tag:p,attrs:l,body:m});else s.set(w,[{file:a,whole:x,tag:p,attrs:l,body:m}])}}let r=[...s.values()].filter((a)=>new Set(a.map((f)=>f.file)).size>1);if(r.length===0)return t;let o=T.join(e,S),g=new Map(i),u=new Map,c=[];for(let a of r){let{tag:f,body:M}=a[0],d=f.toLowerCase()==="script",x=`${d?"chunk":"style"}.${B(M)}.${d?"js":"css"}`;c.push({filename:x,contents:M,contentType:d?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let p=`/${S}/${x}`;for(let l of a){let m=d?`<script${l.attrs} src="${p}"></script>`:`<link${l.attrs} rel="stylesheet" href="${p}">`,w=g.get(l.file),b=w.replace(l.whole,()=>m);if(b===w)continue;g.set(l.file,b),u.set(l.file,(u.get(l.file)??0)+l.body.length)}}h.mkdirSync(o,{recursive:!0});for(let a of c)h.writeFileSync(T.join(o,a.filename),a.contents),t.assets++;for(let[a,f]of g){if(f===i.get(a))continue;h.writeFileSync(a,f),t.pages++,t.bytesInlined+=u.get(a)??0}return t}import E from"fs";import v from"path";var K="layout-types.d.ts";function P(e){let t=[],n=(i,s)=>{let r;try{r=E.readdirSync(i,{withFileTypes:!0})}catch{return}for(let o of r){if(o.name.startsWith("."))continue;let g=v.join(i,o.name);if(o.isDirectory())n(g,s?`${s}/${o.name}`:o.name);else if(o.isFile()&&o.name.endsWith(".stx")&&o.name!=="_layout.stx"){let u=o.name.slice(0,-4);t.push(s?`${s}/${u}`:u)}}};return n(e,""),t.sort()}function W(e){let t=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(e.length===0)return t.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),t.join(`
3
3
  `);return t.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...e.map((n)=>` '${n}': true`)," }","}","","export {}",""),t.join(`
4
- `)}function Uo(e,t){if(!e)return[];let n=v.isAbsolute(e)?e:v.resolve(process.cwd(),e),i=P(n),s=W(i),r=v.join(t,K);try{if(E.existsSync(r)&&E.readFileSync(r,"utf8")===s)return i;E.mkdirSync(t,{recursive:!0}),E.writeFileSync(r,s)}catch{}return i}
5
- export{zo,Ho,Uo};
4
+ `)}function Wo(e,t){if(!e)return[];let n=v.isAbsolute(e)?e:v.resolve(process.cwd(),e),i=P(n),s=W(i),r=v.join(t,K);try{if(E.existsSync(r)&&E.readFileSync(r,"utf8")===s)return i;E.mkdirSync(t,{recursive:!0}),E.writeFileSync(r,s)}catch{}return i}
5
+ export{Uo,Vo,Wo};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import d from"fs";import l from"path";function Vo(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Wo(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function qo(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function Xa(n,s){let e=Vo(n),a=s&&d.existsSync(s)?Wo(s):[];return qo([...e,...a])}function Ja(n){let s=[];s.push(`
2
+ import d from"fs";import l from"path";function qo(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Go(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function Ko(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function Ya(n,s){let e=qo(n),a=s&&d.existsSync(s)?Go(s):[];return Ko([...e,...a])}function Za(n){let s=[];s.push(`
3
3
  === PWA Audit Report ===
4
4
  `);let e=n.score>=90?"32":n.score>=70?"33":"31";s.push(`Score: \x1B[${e}m${n.score}/100\x1B[0m`),s.push(`Passed: ${n.passed} | Failed: ${n.failed} | Warnings: ${n.warnings}
5
5
  `);let a=["required","recommended","optional"];for(let t of a){let c=n.checks.filter((o)=>o.category===t);if(c.length===0)continue;s.push(`
6
6
  ${t.toUpperCase()}:`);for(let o of c){let u=o.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(s.push(` ${u} ${o.name}: ${o.message}`),o.details)s.push(` ${o.details}`)}}return s.push(""),s.join(`
7
7
  `)}
8
- export{Vo,Wo,qo,Xa,Ja};
8
+ export{qo,Go,Ko,Ya,Za};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function W(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function Zt(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function fd(e,n=Object.is){return Zt(e,{equals:n})}function Qt(e,n={}){let r,i=!1,o=()=>{if(i)return;if(r){let c=r;r=void 0;try{c()}catch(u){console.error("[stx] effect cleanup error:",u)}}let t=S(o);try{let c=e();r=typeof c==="function"?c:void 0}catch(c){i=!0,console.error("[stx] effect error (the effect is disposed):",c)}finally{h(t)}};if(n.immediate!==!1)o();return()=>{if(i=!0,r){let t=r;r=void 0,t()}}}function Wr(e){C(e)}function qr(e){k.push(e)}function Fn(e){T.push(e)}function gd(){O(k,"onMount",T)}function md(){O(T,"onDestroy")}function O(e,n,r){let i=e.splice(0,e.length);for(let o of i)try{let t=o();if(r&&typeof t==="function")r.push(t)}catch(t){console.error(`[stx] ${n} callback threw:`,t)}}function hd(){return{mount:k.length,destroy:T.length}}function en(e){return typeof e==="function"&&e._isSignal===!0}function tn(e){return typeof e==="function"&&e._isDerived===!0}function Gr(e){if(en(e)||tn(e))return m(()=>e());return e}function zn(e){return m(e)}function yd(e,n){let r=typeof e==="function"?e:()=>e,i=W([]),o=Zt(()=>i().reduce((u,l)=>n(u,l.action),r())),t=!1;return Qt(()=>{if(r(),!t){t=!0;return}if(zn(()=>i().length))i.set([])}),[o,(u,l)=>{let d={action:u};i.set([...i(),d]);let a=()=>{let s=i().filter((y)=>y!==d);if(s.length!==i().length)i.set(s)};if(l&&typeof l.then==="function")Promise.resolve(l).then(a,a);return a}]}
3
- export{W,Zt,fd,Qt,Wr,qr,Fn,gd,md,hd,en,tn,Gr,zn,yd};
2
+ var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function W(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function Qt(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function md(e,n=Object.is){return Qt(e,{equals:n})}function en(e,n={}){let r,i=!1,o=()=>{if(i)return;if(r){let c=r;r=void 0;try{c()}catch(u){console.error("[stx] effect cleanup error:",u)}}let t=S(o);try{let c=e();r=typeof c==="function"?c:void 0}catch(c){i=!0,console.error("[stx] effect error (the effect is disposed):",c)}finally{h(t)}};if(n.immediate!==!1)o();return()=>{if(i=!0,r){let t=r;r=void 0,t()}}}function qr(e){C(e)}function Gr(e){k.push(e)}function zn(e){T.push(e)}function hd(){O(k,"onMount",T)}function yd(){O(T,"onDestroy")}function O(e,n,r){let i=e.splice(0,e.length);for(let o of i)try{let t=o();if(r&&typeof t==="function")r.push(t)}catch(t){console.error(`[stx] ${n} callback threw:`,t)}}function bd(){return{mount:k.length,destroy:T.length}}function tn(e){return typeof e==="function"&&e._isSignal===!0}function nn(e){return typeof e==="function"&&e._isDerived===!0}function Kr(e){if(tn(e)||nn(e))return m(()=>e());return e}function Hn(e){return m(e)}function wd(e,n){let r=typeof e==="function"?e:()=>e,i=W([]),o=Qt(()=>i().reduce((u,l)=>n(u,l.action),r())),t=!1;return en(()=>{if(r(),!t){t=!0;return}if(Hn(()=>i().length))i.set([])}),[o,(u,l)=>{let d={action:u};i.set([...i(),d]);let a=()=>{let s=i().filter((y)=>y!==d);if(s.length!==i().length)i.set(s)};if(l&&typeof l.then==="function")Promise.resolve(l).then(a,a);return a}]}
3
+ export{W,Qt,md,en,qr,Gr,zn,hd,yd,bd,tn,nn,Kr,Hn,wd};