@stacksjs/stx 0.2.765 → 0.2.770

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 (228) hide show
  1. package/dist/{chunk-3mf27gj6.js → chunk-07thf07b.js} +2 -2
  2. package/dist/chunk-0cvpkj9g.js +2 -0
  3. package/dist/{chunk-8zgvr0fw.js → chunk-0h3sf5tp.js} +5 -5
  4. package/dist/chunk-0qgdex7z.js +2 -0
  5. package/dist/{chunk-p42kp93g.js → chunk-1925kbjc.js} +1 -1
  6. package/dist/chunk-1hb8q271.js +2 -0
  7. package/dist/chunk-1se5y83a.js +2 -0
  8. package/dist/{chunk-nr3pepv1.js → chunk-2bm97z09.js} +3 -3
  9. package/dist/chunk-2p301rsb.js +2 -0
  10. package/dist/{chunk-scq0h2cs.js → chunk-2vbgm9t4.js} +6 -6
  11. package/dist/chunk-33gccrx0.js +2 -0
  12. package/dist/chunk-3754her2.js +2 -0
  13. package/dist/{chunk-t8cgxk8w.js → chunk-392rrp28.js} +2 -2
  14. package/dist/chunk-3jkbs3fc.js +2 -0
  15. package/dist/{chunk-vy1weqvj.js → chunk-3png7zhs.js} +4 -4
  16. package/dist/chunk-3vankrf5.js +2 -0
  17. package/dist/{chunk-8prk7e1z.js → chunk-3y26rjq6.js} +10 -10
  18. package/dist/{chunk-ysfeg3cn.js → chunk-477gjb2b.js} +2 -2
  19. package/dist/chunk-4jzyd8k0.js +2 -0
  20. package/dist/{chunk-wp4nqnn7.js → chunk-4qng287p.js} +1 -1
  21. package/dist/chunk-4tvty67c.js +2 -0
  22. package/dist/chunk-4xaz5jbs.js +2 -0
  23. package/dist/{chunk-s2py8kg7.js → chunk-4xzk9529.js} +2 -2
  24. package/dist/chunk-53md2scd.js +2 -0
  25. package/dist/chunk-56sek7x7.js +2 -0
  26. package/dist/chunk-5g5v7yns.js +2 -0
  27. package/dist/chunk-5gg5jc76.js +2 -0
  28. package/dist/{chunk-1w4a0xya.js → chunk-5s2dwh5z.js} +11 -11
  29. package/dist/{chunk-qv99gqee.js → chunk-5t33zwwg.js} +1 -1
  30. package/dist/{chunk-dphhs29v.js → chunk-618d3ng3.js} +6 -6
  31. package/dist/chunk-68j6zb7n.js +2 -0
  32. package/dist/{chunk-fz717vpc.js → chunk-6b32wt31.js} +30 -30
  33. package/dist/{chunk-4yk7zngj.js → chunk-6cd5dyje.js} +22 -22
  34. package/dist/{chunk-49w4cbqb.js → chunk-6k4tbms6.js} +6 -6
  35. package/dist/{chunk-q22hwm64.js → chunk-6nf4xhv0.js} +5 -5
  36. package/dist/{chunk-n5dd6rpt.js → chunk-6sa5adg6.js} +2 -2
  37. package/dist/chunk-6wf0ter4.js +2 -0
  38. package/dist/{chunk-rv0yth27.js → chunk-70nwqsf6.js} +4 -4
  39. package/dist/chunk-75st1ttq.js +2 -0
  40. package/dist/{chunk-c1b481my.js → chunk-79x0812m.js} +2 -2
  41. package/dist/chunk-7ctvfad1.js +2 -0
  42. package/dist/{chunk-ftt3r7wh.js → chunk-7g29avcd.js} +5 -5
  43. package/dist/{chunk-2mckhfet.js → chunk-7h0mjwkq.js} +5 -5
  44. package/dist/{chunk-ay5g5cbk.js → chunk-7t1medmh.js} +2 -2
  45. package/dist/{chunk-cswar3zs.js → chunk-7wwfaj6b.js} +3 -3
  46. package/dist/{chunk-ccedry39.js → chunk-7y0v5dry.js} +2 -2
  47. package/dist/chunk-83aq0n9s.js +2 -0
  48. package/dist/{chunk-jb1c4e49.js → chunk-83fh7j8g.js} +2 -2
  49. package/dist/{chunk-as4s0nf5.js → chunk-91q55gjp.js} +3 -3
  50. package/dist/{chunk-xcstrdhp.js → chunk-9ewhnwcg.js} +4 -4
  51. package/dist/chunk-9vgkp3nj.js +2 -0
  52. package/dist/chunk-9vqj5jzp.js +2 -0
  53. package/dist/chunk-a50kn0hn.js +2 -0
  54. package/dist/{chunk-4m3666pm.js → chunk-amnydj3d.js} +1 -1
  55. package/dist/chunk-bpbhjn4w.js +2 -0
  56. package/dist/chunk-bqyj88qr.js +2 -0
  57. package/dist/{chunk-ztbk9yqv.js → chunk-bwzjjxnj.js} +4 -4
  58. package/dist/{chunk-ay02q27h.js → chunk-cak9fp9b.js} +7 -7
  59. package/dist/chunk-cgv3r6q9.js +2 -0
  60. package/dist/{chunk-stww901w.js → chunk-cn7zpm1x.js} +5 -5
  61. package/dist/{chunk-4tppbw4r.js → chunk-cqfyby1t.js} +2 -2
  62. package/dist/{chunk-m3dr63n0.js → chunk-ddhazq2g.js} +3 -3
  63. package/dist/{chunk-m15nbvck.js → chunk-ddjkt87h.js} +1 -1
  64. package/dist/{chunk-t70s45hc.js → chunk-dmj9gk6d.js} +2 -2
  65. package/dist/chunk-e6zv6p3x.js +2 -0
  66. package/dist/chunk-e96jbmkj.js +3 -0
  67. package/dist/{chunk-51dxp9w9.js → chunk-eb8dv03t.js} +3 -3
  68. package/dist/{chunk-c5mbhfff.js → chunk-edetp97r.js} +5 -5
  69. package/dist/chunk-ej4wf9m5.js +2 -0
  70. package/dist/{chunk-zs8yjtaz.js → chunk-erjp2w63.js} +5 -5
  71. package/dist/chunk-exfgfjf6.js +2 -0
  72. package/dist/chunk-fvg2p9z0.js +2 -0
  73. package/dist/chunk-fxvhkz72.js +2 -0
  74. package/dist/chunk-g6m3q9n4.js +2 -0
  75. package/dist/{chunk-2hbwpm36.js → chunk-gn5v004x.js} +14 -14
  76. package/dist/{chunk-bnwkytme.js → chunk-gzcg563a.js} +3 -3
  77. package/dist/{chunk-s9m2gfns.js → chunk-gzxjayvp.js} +6 -6
  78. package/dist/chunk-h2ymq7fa.js +2 -0
  79. package/dist/{chunk-kc3kt59e.js → chunk-hgm6f2t2.js} +2 -2
  80. package/dist/chunk-j1nyasyk.js +2 -0
  81. package/dist/chunk-j46nvncc.js +2 -0
  82. package/dist/chunk-jjvrm2j8.js +2 -0
  83. package/dist/chunk-kh0szwf3.js +2 -0
  84. package/dist/chunk-krdc3c87.js +7 -0
  85. package/dist/chunk-krw4m6j1.js +2 -0
  86. package/dist/{chunk-6h6teyxp.js → chunk-m207mdpy.js} +2 -2
  87. package/dist/{chunk-dxk5r71v.js → chunk-mcct58gb.js} +5 -5
  88. package/dist/{chunk-mmcqgwk7.js → chunk-mdw5sbbt.js} +2 -2
  89. package/dist/chunk-mvfj17fr.js +2 -0
  90. package/dist/{chunk-wb2ej5by.js → chunk-ngzdcvry.js} +1 -1
  91. package/dist/{chunk-pqgk9mxp.js → chunk-nj2q40p8.js} +2 -2
  92. package/dist/chunk-nmjgcw4g.js +2 -0
  93. package/dist/{chunk-ev4zxhpd.js → chunk-nnzmbfjq.js} +2 -2
  94. package/dist/{chunk-6jnrpnxb.js → chunk-nwhv1889.js} +3 -3
  95. package/dist/{chunk-1g5fg1ys.js → chunk-p1mbbdwj.js} +2 -2
  96. package/dist/chunk-p454tj1h.js +2 -0
  97. package/dist/{chunk-n8gfetjx.js → chunk-pgkcbm6g.js} +2 -2
  98. package/dist/{chunk-b8hsvzqb.js → chunk-pkyb284z.js} +2 -2
  99. package/dist/{chunk-7aw9qm74.js → chunk-prxe37hj.js} +41 -41
  100. package/dist/{chunk-e1e5xf8z.js → chunk-q3c130w6.js} +13 -13
  101. package/dist/chunk-q4m5p4wx.js +2 -0
  102. package/dist/chunk-q85s8ne0.js +2 -0
  103. package/dist/chunk-qe3hrbge.js +2 -0
  104. package/dist/{chunk-mpaepc7n.js → chunk-qk61pv1v.js} +79 -9
  105. package/dist/chunk-qq4ee7px.js +2 -0
  106. package/dist/chunk-qr5ddqbf.js +3 -0
  107. package/dist/{chunk-vvm38ysm.js → chunk-qsc5nse5.js} +1 -1
  108. package/dist/{chunk-et831a4y.js → chunk-qtja7fpr.js} +2 -2
  109. package/dist/{chunk-a2yptg7r.js → chunk-rc4zsymn.js} +2 -2
  110. package/dist/chunk-rfp5f55f.js +2 -0
  111. package/dist/{chunk-fjbhtakz.js → chunk-rjh7ptw5.js} +1 -1
  112. package/dist/{chunk-7yx2ztt5.js → chunk-rkz3k2td.js} +3 -3
  113. package/dist/{chunk-zfaa5xn5.js → chunk-s3m1ggsn.js} +6 -6
  114. package/dist/{chunk-qv2k0qb1.js → chunk-s8p958da.js} +65 -64
  115. package/dist/{chunk-a627f39k.js → chunk-ssd9g1wz.js} +1 -1
  116. package/dist/{chunk-0nzeqc13.js → chunk-tahdfsp4.js} +2 -2
  117. package/dist/chunk-th7amyq4.js +2 -0
  118. package/dist/chunk-v95kersm.js +2 -0
  119. package/dist/{chunk-0d29b573.js → chunk-vht2rhrj.js} +4 -4
  120. package/dist/{chunk-mdtjjzqc.js → chunk-vke28xq8.js} +2 -2
  121. package/dist/{chunk-vkpmemb1.js → chunk-w07n2ddj.js} +2 -2
  122. package/dist/chunk-w1sjp421.js +2 -0
  123. package/dist/chunk-w5d936jr.js +2 -0
  124. package/dist/{chunk-zjar9jdd.js → chunk-wabahwkj.js} +2 -2
  125. package/dist/{chunk-1day2nbr.js → chunk-x0qtgyqr.js} +5 -5
  126. package/dist/{chunk-dvh63p75.js → chunk-x148cxrj.js} +4 -4
  127. package/dist/chunk-x3xtyr95.js +2 -0
  128. package/dist/{chunk-h8yk9qm7.js → chunk-xaqtk05e.js} +2 -2
  129. package/dist/chunk-xb16yy2x.js +2 -0
  130. package/dist/{chunk-74y29xxs.js → chunk-xr28hjkp.js} +6 -6
  131. package/dist/{chunk-t6d7m4tf.js → chunk-y6hyndrt.js} +9 -9
  132. package/dist/chunk-yavspk55.js +2 -0
  133. package/dist/{chunk-tqf8a258.js → chunk-yjzczm2s.js} +10 -10
  134. package/dist/chunk-yrh9yfnv.js +2 -0
  135. package/dist/chunk-ysm6gaq9.js +2 -0
  136. package/dist/{chunk-knzp4c6m.js → chunk-ytjhb81r.js} +3 -3
  137. package/dist/{chunk-07c8rk93.js → chunk-yzbdm457.js} +2 -2
  138. package/dist/{chunk-8hanmv49.js → chunk-z1br7qeb.js} +31 -4
  139. package/dist/chunk-z515xymr.js +2 -0
  140. package/dist/{chunk-nj5azxxj.js → chunk-z5vkzbct.js} +4 -4
  141. package/dist/chunk-z6xfmrtc.js +2 -0
  142. package/dist/{chunk-kwy0spcd.js → chunk-z846tgfe.js} +3 -3
  143. package/dist/chunk-za7v4w04.js +2 -0
  144. package/dist/chunk-zb8wv7sc.js +2 -0
  145. package/dist/{chunk-z6sg0dq3.js → chunk-zsfr4dv9.js} +4 -4
  146. package/dist/cli.js +19 -19
  147. package/dist/client/signals-for-runtime.js +2 -0
  148. package/dist/client/signals-if-runtime.js +2 -0
  149. package/dist/client/signals-loop-conditional-runtime.js +66 -0
  150. package/dist/component-contract-checks.js +3 -2
  151. package/dist/craft-entry.js +2 -2
  152. package/dist/craft.js +2 -2
  153. package/dist/expressions.js +15 -0
  154. package/dist/message-catalogs.d.ts +6 -0
  155. package/dist/message-catalogs.js +12 -8
  156. package/dist/native/event-names.js +2 -0
  157. package/dist/native/prop-names.js +2 -0
  158. package/dist/process.js +18 -4
  159. package/dist/pwa.js +3 -3
  160. package/dist/signal-processing.d.ts +12 -0
  161. package/dist/signal-processing.js +12 -1
  162. package/dist/ssg.js +4 -4
  163. package/dist/types/config-types.d.ts +1 -0
  164. package/dist/web-modules.d.ts +9 -0
  165. package/dist/web-modules.js +47 -0
  166. package/package.json +5 -5
  167. package/dist/chunk-01484snf.js +0 -2
  168. package/dist/chunk-09cera09.js +0 -2
  169. package/dist/chunk-0f5276fm.js +0 -2
  170. package/dist/chunk-16n128gh.js +0 -2
  171. package/dist/chunk-171bbyqv.js +0 -2
  172. package/dist/chunk-1g0g498y.js +0 -2
  173. package/dist/chunk-1qppvj48.js +0 -2
  174. package/dist/chunk-1z77g0j6.js +0 -2
  175. package/dist/chunk-31e7xkrt.js +0 -2
  176. package/dist/chunk-3ffz7pd4.js +0 -2
  177. package/dist/chunk-4bhbtvtm.js +0 -2
  178. package/dist/chunk-59r38w60.js +0 -2
  179. package/dist/chunk-5ttj2c0h.js +0 -2
  180. package/dist/chunk-5x312c05.js +0 -2
  181. package/dist/chunk-65h2h51z.js +0 -2
  182. package/dist/chunk-6ch8t3d9.js +0 -3
  183. package/dist/chunk-6rd0zz6k.js +0 -2
  184. package/dist/chunk-7bvhpdqv.js +0 -2
  185. package/dist/chunk-axxd53tn.js +0 -2
  186. package/dist/chunk-b8ar6431.js +0 -2
  187. package/dist/chunk-bnm7ym0g.js +0 -2
  188. package/dist/chunk-brg2ydrk.js +0 -2
  189. package/dist/chunk-bwkw2dw3.js +0 -2
  190. package/dist/chunk-c0fwppzc.js +0 -2
  191. package/dist/chunk-c5kpc7rn.js +0 -2
  192. package/dist/chunk-c8256r1a.js +0 -2
  193. package/dist/chunk-cap6exxx.js +0 -2
  194. package/dist/chunk-cft1sprt.js +0 -2
  195. package/dist/chunk-dt0deg4z.js +0 -2
  196. package/dist/chunk-ejqr5cva.js +0 -2
  197. package/dist/chunk-evbxyw80.js +0 -2
  198. package/dist/chunk-f66n66c8.js +0 -2
  199. package/dist/chunk-f6h8yagj.js +0 -2
  200. package/dist/chunk-fpsm2qed.js +0 -2
  201. package/dist/chunk-fta169tc.js +0 -7
  202. package/dist/chunk-fzf7yfpn.js +0 -2
  203. package/dist/chunk-gaatje2g.js +0 -2
  204. package/dist/chunk-hfcmbbkq.js +0 -2
  205. package/dist/chunk-jhz0dvqz.js +0 -2
  206. package/dist/chunk-k54pgbzm.js +0 -2
  207. package/dist/chunk-kkx2gqk8.js +0 -2
  208. package/dist/chunk-n9zka6dg.js +0 -2
  209. package/dist/chunk-pvx57vpw.js +0 -2
  210. package/dist/chunk-qcz104h3.js +0 -2
  211. package/dist/chunk-qgvez75f.js +0 -2
  212. package/dist/chunk-r0j6jkxc.js +0 -2
  213. package/dist/chunk-rzh4xgb4.js +0 -2
  214. package/dist/chunk-rzv9xcyp.js +0 -2
  215. package/dist/chunk-s922mx0k.js +0 -2
  216. package/dist/chunk-sy4wqxta.js +0 -2
  217. package/dist/chunk-szdm8wfn.js +0 -2
  218. package/dist/chunk-t424gvwc.js +0 -2
  219. package/dist/chunk-vtvaa8y9.js +0 -2
  220. package/dist/chunk-vvj09a7b.js +0 -2
  221. package/dist/chunk-vwjy6491.js +0 -2
  222. package/dist/chunk-w2nzevn0.js +0 -2
  223. package/dist/chunk-wadp2rmj.js +0 -2
  224. package/dist/chunk-wbkcwj27.js +0 -2
  225. package/dist/chunk-wzp8y0a4.js +0 -2
  226. package/dist/chunk-xc1he6hs.js +0 -2
  227. package/dist/chunk-ytzzth34.js +0 -2
  228. package/dist/chunk-zhxg6b64.js +0 -2
