@stacksjs/stx 0.2.561 → 0.2.563

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 (144) hide show
  1. package/dist/caching.js +12 -5
  2. package/dist/chunk-00dp53cx.js +2 -0
  3. package/dist/chunk-0pvn63x7.js +2 -0
  4. package/dist/chunk-0vpmdhfm.js +2 -0
  5. package/dist/chunk-10jwyvm0.js +2 -0
  6. package/dist/{chunk-hbb208xt.js → chunk-171xv81z.js} +2 -2
  7. package/dist/{chunk-9bxwy4f9.js → chunk-1ena03xn.js} +1 -1
  8. package/dist/{chunk-km7sb7bj.js → chunk-1zeqghsw.js} +3 -3
  9. package/dist/{chunk-f029nw9a.js → chunk-27t55gtk.js} +4 -4
  10. package/dist/{chunk-w5nw5cj6.js → chunk-2m91qmby.js} +2 -2
  11. package/dist/{chunk-n5swm2mb.js → chunk-2tm3vzm7.js} +3 -3
  12. package/dist/{chunk-e4mbr4az.js → chunk-31ez1sq0.js} +1 -1
  13. package/dist/chunk-3n26hf93.js +2 -0
  14. package/dist/chunk-3tccqahy.js +2 -0
  15. package/dist/chunk-40fqmb3q.js +2 -0
  16. package/dist/chunk-45tq56qf.js +2 -0
  17. package/dist/{chunk-q97v1714.js → chunk-46wykvrs.js} +1 -1
  18. package/dist/chunk-56mkcxvb.js +2 -0
  19. package/dist/chunk-56wcmck6.js +2 -0
  20. package/dist/chunk-5eyf2zeg.js +2 -0
  21. package/dist/chunk-68ph8r20.js +2 -0
  22. package/dist/{chunk-bj958h8d.js → chunk-6bxy1b9q.js} +2 -2
  23. package/dist/{chunk-59nq020j.js → chunk-6n8jzdnm.js} +2 -2
  24. package/dist/chunk-6va8wt88.js +2 -0
  25. package/dist/chunk-7acxdp9r.js +2 -0
  26. package/dist/{chunk-d37enreq.js → chunk-7gdvp6py.js} +2 -2
  27. package/dist/chunk-7h324n17.js +2 -0
  28. package/dist/{chunk-9cc4fdtt.js → chunk-7t05bpf7.js} +2 -2
  29. package/dist/chunk-8fpz04kx.js +2 -0
  30. package/dist/{chunk-tc9r6wc2.js → chunk-8fwczr4s.js} +1 -1
  31. package/dist/{chunk-mdgvzf07.js → chunk-912cj8pq.js} +1 -1
  32. package/dist/chunk-9skdekv5.js +2 -0
  33. package/dist/{chunk-qnf9tr0r.js → chunk-bqdsc6rm.js} +1 -1
  34. package/dist/chunk-c3v5zmnq.js +2 -0
  35. package/dist/chunk-ce7zwt4v.js +2 -0
  36. package/dist/chunk-cp4dr9ch.js +2 -0
  37. package/dist/chunk-dyavx9a1.js +2 -0
  38. package/dist/{chunk-ahhav65p.js → chunk-dz7v901d.js} +1 -1
  39. package/dist/chunk-e099d50m.js +2 -0
  40. package/dist/chunk-e473tm1d.js +2 -0
  41. package/dist/{chunk-m5s1wcn9.js → chunk-emta09j6.js} +1 -1
  42. package/dist/{chunk-qrqw667n.js → chunk-evwj0k99.js} +192 -195
  43. package/dist/{chunk-whykvbys.js → chunk-f11sx09b.js} +2 -2
  44. package/dist/{chunk-tkmcyr0k.js → chunk-f92hq39b.js} +2 -2
  45. package/dist/chunk-fdkyvr7y.js +2 -0
  46. package/dist/{chunk-6kkt5fjx.js → chunk-fgmv8f14.js} +5 -5
  47. package/dist/chunk-fqge0zn8.js +2 -0
  48. package/dist/{chunk-m6m19hwd.js → chunk-g12j8ahm.js} +4 -4
  49. package/dist/{chunk-cngtf95k.js → chunk-g6cwhsb4.js} +2 -2
  50. package/dist/{chunk-gfqka4zx.js → chunk-gbx3gx8a.js} +3 -3
  51. package/dist/{chunk-skbbk6va.js → chunk-gxtk4fbm.js} +5 -5
  52. package/dist/{chunk-b156xw15.js → chunk-h23bjqn1.js} +2 -2
  53. package/dist/{chunk-frgpx23w.js → chunk-hj67a88k.js} +2 -2
  54. package/dist/chunk-hv2kxb94.js +2 -0
  55. package/dist/chunk-j9c0yam7.js +2 -0
  56. package/dist/{chunk-dp163aad.js → chunk-jen9yg68.js} +3 -3
  57. package/dist/{chunk-cv1q9fq8.js → chunk-jjwg83xv.js} +1 -1
  58. package/dist/chunk-k9nd7z8j.js +2 -0
  59. package/dist/{chunk-gjx5256r.js → chunk-m5fw8jq1.js} +5 -5
  60. package/dist/chunk-m7jmpech.js +2 -0
  61. package/dist/chunk-m7ktr4xn.js +2 -0
  62. package/dist/{chunk-4zb2ga7p.js → chunk-mtdx75j5.js} +2 -2
  63. package/dist/{chunk-7ze47qgv.js → chunk-nd8v4xgb.js} +5 -5
  64. package/dist/{chunk-xya3vdqy.js → chunk-nda4xq79.js} +2 -2
  65. package/dist/chunk-nr5jf1hp.js +2 -0
  66. package/dist/{chunk-0fatkxpr.js → chunk-p2mxsjv1.js} +3 -3
  67. package/dist/{chunk-g84ctpqq.js → chunk-pp9jgyb6.js} +1 -1
  68. package/dist/{chunk-n9y4ssn1.js → chunk-qd7bqhm3.js} +1 -1
  69. package/dist/{chunk-39tkfkp7.js → chunk-qmza4327.js} +3 -3
  70. package/dist/{chunk-v2rhpdw3.js → chunk-qprkb5qe.js} +1 -1
  71. package/dist/{chunk-77j26p6r.js → chunk-s040j1bv.js} +2 -2
  72. package/dist/chunk-schxd5k5.js +2 -0
  73. package/dist/chunk-sn5c0x7q.js +2 -0
  74. package/dist/chunk-sx4wmprc.js +2 -0
  75. package/dist/{chunk-b11qrqzz.js → chunk-tc2z8t2q.js} +3 -3
  76. package/dist/{chunk-3cq4g0t1.js → chunk-v09hk0j6.js} +1 -1
  77. package/dist/chunk-vakryadj.js +2 -0
  78. package/dist/{chunk-05hr7567.js → chunk-vb1w9wy4.js} +6 -6
  79. package/dist/chunk-vgge9rf4.js +2 -0
  80. package/dist/{chunk-h0e3ps74.js → chunk-w36w5jgs.js} +2 -2
  81. package/dist/{chunk-v39ysweq.js → chunk-w8q1xp9e.js} +2 -2
  82. package/dist/chunk-wzymzex7.js +2 -0
  83. package/dist/{chunk-4kj8a2bn.js → chunk-x07x8hzs.js} +1 -1
  84. package/dist/{chunk-yp1360pq.js → chunk-x8rx0s3h.js} +1 -1
  85. package/dist/{chunk-kch9a9v1.js → chunk-xab6b4mt.js} +2 -2
  86. package/dist/{chunk-8tpey96f.js → chunk-xb739v4r.js} +2 -2
  87. package/dist/{chunk-f1n5napx.js → chunk-xj45mw7v.js} +2 -2
  88. package/dist/{chunk-yq1mvakj.js → chunk-y0pbnxjg.js} +2 -2
  89. package/dist/{chunk-wy4hfmjs.js → chunk-yn3kp3qy.js} +5 -5
  90. package/dist/{chunk-vvkfde23.js → chunk-yp00nht2.js} +2 -2
  91. package/dist/{chunk-5141wftw.js → chunk-z9q5p39g.js} +1 -1
  92. package/dist/chunk-zh0jbzvk.js +2 -0
  93. package/dist/chunk-zpf9he2x.js +2 -0
  94. package/dist/cli.js +11 -11
  95. package/dist/craft-entry.js +2 -2
  96. package/dist/craft.js +2 -2
  97. package/dist/dev-server/ts-css.d.ts +1 -10
  98. package/dist/dev-server/ts-css.js +14 -7
  99. package/dist/native/primitives/Map.stx +4 -1
  100. package/dist/native/runtime/browser-renderer.js +23 -8
  101. package/dist/pwa.js +3 -3
  102. package/dist/server-bindings.js +2 -2
  103. package/dist/signal-processing.js +3 -120
  104. package/dist/ssg.js +2 -2
  105. package/package.json +5 -5
  106. package/dist/chunk-12dkj7xn.js +0 -2
  107. package/dist/chunk-13xhvx68.js +0 -2
  108. package/dist/chunk-29r6af6f.js +0 -2
  109. package/dist/chunk-3220kken.js +0 -2
  110. package/dist/chunk-49ms9skq.js +0 -2
  111. package/dist/chunk-4bdshma4.js +0 -2
  112. package/dist/chunk-550whbab.js +0 -2
  113. package/dist/chunk-5fwphmtr.js +0 -2
  114. package/dist/chunk-66f3w7rx.js +0 -2
  115. package/dist/chunk-6cq0ggmf.js +0 -2
  116. package/dist/chunk-7pewegtw.js +0 -2
  117. package/dist/chunk-7qqx3ja8.js +0 -2
  118. package/dist/chunk-abtgtvs7.js +0 -2
  119. package/dist/chunk-b8j7qsct.js +0 -2
  120. package/dist/chunk-e5vc83gz.js +0 -2
  121. package/dist/chunk-ej5w5a5x.js +0 -2
  122. package/dist/chunk-ft447y2j.js +0 -2
  123. package/dist/chunk-fvdm6dta.js +0 -2
  124. package/dist/chunk-hd47q9s0.js +0 -2
  125. package/dist/chunk-j1jh32tw.js +0 -2
  126. package/dist/chunk-knr41h7p.js +0 -2
  127. package/dist/chunk-m9cmc6np.js +0 -2
  128. package/dist/chunk-m9r4x7e6.js +0 -2
  129. package/dist/chunk-mbwdn96z.js +0 -2
  130. package/dist/chunk-mqje968d.js +0 -2
  131. package/dist/chunk-n6v7nqgb.js +0 -2
  132. package/dist/chunk-nt0j3fm8.js +0 -2
  133. package/dist/chunk-pq8mz4ma.js +0 -2
  134. package/dist/chunk-q0n8vb38.js +0 -2
  135. package/dist/chunk-q8p16y1h.js +0 -2
  136. package/dist/chunk-qnqb8s28.js +0 -2
  137. package/dist/chunk-qtnqmw1n.js +0 -2
  138. package/dist/chunk-qyj6zygv.js +0 -2
  139. package/dist/chunk-ry8v73j8.js +0 -2
  140. package/dist/chunk-shq0hp3a.js +0 -2
  141. package/dist/chunk-srs912da.js +0 -2
  142. package/dist/chunk-tgfpk4ng.js +0 -2
  143. package/dist/chunk-xhay04n8.js +0 -2
  144. package/dist/chunk-y2gaadz3.js +0 -2
@@ -100,16 +100,7 @@ export declare function getCachedCSS(): string;
100
100
  */
101
101
  export declare function extractClassNames(htmlContent: string): Set<string>;
102
102
  export declare function generateCss(htmlContent: string, appDir?: string): Promise<string>;
103
- /**
104
- * The page and the module bundles it links (`/_stx/modules.<hash>.js`).
105
- *
106
- * The stores, composables and module registry used to be inline, and the
107
- * extractor read the class names their code assigns at runtime (an icon class
108
- * a helper returns, a tone picked by status) straight out of the page. Served
109
- * as files they left the page's text, and every such class lost its CSS: the
110
- * phone's sport icons drew as empty boxes. The URL carries the bundle's hash,
111
- * so the page text still decides what is cached.
112
- */
103
+ /** Compatibility helper for callers that need the combined source text. */
113
104
  export declare function withLinkedModuleBundles(htmlContent: string): string;
114
105
  /**
115
106
  * Inject generated CSS into HTML content
@@ -348,8 +348,9 @@ export async function generateCss(htmlContent, appDir) {
348
348
  cssByPage.set(contentKey(htmlContent, appDir, rootFingerprint()), css);
349
349
  return css;
350
350
  }
351
- export function withLinkedModuleBundles(htmlContent) {
352
- const bundles = [], seen = new Set;
351
+ function* cssSources(htmlContent) {
352
+ yield htmlContent;
353
+ const seen = new Set;
353
354
  for (const match of htmlContent.matchAll(/\/_stx\/modules\.([0-9a-f]{16})\.js/g)) {
354
355
  const hash = match[1];
355
356
  if (seen.has(hash))
@@ -357,18 +358,24 @@ export function withLinkedModuleBundles(htmlContent) {
357
358
  seen.add(hash);
358
359
  const code = getServeModuleBundle(hash);
359
360
  if (code)
360
- bundles.push(code);
361
+ yield code;
361
362
  }
362
- return bundles.length ? `${htmlContent}
363
- ${bundles.join(`
364
- `)}` : htmlContent;
363
+ }
364
+ export function withLinkedModuleBundles(htmlContent) {
365
+ return [...cssSources(htmlContent)].join(`
366
+ `);
365
367
  }
366
368
  async function generateCssUncached(htmlContent, appDir) {
367
369
  try {
368
370
  const hw = await loadCssEngine();
369
371
  if (!hw)
370
372
  return "";
371
- const scanned = withLinkedModuleBundles(htmlContent), classes = typeof hw.extractClasses === "function" ? hw.extractClasses(scanned) : extractClassNames(scanned);
373
+ const classes = new Set;
374
+ for (const source of cssSources(htmlContent)) {
375
+ const extracted = typeof hw.extractClasses === "function" ? hw.extractClasses(source) : extractClassNames(source);
376
+ for (const className of extracted)
377
+ classes.add(className);
378
+ }
372
379
  if (classes.size === 0)
373
380
  return "";
374
381
  const resolveRoot = appDir ? path.resolve(appDir) : process.cwd(), appDiskCache = stateDir(resolveRoot, "cache");
@@ -1,2 +1,5 @@
1
1
  {{-- Map: a native map host with overlay children. --}}
2
- <div data-native="Map"><slot /></div>
2
+ <script server>
3
+ const classes = $props.class ?? $props.className ?? ''
4
+ </script>
5
+ <div data-native="Map" class="{{ classes }}"><slot /></div>
@@ -31,12 +31,14 @@ export class BrowserScreenRenderer {
31
31
  const record = this.create(node.id, node.type, node.props, { ...node.style }, node.events);
32
32
  record.parent = parent;
33
33
  for (const child of node.children)
34
- if (typeof child === "string")
34
+ if (typeof child === "string") {
35
+ record.text = (record.text ?? "") + child;
35
36
  record.element.append(this.container.ownerDocument.createTextNode(child));
36
- else {
37
+ } else {
37
38
  record.element.append(create(child, node.id));
38
39
  record.children.push(child.id);
39
40
  }
41
+ this.buttonLabel(record);
40
42
  return record.element;
41
43
  };
42
44
  this.container.replaceChildren(create(tree, null));
@@ -50,15 +52,20 @@ export class BrowserScreenRenderer {
50
52
  for (const operation of batch.operations)
51
53
  if (operation.op === "createNode") {
52
54
  const record = this.create(operation.id, operation.node.type, operation.node.props ?? {}, operation.node.style ?? {}, operation.node.events ?? {});
53
- if (operation.node.children)
54
- record.element.textContent = operation.node.children.join("");
55
+ if (operation.node.children) {
56
+ record.text = operation.node.children.join("");
57
+ record.element.textContent = record.text;
58
+ this.buttonLabel(record);
59
+ }
55
60
  } else if (operation.op === "updateNode") {
56
61
  const record = this.nodes.get(operation.id);
57
62
  Object.assign(record.props, operation.patch.props);
58
63
  Object.assign(record.style, operation.patch.style);
59
64
  Object.assign(record.events, operation.patch.events);
60
- if (operation.patch.children)
61
- record.element.textContent = operation.patch.children.join("");
65
+ if (operation.patch.children) {
66
+ record.text = operation.patch.children.join("");
67
+ record.element.textContent = record.text;
68
+ }
62
69
  this.update(record);
63
70
  } else if (operation.op === "removeNode")
64
71
  this.remove(operation.id);
@@ -233,6 +240,13 @@ export class BrowserScreenRenderer {
233
240
  });
234
241
  }
235
242
  }
243
+ buttonLabel(record) {
244
+ if (record.type !== "Button" || record.children.length !== 0)
245
+ return;
246
+ const title = typeof record.props.title === "string" ? record.props.title : record.text ?? "";
247
+ if (record.element.textContent !== title)
248
+ record.element.textContent = title;
249
+ }
236
250
  update(record) {
237
251
  const { element, props, type, style } = record, css = element.style;
238
252
  css.cssText = "";
@@ -364,8 +378,9 @@ export class BrowserScreenRenderer {
364
378
  if (props.autoComplete)
365
379
  input.autocomplete = String(props.autoComplete);
366
380
  }
381
+ this.buttonLabel(record);
367
382
  if (type === "Picker") {
368
- const select = element, options = Array.isArray(props.options) ? props.options : [], signature = JSON.stringify(options);
383
+ const select = element, options = Array.isArray(props.items) ? props.items : Array.isArray(props.options) ? props.options : [], signature = JSON.stringify(options);
369
384
  if (select.dataset.options !== signature) {
370
385
  select.replaceChildren(...options.map((option) => {
371
386
  const node = element.ownerDocument.createElement("option");
@@ -375,7 +390,7 @@ export class BrowserScreenRenderer {
375
390
  }));
376
391
  select.dataset.options = signature;
377
392
  }
378
- select.value = String(props.value ?? "");
393
+ select.value = String(props.selectedValue ?? props.value ?? "");
379
394
  }
380
395
  if (type === "Image" || type === "Video" || type === "ImageBackground") {
381
396
  const source = props.source ?? props.src, url = typeof source === "string" ? source : source && typeof source === "object" ? String(source.uri ?? "") : "";
package/dist/pwa.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{Bn,Ne,Ho,Ja}from"./chunk-vpmb8gcc.js";import{jn,qr,Ga,Ka,Xa}from"./chunk-8a4g0mex.js";import{Bo,Fo,zo,Wa,qa}from"./chunk-5fx8m234.js";import{ie,ht,Gr}from"./chunk-97vj2cqz.js";import{Qc,el,tl,nl,hr,vu}from"./chunk-xya3vdqy.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-ry8v73j8.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{Bn,Ne,Ho,Ja}from"./chunk-vpmb8gcc.js";import{jn,qr,Ga,Ka,Xa}from"./chunk-8a4g0mex.js";import{Bo,Fo,zo,Wa,qa}from"./chunk-5fx8m234.js";import{ie,ht,Gr}from"./chunk-97vj2cqz.js";import{Zc,Qc,el,tl,hr,vu}from"./chunk-nda4xq79.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-nr5jf1hp.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=ie(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=Bn(n,t);if(a){let s=Ne(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 qr(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,Fo as auditBuildOutput,Bo as auditConfig,re as buildPwaAssets,zo as calculateAuditResult,qa as formatAuditResult,Gr as formatSize,j as generateManifest,_ as generateManifestJson,Ka as generateManifestLink,F as generateOfflinePage,ie as generatePrecacheManifest,ht as generatePrecacheManifestJs,M as generatePwaIcons,jn as generatePwaTags,Bn as generateServiceWorker,Ja as generateServiceWorkerAuto,Ga as generateSwRegistrationScript,Xa as generateThemeColorMeta,N as getExpectedIconPaths,Ne as getServiceWorkerFileName,qr as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,Ho as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,hr as pwaDirectives,Qc as pwaInstallDirective,tl as pwaOfflineDirective,nl as pwaPushDirective,el as pwaUpdateDirective,vu as registerPwaDirectives,Wa 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=ie(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=Bn(n,t);if(a){let s=Ne(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 qr(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,Fo as auditBuildOutput,Bo as auditConfig,re as buildPwaAssets,zo as calculateAuditResult,qa as formatAuditResult,Gr as formatSize,j as generateManifest,_ as generateManifestJson,Ka as generateManifestLink,F as generateOfflinePage,ie as generatePrecacheManifest,ht as generatePrecacheManifestJs,M as generatePwaIcons,jn as generatePwaTags,Bn as generateServiceWorker,Ja as generateServiceWorkerAuto,Ga as generateSwRegistrationScript,Xa as generateThemeColorMeta,N as getExpectedIconPaths,Ne as getServiceWorkerFileName,qr as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,Ho as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,hr as pwaDirectives,Zc as pwaInstallDirective,el as pwaOfflineDirective,tl as pwaPushDirective,Qc as pwaUpdateDirective,vu as registerPwaDirectives,Wa as runPwaAudit,D as validateManifest};
@@ -98,7 +98,7 @@ export function processServerBindings(template, context) {
98
98
  const fullTag = match[0], attrs = match[2];
99
99
  if (!attrs || !attrs.includes(":"))
100
100
  continue;
101
- const bindingRegex = /\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g;
101
+ const nativeHost = /(?:^|\s)data-native(?:\s|=|$)/i.test(attrs.replace(/"[^"]*"|'[^']*'/g, "")), bindingRegex = /\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g;
102
102
  let attrMatch, newAttrs = attrs, hadReplacement = !1;
103
103
  while ((attrMatch = bindingRegex.exec(attrs)) !== null) {
104
104
  const attrName = attrMatch[1], expression = attrMatch[2];
@@ -145,7 +145,7 @@ export function processServerBindings(template, context) {
145
145
  if (value === null || value === void 0 || value === !1)
146
146
  newAttrs = newAttrs.replace(attrMatch[0], "");
147
147
  else {
148
- const escaped = String(value).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
148
+ const escaped = (nativeHost && typeof value === "object" ? JSON.stringify(value) : String(value)).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
149
149
  newAttrs = newAttrs.replace(attrMatch[0], ` ${attrName}="${escaped}"`);
150
150
  }
151
151
  hadReplacement = !0;
@@ -8,6 +8,7 @@ import { injectSignalsRuntime } from "./runtime-injection.js";
8
8
  import { evictOldest, matchScriptElement, scanAtElementPosition } from "./html-masking.js";
9
9
  import { importOnce } from "./lazy-module.js";
10
10
  import { findBodyOpenTag } from "./find-body-tag.js";
11
+ import { stripCommentsAndLiterals } from "./strip-literals.js";
11
12
  let signalSetupCounter = 0;
12
13
  const TAG_ATTR_RUN = `(?:"[^"]*"|'[^']*'|[^>"'])*`, SINGLE_ELEMENT_RE = /^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s, SCRIPT_SCAN_CACHE_MIN_BYTES = 65536, SCRIPT_SCAN_CACHE_MAX_ENTRIES = 4, scriptScanCache = new Map;
13
14
  export function clearScriptScanCache() {
@@ -861,106 +862,9 @@ if(window.stx)window.stx._latestSetup=${setupFnName};
861
862
  return { output: rebuildSetupOwner(template, signalScripts, markerAt, setupFnName), setupCode };
862
863
  }
863
864
  export function extractExports(setupContent) {
864
- const code = setupContent, names = [], seen = new Set;
865
+ const code = stripCommentsAndLiterals(setupContent), names = [], seen = new Set;
865
866
  let depth = 0, i = 0;
866
- const len = code.length;
867
- let lastSig = "";
868
- const skipRegex = () => {
869
- i++;
870
- let inClass = !1;
871
- while (i < len) {
872
- const c = code[i];
873
- if (c === "\\") {
874
- i += 2;
875
- continue;
876
- }
877
- if (c === "[" && !inClass) {
878
- inClass = !0;
879
- i++;
880
- continue;
881
- }
882
- if (c === "]" && inClass) {
883
- inClass = !1;
884
- i++;
885
- continue;
886
- }
887
- if (c === "/" && !inClass) {
888
- i++;
889
- while (i < len && /[gimsuyd]/.test(code[i]))
890
- i++;
891
- return;
892
- }
893
- if (c === `
894
- `)
895
- return;
896
- i++;
897
- }
898
- }, isRegexStart = () => {
899
- if (!lastSig)
900
- return !0;
901
- if (/[\w)\]]/.test(lastSig))
902
- return !1;
903
- return !0;
904
- }, skipString = (quote) => {
905
- i++;
906
- while (i < len) {
907
- if (code[i] === "\\") {
908
- i += 2;
909
- continue;
910
- }
911
- if (code[i] === quote) {
912
- i++;
913
- return;
914
- }
915
- i++;
916
- }
917
- }, skipTemplateLiteral = () => {
918
- i++;
919
- while (i < len) {
920
- if (code[i] === "\\") {
921
- i += 2;
922
- continue;
923
- }
924
- if (code[i] === "`") {
925
- i++;
926
- return;
927
- }
928
- if (code[i] === "$" && code[i + 1] === "{") {
929
- i += 2;
930
- let templateDepth = 1;
931
- while (i < len && templateDepth > 0)
932
- if (code[i] === "{") {
933
- templateDepth++;
934
- i++;
935
- } else if (code[i] === "}") {
936
- templateDepth--;
937
- i++;
938
- } else if (code[i] === "'" || code[i] === '"')
939
- skipString(code[i]);
940
- else if (code[i] === "`")
941
- skipTemplateLiteral();
942
- else
943
- i++;
944
- continue;
945
- }
946
- i++;
947
- }
948
- }, skipComment = () => {
949
- if (code[i] === "/" && code[i + 1] === "/") {
950
- while (i < len && code[i] !== `
951
- `)
952
- i++;
953
- return !0;
954
- }
955
- if (code[i] === "/" && code[i + 1] === "*") {
956
- i += 2;
957
- while (i < len - 1 && !(code[i] === "*" && code[i + 1] === "/"))
958
- i++;
959
- i += 2;
960
- return !0;
961
- }
962
- return !1;
963
- }, checkDeclaration = () => {
867
+ const len = code.length, checkDeclaration = () => {
964
868
  if (depth !== 0)
965
869
  return;
966
870
  const declMatch = code.slice(i).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);
@@ -1019,39 +923,18 @@ export function extractExports(setupContent) {
1019
923
  }
1020
924
  };
1021
925
  while (i < len) {
1022
- if (skipComment())
1023
- continue;
1024
- if (code[i] === "'" || code[i] === '"') {
1025
- skipString(code[i]);
1026
- lastSig = code[i - 1];
1027
- continue;
1028
- }
1029
- if (code[i] === "`") {
1030
- skipTemplateLiteral();
1031
- lastSig = "`";
1032
- continue;
1033
- }
1034
- if (code[i] === "/" && code[i + 1] !== "/" && code[i + 1] !== "*" && isRegexStart()) {
1035
- skipRegex();
1036
- lastSig = "/";
1037
- continue;
1038
- }
1039
926
  if (code[i] === "{") {
1040
927
  depth++;
1041
- lastSig = "{";
1042
928
  i++;
1043
929
  continue;
1044
930
  }
1045
931
  if (code[i] === "}") {
1046
932
  depth--;
1047
- lastSig = "}";
1048
933
  i++;
1049
934
  continue;
1050
935
  }
1051
936
  if (depth === 0 && /[a-z]/i.test(code[i]) && (i === 0 || /\s|[;{}()]/.test(code[i - 1])))
1052
937
  checkDeclaration();
1053
- if (!/\s/.test(code[i]))
1054
- lastSig = code[i];
1055
938
  i++;
1056
939
  }
1057
940
  return names.join(", ");
package/dist/ssg.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-azb58ven.js";import"./chunk-a5kaw8sc.js";import"./chunk-4zb2ga7p.js";import{nt,rt,st,ot,it,at}from"./chunk-b156xw15.js";import"./chunk-r4199q6x.js";import"./chunk-6v1gwdbv.js";import{f,ze,N,K,n,o}from"./chunk-qrqw667n.js";import"./chunk-cngtf95k.js";import{sr}from"./chunk-g84ctpqq.js";import"./chunk-e124cgb6.js";import"./chunk-mdgvzf07.js";import"./chunk-1xgs9gd5.js";import"./chunk-ff61d2wr.js";import"./chunk-n5swm2mb.js";import{ae,yt,bt}from"./chunk-w5nw5cj6.js";import{No,Lo,jo}from"./chunk-wk85dz07.js";import{mt,Qt,en}from"./chunk-hpeg9erh.js";import"./chunk-yp1360pq.js";import{a}from"./chunk-4cmqjmqr.js";import x from"fs";import g from"path";import{createHash as Dt}from"crypto";function Rt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var kt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Ct(t){return Bun.hash(t).toString(16)}function ut(t,i={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,r=t.replace(kt,(e,l,w,y)=>{let h=y.trim();if(!h)return e;if(/\bdata-stx-src=/.test(w))return e;if(i.minify)h=Rt(h);let S=Ct(h);if(!s.has(S))s.set(S,h);let P=i.integrity?` data-stx-integrity="sha384-${Dt("sha384").update(h).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),c=Array.from(s,([e,l])=>({hash:e,code:l}));return{html:r,chunks:c}}var Et=new Set(["visible","idle"]);function dt(t){if(!t.includes("data-stx-src="))return t;let i=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,r;while((r=s.exec(t))!==null)i.set(r[1],r[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(Et.has(i.get(l[1])||""))c.add(l[2]);let w=t.lastIndexOf("</head>");if(c.size===0||w===-1)return t;let y=Array.from(c).filter((h)=>!t.includes(`rel="prefetch" href="${h}"`)).map((h)=>`<link rel="prefetch" href="${h}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var It=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function q(t){let i=t.trim();if(!i)return null;let s=/^https?:\/\//i.test(i)?i:`https://${i}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function Bt(t){for(let i of It){let s=t[i];if(!s)continue;let r=q(s);if(r)return{url:r,source:"env",via:i}}return null}function gt(t){if(!t||typeof t!=="object")return null;let i=t,s=i.site?.url??i.url??i.app?.url;return typeof s==="string"?q(s):null}async function jt(t){let{existsSync:i}=await import("fs"),s=await import("path");for(let r of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,r);if(!i(c))continue;try{let e=await import(c),l=gt(e.default??e);if(l)return l}catch{}}return null}async function pt(t={}){let i=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let l=q(t.explicit);if(l)return{url:l,source:"option"}}let r=gt(t.stxConfig);if(r)return{url:r,source:"stx.config",via:"site.url"};let c=await jt(i);if(c)return{url:c,source:"site.config",via:"url"};let e=Bt(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ht(){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(`
2
+ import"./chunk-azb58ven.js";import"./chunk-a5kaw8sc.js";import"./chunk-mtdx75j5.js";import{nt,rt,st,ot,it,at}from"./chunk-h23bjqn1.js";import"./chunk-r4199q6x.js";import"./chunk-6v1gwdbv.js";import{f,ze,N,K,n,o}from"./chunk-evwj0k99.js";import"./chunk-g6cwhsb4.js";import{sr}from"./chunk-pp9jgyb6.js";import"./chunk-e124cgb6.js";import"./chunk-912cj8pq.js";import"./chunk-1xgs9gd5.js";import"./chunk-ff61d2wr.js";import"./chunk-2tm3vzm7.js";import{ae,yt,bt}from"./chunk-2m91qmby.js";import{No,Lo,jo}from"./chunk-wk85dz07.js";import{mt,Qt,en}from"./chunk-hpeg9erh.js";import"./chunk-x8rx0s3h.js";import{a}from"./chunk-4cmqjmqr.js";import x from"fs";import g from"path";import{createHash as Dt}from"crypto";function Rt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var kt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Ct(t){return Bun.hash(t).toString(16)}function ut(t,i={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,r=t.replace(kt,(e,l,w,y)=>{let h=y.trim();if(!h)return e;if(/\bdata-stx-src=/.test(w))return e;if(i.minify)h=Rt(h);let S=Ct(h);if(!s.has(S))s.set(S,h);let P=i.integrity?` data-stx-integrity="sha384-${Dt("sha384").update(h).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),c=Array.from(s,([e,l])=>({hash:e,code:l}));return{html:r,chunks:c}}var Et=new Set(["visible","idle"]);function dt(t){if(!t.includes("data-stx-src="))return t;let i=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,r;while((r=s.exec(t))!==null)i.set(r[1],r[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(Et.has(i.get(l[1])||""))c.add(l[2]);let w=t.lastIndexOf("</head>");if(c.size===0||w===-1)return t;let y=Array.from(c).filter((h)=>!t.includes(`rel="prefetch" href="${h}"`)).map((h)=>`<link rel="prefetch" href="${h}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var It=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function q(t){let i=t.trim();if(!i)return null;let s=/^https?:\/\//i.test(i)?i:`https://${i}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function Bt(t){for(let i of It){let s=t[i];if(!s)continue;let r=q(s);if(r)return{url:r,source:"env",via:i}}return null}function gt(t){if(!t||typeof t!=="object")return null;let i=t,s=i.site?.url??i.url??i.app?.url;return typeof s==="string"?q(s):null}async function jt(t){let{existsSync:i}=await import("fs"),s=await import("path");for(let r of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,r);if(!i(c))continue;try{let e=await import(c),l=gt(e.default??e);if(l)return l}catch{}}return null}async function pt(t={}){let i=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let l=q(t.explicit);if(l)return{url:l,source:"option"}}let r=gt(t.stxConfig);if(r)return{url:r,source:"stx.config",via:"site.url"};let c=await jt(i);if(c)return{url:c,source:"site.config",via:"url"};let e=Bt(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ht(){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
3
  `)}class ft{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,i=""){this.cacheDir=t,this.salt=i}async load(){if(this.loaded)return;let t=g.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let i=JSON.parse(await Bun.file(t).text());for(let[s,r]of Object.entries(i))this.cache.set(s,r)}catch{}this.loaded=!0}async save(){await x.promises.mkdir(this.cacheDir,{recursive:!0});let t=g.join(this.cacheDir,"build-cache.json"),i={};for(let[s,r]of this.cache)i[s]=r;await Bun.write(t,JSON.stringify(i))}getHash(t,i){let s=x.statSync(t),r=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of i)if(x.existsSync(e)){let l=x.statSync(e);r+=`:${e}:${l.mtimeMs}`}let c=0;for(let e=0;e<r.length;e++){let l=r.charCodeAt(e);c=(c<<5)-c+l,c=c&c}return Math.abs(c).toString(36)}get(t,i){let s=this.cache.get(t);if(!s)return null;let r=this.getHash(i,s.dependencies??[]);if(s.hash!==r)return this.cache.delete(t),null;return s.html}set(t,i,s,r){let c=this.getHash(i,s);this.cache.set(t,{hash:c,html:r,generatedAt:Date.now(),dependencies:s})}}class wt{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let i=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return g.join(this.cacheDir,"isr",i)}async get(t){let i=this.getFilePath(t);if(!await Bun.file(i).exists())return null;try{return JSON.parse(await Bun.file(i).text())}catch{return null}}async set(t,i){let s=this.getFilePath(t);await x.promises.mkdir(g.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(i))}async invalidate(t){let i=this.getFilePath(t);if(await Bun.file(i).exists())await x.promises.unlink(i)}async invalidatePattern(t){let i=g.join(this.cacheDir,"isr");if(!x.existsSync(i))return;let s=await x.promises.readdir(i);for(let r of s){let c=r.replace(/_/g,"/").replace(".json","");if(t.test(c))await x.promises.unlink(g.join(i,r))}}async needsRevalidation(t){let i=await this.get(t);if(!i)return!0;return Date.now()>i.revalidateAfter}}async function Ft(t){try{let s=(await Bun.file(t).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!s)return null;let r=s[1];if(!r.includes("getStaticPaths"))return null;let c=r.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!c)return null;return await Function(`
4
4
  return (async function getStaticPaths() {
5
5
  ${c[1]}
@@ -41,7 +41,7 @@ ${t.map((r)=>{let c=new URL(r.loc,i).href,e=` <url>
41
41
  ${s.join(`
42
42
  `)}
43
43
  </channel>
44
- </rss>`}async function zt(t={}){let i=Date.now();bt();let s=await o(process.cwd()),r=s.build||{},c=await pt({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ht());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||a(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,h={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-12dkj7xn.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-q97v1714.js"),b=await p(e.publicDir,e.outputDir);if(b.count>0)console.log(`Optimized ${b.count} image(s) for responsive delivery`),D=[D,b.fingerprint].filter(Boolean).join(":");let B=new ft(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-12dkj7xn.js");await u('<div class="bg-black"></div>')}catch{}nt();let xt=s?.routeMiddleware?.dir||"middleware";await st(process.cwd(),xt);let H=rt();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let vt=s?.routeMiddleware?.global||[];jo(s?.layoutsDir,a(process.cwd()));let V=N(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${V.length} routes`);let _=[];for(let u of V){let m=await Ot(u);for(let v of m)_.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=_.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],X=[];for(let u=0;u<_.length;u+=e.concurrency)X.push(_.slice(u,u+e.concurrency));for(let u of X)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:L,props:Pt,revalidate:Q}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Jt(j),$t=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],tt=[...vt,...$t];if(tt.length>0){let C=ot(d,L,F||{}),O=it(C,null,void 0,{isServer:!0}),E=await at(tt,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,U=Vt(String(R),d),T=Kt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,U),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(U),cached:!1}),A.push({loc:d,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${d} \u2192 redirect to ${R}`);return}if(E.abort){let R=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${d} \u2014 middleware aborted: ${R}`);return}}let et=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(et)try{if(!await Function("route",`
44
+ </rss>`}async function zt(t={}){let i=Date.now();bt();let s=await o(process.cwd()),r=s.build||{},c=await pt({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ht());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||a(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,h={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-7h324n17.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-46wykvrs.js"),b=await p(e.publicDir,e.outputDir);if(b.count>0)console.log(`Optimized ${b.count} image(s) for responsive delivery`),D=[D,b.fingerprint].filter(Boolean).join(":");let B=new ft(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-7h324n17.js");await u('<div class="bg-black"></div>')}catch{}nt();let xt=s?.routeMiddleware?.dir||"middleware";await st(process.cwd(),xt);let H=rt();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let vt=s?.routeMiddleware?.global||[];jo(s?.layoutsDir,a(process.cwd()));let V=N(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${V.length} routes`);let _=[];for(let u of V){let m=await Ot(u);for(let v of m)_.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=_.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],X=[];for(let u=0;u<_.length;u+=e.concurrency)X.push(_.slice(u,u+e.concurrency));for(let u of X)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:L,props:Pt,revalidate:Q}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Jt(j),$t=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],tt=[...vt,...$t];if(tt.length>0){let C=ot(d,L,F||{}),O=it(C,null,void 0,{isServer:!0}),E=await at(tt,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,U=Vt(String(R),d),T=Kt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,U),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(U),cached:!1}),A.push({loc:d,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${d} \u2192 redirect to ${R}`);return}if(E.abort){let R=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${d} \u2014 middleware aborted: ${R}`);return}}let et=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(et)try{if(!await Function("route",`
45
45
  const validate = ${et[1]};
46
46
  return validate(route);
47
47
  `)({params:L})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,ct=!1;if(e.cache){if(k=B.get(d,v.filePath),k)ct=!0,l.cachedCount++}if(!k){let C=await St(v,L,Pt,e,s);if(k=C.html,e.failOnIncludeError&&C.includeFailures.length>0)throw Error(`${C.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.561",
4
+ "version": "0.2.563",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -123,12 +123,12 @@
123
123
  "dependencies": {
124
124
  "@stacksjs/ts-css": "^0.3.11",
125
125
  "@stacksjs/clapp": "^0.2.16",
126
- "@stacksjs/desktop": "0.2.561",
127
- "@stacksjs/sanitizer": "0.2.561",
126
+ "@stacksjs/desktop": "0.2.563",
127
+ "@stacksjs/sanitizer": "0.2.563",
128
128
  "@stacksjs/ts-i18n": "^0.1.11",
129
- "bun-plugin-stx": "0.2.561",
129
+ "bun-plugin-stx": "0.2.563",
130
130
  "bunfig": "^0.15.19",
131
- "stx-router": "0.2.561",
131
+ "stx-router": "0.2.563",
132
132
  "ts-broadcasting": "^0.0.11",
133
133
  "ts-images": "^0.2.22",
134
134
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Gd,Zo,Kd,Qo,fc,gc,_t,an,Xd,mc,hc,yc,f}from"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{_t as buildCss,mc as extractClassNames,gc as fingerprintConfig,hc as generateCss,Xd as getCachedCSS,Gd as getCssServeAsset,f as injectCss,Zo as loadCssEngine,Qo as loadCssEngineConfig,an as rebuildCss,Kd as resetCssCache,fc as resolveUserCssConfig,yc as withLinkedModuleBundles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ca,ul}from"./chunk-yq1mvakj.js";export{ca as captureScreenshot,ul as captureScreenshots};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{gd,Co,Ha,md,hd,yd,bd,wd,Ua,Va,vd,xd,Sd,kd}from"./chunk-f029nw9a.js";import"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{Ha as SUSPENSE_RESOLVER_RUNTIME,Co as buildSuspenseResolveScript,wd as createStreamRenderer,yd as extractStreamBoundaries,kd as generateHydrationRuntime,Va as islandDirective,xd as processSectionDirectives,hd as processStreamDirectives,vd as registerStreamingDirectives,md as renderStreamingPage,gd as streamTemplate,bd as streamTemplateSimple,Sd as streamToResponse,Ua as streamingSuspenseDirective};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{zn,sc,Md,oc,Nd,ic,Hn,b,Ct,be,ac,rs,cc,Ld,G,lc,jd,x,Bd}from"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{lc as applyFilters,Nd as clearCustomFilters,ac as clientLoopScopes,zn as defaultFilters,b as escapeHtml,Ct as escapeHtmlValue,x as evaluateExpression,ic as findMustacheEnd,oc as getAllFilters,cc as interpolateScriptAttributes,rs as interpolateScriptExpressions,Ld as interpolateScriptsInTemplate,G as processExpressions,sc as registerFilter,Md as registerFilters,Hn as replaceInterpolations,jd as resetRejectedExpressionWarnings,Bd as unescapeHtml,be as usesSignalsInScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{je,dc,Fd,zd,Hd,Ud,uc,pc,Vd,Wd,Yo,qd,sn,on,Un}from"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{Ud as __setSignalsGeneratorsForTest,je as cacheEngineFingerprint,on as cacheTemplate,sn as checkCache,qd as clearDevCaches,pc as getCachedRouterScript,uc as getCachedSignalsRuntime,Vd as getServeClientAsset,Yo as getServeModuleBundle,Un as hashFilePath,zd as invalidateFileCache,Hd as invalidateFileCacheByDir,Fd as readFileCached,Wd as registerServeModuleBundle,dc as templateCache};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Tt,kc,Cc,_c,Ec,Tc,d,$c,hs,Rc,pi,fi}from"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{Tt as STX_ENGINE_BINDING_NAMES,hs as convertToCommonJS,pi as extractScriptFromTemplate,d as extractVariables,fi as hasVariables,$c as isCompleteImport,Tc as isMissingBindingFailure,_c as isModuleResolutionFailure,Ec as isSyntaxFailure,Rc as splitDeclaration,kc as stripTypeScript,Cc as withoutStxReferrer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xt,Kr,Xr,Jr,Od,Yr}from"./chunk-n5swm2mb.js";import"./chunk-ff61d2wr.js";import"./chunk-e124cgb6.js";import"./chunk-b156xw15.js";export{Xr as buildServerApi,Od as createServerApi,xt as discoverServerApi,Kr as generateApiTypes,Yr as isServerApiSource,Jr as productionApiDispatcher};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Fr,Fl,zl}from"./chunk-dp163aad.js";import"./chunk-w5nw5cj6.js";import"./chunk-n5swm2mb.js";import"./chunk-azb58ven.js";import"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{zl as clearComposableCache,Fl as getComposableScript,Fr as listComposableModules};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{zs,Hs,tt,J,kn,pr,Cn,fr,gr,Vc,Wc,qc,_n,Gc,Kc,Xc,Jc,Wi,qi,Gi,Us,Ki,Yc,nt,rt,st,ot,it,at,_e,Zc}from"./chunk-b156xw15.js";export{Cn as Router,Xc as abortNavigation,pr as bracketPathToRegex,nt as clearMiddleware,qi as createClientCookieManager,it as createMiddlewareContext,ot as createRouteLocation,Wi as createServerCookieManager,Gi as createStorageManager,Jc as defineMiddleware,Wc as defineRoute,qc as defineRoutes,fr as findErrorPage,gr as formatRoutes,Hs as generateRouteManifest,zs as generateRouteTypes,Ki as getMiddleware,rt as getMiddlewareNames,_e as getRouterScript,Zc as getRouterScriptDev,Yc as hasMiddleware,tt as isFileRequestPath,st as loadMiddlewareFromDirectory,kn as matchRoute,Kc as navigateTo,J as patternToRegex,Us as registerMiddleware,Gc as resetRoutes,_n as route,at as runMiddleware,Vc as setAppUrl};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ro,Ao,Po,Ad}from"./chunk-05hr7567.js";import"./chunk-59nq020j.js";import"./chunk-tqnh98j7.js";import"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{Ro as buildNative,Ad as default,Po as getAvailableFormats,Ao as getAvailableTargets};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{nd,rd,sd,od,id}from"./chunk-m6m19hwd.js";export{rd as defineAsyncComponent,od as generateAsyncComponentCSS,id as generateAsyncComponentRuntime,sd as isAsyncComponent,nd as processAsyncDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{pl}from"./chunk-9cc4fdtt.js";import"./chunk-h0e3ps74.js";import"./chunk-0fatkxpr.js";import"./chunk-n5swm2mb.js";import"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{pl as buildForProduction};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Cl}from"./chunk-tkmcyr0k.js";import"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{Cl as buildApp};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{pa,El,fa,ga,Tl,$l}from"./chunk-hbb208xt.js";import"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{$l as applySlots,Tl as extractSlotContent,El as parseSlotElement,pa as parseSlots,ga as processSlots,fa as renderSlot};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{R,zc,o,A,nu,ru}from"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{A as config,R as defaultConfig,nu as defineStxConfig,o as loadStxConfig,zc as resolveStxDirectories,ru as validateConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ae,Ya,Uo,yt,bt,Id,Vo,wt,tn,Za,Qa,ec,tc,vt,nc}from"./chunk-w5nw5cj6.js";import"./chunk-n5swm2mb.js";import"./chunk-azb58ven.js";import"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{tn as MODULE_SPECIFIER_PREFIX,vt as bundleClientScript,bt as clearBundleFailures,ae as clientBundleDependencies,yt as getBundleFailures,wt as hasUserImports,Qa as normalizeRegistrySpecifiers,tc as queueClientBundleBuild,Uo as recordBundleFailure,Za as registryIdForPath,Vo as resolveBundlerFallback,ec as rewriteRegistryImports,Id as setBundlerFallbackMode,Ya as shouldLogBundlerDiagnostics,nc as tempBuildName};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ko,La,Gt,jl,ja,Ba,Fa,Bl}from"./chunk-d37enreq.js";export{Gt as Validator,La as defineForm,ja as processErrorDirective,Ba as processErrorsDirective,Bl as processFormValidationDirectives,Fa as processHasErrorsDirective,ko as useForm,jl as v};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cn,wc,ds}from"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import{ke}from"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{ke as freeIdentifiers,ds as processComponents,wc as processESImports,cn as rendersAsElement};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{sl}from"./chunk-whykvbys.js";import"./chunk-h0e3ps74.js";import"./chunk-n5swm2mb.js";import"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{sl as startProductionServer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Xi,Ji}from"./chunk-skbbk6va.js";import"./chunk-b11qrqzz.js";import"./chunk-whykvbys.js";import"./chunk-km7sb7bj.js";import"./chunk-frgpx23w.js";import"./chunk-6kkt5fjx.js";import"./chunk-yq1mvakj.js";import"./chunk-9cc4fdtt.js";import{co}from"./chunk-h0e3ps74.js";import"./chunk-vvkfde23.js";import"./chunk-ah7h9q0x.js";import"./chunk-tkmcyr0k.js";import"./chunk-cv1q9fq8.js";import"./chunk-3nc2fr4q.js";import"./chunk-hbb208xt.js";import"./chunk-v79qs0qh.js";import"./chunk-8nwzd6eg.js";import"./chunk-gjx5256r.js";import"./chunk-8tpey96f.js";import"./chunk-77j26p6r.js";import"./chunk-d37enreq.js";import"./chunk-zmq9hwta.js";import"./chunk-dp163aad.js";import"./chunk-kch9a9v1.js";import"./chunk-39tkfkp7.js";import"./chunk-7ze47qgv.js";import"./chunk-wy4hfmjs.js";import"./chunk-m6m19hwd.js";import"./chunk-gfqka4zx.js";import"./chunk-0fatkxpr.js";import"./chunk-f029nw9a.js";import"./chunk-59nq020j.js";import"./chunk-tqnh98j7.js";import"./chunk-wk85dz07.js";import"./chunk-w5nw5cj6.js";import"./chunk-n5swm2mb.js";import"./chunk-azb58ven.js";import{ye,sn,on,K,d,n,Zn,R,o,de}from"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{Zn as buildWebComponents,on as cacheTemplate,sn as checkCache,co as classifyAllScripts,Xi as createMiddleware,Ji as createRoute,R as defaultConfig,d as extractVariables,K as injectRouterScript,o as loadStxConfig,ye as processClientScript,n as processDirectives,de as readMarkdownFile};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{De,Xt,ld}from"./chunk-0fatkxpr.js";import{U,Mn,Jt,zr,Hr,Nn,dd,ud,pd,Yt,Zt,Ur,Ln,fd}from"./chunk-v39ysweq.js";import"./chunk-r4199q6x.js";export{zr as batch,ld as default,Mn as derived,Jt as effect,De as generateSignalsRuntime,Xt as generateSignalsRuntimeDev,Zt as isDerived,Yt as isSignal,Nn as onDestroy,Hr as onMount,Ln as peek,pd as pendingLifecycleCounts,ud as runDestroyCallbacks,dd as runMountCallbacks,U as state,Ur as untrack,fd as useOptimistic};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Hl}from"./chunk-kch9a9v1.js";export{Hl as processDeferDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Wl,ql,Gl,Kl,Xl,Jl}from"./chunk-7ze47qgv.js";export{Kl as generateTransitionCSS,Xl as generateTransitionRuntime,Wl as performEnter,ql as performLeave,Jl as processTransitionAttributes,Gl as processTransitionDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Yl,Zl,Ql,ed,td}from"./chunk-wy4hfmjs.js";export{Zl as createSSRSuspense,ed as generateSuspenseCSS,td as generateSuspenseRuntime,Yl as processSuspenseDirectives,Ql as renderSSRSuspense};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rl,Al,Pl,Il,Ol,Dl,Ml}from"./chunk-gjx5256r.js";export{Al as createKeepAliveCache,Il as generateKeepAliveCSS,Ol as generateKeepAliveRuntime,Dl as onActivated,Ml as onDeactivated,Rl as processKeepAliveDirectives,Pl as shouldCacheComponent};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Zd,vc,us,ps,ci,li,gs,ms,Kn,xc,di,ui,Sc,We}from"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{Zd as clearScriptScanCache,gs as convertServerLoopAttributesToDirectives,ci as convertSignalDirectivesToAttributes,ms as convertSignalLoopsToAttributes,xc as extractExports,ui as findMarkupIndexOutsideScripts,ps as hasSignalsSyntax,us as parseLoopExpression,li as preEvalLiteralReactiveIfs,Kn as processScriptSetup,di as processSignals,Sc as rewriteStxImportSpecifiers,vc as scanScriptTags,We as stripStxRuntimeImports};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{oa,ao,cl,ia,aa,ll,dl}from"./chunk-6kkt5fjx.js";import"./chunk-dp163aad.js";import"./chunk-w5nw5cj6.js";import"./chunk-n5swm2mb.js";import"./chunk-azb58ven.js";import{Ve,bc}from"./chunk-qrqw667n.js";import"./chunk-yp1360pq.js";import"./chunk-4zb2ga7p.js";import"./chunk-ff61d2wr.js";import"./chunk-mdgvzf07.js";import"./chunk-e124cgb6.js";import"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-b156xw15.js";import"./chunk-1xgs9gd5.js";export{oa as buildVirtualSource,Ve as extractScriptBlocks,bc as extractTemplateExpressions,ia as findRuntimeTypeDeclarations,aa as findStxModuleDeclarations,dl as formatTypecheckDiagnostics,cl as sourcePathFor,ll as typecheckStxFiles,ao as virtualPathFor};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ul,Vl}from"./chunk-39tkfkp7.js";export{Vl as ensureTeleportTargets,Ul as processTeleportDirectives};