@@ -470,6 +470,19 @@ const reportedUnresolvedScriptExpressions = new Set;
470
470
  function looksLikeServerValue(expression) {
471
471
  return /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(expression.trim());
472
472
  }
473
+ function isBraceLiteralInCode(source, offset, expr) {
474
+ const quote = expr[0];
475
+ if (quote !== "'" && quote !== '"' && quote !== "`")
476
+ return !1;
477
+ let count = 0;
478
+ for (let i = source.lastIndexOf(`
479
+ `, offset - 1) + 1;i < offset; i++)
480
+ if (source[i] === "\\")
481
+ i++;
482
+ else if (source[i] === quote)
483
+ count++;
484
+ return count % 2 === 1;
485
+ }
473
486
  function unresolvedServerValue(expression, filePath) {
474
487
  const key = `${filePath ?? "<unknown>"}\x00${expression}`;
475
488
  if (process.env.STX_DEBUG || !reportedUnresolvedScriptExpressions.has(key)) {
@@ -492,6 +505,8 @@ export function interpolateScriptExpressions(scriptBody, context, filePath) {
492
505
  });
493
506
  output = replaceInterpolations(output, (match, expr, offset) => {
494
507
  const trimmed = expr.trim();
508
+ if (isBraceLiteralInCode(output, offset, expr))
509
+ return match;
495
510
  if (/^__[A-Z_]+__$/.test(trimmed))
496
511
  return match;
497
512
  try {
@@ -1,5 +1,11 @@
1
1
  /** Read every language's message modules, at build time. */
2
2
  export declare function collectMessageCatalogs(root: string, options: MessageCatalogsOptions): Promise<CollectedMessages>;
3
+ /**
4
+ * A file's path as written and as Bun may resolve it, the keys a module
5
+ * substitute is found by. macOS's /var and /tmp are links into /private, and
6
+ * a project there is named either way depending on who resolved it.
7
+ */
8
+ export declare function pathSpellings(file: string): string[];
3
9
  /**
4
10
  * Whether web pages ship messages a language at a time: with the `messages`
5
11
  * option, in production. `STX_PAGE_MESSAGES=0` turns it off; `=1` turns it
@@ -44,6 +44,16 @@ function pageMessagesStub(language, area) {
44
44
  export default kept[${key}] || (kept[${key}] = {});`;
45
45
  }
46
46
  const collected = new Map;
47
+ export function pathSpellings(file) {
48
+ const names = [file];
49
+ try {
50
+ names.push(realpathSync(file));
51
+ } catch {}
52
+ for (const named of [...names])
53
+ if (named.startsWith("/private/"))
54
+ names.push(named.slice(8));
55
+ return [...new Set(names)];
56
+ }
47
57
  export function pageMessagesEnabled(options, env = process.env) {
48
58
  if (!options.messages || env.STX_PAGE_MESSAGES === "0")
49
59
  return !1;
@@ -61,14 +71,8 @@ export async function loadPageMessages(root, options) {
61
71
  return cached.messages;
62
72
  const catalogs = await collectMessageCatalogs(root, options), stubs = new Map;
63
73
  for (const [file, { language, area }] of catalogs.files) {
64
- const stub = pageMessagesStub(language, area), names = [file];
65
- try {
66
- names.push(realpathSync(file));
67
- } catch {}
68
- for (const named of [...names])
69
- if (named.startsWith("/private/"))
70
- names.push(named.slice(8));
71
- for (const named of names)
74
+ const stub = pageMessagesStub(language, area);
75
+ for (const named of pathSpellings(file))
72
76
  stubs.set(named, stub);
73
77
  }
74
78
  const fallback = options.fallback ?? options.languages[0];
@@ -23,6 +23,8 @@ export const NATIVE_EVENT_NAMES = {
23
23
  submitediting: "onSubmitEditing",
24
24
  "accept-completion": "onAcceptCompletion",
25
25
  acceptcompletion: "onAcceptCompletion",
26
+ "selection-change": "onSelectionChange",
27
+ selectionchange: "onSelectionChange",
26
28
  "end-editing": "onEndEditing",
27
29
  endediting: "onEndEditing",
28
30
  scroll: "onScroll",
@@ -100,6 +100,8 @@ const NATIVE_PROP_NAMES = [
100
100
  "autoScrollBottom",
101
101
  "scrollKey",
102
102
  "ghostText",
103
+ "rowHeight",
104
+ "labelFontSize",
103
105
  "pictureInPicture",
104
106
  "transitionID"
105
107
  ];
package/dist/process.js CHANGED
@@ -302,15 +302,22 @@ async function buildPageBundles(result, options, dependencies, context) {
302
302
  return built;
303
303
  }
304
304
  async function pageBundleTags(result, options, dependencies, context = {}) {
305
- const { withModuleSubstitutes, moduleSubstitutionKey } = await import("./client-script-bundler.js"), catalogs = await import("./message-catalogs.js"), messagesOption = options.messages;
306
- let messages = null;
307
- if (messagesOption && catalogs.pageMessagesEnabled(options) && moduleSubstitutionKey() === "" && !context.__stx_native_screen)
305
+ const { withModuleSubstitutes, moduleSubstitutionKey } = await import("./client-script-bundler.js"), catalogs = await import("./message-catalogs.js"), { messages: messagesOption, webModules: webModulesOption } = options;
306
+ let messages = null, standIns = null;
307
+ const substitutable = moduleSubstitutionKey() === "" && !context.__stx_native_screen;
308
+ if (messagesOption && catalogs.pageMessagesEnabled(options) && substitutable)
308
309
  try {
309
310
  messages = await catalogs.loadPageMessages(process.cwd(), messagesOption);
310
311
  } catch (error) {
311
312
  warnPageMessagesOnce(error);
312
313
  }
313
- const build = () => buildPageBundles(result, options, dependencies, context), built = messages ? await withModuleSubstitutes(messages.stubs, build) : await build();
314
+ if (webModulesOption && Object.keys(webModulesOption).length && substitutable)
315
+ try {
316
+ standIns = await (await import("./web-modules.js")).loadWebModules(process.cwd(), webModulesOption);
317
+ } catch (error) {
318
+ warnWebModulesOnce(error);
319
+ }
320
+ const substitutes = new Map([...standIns ?? [], ...messages?.stubs ?? []]), build = () => buildPageBundles(result, options, dependencies, context), built = substitutes.size ? await withModuleSubstitutes(substitutes, build) : await build();
314
321
  let messagesTag = null;
315
322
  if (messages) {
316
323
  const areas = catalogs.messageAreasIn(built.modulesCode, built.storeCode, built.composableCode), code = catalogs.pageMessagesScript(messages, catalogs.pageLanguages(result, messages), areas);
@@ -328,6 +335,13 @@ function warnPageMessagesOnce(error) {
328
335
  warnedPageMessages = !0;
329
336
  console.warn(`[stx] messages: ${error instanceof Error ? error.message : String(error)}; pages ship every language`);
330
337
  }
338
+ let warnedWebModules = !1;
339
+ function warnWebModulesOnce(error) {
340
+ if (warnedWebModules)
341
+ return;
342
+ warnedWebModules = !0;
343
+ console.warn(`[stx] ${error instanceof Error ? error.message : String(error)}; pages bundle the real modules`);
344
+ }
331
345
  function placeSignalsRuntimeBeforeScripts(html, afterRuntime = "") {
332
346
  const runtime = findScriptBlockByAttribute(html, "data-stx-runtime");
333
347
  if (!runtime)
package/dist/pwa.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{Js,zt,yl,wg}from"./chunk-dvh63p75.js";import{Gs,$i,hg,yg,bg}from"./chunk-74y29xxs.js";import{gl,ml,hl,gg,mg}from"./chunk-mdtjjzqc.js";import{Ue,En,Ri}from"./chunk-ev4zxhpd.js";import{vg,xg,Sg,kg,Ys,oy}from"./chunk-et831a4y.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
3
- Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-b8ar6431.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
2
+ import{Ys,zt,bl,xg}from"./chunk-x148cxrj.js";import{Js,Ri,bg,wg,vg}from"./chunk-xr28hjkp.js";import{ml,hl,yl,hg,yg}from"./chunk-vke28xq8.js";import{Ue,En,Ai}from"./chunk-nnzmbfjq.js";import{Sg,kg,_g,Cg,Zs,ay}from"./chunk-qtja7fpr.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
3
+ Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-krw4m6j1.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
4
4
  <html lang="en">
5
5
  <head>
6
6
  <meta charset="UTF-8">
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
233
233
  }, 5000);
234
234
  </script>
235
235
  </body>
236
- </html>`}function b(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=Ue(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=Js(n,t);if(a){let s=zt(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return $i(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,ml as auditBuildOutput,gl as auditConfig,re as buildPwaAssets,hl as calculateAuditResult,mg as formatAuditResult,Ri as formatSize,j as generateManifest,_ as generateManifestJson,yg as generateManifestLink,F as generateOfflinePage,Ue as generatePrecacheManifest,En as generatePrecacheManifestJs,M as generatePwaIcons,Gs as generatePwaTags,Js as generateServiceWorker,wg as generateServiceWorkerAuto,hg as generateSwRegistrationScript,bg as generateThemeColorMeta,N as getExpectedIconPaths,zt as getServiceWorkerFileName,$i as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,yl as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,Ys as pwaDirectives,vg as pwaInstallDirective,Sg as pwaOfflineDirective,kg as pwaPushDirective,xg as pwaUpdateDirective,oy as registerPwaDirectives,gg as runPwaAudit,D as validateManifest};
236
+ </html>`}function b(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=Ue(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=Ys(n,t);if(a){let s=zt(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Ri(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,hl as auditBuildOutput,ml as auditConfig,re as buildPwaAssets,yl as calculateAuditResult,yg as formatAuditResult,Ai as formatSize,j as generateManifest,_ as generateManifestJson,wg as generateManifestLink,F as generateOfflinePage,Ue as generatePrecacheManifest,En as generatePrecacheManifestJs,M as generatePwaIcons,Js as generatePwaTags,Ys as generateServiceWorker,xg as generateServiceWorkerAuto,bg as generateSwRegistrationScript,vg as generateThemeColorMeta,N as getExpectedIconPaths,zt as getServiceWorkerFileName,Ri as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,bl as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,Zs as pwaDirectives,Sg as pwaInstallDirective,_g as pwaOfflineDirective,Cg as pwaPushDirective,kg as pwaUpdateDirective,ay as registerPwaDirectives,hg as runPwaAudit,D as validateManifest};
@@ -111,6 +111,18 @@ export declare function convertSignalDirectivesToAttributes(template: string, co
111
111
  * - elements inside `<script>` / `<style>` bodies
112
112
  */
113
113
  export declare function preEvalLiteralReactiveIfs(template: string): string;
114
+ /**
115
+ * `{{ }}` inside a JS string of a reactive attribute, within a client loop.
116
+ *
117
+ * The loop body is evaluated in the browser, where `{{ item.id }}` in an
118
+ * element's text reads the loop's `item`. The value of a `:class`, `@click`
119
+ * or other reactive attribute is not text but a JavaScript expression, and the
120
+ * runtime never looks for a placeholder inside it: `@click="pick('{{ item.id }}')"`
121
+ * passed the literal characters `{{ item.id }}` (stacksjs/stx#2140). The
122
+ * placeholder is rewritten to the expression it names, so the string becomes a
123
+ * template literal that reads the loop variable.
124
+ */
125
+ export declare function bindLoopInterpolations(html: string): string;
114
126
  /**
115
127
  * A `:for` over `<script server>` data becomes a server loop (stacksjs/stx#2051).
116
128
  *
@@ -552,6 +552,17 @@ export function preEvalLiteralReactiveIfs(template) {
552
552
  return output;
553
553
  }
554
554
  const LOOP_ATTRS = [":for", "@for", "x-for"];
555
+ export function bindLoopInterpolations(html) {
556
+ const reactive = /(\s)((?::|@|x-|v-)[\w.:-]+)\s*=\s*"([^"]*\{\{[^"]*)"/g;
557
+ return html.replace(reactive, (whole, space, name, value) => {
558
+ const bound = value.replace(/'((?:[^'\\]|\\.)*)'/g, (literal, body) => {
559
+ if (!body.includes("{{"))
560
+ return literal;
561
+ return `\`${body.replace(/`/g, "\\`").replace(/\$\{/g, "\\${").replace(/\{\{\s*([^}]+?)\s*\}\}/g, (_, expression) => `\${${expression}}`)}\``;
562
+ });
563
+ return `${space}${name}="${bound}"`;
564
+ });
565
+ }
555
566
  export function convertServerLoopAttributesToDirectives(template, context) {
556
567
  if (!context || Object.keys(context).length === 0)
557
568
  return template;
@@ -655,7 +666,7 @@ export function convertSignalLoopsToAttributes(template, context) {
655
666
  delete nestedContext[parsed.itemVar];
656
667
  if (parsed.indexVar)
657
668
  delete nestedContext[parsed.indexVar];
658
- const convertedContent = convertSignalLoopsToAttributes(content, nestedContext), singleElementMatch = convertedContent.match(SINGLE_ELEMENT_RE);
669
+ const convertedContent = bindLoopInterpolations(convertSignalLoopsToAttributes(content, nestedContext)), singleElementMatch = convertedContent.match(SINGLE_ELEMENT_RE);
659
670
  let replacement;
660
671
  if (singleElementMatch) {
661
672
  const [, tag, attrs, innerContent] = singleElementMatch;
package/dist/ssg.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import"./chunk-wmnzapn8.js";import{w,Zc}from"./chunk-1w4a0xya.js";import"./chunk-07c8rk93.js";import"./chunk-4833k99b.js";import{$t,S}from"./chunk-qv2k0qb1.js";import"./chunk-1g5fg1ys.js";import"./chunk-t8cgxk8w.js";import"./chunk-c1b481my.js";import{St,kt,_t,Ct,Et,Tt}from"./chunk-8hanmv49.js";import{a}from"./chunk-tqf8a258.js";import{ks}from"./chunk-ay02q27h.js";import"./chunk-ztbk9yqv.js";import"./chunk-c5mbhfff.js";import{he,Qt,en}from"./chunk-rv0yth27.js";import"./chunk-b8hsvzqb.js";import{y}from"./chunk-s9m2gfns.js";import{ht,i}from"./chunk-7aw9qm74.js";import"./chunk-z6sg0dq3.js";import"./chunk-49w4cbqb.js";import{ls}from"./chunk-t6d7m4tf.js";import"./chunk-kwy0spcd.js";import"./chunk-h8yk9qm7.js";import{Ka,Xa,Ga}from"./chunk-7yx2ztt5.js";import{Yt,Jn,Yn}from"./chunk-wwnqbv9j.js";import{Zt}from"./chunk-vvm38ysm.js";import"./chunk-6ch8t3d9.js";import"./chunk-vkpmemb1.js";import{X,we}from"./chunk-dxk5r71v.js";import"./chunk-qv99gqee.js";import"./chunk-knzp4c6m.js";import{l}from"./chunk-s2py8kg7.js";import{s,ge}from"./chunk-nr3pepv1.js";import D from"fs";import f from"path";import{createHash as Pt}from"crypto";function Dt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Rt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function It(t){return Bun.hash(t).toString(16)}function ot(t,r={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let n=new Map,o=t.replace(Rt,(e,u,g,v)=>{let x=v.trim();if(!x)return e;if(/\bdata-stx-src=/.test(g))return e;if(r.minify)x=Dt(x);let p=It(x);if(!n.has(p))n.set(p,x);let P=r.integrity?` data-stx-integrity="sha384-${Pt("sha384").update(x).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),c=Array.from(n,([e,u])=>({hash:e,code:u}));return{html:o,chunks:c}}var Bt=new Set(["visible","idle"]);function ct(t){if(!t.includes("data-stx-src="))return t;let r=new Map,n=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=n.exec(t))!==null)r.set(o[1],o[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(Bt.has(r.get(u[1])||""))c.add(u[2]);let g=/<\/head\s*>/iy,v=S(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(c.size===0||v===-1)return t;let x=Array.from(c).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!x)return t;return t.slice(0,v)+x+t.slice(v)}var jt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function K(t){let r=t.trim();if(!r)return null;let n=/^https?:\/\//i.test(r)?r:`https://${r}`;try{return new URL(n).origin+new URL(n).pathname.replace(/\/$/,"")}catch{return null}}function Ft(t){for(let r of jt){let n=t[r];if(!n)continue;let o=K(n);if(o)return{url:o,source:"env",via:r}}return null}function lt(t){if(!t||typeof t!=="object")return null;let r=t,n=r.site?.url??r.url??r.app?.url;return typeof n==="string"?K(n):null}async function At(t){let{existsSync:r}=await import("fs"),n=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=n.resolve(t,o);if(!r(c))continue;try{let e=await import(c),u=lt(e.default??e);if(u)return u}catch{}}return null}async function ut(t={}){let r=t.cwd??process.cwd(),n=t.env??process.env;if(t.explicit){let u=K(t.explicit);if(u)return{url:u,source:"option"}}let o=lt(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let c=await At(r);if(c)return{url:c,source:"site.config",via:"url"};let e=Ft(n);if(e)return e;return{url:"http://localhost",source:"fallback"}}function dt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
- `)}function q(t){return async()=>({paths:await t(),fallback:!1})}var Ot;function Lt(t){let r=s(t),{depths:n}=ge(r),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,c;while((c=o.exec(r))!==null){if(n[c.index]!==0)continue;let u=w(r,"(",")",o.lastIndex-1),g=r.indexOf("{",u+1),v=w(r,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(c.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((c=e.exec(r))!==null){if(n[c.index]!==0)continue;let u=Zc(r,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function gt(t){let r="read";try{let n=await Bun.file(t).text();r="parse";let o=Zt(n),c=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(s(e.attrs))).sort((e,u)=>n.indexOf(e.fullTag)-n.indexOf(u.fullTag));for(let e of c){if(!/\bgetStaticPaths\b/.test(s(e.content)))continue;let u=(Ot??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(s(u)))continue;let g=Lt(u);if(/\bdefineStaticPaths\b/.test(s(g))&&$t(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");r="execute";let v=Function("defineStaticPaths",`return (${g})`)(q);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let x=await v();r="result";let p=Array.isArray(x)?{paths:x}:x;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(n){return{kind:"error",phase:r,error:n instanceof Error?n:Error(String(n))}}}class pt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,r=""){this.cacheDir=t,this.salt=r}async load(){if(this.loaded)return;let t=f.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let r=JSON.parse(await Bun.file(t).text());for(let[n,o]of Object.entries(r))this.cache.set(n,o)}catch{}this.loaded=!0}async save(){await D.promises.mkdir(this.cacheDir,{recursive:!0});let t=f.join(this.cacheDir,"build-cache.json"),r={};for(let[n,o]of this.cache)r[n]=o;await Bun.write(t,JSON.stringify(r))}getHash(t,r){let n=D.statSync(t),o=`${this.salt}|${t}:${n.mtimeMs}`;for(let e of r)if(D.existsSync(e)){let u=D.statSync(e);o+=`:${e}:${u.mtimeMs}`}let c=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);c=(c<<5)-c+u,c=c&c}return Math.abs(c).toString(36)}get(t,r){let n=this.cache.get(t);if(!n)return null;let o=mt(r).some((u)=>D.existsSync(u)),c=[r,...n.dependencies??[]].some((u)=>u.endsWith(".stx")&&D.existsSync(u)&&ls(D.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||c)return this.cache.delete(t),null;let e=this.getHash(r,n.dependencies??[]);if(n.hash!==e)return this.cache.delete(t),null;return n.html}set(t,r,n,o){let c=this.getHash(r,n);this.cache.set(t,{hash:c,html:o,generatedAt:Date.now(),dependencies:n})}}class ft{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let r=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return f.join(this.cacheDir,"isr",r)}async get(t){let r=this.getFilePath(t);if(!await Bun.file(r).exists())return null;try{return JSON.parse(await Bun.file(r).text())}catch{return null}}async set(t,r){let n=this.getFilePath(t);await D.promises.mkdir(f.dirname(n),{recursive:!0}),await Bun.write(n,JSON.stringify(r))}async invalidate(t){let r=this.getFilePath(t);if(await Bun.file(r).exists())await D.promises.unlink(r)}async invalidatePattern(t){let r=f.join(this.cacheDir,"isr");if(!D.existsSync(r))return;let n=await D.promises.readdir(r);for(let o of n){let c=o.replace(/_/g,"/").replace(".json","");if(t.test(c))await D.promises.unlink(f.join(r,o))}}async needsRevalidation(t){let r=await this.get(t);if(!r)return!0;return Date.now()>r.revalidateAfter}}async function Ut(t){let r=[];if(!t.isDynamic)r.push({url:t.pattern,params:{}});else{let n=await gt(t.filePath);if(n.kind==="error")throw Error(`getStaticPaths ${n.phase} failed for ${t.pattern} (${t.filePath}): ${n.error.message}`,{cause:n.error});if(n.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),r;let o=n.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),r;for(let c of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(c.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);r.push({url:e,params:c.params,props:c.props,revalidate:c.revalidate})}}return r}function mt(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function Mt(t){for(let r of mt(t))if(await Bun.file(r).exists())try{let n=await import(r);if(typeof n.default==="function")return await n.default();else if(typeof n.default==="object")return n.default;else if(typeof n.getData==="function")return await n.getData();else{let{default:o,...c}=n;return c}}catch(n){console.error(`Error loading data file ${r}:`,n)}return null}async function Gt(t,r,n){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let c=o[1];if(!c.includes("getStaticProps"))return null;try{let e=c.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
2
+ import"./chunk-wmnzapn8.js";import{w,Qc}from"./chunk-5s2dwh5z.js";import"./chunk-yzbdm457.js";import"./chunk-4833k99b.js";import{$t,S}from"./chunk-s8p958da.js";import"./chunk-p1mbbdwj.js";import"./chunk-392rrp28.js";import"./chunk-79x0812m.js";import{St,kt,_t,Ct,Et,Tt}from"./chunk-z1br7qeb.js";import{a}from"./chunk-yjzczm2s.js";import{_s}from"./chunk-cak9fp9b.js";import"./chunk-bwzjjxnj.js";import"./chunk-edetp97r.js";import{he,Qt,en}from"./chunk-70nwqsf6.js";import"./chunk-pkyb284z.js";import{y}from"./chunk-gzxjayvp.js";import{ht,i}from"./chunk-prxe37hj.js";import"./chunk-zsfr4dv9.js";import"./chunk-6k4tbms6.js";import{us}from"./chunk-y6hyndrt.js";import"./chunk-z846tgfe.js";import"./chunk-xaqtk05e.js";import{Xa,Ga,Ja}from"./chunk-rkz3k2td.js";import{Yt,Jn,Yn}from"./chunk-wwnqbv9j.js";import{Zt}from"./chunk-qsc5nse5.js";import"./chunk-e96jbmkj.js";import"./chunk-w07n2ddj.js";import{X,we}from"./chunk-mcct58gb.js";import"./chunk-5t33zwwg.js";import"./chunk-ytjhb81r.js";import{l}from"./chunk-4xzk9529.js";import{s,ge}from"./chunk-2bm97z09.js";import D from"fs";import f from"path";import{createHash as Pt}from"crypto";function Dt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Rt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function It(t){return Bun.hash(t).toString(16)}function ot(t,r={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let n=new Map,o=t.replace(Rt,(e,u,g,v)=>{let x=v.trim();if(!x)return e;if(/\bdata-stx-src=/.test(g))return e;if(r.minify)x=Dt(x);let p=It(x);if(!n.has(p))n.set(p,x);let P=r.integrity?` data-stx-integrity="sha384-${Pt("sha384").update(x).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),c=Array.from(n,([e,u])=>({hash:e,code:u}));return{html:o,chunks:c}}var Bt=new Set(["visible","idle"]);function ct(t){if(!t.includes("data-stx-src="))return t;let r=new Map,n=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=n.exec(t))!==null)r.set(o[1],o[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(Bt.has(r.get(u[1])||""))c.add(u[2]);let g=/<\/head\s*>/iy,v=S(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(c.size===0||v===-1)return t;let x=Array.from(c).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!x)return t;return t.slice(0,v)+x+t.slice(v)}var jt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function K(t){let r=t.trim();if(!r)return null;let n=/^https?:\/\//i.test(r)?r:`https://${r}`;try{return new URL(n).origin+new URL(n).pathname.replace(/\/$/,"")}catch{return null}}function Ft(t){for(let r of jt){let n=t[r];if(!n)continue;let o=K(n);if(o)return{url:o,source:"env",via:r}}return null}function lt(t){if(!t||typeof t!=="object")return null;let r=t,n=r.site?.url??r.url??r.app?.url;return typeof n==="string"?K(n):null}async function At(t){let{existsSync:r}=await import("fs"),n=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=n.resolve(t,o);if(!r(c))continue;try{let e=await import(c),u=lt(e.default??e);if(u)return u}catch{}}return null}async function ut(t={}){let r=t.cwd??process.cwd(),n=t.env??process.env;if(t.explicit){let u=K(t.explicit);if(u)return{url:u,source:"option"}}let o=lt(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let c=await At(r);if(c)return{url:c,source:"site.config",via:"url"};let e=Ft(n);if(e)return e;return{url:"http://localhost",source:"fallback"}}function dt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
+ `)}function q(t){return async()=>({paths:await t(),fallback:!1})}var Ot;function Lt(t){let r=s(t),{depths:n}=ge(r),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,c;while((c=o.exec(r))!==null){if(n[c.index]!==0)continue;let u=w(r,"(",")",o.lastIndex-1),g=r.indexOf("{",u+1),v=w(r,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(c.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((c=e.exec(r))!==null){if(n[c.index]!==0)continue;let u=Qc(r,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function gt(t){let r="read";try{let n=await Bun.file(t).text();r="parse";let o=Zt(n),c=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(s(e.attrs))).sort((e,u)=>n.indexOf(e.fullTag)-n.indexOf(u.fullTag));for(let e of c){if(!/\bgetStaticPaths\b/.test(s(e.content)))continue;let u=(Ot??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(s(u)))continue;let g=Lt(u);if(/\bdefineStaticPaths\b/.test(s(g))&&$t(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");r="execute";let v=Function("defineStaticPaths",`return (${g})`)(q);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let x=await v();r="result";let p=Array.isArray(x)?{paths:x}:x;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(n){return{kind:"error",phase:r,error:n instanceof Error?n:Error(String(n))}}}class pt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,r=""){this.cacheDir=t,this.salt=r}async load(){if(this.loaded)return;let t=f.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let r=JSON.parse(await Bun.file(t).text());for(let[n,o]of Object.entries(r))this.cache.set(n,o)}catch{}this.loaded=!0}async save(){await D.promises.mkdir(this.cacheDir,{recursive:!0});let t=f.join(this.cacheDir,"build-cache.json"),r={};for(let[n,o]of this.cache)r[n]=o;await Bun.write(t,JSON.stringify(r))}getHash(t,r){let n=D.statSync(t),o=`${this.salt}|${t}:${n.mtimeMs}`;for(let e of r)if(D.existsSync(e)){let u=D.statSync(e);o+=`:${e}:${u.mtimeMs}`}let c=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);c=(c<<5)-c+u,c=c&c}return Math.abs(c).toString(36)}get(t,r){let n=this.cache.get(t);if(!n)return null;let o=mt(r).some((u)=>D.existsSync(u)),c=[r,...n.dependencies??[]].some((u)=>u.endsWith(".stx")&&D.existsSync(u)&&us(D.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||c)return this.cache.delete(t),null;let e=this.getHash(r,n.dependencies??[]);if(n.hash!==e)return this.cache.delete(t),null;return n.html}set(t,r,n,o){let c=this.getHash(r,n);this.cache.set(t,{hash:c,html:o,generatedAt:Date.now(),dependencies:n})}}class ft{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let r=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return f.join(this.cacheDir,"isr",r)}async get(t){let r=this.getFilePath(t);if(!await Bun.file(r).exists())return null;try{return JSON.parse(await Bun.file(r).text())}catch{return null}}async set(t,r){let n=this.getFilePath(t);await D.promises.mkdir(f.dirname(n),{recursive:!0}),await Bun.write(n,JSON.stringify(r))}async invalidate(t){let r=this.getFilePath(t);if(await Bun.file(r).exists())await D.promises.unlink(r)}async invalidatePattern(t){let r=f.join(this.cacheDir,"isr");if(!D.existsSync(r))return;let n=await D.promises.readdir(r);for(let o of n){let c=o.replace(/_/g,"/").replace(".json","");if(t.test(c))await D.promises.unlink(f.join(r,o))}}async needsRevalidation(t){let r=await this.get(t);if(!r)return!0;return Date.now()>r.revalidateAfter}}async function Ut(t){let r=[];if(!t.isDynamic)r.push({url:t.pattern,params:{}});else{let n=await gt(t.filePath);if(n.kind==="error")throw Error(`getStaticPaths ${n.phase} failed for ${t.pattern} (${t.filePath}): ${n.error.message}`,{cause:n.error});if(n.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),r;let o=n.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),r;for(let c of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(c.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);r.push({url:e,params:c.params,props:c.props,revalidate:c.revalidate})}}return r}function mt(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function Mt(t){for(let r of mt(t))if(await Bun.file(r).exists())try{let n=await import(r);if(typeof n.default==="function")return await n.default();else if(typeof n.default==="object")return n.default;else if(typeof n.getData==="function")return await n.getData();else{let{default:o,...c}=n;return c}}catch(n){console.error(`Error loading data file ${r}:`,n)}return null}async function Gt(t,r,n){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let c=o[1];if(!c.includes("getStaticProps"))return null;try{let e=c.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
4
4
  return (async function getStaticProps() {
5
5
  ${e[1]}
6
6
  })()
@@ -37,7 +37,7 @@ ${t.map((o)=>{let c=new URL(o.loc,r).href,e=` <url>
37
37
  ${n.join(`
38
38
  `)}
39
39
  </channel>
40
- </rss>`}async function Vt(t={}){let r=Date.now();en();let n=await a(process.cwd()),o=n.build||{},c=await ut({explicit:t.domain||o.domain,stxConfig:n});if(c.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(dt());let e={router:t.router??n?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:c.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||n?.partialsDir||"",componentsDir:t.componentsDir||n?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,x={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&D.existsSync(e.outputDir))await D.promises.rm(e.outputDir,{recursive:!0});await D.promises.mkdir(e.outputDir,{recursive:!0});let E=e.cacheSalt;if(!E){let{resolveUserCssConfig:d,fingerprintConfig:m}=await import("./chunk-c5kpc7rn.js");try{E=m(await d(process.cwd()))}catch{}}let{prepareImageDelivery:b}=await import("./chunk-qcz104h3.js"),R=await b(e.publicDir,e.outputDir);if(R.count>0)console.log(`Optimized ${R.count} image(s) for responsive delivery`),E=[E,R.fingerprint].filter(Boolean).join(":");let T=new pt(e.cacheDir,E);if(e.cache)await T.load();try{let{generateCss:d}=await import("./chunk-c5kpc7rn.js");await d('<div class="bg-black"></div>')}catch{}St();let yt=n?.routeMiddleware?.dir||"middleware";await _t(process.cwd(),yt);let J=kt();if(J.length>0)console.log(`Loaded ${J.length} middleware: ${J.join(", ")}`);let xt=n?.routeMiddleware?.global||[];Ga(n?.layoutsDir,l(process.cwd()));let Z=X(".",{pagesDir:e.pagesDir,pagesDirs:n?._layerPageDirs});console.log(`Found ${Z.length} routes`);let M=[];for(let d of Z)try{let m=await Ut(d);for(let k of m)M.push({route:d,url:k.url,params:k.params,props:k.props,revalidate:k.revalidate??e.revalidate})}catch(m){let k=m instanceof Error?m:Error(String(m));u.failedCount++,u.errors.push({route:d.pattern,error:k}),await e.hooks.onError?.(k,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,k)}u.totalPages=M.length+u.failedCount,console.log(`Generating ${M.length} pages...`);let _=[],Q=[];for(let d=0;d<M.length;d+=e.concurrency)Q.push(M.slice(d,d+e.concurrency));for(let d of Q)await Promise.all(d.map(async(m)=>{let{route:k,url:h,params:G,props:bt,revalidate:rt}=m;try{await e.hooks.onPageStart?.(h);let A=await Bun.file(k.filePath).text(),O=te(A),vt=O?.middleware?Array.isArray(O.middleware)?O.middleware:[O.middleware]:[],nt=[...xt,...vt];if(nt.length>0){let B=Ct(h,G,O||{}),L=Et(B,null,void 0,{isServer:!0}),j=await Tt(nt,L);if(j.redirect){let C=typeof j.redirect==="string"?j.redirect:j.redirect.path||j.redirect,H=ee(String(C),h),U=re(h,e);await D.promises.mkdir(f.dirname(U),{recursive:!0}),await Bun.write(U,H),u.successCount++,u.pages.push({route:h,outputPath:U,size:Buffer.byteLength(H),cached:!1}),_.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${C}`);return}if(j.abort){let C=typeof j.abort==="string"?j.abort:j.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${C}`);return}}let it=A.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(it)try{if(!await Function("route",`
40
+ </rss>`}async function Vt(t={}){let r=Date.now();en();let n=await a(process.cwd()),o=n.build||{},c=await ut({explicit:t.domain||o.domain,stxConfig:n});if(c.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(dt());let e={router:t.router??n?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:c.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||n?.partialsDir||"",componentsDir:t.componentsDir||n?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,x={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&D.existsSync(e.outputDir))await D.promises.rm(e.outputDir,{recursive:!0});await D.promises.mkdir(e.outputDir,{recursive:!0});let E=e.cacheSalt;if(!E){let{resolveUserCssConfig:d,fingerprintConfig:m}=await import("./chunk-56sek7x7.js");try{E=m(await d(process.cwd()))}catch{}}let{prepareImageDelivery:b}=await import("./chunk-yavspk55.js"),R=await b(e.publicDir,e.outputDir);if(R.count>0)console.log(`Optimized ${R.count} image(s) for responsive delivery`),E=[E,R.fingerprint].filter(Boolean).join(":");let T=new pt(e.cacheDir,E);if(e.cache)await T.load();try{let{generateCss:d}=await import("./chunk-56sek7x7.js");await d('<div class="bg-black"></div>')}catch{}St();let yt=n?.routeMiddleware?.dir||"middleware";await _t(process.cwd(),yt);let J=kt();if(J.length>0)console.log(`Loaded ${J.length} middleware: ${J.join(", ")}`);let xt=n?.routeMiddleware?.global||[];Ja(n?.layoutsDir,l(process.cwd()));let Z=X(".",{pagesDir:e.pagesDir,pagesDirs:n?._layerPageDirs});console.log(`Found ${Z.length} routes`);let M=[];for(let d of Z)try{let m=await Ut(d);for(let k of m)M.push({route:d,url:k.url,params:k.params,props:k.props,revalidate:k.revalidate??e.revalidate})}catch(m){let k=m instanceof Error?m:Error(String(m));u.failedCount++,u.errors.push({route:d.pattern,error:k}),await e.hooks.onError?.(k,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,k)}u.totalPages=M.length+u.failedCount,console.log(`Generating ${M.length} pages...`);let _=[],Q=[];for(let d=0;d<M.length;d+=e.concurrency)Q.push(M.slice(d,d+e.concurrency));for(let d of Q)await Promise.all(d.map(async(m)=>{let{route:k,url:h,params:G,props:bt,revalidate:rt}=m;try{await e.hooks.onPageStart?.(h);let A=await Bun.file(k.filePath).text(),O=te(A),vt=O?.middleware?Array.isArray(O.middleware)?O.middleware:[O.middleware]:[],nt=[...xt,...vt];if(nt.length>0){let B=Ct(h,G,O||{}),L=Et(B,null,void 0,{isServer:!0}),j=await Tt(nt,L);if(j.redirect){let C=typeof j.redirect==="string"?j.redirect:j.redirect.path||j.redirect,H=ee(String(C),h),U=re(h,e);await D.promises.mkdir(f.dirname(U),{recursive:!0}),await Bun.write(U,H),u.successCount++,u.pages.push({route:h,outputPath:U,size:Buffer.byteLength(H),cached:!1}),_.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${C}`);return}if(j.abort){let C=typeof j.abort==="string"?j.abort:j.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${C}`);return}}let it=A.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(it)try{if(!await Function("route",`
41
41
  const validate = ${it[1]};
42
42
  return validate(route);
43
43
  `)({params:G})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let I=null,st=!1;if(e.cache){if(I=T.get(h,k.filePath),I)st=!0,u.cachedCount++}if(!I){let B=await wt(k,G,bt,e,n);if(I=B.html,e.failOnIncludeError&&B.includeFailures.length>0)throw Error(`${B.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
@@ -69,7 +69,7 @@ ${d}`)}if(e.cache)await T.save();if(e.generate404){let d=f.join(e.pagesDir,"404.
69
69
  <a href="/">Go home</a>
70
70
  </div>
71
71
  </body>
72
- </html>`)}for(let d of[500]){let m=f.join(e.pagesDir,`${d}.stx`);if(await Bun.file(m).exists()){let k=new Set,h={...n,minifyClient:!0,debug:!1,cache:!1},G=await i(await Bun.file(m).text(),{},m,h,k);await Bun.write(f.join(e.outputDir,`${d}.html`),G)}}let V=f.join(e.pagesDir,"error.stx");if(await Bun.file(V).exists()){let d=new Set,m={...n,minifyClient:!0,debug:!1,cache:!1},k=await i(await Bun.file(V).text(),{},V,m,d);await Bun.write(f.join(e.outputDir,"error.html"),k)}if(e.sitemap&&_.length>0){let d=qt(_,e.domain),m=f.join(e.outputDir,"sitemap.xml");await Bun.write(m,d),u.sitemapPath=m,console.log(`Generated sitemap.xml with ${_.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((h)=>typeof h==="string"),...d.disallow||[]],k=ks({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...m.length>0?{disallow:m}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(f.join(e.outputDir,"robots.txt"),k),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(d.getItems)m=await d.getItems();let k=Jt(d,m),h=f.join(e.outputDir,"rss.xml");await Bun.write(h,k),u.rssPath=h,console.log(`Generated rss.xml with ${m.length} items`)}let z=Ka(e.outputDir);if(z.assets>0)console.log(`Externalized ${z.assets} asset(s) from ${z.pages} page(s) (${(z.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let W=Xa(e.outputDir);if(W.assets>0)console.log(`Externalized ${W.assets} repeated asset(s) from ${W.pages} page(s) (${(W.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&D.existsSync(e.publicDir))await Y(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let et=Yn();if(et)await Y(et,f.join(e.outputDir,Jn)),console.log(`Copied assets from ${Yt}`)}catch(E){throw await e.hooks.onError?.(E),E}if(u.buildTime=Date.now()-r,g.size>0){u.islandChunks={count:g.size,totalBytes:v};let E={generatedChunks:g.size,totalBytes:v,chunks:x,pages:p};await Bun.write(f.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(E,null,2))}await e.hooks.onBuildEnd?.(u);let P=u.islandChunks?`
72
+ </html>`)}for(let d of[500]){let m=f.join(e.pagesDir,`${d}.stx`);if(await Bun.file(m).exists()){let k=new Set,h={...n,minifyClient:!0,debug:!1,cache:!1},G=await i(await Bun.file(m).text(),{},m,h,k);await Bun.write(f.join(e.outputDir,`${d}.html`),G)}}let V=f.join(e.pagesDir,"error.stx");if(await Bun.file(V).exists()){let d=new Set,m={...n,minifyClient:!0,debug:!1,cache:!1},k=await i(await Bun.file(V).text(),{},V,m,d);await Bun.write(f.join(e.outputDir,"error.html"),k)}if(e.sitemap&&_.length>0){let d=qt(_,e.domain),m=f.join(e.outputDir,"sitemap.xml");await Bun.write(m,d),u.sitemapPath=m,console.log(`Generated sitemap.xml with ${_.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((h)=>typeof h==="string"),...d.disallow||[]],k=_s({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...m.length>0?{disallow:m}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(f.join(e.outputDir,"robots.txt"),k),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(d.getItems)m=await d.getItems();let k=Jt(d,m),h=f.join(e.outputDir,"rss.xml");await Bun.write(h,k),u.rssPath=h,console.log(`Generated rss.xml with ${m.length} items`)}let z=Xa(e.outputDir);if(z.assets>0)console.log(`Externalized ${z.assets} asset(s) from ${z.pages} page(s) (${(z.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let W=Ga(e.outputDir);if(W.assets>0)console.log(`Externalized ${W.assets} repeated asset(s) from ${W.pages} page(s) (${(W.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&D.existsSync(e.publicDir))await Y(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let et=Yn();if(et)await Y(et,f.join(e.outputDir,Jn)),console.log(`Copied assets from ${Yt}`)}catch(E){throw await e.hooks.onError?.(E),E}if(u.buildTime=Date.now()-r,g.size>0){u.islandChunks={count:g.size,totalBytes:v};let E={generatedChunks:g.size,totalBytes:v,chunks:x,pages:p};await Bun.write(f.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(E,null,2))}await e.hooks.onBuildEnd?.(u);let P=u.islandChunks?`
73
73
  Island chunks: ${u.islandChunks.count} (${(u.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
74
74
  Build complete!
75
75
  Total: ${u.totalPages} pages
@@ -348,6 +348,7 @@ export declare interface StxConfig {
348
348
  pwa?: Partial<PwaConfig>
349
349
  offline?: import('../offline/app-service-worker').OfflineAppConfig
350
350
  messages?: import('../message-catalogs').PageMessagesOptions
351
+ webModules?: import('../web-modules').WebModulesOption
351
352
  components?: Partial<ComponentConfig>
352
353
  routeMiddleware?: Partial<RouteMiddlewareConfig>
353
354
  heatmap?: Partial<HeatmapConfig>
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The stand-ins, as JavaScript by every spelling of each replaced module's
3
+ * path (the bundler's substitutes, `withModuleSubstitutes`). Read again when
4
+ * a stand-in changes. Throws on a module or stand-in that is not there, or a
5
+ * stand-in whose relative imports would resolve elsewhere.
6
+ */
7
+ export declare function loadWebModules(root: string, option: WebModulesOption): Promise<Map<string, string>>;
8
+ /** Each module (relative to the project root) and the module a web page loads instead. */
9
+ export type WebModulesOption = Record<string, string>;
@@ -0,0 +1,47 @@
1
+ import { existsSync, statSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { pathSpellings } from "./message-catalogs.js";
4
+ const loaded = new Map;
5
+ function loaderFor(file) {
6
+ const extension = path.extname(file);
7
+ if (extension === ".tsx")
8
+ return "tsx";
9
+ if (extension === ".jsx")
10
+ return "jsx";
11
+ if (extension === ".ts" || extension === ".mts" || extension === ".cts")
12
+ return "ts";
13
+ return "js";
14
+ }
15
+ export async function loadWebModules(root, option) {
16
+ const pairs = Object.entries(option).map(([module, standIn]) => [path.resolve(root, module), path.resolve(root, standIn)]), signature = pairs.map(([module, standIn]) => {
17
+ try {
18
+ return `${module}\x00${standIn}\x00${statSync(standIn).mtimeMs}`;
19
+ } catch {
20
+ return `${module}\x00${standIn}\x00-`;
21
+ }
22
+ }).join(`
23
+ `), cacheKey = `${root}\x00${JSON.stringify(option)}`, cached = loaded.get(cacheKey);
24
+ if (cached && cached.signature === signature)
25
+ return cached.standIns;
26
+ const standIns = new Map;
27
+ for (const [module, standIn] of pairs) {
28
+ const name = path.relative(root, module);
29
+ if (!existsSync(module))
30
+ throw Error(`webModules: ${name} does not exist`);
31
+ if (!existsSync(standIn))
32
+ throw Error(`webModules: ${path.relative(root, standIn)}, the stand-in for ${name}, does not exist`);
33
+ if (module === standIn)
34
+ throw Error(`webModules: ${name} stands in for itself`);
35
+ const source = await Bun.file(standIn).text(), transpiler = new Bun.Transpiler({ loader: loaderFor(standIn), target: "browser" });
36
+ if (path.dirname(standIn) !== path.dirname(module)) {
37
+ const relative = transpiler.scanImports(source).find((entry) => /^\.\.?\//.test(entry.path));
38
+ if (relative)
39
+ throw Error(`webModules: ${path.relative(root, standIn)} imports ${relative.path}, which would resolve from ${path.relative(root, path.dirname(module)) || "."}; a stand-in imports relatively only from the directory of the module it replaces`);
40
+ }
41
+ const code = transpiler.transformSync(source);
42
+ for (const spelling of pathSpellings(module))
43
+ standIns.set(spelling, code);
44
+ }
45
+ loaded.set(cacheKey, { signature, standIns });
46
+ return standIns;
47
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.765",
4
+ "version": "0.2.770",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -128,12 +128,12 @@
128
128
  "dependencies": {
129
129
  "@stacksjs/ts-css": "^0.3.11",
130
130
  "@stacksjs/clapp": "^0.2.16",
131
- "@stacksjs/desktop": "0.2.765",
132
- "@stacksjs/sanitizer": "0.2.765",
131
+ "@stacksjs/desktop": "0.2.770",
132
+ "@stacksjs/sanitizer": "0.2.770",
133
133
  "@stacksjs/ts-i18n": "^0.1.11",
134
- "bun-plugin-stx": "0.2.765",
134
+ "bun-plugin-stx": "0.2.770",
135
135
  "bunfig": "^0.15.21",
136
- "stx-router": "0.2.765",
136
+ "stx-router": "0.2.770",
137
137
  "ts-broadcasting": "^0.0.11",
138
138
  "ts-images": "^0.2.22",
139
139
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{la,Ml}from"./chunk-pqgk9mxp.js";import"./chunk-t70s45hc.js";import"./chunk-kc3kt59e.js";export{Ml as createImageHandler,la as handleImageRequest};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xl,Sl}from"./chunk-4yk7zngj.js";import"./chunk-0nzeqc13.js";import"./chunk-bnwkytme.js";import"./chunk-4tppbw4r.js";import"./chunk-ccedry39.js";import"./chunk-1day2nbr.js";import"./chunk-0d29b573.js";import"./chunk-8prk7e1z.js";import"./chunk-mmcqgwk7.js";import"./chunk-q22hwm64.js";import"./chunk-6h6teyxp.js";import"./chunk-pqgk9mxp.js";import"./chunk-m15nbvck.js";import"./chunk-ay5g5cbk.js";import"./chunk-t70s45hc.js";import"./chunk-stww901w.js";import"./chunk-dphhs29v.js";import"./chunk-scq0h2cs.js";import"./chunk-51dxp9w9.js";import"./chunk-ysfeg3cn.js";import"./chunk-zfaa5xn5.js";import"./chunk-3mf27gj6.js";import"./chunk-as4s0nf5.js";import"./chunk-2mckhfet.js";import"./chunk-zs8yjtaz.js";import"./chunk-nj5azxxj.js";import"./chunk-vy1weqvj.js";import"./chunk-cswar3zs.js";import"./chunk-mpaepc7n.js";import"./chunk-xcstrdhp.js";import"./chunk-kc3kt59e.js";import"./chunk-7yx2ztt5.js";import{Zt}from"./chunk-vvm38ysm.js";import"./chunk-rv0yth27.js";import"./chunk-c5mbhfff.js";import"./chunk-wmnzapn8.js";import{Re,i}from"./chunk-7aw9qm74.js";import"./chunk-s9m2gfns.js";import"./chunk-h8yk9qm7.js";import"./chunk-kwy0spcd.js";import"./chunk-49w4cbqb.js";import"./chunk-z6sg0dq3.js";import"./chunk-6ch8t3d9.js";import"./chunk-vkpmemb1.js";import"./chunk-t6d7m4tf.js";import{we}from"./chunk-dxk5r71v.js";import"./chunk-qv99gqee.js";import{cr,lr}from"./chunk-b8hsvzqb.js";import{bs,j,a}from"./chunk-tqf8a258.js";import"./chunk-knzp4c6m.js";import"./chunk-c1b481my.js";import"./chunk-ztbk9yqv.js";import"./chunk-ay02q27h.js";import"./chunk-8hanmv49.js";import{m,Le}from"./chunk-qv2k0qb1.js";import"./chunk-t8cgxk8w.js";import"./chunk-1g5fg1ys.js";import"./chunk-1w4a0xya.js";import"./chunk-4833k99b.js";import"./chunk-07c8rk93.js";import"./chunk-p42kp93g.js";import"./chunk-m3dr63n0.js";export{bs as buildWebComponents,lr as cacheTemplate,cr as checkCache,Zt as classifyAllScripts,xl as createMiddleware,Sl as createRoute,j as defaultConfig,m as extractVariables,we as injectRouterScript,a as loadStxConfig,Le as processClientScript,i as processDirectives,Re as readMarkdownFile};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{bo,ma,ha,lh}from"./chunk-6jnrpnxb.js";export{bo as NATIVE_COMPONENTS,ma as compileToNative,ha as createHotReloadServer,lh as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Js,zt,yl,wg}from"./chunk-dvh63p75.js";export{Js as generateServiceWorker,wg as generateServiceWorkerAuto,zt as getServiceWorkerFileName,yl as isWorkboxEnabled};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Fm,zm,Hm,Vm,Um}from"./chunk-zs8yjtaz.js";export{zm as createSSRSuspense,Vm as generateSuspenseCSS,Um as generateSuspenseRuntime,Fm as processSuspenseDirectives,Hm as renderSSRSuspense};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{um,dm,pm,fm,gm,mm,hm}from"./chunk-stww901w.js";export{dm as createKeepAliveCache,fm as generateKeepAliveCSS,gm as generateKeepAliveRuntime,mm as onActivated,hm as onDeactivated,um as processKeepAliveDirectives,pm as shouldCacheComponent};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ve,Fs,cg,Vh,lg,Uh,Dt,p,V,Z,bn,Se,ug,hi,dg,Wh,_,pg,qh,T,Kh}from"./chunk-qv2k0qb1.js";import"./chunk-t8cgxk8w.js";import"./chunk-1g5fg1ys.js";import"./chunk-1w4a0xya.js";import"./chunk-4833k99b.js";import"./chunk-07c8rk93.js";export{pg as applyFilters,Uh as clearCustomFilters,ug as clientLoopScopes,Fs as defaultFilters,bn as escapeAttributeValue,p as escapeHtml,V as escapeHtmlValue,Z as escapeInterpolatedHtmlValue,T as evaluateExpression,ve as findMustacheEnd,lg as getAllFilters,dg as interpolateScriptAttributes,hi as interpolateScriptExpressions,Wh as interpolateScriptsInTemplate,_ as processExpressions,cg as registerFilter,Vh as registerFilters,Dt as replaceInterpolations,qh as resetRejectedExpressionWarnings,Kh as unescapeHtml,Se as usesSignalsInScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Nm,Dm,Mm,Lm,jm,Bm}from"./chunk-2mckhfet.js";export{Lm as generateTransitionCSS,jm as generateTransitionRuntime,Nm as performEnter,Dm as performLeave,Bm as processTransitionAttributes,Mm as processTransitionDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Wl,ql,Kl,Xl,Gl,Jl,Yl,Zl,Ql,eu,bm}from"./chunk-scq0h2cs.js";export{Wl as createIslandRegistry,bm as default,eu as generateIslandManifest,Kl as generatePartialHydrationCSS,Jl as hydrateAll,Gl as hydrateByStrategy,Xl as hydrateIsland,Yl as isHydrated,Zl as onHydrated,ql as processPartialHydrationDirectives,Ql as processStaticDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{_l,Qi,Cl,El,ea,Tl,$l,Rl,Al,ta,Pl,Ug}from"./chunk-0d29b573.js";import{la,Ml}from"./chunk-pqgk9mxp.js";import{Q,ee,te,On,me,Te,Wr,ft,Kt,Nn,Dn,Mn,ne,Ln,jn,qr}from"./chunk-t70s45hc.js";import{ou}from"./chunk-ysfeg3cn.js";import"./chunk-kc3kt59e.js";export{ee as DEFAULT_FORMATS,te as DEFAULT_QUALITY,Q as DEFAULT_WIDTHS,qr as ImageProcessingError,El as clearImageCache,ea as createImageDirective,Ml as createImageHandler,$l as createImagePlugin,Ug as defaultImageConfig,jn as formatSize,ta as generateImageManifest,Kt as generateSizes,ft as generateSrcSet,Nn as getFallbackVariant,Wr as getImageMetadata,ne as getMimeType,Ln as getTotalSize,Dn as groupVariantsByFormat,la as handleImageRequest,Tl as imageDirective,me as isImageBackendAvailable,Mn as isImageFile,On as isSharpAvailable,Al as optimizeDirectory,Rl as optimizeImage,Qi as parseImageComponent,Te as processImage,Cl as processImageComponents,_l as renderImageComponent,ou as rewriteImagesWithSiblings,Pl as writeImageManifest};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Xo,Go,Jo,Yo,xs,Ss,Mh,Lh,jh,Bh,ks,Fh}from"./chunk-ay02q27h.js";import"./chunk-1w4a0xya.js";export{Fh as generateDefaultRobotsTxt,ks as generateRobotsTxt,Lh as generateSitemap,jh as generateSitemapIndex,Yo as injectSeoTags,xs as metaDirective,Xo as processMetaDirectives,Jo as processSeoDirective,Go as processStructuredData,Mh as registerSeoDirectives,Bh as scanForSitemapEntries,Ss as structuredDataDirective};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{oo,Yi,zr,io,ao,$n,qt,Zi,Hr,Vr,co,lo,Hg,Vg,dt}from"./chunk-1day2nbr.js";export{dt as DeployError,Yi as calculateSha1,zr as collectDeployFiles,Vr as createDefaultNetlifyConfig,io as createFileManifest,oo as createNetlifyClient,Hg as deploy,Hr as detectProjectConfig,ao as filterRequiredFiles,$n as formatSize,Zi as generateNetlifyToml,qt as getTotalSize,lo as hasNetlifyConfig,Vg as initNetlify,co as writeNetlifyConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ze,vn,zs,bi,O,Mt}from"./chunk-1g5fg1ys.js";export{vn as currentRuntimeConfig,Mt as injectRuntimeConfig,O as resolveRuntimeConfig,bi as useRuntimeConfig,zs as useServerRuntimeConfig,ze as withRuntimeConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{sn,Eo,To,$o,yh,Ro}from"./chunk-c5mbhfff.js";import"./chunk-ztbk9yqv.js";import"./chunk-8hanmv49.js";import"./chunk-1g5fg1ys.js";export{To as buildServerApi,yh as createServerApi,sn as discoverServerApi,Eo as generateApiTypes,Ro as isServerApiSource,$o as productionApiDispatcher};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ai,Pi,Ii,_g,Cg,Eg,bl,Tg,$g}from"./chunk-p42kp93g.js";export{Ai as ImageProcessorCache,bl as applyTransformations,_g as clearImageCache,Tg as generateResponsiveVariants,$g as generateSrcset,Pi as getCachedImageResult,Eg as optimizeImage,Cg as processImage,Ii as setCachedImageResult};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{V}from"./chunk-qv2k0qb1.js";function n(t){return V(t)}
3
- export{n};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{m,ui,zc,Hc,eg,tg,ng,rg,sg,Bs,og,je,Y,Be,ig,_r,ag,Wc,gi,Fe,r,yn,qc,h,fe,Hh}from"./chunk-qv2k0qb1.js";import"./chunk-t8cgxk8w.js";import"./chunk-1g5fg1ys.js";import"./chunk-1w4a0xya.js";import"./chunk-4833k99b.js";import"./chunk-07c8rk93.js";export{fe as clearComponentCache,gi as componentClientSignalNames,ui as convertToCommonJS,h as createDetailedErrorMessage,sg as extractDirectiveNames,zc as extractScriptFromTemplate,m as extractVariables,r as fileExists,Hh as getComponentCacheStats,tg as getPositionInfo,Y as getSharedTranspiler,qc as getSourceLineInfo,rg as hasDirectives,Hc as hasVariables,ag as isHydrateTrigger,og as isJavaScriptScript,Fe as renderComponentWithSlot,yn as resolveTemplatePath,ig as scopeOnRootElement,Bs as scopeSequenceKey,je as shouldTranspileTypeScript,Wc as slotContentHasExpressions,Be as transpileTypeScript,_r as userComponentFileExists,ng as validateDirective,eg as validateTemplate};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{rs,sr,Tf}from"./chunk-kwy0spcd.js";import"./chunk-vkpmemb1.js";import"./chunk-t6d7m4tf.js";import"./chunk-dxk5r71v.js";import"./chunk-qv99gqee.js";import"./chunk-tqf8a258.js";import"./chunk-knzp4c6m.js";import"./chunk-c1b481my.js";import"./chunk-ztbk9yqv.js";import"./chunk-ay02q27h.js";import"./chunk-8hanmv49.js";import{At}from"./chunk-qv2k0qb1.js";import"./chunk-t8cgxk8w.js";import"./chunk-1g5fg1ys.js";import"./chunk-1w4a0xya.js";import"./chunk-4833k99b.js";import"./chunk-07c8rk93.js";export{Tf as declareBareLoopHead,At as parseLoopBinding,sr as processLoops,rs as reportDeferredLoopWarnings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Il,na,Wg,Ol,Nl,qg,Kg}from"./chunk-8prk7e1z.js";import"./chunk-cswar3zs.js";import"./chunk-rv0yth27.js";import"./chunk-c5mbhfff.js";import"./chunk-wmnzapn8.js";import"./chunk-t6d7m4tf.js";import"./chunk-dxk5r71v.js";import"./chunk-qv99gqee.js";import"./chunk-tqf8a258.js";import"./chunk-knzp4c6m.js";import"./chunk-c1b481my.js";import"./chunk-ztbk9yqv.js";import"./chunk-ay02q27h.js";import"./chunk-8hanmv49.js";import{Pt,Wf}from"./chunk-qv2k0qb1.js";import"./chunk-t8cgxk8w.js";import"./chunk-1g5fg1ys.js";import"./chunk-1w4a0xya.js";import"./chunk-4833k99b.js";import"./chunk-07c8rk93.js";export{Il as buildVirtualSource,Pt as extractScriptBlocks,Wf as extractTemplateExpressions,Ol as findRuntimeTypeDeclarations,Nl as findStxModuleDeclarations,Kg as formatTypecheckDiagnostics,Wg as sourcePathFor,qg as typecheckStxFiles,na as virtualPathFor};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{er,i}from"./chunk-7aw9qm74.js";import"./chunk-s9m2gfns.js";import"./chunk-h8yk9qm7.js";import"./chunk-kwy0spcd.js";import"./chunk-49w4cbqb.js";import"./chunk-z6sg0dq3.js";import"./chunk-6ch8t3d9.js";import"./chunk-vkpmemb1.js";import"./chunk-t6d7m4tf.js";import{we}from"./chunk-dxk5r71v.js";import"./chunk-qv99gqee.js";import"./chunk-b8hsvzqb.js";import"./chunk-tqf8a258.js";import"./chunk-knzp4c6m.js";import"./chunk-c1b481my.js";import"./chunk-ztbk9yqv.js";import"./chunk-ay02q27h.js";import"./chunk-8hanmv49.js";import{Oe,Ls,js}from"./chunk-qv2k0qb1.js";import"./chunk-t8cgxk8w.js";import"./chunk-1g5fg1ys.js";import"./chunk-1w4a0xya.js";import"./chunk-4833k99b.js";import"./chunk-07c8rk93.js";export{er as buildModulesTag,we as injectRouterScript,i as processDirectives,Ls as processJsonDirective,js as processOnceDirective,Oe as validateClientScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{_i,Xh,Gh,sl,Ve,fg,Ks,Jh,Yh,Zh,Qh,ey,ty,ny,ry,sy}from"./chunk-1w4a0xya.js";export{ty as applyHead,Jh as definePageMeta,_i as getHead,Xh as getPageMeta,Ve as mergeHeadConfigs,ny as processHeadDirective,sy as processMetaDirective,ry as processTitleDirective,ey as renderBodyAttrs,Zh as renderHead,Qh as renderHtmlAttrs,Gh as resetHead,Ks as seoMetaToHeadConfig,sl as useHead,Yh as usePageTitle,fg as useSeoMeta,Yh as useTitle};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Oi,Ni,Di,Rg,Mi,Li,Ag,ji,Bi,wl,Pg}from"./chunk-m3dr63n0.js";export{Oi as VideoProcessorCache,wl as analyzeVideo,Rg as clearVideoCache,Bi as generateDASHManifest,ji as generateHLSManifest,Mi as generatePoster,Ag as generateSpriteSheet,Li as generateThumbnails,Ni as getCachedVideoResult,Pg as processVideo,Di as setCachedVideoResult};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{uu,vo,qn,du,pu,fu,gu,mu,hu,yu,bu,wu,vu,xu,Su,ku,_u,Cu,Eu,Tu,$u,Ru,Au,Pu,Iu,Ou,Nu,Du,Mu,Lu,ju,Bu,Fu,zu,Hu,Vu,Uu,Wu,qu,Ku,Xu,Gu,Ju,Yu,Zu,Qu,ed,td,Gt,Ca,nd,rd,sd,Ea,od,id,ad,cd,ld,ud,Ta,dd,pd,fd,gd,md,hd,yd,bd,wd,Kn,vd,xd,Sd,kd,_d,Cd,Ed,Td,$d,Rd,Ad,Pd,xo,Id,Od,Nd,Dd,Md,Yr,Ld,jd,Bd,Fd,zd,$a,Hd,Vd,Ud,Ra,So,Wd,qd,Aa,Pa,Zr,Ia,Kd,Jt,Xd,Oa,Na,ko,Gd,_o,Jd,Yd,Zd,Qd,ep,tp,np,Da,rp,sp,Ma,op,ip,ap,cp,lp,up,dp,pp,fp,gp,mp,hp,yp,bp,wp,vp,xp,Sp,kp,_p,Cp,Ep,Tp,$p,La,Rp,Ap,Pp,Ip,Op,Np,Dp,Mp,Lp,jp,Bp,Xn,ja,Ba,Fp,Gn,zp,Hp,Vp,Fa,za,Qr,es,Up,Co,Wp,qp,Kp,Xp,Gp,Jp,Yp,Zp,Qp,ef,tf,nf,rf,sf,of,af,cf,lf,uf,df,Ha,pf,ff,Va,Ua,gf,mf}from"./chunk-fz717vpc.js";export{ed as AVAILABLE_COMPONENTS,$a as AutoUpdater,td as COMPONENT_STYLES,Qr as DEFAULT_WATCH_INTERVAL_MS,za as MAX_WATCH_INTERVAL_MS,Fa as MIN_WATCH_INTERVAL_MS,ud as MODAL_STYLES,wu as TOAST_STYLES,yd as TRAY_MENU_STYLES,Aa as UPDATE_MANIFEST_ASSET,id as alert,Cp as appInfo,Jp as appleScript,mf as applicationDataDirectory,Gp as audio,ff as backgroundDelay,xp as battery,Xp as biometric,jp as bluetooth,tf as bonjour,Jt as bundlePathForExecutable,Gd as caffeinate,Hd as canReplaceBundle,Vd as clearQuarantine,pp as clipboard,ld as closeAllModals,Pd as closeAllWindows,od as confirm,$p as contextMenu,cf as continuityCamera,af as coreml,Fd as craftBinaryNotFoundMessage,xo as craftWindowArguments,Xn as crashReporter,Hu as createAccordion,Du as createAutocomplete,Eu as createAvatar,Cu as createBadge,vu as createButton,Tu as createCard,Gu as createChart,Su as createCheckbox,ju as createChip,Ju as createCodeEditor,Iu as createColorPicker,Xu as createDataGrid,Ou as createDatePicker,Ru as createDropdown,Zu as createFileExplorer,Kd as createGitHubUpdateManifest,Ia as createGitHubUpdater,Lu as createImageView,cp as createInterval,Mu as createLabel,Wu as createListView,Yu as createMediaPlayer,dd as createMenubar,Uu as createModalComponent,gf as createNativeUpdateApi,Ua as createPantrySelfUpdater,ep as createPreferences,_u as createProgressBar,Pu as createRadioButton,Au as createRating,Fu as createScrollView,ko as createSelfUpdater,ku as createSlider,zu as createSplitView,Vu as createStepper,Ta as createSystemTray,qu as createTable,$u as createTabs,xu as createTextInput,Nu as createTimePicker,ap as createTimer,Bu as createTooltip,Ku as createTreeView,Qu as createWebView,Id as createWindow,Nd as createWindowWithHTML,_o as decaffeinate,vp as deepLinks,lp as delay,hu as dismissAlertById,yu as dismissAllAlerts,bp as dragOut,Ud as extractBundle,Yp as fileAssociations,Co as focus,qp as focusShortcutsReady,dp as formatCompact,Qd as formatDuration,Zd as formatRemainingTime,rp as formatShortcut,up as formatTime,gp as fs,Ra as generateUpdateManifest,bu as getActiveAlertCount,cd as getActiveModalCount,pd as getActiveTrayInstances,Rd as getActiveWindowIds,Yd as getCaffeinateStatus,df as getCapabilities,Ha as getCapability,Td as getDesktopConfig,Cd as getDialogBridgeScript,ip as getRegisteredHotkeys,md as getSimulatedTrayHTML,hd as getTrayBridgeScript,fd as getTrayInstance,Ad as getWindow,Md as getWindowBridgeScript,Pa as githubLatestAssetUrl,Zr as githubReleaseAssetUrl,hp as globalShortcuts,Gn as handoff,Wp as hasFocusShortcuts,Fp as iap,np as isAutoLaunchEnabled,pf as isAvailable,Jd as isCaffeinated,wp as isDragOutAvailable,Dd as isWebviewAvailable,Pp as keychain,zp as liveActivities,Kp as localServer,Hp as location,ef as log,Ld as macOSRuntimeExecutablePath,Tp as menu,of as midi,Np as nativeAutoLaunch,Dp as nativeTray,Mp as nativeWindow,Sp as network,fp as notifications,mu as notify,Od as openDevWindow,jd as pack,Bd as packageApp,Va as parsePantryUpdateManifest,Da as parseShortcut,Qp as pdf,Ip as permissions,Op as printing,ad as prompt,Oa as quitLauncher,So as readBundleIdentity,ja as redactPII,sp as registerHotkey,Na as relaunchBundle,uu as requestNotificationPermission,$d as resetDesktopConfig,zd as resolveCraftBinary,Yr as resolveCraftExecutablePath,Xd as runningBundleTeamId,Ap as screen,Vp as screenCapture,es as screenSharing,uf as serial,lf as serviceMenu,tp as setAutoLaunch,Ed as setDesktopConfig,mp as shell,vo as showAlert,xd as showAlertDialog,vd as showColorPicker,Sd as showConfirmDialog,kd as showErrorDialog,rd as showErrorModal,gu as showErrorToast,Ca as showInfoModal,du as showInfoToast,Kn as showMessageBox,Gt as showModal,bd as showOpenDialog,Ea as showQuestionModal,wd as showSaveDialog,sd as showSuccessModal,pu as showSuccessToast,qn as showToast,_d as showWarningDialog,nd as showWarningModal,fu as showWarningToast,La as sidebar,Ba as signPayload,Bp as speech,rf as speechRecognition,nf as spotlight,Ep as standardMenus,Wd as swapBundle,Rp as system,Zp as tags,yp as theme,Lp as touchbar,gd as triggerTrayAction,op as unregisterAllHotkeys,Ma as unregisterHotkey,kp as updater,qd as verifyBundleTrust,sf as vision,Up as watchScreenSharing,_p as windowEvents};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Pf,Th,$h,Rh,Ah,If,Of,Ph,Ih,Uo,Oh,cr,lr,hs}from"./chunk-b8hsvzqb.js";import{tt}from"./chunk-3csfmhg0.js";import"./chunk-qv2k0qb1.js";import"./chunk-t8cgxk8w.js";import"./chunk-1g5fg1ys.js";import"./chunk-1w4a0xya.js";import"./chunk-4833k99b.js";import"./chunk-07c8rk93.js";export{Ah as __setSignalsGeneratorsForTest,tt as cacheEngineFingerprint,lr as cacheTemplate,cr as checkCache,Oh as clearDevCaches,Of as getCachedRouterScript,If as getCachedSignalsRuntime,Ph as getServeClientAsset,Uo as getServeModuleBundle,hs as hashFilePath,$h as invalidateFileCache,Rh as invalidateFileCacheByDir,Th as readFileCached,Ih as registerServeModuleBundle,Pf as templateCache};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{bh,ec,wh,tc,kf,_f,an,rr,vh,Cf,Ef,xh,y}from"./chunk-s9m2gfns.js";import"./chunk-b8hsvzqb.js";import"./chunk-qv2k0qb1.js";import"./chunk-t8cgxk8w.js";import"./chunk-1g5fg1ys.js";import"./chunk-1w4a0xya.js";import"./chunk-4833k99b.js";import"./chunk-07c8rk93.js";export{an as buildCss,Cf as extractClassNames,_f as fingerprintConfig,Ef as generateCss,vh as getCachedCSS,bh as getCssServeAsset,y as injectCss,ec as loadCssEngine,tc as loadCssEngineConfig,rr as rebuildCss,wh as resetCssCache,kf as resolveUserCssConfig,xh as withLinkedModuleBundles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Pm}from"./chunk-3mf27gj6.js";export{Pm as processDeferDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Jm,go,Ym,Zm,Qm,eh}from"./chunk-vy1weqvj.js";import"./chunk-rv0yth27.js";import"./chunk-c5mbhfff.js";import"./chunk-wmnzapn8.js";import"./chunk-t6d7m4tf.js";import"./chunk-dxk5r71v.js";import"./chunk-qv99gqee.js";import"./chunk-tqf8a258.js";import"./chunk-knzp4c6m.js";import"./chunk-c1b481my.js";import"./chunk-ztbk9yqv.js";import"./chunk-ay02q27h.js";import"./chunk-8hanmv49.js";import"./chunk-qv2k0qb1.js";import"./chunk-t8cgxk8w.js";import"./chunk-1g5fg1ys.js";import"./chunk-1w4a0xya.js";import"./chunk-4833k99b.js";import"./chunk-07c8rk93.js";export{eh as clearStoreCache,Jm as getStoreScript,Qm as getStoreScriptFor,Zm as pageStoresAll,go as storesRead,Ym as storesReadInFiles};