@stacksjs/stx 0.2.720 → 0.2.722

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 (86) hide show
  1. package/README.md +6 -0
  2. package/dist/{chunk-e13vngat.js → chunk-04pzzhn7.js} +1 -1
  3. package/dist/{chunk-gwq82dpy.js → chunk-1z0zmgsj.js} +4 -4
  4. package/dist/{chunk-6h0n7h97.js → chunk-2d31hmtc.js} +2 -2
  5. package/dist/{chunk-nb65s3b5.js → chunk-2dm1kn1w.js} +4 -4
  6. package/dist/{chunk-a82dg51h.js → chunk-3hsw0s60.js} +1 -1
  7. package/dist/chunk-3mqxasmr.js +2 -0
  8. package/dist/{chunk-zc116ep8.js → chunk-48v2mdxa.js} +1 -1
  9. package/dist/{chunk-2f3zw2wy.js → chunk-4haedk3v.js} +1 -1
  10. package/dist/chunk-52ysrkex.js +2 -0
  11. package/dist/{chunk-9vx6et01.js → chunk-6tf24hs3.js} +1 -1
  12. package/dist/{chunk-pz837t6v.js → chunk-6vd1tw4p.js} +1 -1
  13. package/dist/chunk-82hhwy20.js +2 -0
  14. package/dist/{chunk-qvwwpnyk.js → chunk-99ke9sz0.js} +3 -3
  15. package/dist/{chunk-0ktg5dw9.js → chunk-9gdz941b.js} +1 -1
  16. package/dist/chunk-a0ab1h7m.js +2 -0
  17. package/dist/{chunk-2gg3apz0.js → chunk-aj2mxp6q.js} +1 -1
  18. package/dist/{chunk-9v16zd8h.js → chunk-atz8z223.js} +1 -1
  19. package/dist/{chunk-jh8b3f9w.js → chunk-b4xavv78.js} +1 -1
  20. package/dist/{chunk-kn92y5yd.js → chunk-bdsp619m.js} +2 -2
  21. package/dist/{chunk-rfb00eqz.js → chunk-brwcbz1z.js} +5 -5
  22. package/dist/{chunk-11k6atcw.js → chunk-cr8kksjp.js} +1 -1
  23. package/dist/{chunk-ejp4d8cq.js → chunk-e8tyr2mk.js} +1 -1
  24. package/dist/{chunk-rm9rmyh2.js → chunk-eebn36ws.js} +1 -1
  25. package/dist/{chunk-dffe3vx2.js → chunk-ewen9p1d.js} +1 -1
  26. package/dist/{chunk-1xt84h16.js → chunk-f168pjxz.js} +1 -1
  27. package/dist/{chunk-m7hbk341.js → chunk-fxtqbtey.js} +1 -1
  28. package/dist/{chunk-jtf6sxgd.js → chunk-g6r1vft1.js} +1 -1
  29. package/dist/{chunk-43anje0a.js → chunk-ghf5pc18.js} +1 -1
  30. package/dist/{chunk-2rj4t9wz.js → chunk-gq58xt9y.js} +1 -1
  31. package/dist/{chunk-ve78svbr.js → chunk-gz5w84nz.js} +1 -1
  32. package/dist/{chunk-hp957nrn.js → chunk-h0mh5gec.js} +2 -2
  33. package/dist/{chunk-y0bepgyh.js → chunk-hh3ss945.js} +1 -1
  34. package/dist/chunk-hrjzd135.js +2 -0
  35. package/dist/{chunk-5rjfaj0b.js → chunk-kdp20nnt.js} +2 -2
  36. package/dist/{chunk-04xtzbf6.js → chunk-ke2t93w6.js} +1 -1
  37. package/dist/{chunk-pqrgaahp.js → chunk-m3qb17ad.js} +3 -3
  38. package/dist/{chunk-0wfbhs15.js → chunk-madkha56.js} +1 -1
  39. package/dist/{chunk-8csv4s4f.js → chunk-mj04jc44.js} +3 -3
  40. package/dist/{chunk-57ecpsqy.js → chunk-ncq1bzwh.js} +1 -1
  41. package/dist/{chunk-n0bw2kzs.js → chunk-p3n4z56e.js} +1 -1
  42. package/dist/{chunk-8deed4r2.js → chunk-p8z3fmz8.js} +1 -1
  43. package/dist/{chunk-5bm0nh5f.js → chunk-pcpt0661.js} +2 -2
  44. package/dist/{chunk-znknf1jt.js → chunk-pv9vw6y3.js} +101 -101
  45. package/dist/{chunk-hpg5bjzb.js → chunk-pxg67s3v.js} +1 -1
  46. package/dist/chunk-qbp5ne23.js +2 -0
  47. package/dist/{chunk-ty5rncss.js → chunk-r0cnxng9.js} +1 -1
  48. package/dist/{chunk-r1t5dcsn.js → chunk-t06tskeq.js} +1 -1
  49. package/dist/{chunk-kxp881ch.js → chunk-tef5t0b2.js} +1 -1
  50. package/dist/{chunk-0azq3w1a.js → chunk-v7gqjf44.js} +50 -50
  51. package/dist/{chunk-kbw75yd7.js → chunk-v7pzn7md.js} +1 -1
  52. package/dist/chunk-vejmjcmj.js +3 -0
  53. package/dist/{chunk-hsqqhjhr.js → chunk-vz9r5f1r.js} +1 -1
  54. package/dist/{chunk-b8a8900p.js → chunk-wd71x3xf.js} +1 -1
  55. package/dist/{chunk-xvkqa756.js → chunk-wf3sjfvb.js} +1 -1
  56. package/dist/chunk-x7yb70j1.js +2 -0
  57. package/dist/{chunk-009y9zkg.js → chunk-xb63rsr1.js} +1 -1
  58. package/dist/{chunk-bpds7e9v.js → chunk-xyy9shta.js} +1 -1
  59. package/dist/{chunk-pcsgj3a5.js → chunk-y43xak2g.js} +1 -1
  60. package/dist/chunk-y7hfh69h.js +2 -0
  61. package/dist/chunk-y9335aa8.js +2 -0
  62. package/dist/{chunk-xhpf68p4.js → chunk-ypvt1sy9.js} +1 -1
  63. package/dist/{chunk-mhpek1hj.js → chunk-yqrckcv0.js} +1 -1
  64. package/dist/chunk-zgkwpsyj.js +2 -0
  65. package/dist/cli.js +7 -7
  66. package/dist/component-library.js +12 -7
  67. package/dist/craft-entry.js +1 -1
  68. package/dist/craft.js +1 -1
  69. package/dist/misc-directives.js +7 -3
  70. package/dist/native-backend.d.ts +1 -0
  71. package/dist/native-backend.js +16 -1
  72. package/dist/native-build.js +2 -2
  73. package/dist/pwa.js +1 -1
  74. package/dist/ssg.js +2 -2
  75. package/package.json +5 -5
  76. package/dist/chunk-2sjvj2gb.js +0 -2
  77. package/dist/chunk-4m1zv168.js +0 -2
  78. package/dist/chunk-5awvckb2.js +0 -2
  79. package/dist/chunk-5dvb2e8f.js +0 -2
  80. package/dist/chunk-6r1wzzt3.js +0 -2
  81. package/dist/chunk-ddxrb5zk.js +0 -2
  82. package/dist/chunk-g9vag1n2.js +0 -2
  83. package/dist/chunk-hgrtnyp3.js +0 -2
  84. package/dist/chunk-jy8m3dah.js +0 -3
  85. package/dist/chunk-sey2x612.js +0 -2
  86. package/dist/chunk-y7b9kqz8.js +0 -2
@@ -363,7 +363,7 @@ function parsePropsDeclaration(code) {
363
363
  start = found.index + found[0].indexOf(found[1]);
364
364
  if (start === -1)
365
365
  return null;
366
- const declared = {}, defaults = {}, propNames = [];
366
+ const declared = {}, defaults = {}, propNames = [], propBindings = {};
367
367
  let cursor = start + (/^(?:const|let|var)\s+/.exec(code.slice(start))?.[0].length ?? 0);
368
368
  const skipSpace = () => {
369
369
  while (cursor < code.length && /\s/.test(code[cursor]))
@@ -467,16 +467,17 @@ function parsePropsDeclaration(code) {
467
467
  if (pattern.startsWith("{")) {
468
468
  propNames.length = 0;
469
469
  for (const entry of splitTopLevel(pattern.replace(/^\{/, "").replace(/\}$/, ""), ",", !1)) {
470
- const assignment = defaultAssignmentIndex(entry), name = (assignment === -1 ? entry : entry.slice(0, assignment)).split(":")[0].trim().replace(/^\.\.\./, "");
470
+ const assignment = defaultAssignmentIndex(entry), binding = assignment === -1 ? entry : entry.slice(0, assignment), name = binding.split(":")[0].trim().replace(/^\.\.\./, "");
471
471
  if (!name)
472
472
  continue;
473
473
  propNames.push(name);
474
+ propBindings[name] = binding.trim();
474
475
  if (assignment !== -1)
475
476
  defaults[name] = entry.slice(assignment + 1).trim();
476
477
  }
477
478
  } else if (propNames.length === 0)
478
479
  propNames.push(...Object.keys(declared));
479
- return { text: code.slice(start, cursor), propNames, defaults, declared, typeName };
480
+ return { text: code.slice(start, cursor), propNames, propBindings, defaults, declared, typeName };
480
481
  }
481
482
  export function parseDefaults(object) {
482
483
  const body = object.trim().replace(/^\{/, "").replace(/\}$/, ""), pairs = [];
@@ -517,9 +518,9 @@ export function parseDefaults(object) {
517
518
  function compileScriptScope(source, file, outputDir) {
518
519
  const block = [...source.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)].find((script) => !/\bcomponent\b|\bstx:component\b|\bclient\b/i.test(script[1]));
519
520
  if (!block)
520
- return { imports: [], body: "", propNames: [], defaults: {}, declared: {} };
521
+ return { imports: [], body: "", propNames: [], propBindings: {}, defaults: {}, declared: {} };
521
522
  let code = block[2];
522
- const imports = [], propNames = [], defaults = {}, declared = {};
523
+ const imports = [], propNames = [], propBindings = {}, defaults = {}, declared = {};
523
524
  code = code.replace(/^\s*import\s+[\s\S]*?from\s*['"][^'"]+['"];?\s*$/gm, (statement) => {
524
525
  if (/from\s*['"]stx['"]/.test(statement))
525
526
  return "";
@@ -532,6 +533,7 @@ function compileScriptScope(source, file, outputDir) {
532
533
  const props = parsePropsDeclaration(code);
533
534
  if (props) {
534
535
  propNames.push(...props.propNames);
536
+ Object.assign(propBindings, props.propBindings);
535
537
  Object.assign(defaults, props.defaults);
536
538
  Object.assign(declared, props.declared);
537
539
  code = code.replace(props.text, "");
@@ -551,7 +553,7 @@ function compileScriptScope(source, file, outputDir) {
551
553
  propNames.push(name);
552
554
  }
553
555
  code = code.replace(/(?:export\s+)?interface\s+[A-Za-z_$][\w$]*\s*\{[\s\S]*?\n\}/g, "");
554
- return { imports, body: code.trim(), propNames, defaults, declared };
556
+ return { imports, body: code.trim(), propNames, propBindings, defaults, declared };
555
557
  }
556
558
  function compileEventDirectives(template) {
557
559
  const eventTypes = new Set;
@@ -947,7 +949,10 @@ ${body}
947
949
  }`;
948
950
  }).join(`
949
951
 
950
- `), scope = component.scope, destructured = [...new Set([...Object.keys(component.properties), ...scope.propNames])].map((name) => scope.defaults[name] === void 0 ? name : `${name} = ${scope.defaults[name]}`).join(", "), indent = (code) => code.split(`
952
+ `), scope = component.scope, destructured = [...new Set([...Object.keys(component.properties), ...scope.propNames])].map((name) => {
953
+ const binding = scope.propBindings[name] || name;
954
+ return scope.defaults[name] === void 0 ? binding : `${binding} = ${scope.defaults[name]}`;
955
+ }).join(", "), indent = (code) => code.split(`
951
956
  `).map((line) => line.trim() === "" ? line : ` ${line}`).join(`
952
957
  `);
953
958
  let renderMethod = "";
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{co,fa,ga}from"./chunk-9chqvq23.js";import"./chunk-x6hqe25e.js";import"./chunk-zkx2m308.js";import"./chunk-ez35607j.js";import"./chunk-zn3c0ew5.js";import"./chunk-0azq3w1a.js";import"./chunk-rbmt5w9v.js";import"./chunk-xhpf68p4.js";import"./chunk-4c86wr9a.js";import"./chunk-2mqzpzy7.js";import"./chunk-5rjfaj0b.js";import"./chunk-q7fh1xka.js";import"./chunk-3fwdxxh1.js";import"./chunk-8deed4r2.js";import"./chunk-6h0n7h97.js";import"./chunk-rfb00eqz.js";import"./chunk-kbw75yd7.js";import"./chunk-nb65s3b5.js";import"./chunk-5bm0nh5f.js";import"./chunk-jtf6sxgd.js";import"./chunk-x9wwd2ee.js";import"./chunk-hez09ssh.js";import{Jl,oa,Hm,Vm,ia,ao,Wr,aa,ca,Um,Wm,la,ua,da,pa}from"./chunk-pqrgaahp.js";import"./chunk-kn92y5yd.js";import"./chunk-jy8m3dah.js";import"./chunk-r3j4m04w.js";import"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-b8a8900p.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
2
+ import{co,fa,ga}from"./chunk-9chqvq23.js";import"./chunk-x6hqe25e.js";import"./chunk-zkx2m308.js";import"./chunk-ez35607j.js";import"./chunk-zn3c0ew5.js";import"./chunk-v7gqjf44.js";import"./chunk-rbmt5w9v.js";import"./chunk-ypvt1sy9.js";import"./chunk-4c86wr9a.js";import"./chunk-2mqzpzy7.js";import"./chunk-kdp20nnt.js";import"./chunk-q7fh1xka.js";import"./chunk-3fwdxxh1.js";import"./chunk-p8z3fmz8.js";import"./chunk-2d31hmtc.js";import"./chunk-brwcbz1z.js";import"./chunk-v7pzn7md.js";import"./chunk-2dm1kn1w.js";import"./chunk-pcpt0661.js";import"./chunk-g6r1vft1.js";import"./chunk-x9wwd2ee.js";import"./chunk-hez09ssh.js";import{Jl,oa,Hm,Vm,ia,ao,Wr,aa,ca,Um,Wm,la,ua,da,pa}from"./chunk-m3qb17ad.js";import"./chunk-bdsp619m.js";import"./chunk-vejmjcmj.js";import"./chunk-r3j4m04w.js";import"./chunk-1z0zmgsj.js";import"./chunk-m5nzpjej.js";import"./chunk-wd71x3xf.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
3
3
  `),scripts:t.scripts.join(`
4
4
  `),metadata:{renderTime:0,cacheHit:!0,totalSize:c.html.length,componentCount:t.metadata.componentCount}}}let a;if(n.streaming)a=await H(t.tree,e);else a=h(t.tree,e);let i;if(n.hydrate){let o=j(a,t,e);a=o.html,i=o.data}if(n.minify)a=D(a);if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`;d.set(o,{html:a,timestamp:Date.now()})}let s=performance.now()-r;return{html:a,styles:t.styles.join(`
5
5
  `),scripts:t.scripts.join(`
package/dist/craft.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{co,fa,ga}from"./chunk-9chqvq23.js";import"./chunk-x6hqe25e.js";import"./chunk-zkx2m308.js";import"./chunk-ez35607j.js";import"./chunk-zn3c0ew5.js";import"./chunk-0azq3w1a.js";import"./chunk-rbmt5w9v.js";import"./chunk-xhpf68p4.js";import"./chunk-4c86wr9a.js";import"./chunk-2mqzpzy7.js";import"./chunk-5rjfaj0b.js";import"./chunk-q7fh1xka.js";import"./chunk-3fwdxxh1.js";import"./chunk-8deed4r2.js";import"./chunk-6h0n7h97.js";import"./chunk-rfb00eqz.js";import"./chunk-kbw75yd7.js";import"./chunk-nb65s3b5.js";import"./chunk-5bm0nh5f.js";import"./chunk-jtf6sxgd.js";import"./chunk-x9wwd2ee.js";import"./chunk-hez09ssh.js";import{Jl,oa,Hm,Vm,ia,ao,Wr,aa,ca,Um,Wm,la,ua,da,pa}from"./chunk-pqrgaahp.js";import"./chunk-kn92y5yd.js";import"./chunk-jy8m3dah.js";import"./chunk-r3j4m04w.js";import"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-b8a8900p.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
2
+ import{co,fa,ga}from"./chunk-9chqvq23.js";import"./chunk-x6hqe25e.js";import"./chunk-zkx2m308.js";import"./chunk-ez35607j.js";import"./chunk-zn3c0ew5.js";import"./chunk-v7gqjf44.js";import"./chunk-rbmt5w9v.js";import"./chunk-ypvt1sy9.js";import"./chunk-4c86wr9a.js";import"./chunk-2mqzpzy7.js";import"./chunk-kdp20nnt.js";import"./chunk-q7fh1xka.js";import"./chunk-3fwdxxh1.js";import"./chunk-p8z3fmz8.js";import"./chunk-2d31hmtc.js";import"./chunk-brwcbz1z.js";import"./chunk-v7pzn7md.js";import"./chunk-2dm1kn1w.js";import"./chunk-pcpt0661.js";import"./chunk-g6r1vft1.js";import"./chunk-x9wwd2ee.js";import"./chunk-hez09ssh.js";import{Jl,oa,Hm,Vm,ia,ao,Wr,aa,ca,Um,Wm,la,ua,da,pa}from"./chunk-m3qb17ad.js";import"./chunk-bdsp619m.js";import"./chunk-vejmjcmj.js";import"./chunk-r3j4m04w.js";import"./chunk-1z0zmgsj.js";import"./chunk-m5nzpjej.js";import"./chunk-wd71x3xf.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
3
3
  `),scripts:t.scripts.join(`
4
4
  `),metadata:{renderTime:0,cacheHit:!0,totalSize:c.html.length,componentCount:t.metadata.componentCount}}}let a;if(n.streaming)a=await H(t.tree,e);else a=h(t.tree,e);let i;if(n.hydrate){let o=j(a,t,e);a=o.html,i=o.data}if(n.minify)a=D(a);if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`;d.set(o,{html:a,timestamp:Date.now()})}let s=performance.now()-r;return{html:a,styles:t.styles.join(`
5
5
  `),scripts:t.scripts.join(`
@@ -164,13 +164,17 @@ export function markProjectedRefs(template, receiver) {
164
164
  }
165
165
  continue;
166
166
  }
167
- const scoped = /\sdata-stx-scope\s*=/.test(token);
168
- if (!scopedDepth && !scoped && /\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(token) && !/\sdata-stx-ref-caller\s*=/.test(token)) {
167
+ const scoped = /\sdata-stx-scope\s*=/.test(token), projected = /\sdata-stx-ref-caller\s*=\s*(["'])(.*?)\1/.exec(token), boundary = ancestors.find((ancestor) => ancestor.scoped)?.scopeId;
168
+ if (projected && boundary && projected[2] === boundary) {
169
+ output.push(template.slice(cursor, start), token.replace(projected[0], ` data-stx-ref-caller="${receiver}"`));
170
+ cursor = end;
171
+ } else if (!scopedDepth && !scoped && /\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(token) && !/\sdata-stx-ref-caller\s*=/.test(token)) {
169
172
  output.push(template.slice(cursor, start), token.replace(/\s*\/?>$/, (ending) => ` data-stx-ref-caller="${receiver}"${ending}`));
170
173
  cursor = end;
171
174
  }
172
175
  if (!VOID_TAGS.has(name) && !/\/>$/.test(token)) {
173
- ancestors.push({ name, scoped });
176
+ const scopeId = /\sdata-stx-scope\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(token);
177
+ ancestors.push({ name, scoped, scopeId: scopeId?.[1] ?? scopeId?.[2] });
174
178
  if (scoped)
175
179
  scopedDepth++;
176
180
  }
@@ -4,4 +4,5 @@ export declare interface NativeBackendOptions {
4
4
  html: string
5
5
  fetch: (request: Request) => Response | null | Promise<Response | null>
6
6
  maxRequestBodySize?: number
7
+ shutdown?: () => void | Promise<void>
7
8
  }
@@ -31,9 +31,24 @@ export async function runNativeBackend(options) {
31
31
  }
32
32
  }), url = `${server.url}?session=${token}`;
33
33
  console.log(url);
34
+ let stopping = !1;
34
35
  const stop = () => {
36
+ if (stopping)
37
+ return;
38
+ stopping = !0;
35
39
  server.stop(!0);
36
- process.exit(0);
40
+ const timeout = setTimeout(() => {
41
+ console.error("Native backend shutdown exceeded two seconds.");
42
+ process.exit(1);
43
+ }, 2000);
44
+ Promise.resolve().then(() => options.shutdown?.()).then(() => {
45
+ clearTimeout(timeout);
46
+ process.exit(0);
47
+ }, () => {
48
+ clearTimeout(timeout);
49
+ console.error("Native backend shutdown failed.");
50
+ process.exit(1);
51
+ });
37
52
  };
38
53
  process.once("SIGTERM", stop);
39
54
  process.once("SIGINT", stop);
@@ -124,8 +124,8 @@ async function buildMacOS(html, appName, appVersion, outputDir, format, config,
124
124
  try {
125
125
  const entry = join(scratch, "launcher.ts"), runtime = join(import.meta.dir, "native-backend" + (import.meta.path.endsWith(".ts") ? ".ts" : ".js"));
126
126
  await Bun.write(entry, `import { runNativeBackend } from ${JSON.stringify(runtime)}
127
- import handler from ${JSON.stringify(resolve(config.backend.entry))}
128
- await runNativeBackend({ html: ${JSON.stringify(html)}, fetch: handler,
127
+ import * as backend from ${JSON.stringify(resolve(config.backend.entry))}
128
+ await runNativeBackend({ html: ${JSON.stringify(html)}, fetch: backend.default, shutdown: Reflect.get(backend, "shutdown"),
129
129
  maxRequestBodySize: ${config.backend.maxRequestBodySize ?? 33554432} })
130
130
  `);
131
131
  const compiled = Bun.spawn([
package/dist/pwa.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  import{Vs,Ft,ol,ag}from"./chunk-88rftjjk.js";import{Hs,bi,sg,og,ig}from"./chunk-qf2aa8qe.js";import{nl,rl,sl,ng,rg}from"./chunk-narz7105.js";import{Ve,_n,vi}from"./chunk-j28r2d0q.js";import{cg,lg,ug,dg,Us,Lh}from"./chunk-dhy6n39n.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-4m1zv168.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>
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-hrjzd135.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">
package/dist/ssg.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-1xjv71dw.js";import{b,Fc}from"./chunk-zkx2m308.js";import"./chunk-ez35607j.js";import"./chunk-zn3c0ew5.js";import{Tt,S}from"./chunk-0azq3w1a.js";import"./chunk-rbmt5w9v.js";import"./chunk-xhpf68p4.js";import"./chunk-4c86wr9a.js";import{xt,St,kt,_t,Ct,Et}from"./chunk-2mqzpzy7.js";import{a}from"./chunk-5rjfaj0b.js";import{ms}from"./chunk-q7fh1xka.js";import"./chunk-3fwdxxh1.js";import"./chunk-0wfbhs15.js";import{Te,Yt,Zt}from"./chunk-hsqqhjhr.js";import"./chunk-8deed4r2.js";import{y}from"./chunk-6h0n7h97.js";import{mt,i}from"./chunk-rfb00eqz.js";import"./chunk-kbw75yd7.js";import"./chunk-nb65s3b5.js";import"./chunk-5bm0nh5f.js";import"./chunk-jtf6sxgd.js";import"./chunk-x9wwd2ee.js";import{Ma,La,ja}from"./chunk-dmnncw90.js";import{Xt,Gn,Xn}from"./chunk-9adx6f4k.js";import{Jt}from"./chunk-n0bw2kzs.js";import"./chunk-jy8m3dah.js";import"./chunk-r3j4m04w.js";import{G,be}from"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-b8a8900p.js";import{l}from"./chunk-qc93ce5h.js";import{s,ge}from"./chunk-05qf3e2p.js";import D from"fs";import h from"path";import{createHash as Pt}from"crypto";function $t(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Dt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Rt(t){return Bun.hash(t).toString(16)}function ot(t,r={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let o=new Map,n=t.replace(Dt,(e,u,f,v)=>{let w=v.trim();if(!w)return e;if(/\bdata-stx-src=/.test(f))return e;if(r.minify)w=$t(w);let g=Rt(w);if(!o.has(g))o.set(g,w);let P=r.integrity?` data-stx-integrity="sha384-${Pt("sha384").update(w).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${g}.js"${P}${f}></script>`}),c=Array.from(o,([e,u])=>({hash:e,code:u}));return{html:n,chunks:c}}var It=new Set(["visible","idle"]);function ct(t){if(!t.includes("data-stx-src="))return t;let r=new Map,o=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,n;while((n=o.exec(t))!==null)r.set(n[1],n[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(It.has(r.get(u[1])||""))c.add(u[2]);let f=/<\/head\s*>/iy,v=S(t,(g,P)=>(f.lastIndex=P,f.exec(g)?f.lastIndex:-1))[0]?.start??-1;if(c.size===0||v===-1)return t;let w=Array.from(c).filter((g)=>!t.includes(`rel="prefetch" href="${g}"`)).map((g)=>`<link rel="prefetch" href="${g}" as="script">`).join("");if(!w)return t;return t.slice(0,v)+w+t.slice(v)}var Bt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let r=t.trim();if(!r)return null;let o=/^https?:\/\//i.test(r)?r:`https://${r}`;try{return new URL(o).origin+new URL(o).pathname.replace(/\/$/,"")}catch{return null}}function jt(t){for(let r of Bt){let o=t[r];if(!o)continue;let n=X(o);if(n)return{url:n,source:"env",via:r}}return null}function lt(t){if(!t||typeof t!=="object")return null;let r=t,o=r.site?.url??r.url??r.app?.url;return typeof o==="string"?X(o):null}async function Ft(t){let{existsSync:r}=await import("fs"),o=await import("path");for(let n of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=o.resolve(t,n);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(),o=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let n=lt(t.stxConfig);if(n)return{url:n,source:"stx.config",via:"site.url"};let c=await Ft(r);if(c)return{url:c,source:"site.config",via:"url"};let e=jt(o);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(`
2
+ import"./chunk-1xjv71dw.js";import{b,Fc}from"./chunk-zkx2m308.js";import"./chunk-ez35607j.js";import"./chunk-zn3c0ew5.js";import{Tt,S}from"./chunk-v7gqjf44.js";import"./chunk-rbmt5w9v.js";import"./chunk-ypvt1sy9.js";import"./chunk-4c86wr9a.js";import{xt,St,kt,_t,Ct,Et}from"./chunk-2mqzpzy7.js";import{a}from"./chunk-kdp20nnt.js";import{ms}from"./chunk-q7fh1xka.js";import"./chunk-3fwdxxh1.js";import"./chunk-madkha56.js";import{Te,Yt,Zt}from"./chunk-vz9r5f1r.js";import"./chunk-p8z3fmz8.js";import{y}from"./chunk-2d31hmtc.js";import{mt,i}from"./chunk-brwcbz1z.js";import"./chunk-v7pzn7md.js";import"./chunk-2dm1kn1w.js";import"./chunk-pcpt0661.js";import"./chunk-g6r1vft1.js";import"./chunk-x9wwd2ee.js";import{Ma,La,ja}from"./chunk-dmnncw90.js";import{Xt,Gn,Xn}from"./chunk-9adx6f4k.js";import{Jt}from"./chunk-p3n4z56e.js";import"./chunk-vejmjcmj.js";import"./chunk-r3j4m04w.js";import{G,be}from"./chunk-1z0zmgsj.js";import"./chunk-m5nzpjej.js";import"./chunk-wd71x3xf.js";import{l}from"./chunk-qc93ce5h.js";import{s,ge}from"./chunk-05qf3e2p.js";import D from"fs";import h from"path";import{createHash as Pt}from"crypto";function $t(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Dt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Rt(t){return Bun.hash(t).toString(16)}function ot(t,r={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let o=new Map,n=t.replace(Dt,(e,u,f,v)=>{let w=v.trim();if(!w)return e;if(/\bdata-stx-src=/.test(f))return e;if(r.minify)w=$t(w);let g=Rt(w);if(!o.has(g))o.set(g,w);let P=r.integrity?` data-stx-integrity="sha384-${Pt("sha384").update(w).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${g}.js"${P}${f}></script>`}),c=Array.from(o,([e,u])=>({hash:e,code:u}));return{html:n,chunks:c}}var It=new Set(["visible","idle"]);function ct(t){if(!t.includes("data-stx-src="))return t;let r=new Map,o=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,n;while((n=o.exec(t))!==null)r.set(n[1],n[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(It.has(r.get(u[1])||""))c.add(u[2]);let f=/<\/head\s*>/iy,v=S(t,(g,P)=>(f.lastIndex=P,f.exec(g)?f.lastIndex:-1))[0]?.start??-1;if(c.size===0||v===-1)return t;let w=Array.from(c).filter((g)=>!t.includes(`rel="prefetch" href="${g}"`)).map((g)=>`<link rel="prefetch" href="${g}" as="script">`).join("");if(!w)return t;return t.slice(0,v)+w+t.slice(v)}var Bt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let r=t.trim();if(!r)return null;let o=/^https?:\/\//i.test(r)?r:`https://${r}`;try{return new URL(o).origin+new URL(o).pathname.replace(/\/$/,"")}catch{return null}}function jt(t){for(let r of Bt){let o=t[r];if(!o)continue;let n=X(o);if(n)return{url:n,source:"env",via:r}}return null}function lt(t){if(!t||typeof t!=="object")return null;let r=t,o=r.site?.url??r.url??r.app?.url;return typeof o==="string"?X(o):null}async function Ft(t){let{existsSync:r}=await import("fs"),o=await import("path");for(let n of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=o.resolve(t,n);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(),o=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let n=lt(t.stxConfig);if(n)return{url:n,source:"stx.config",via:"site.url"};let c=await Ft(r);if(c)return{url:c,source:"site.config",via:"url"};let e=jt(o);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
3
  `)}function J(t){return async()=>({paths:await t(),fallback:!1})}var At;function Ot(t){let r=s(t),{depths:o}=ge(r),n=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,c;while((c=n.exec(r))!==null){if(o[c.index]!==0)continue;let u=b(r,"(",")",n.lastIndex-1),f=r.indexOf("{",u+1),v=b(r,"{","}",f);if(u<0||f<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(o[c.index]!==0)continue;let u=Fc(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 o=await Bun.file(t).text();r="parse";let n=Jt(o),c=[...n.server,...n.client,...n.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(s(e.attrs))).sort((e,u)=>o.indexOf(e.fullTag)-o.indexOf(u.fullTag));for(let e of c){if(!/\bgetStaticPaths\b/.test(s(e.content)))continue;let u=(At??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(s(u)))continue;let f=Ot(u);if(/\bdefineStaticPaths\b/.test(s(f))&&Tt(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");r="execute";let v=Function("defineStaticPaths",`return (${f})`)(J);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let w=await v();r="result";let g=Array.isArray(w)?{paths:w}:w;if(!g||typeof g!=="object"||!("paths"in g)||!Array.isArray(g.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of g.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:g}}return{kind:"absent"}}catch(o){return{kind:"error",phase:r,error:o instanceof Error?o:Error(String(o))}}}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=h.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let r=JSON.parse(await Bun.file(t).text());for(let[o,n]of Object.entries(r))this.cache.set(o,n)}catch{}this.loaded=!0}async save(){await D.promises.mkdir(this.cacheDir,{recursive:!0});let t=h.join(this.cacheDir,"build-cache.json"),r={};for(let[o,n]of this.cache)r[o]=n;await Bun.write(t,JSON.stringify(r))}getHash(t,r){let o=D.statSync(t),n=`${this.salt}|${t}:${o.mtimeMs}`;for(let e of r)if(D.existsSync(e)){let u=D.statSync(e);n+=`:${e}:${u.mtimeMs}`}let c=0;for(let e=0;e<n.length;e++){let u=n.charCodeAt(e);c=(c<<5)-c+u,c=c&c}return Math.abs(c).toString(36)}get(t,r){let o=this.cache.get(t);if(!o)return null;let n=this.getHash(r,o.dependencies??[]);if(o.hash!==n)return this.cache.delete(t),null;return o.html}set(t,r,o,n){let c=this.getHash(r,o);this.cache.set(t,{hash:c,html:n,generatedAt:Date.now(),dependencies:o})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let r=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return h.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 o=this.getFilePath(t);await D.promises.mkdir(h.dirname(o),{recursive:!0}),await Bun.write(o,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=h.join(this.cacheDir,"isr");if(!D.existsSync(r))return;let o=await D.promises.readdir(r);for(let n of o){let c=n.replace(/_/g,"/").replace(".json","");if(t.test(c))await D.promises.unlink(h.join(r,n))}}async needsRevalidation(t){let r=await this.get(t);if(!r)return!0;return Date.now()>r.revalidateAfter}}async function Lt(t){let r=[];if(!t.isDynamic)r.push({url:t.pattern,params:{}});else{let o=await gt(t.filePath);if(o.kind==="error")throw Error(`getStaticPaths ${o.phase} failed for ${t.pattern} (${t.filePath}): ${o.error.message}`,{cause:o.error});if(o.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),r;let n=o.value;if(n.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),r;for(let c of n.paths){let e=t.pattern;for(let[u,f]of Object.entries(c.params))e=e.replace(`:${u}`,f).replace(`:${u}*`,f);r.push({url:e,params:c.params,props:c.props,revalidate:c.revalidate})}}return r}async function Ut(t){let r=[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"];for(let o of r)if(await Bun.file(o).exists())try{let n=await import(o);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:c,...e}=n;return e}}catch(n){console.error(`Error loading data file ${o}:`,n)}return null}async function Mt(t,r,o){let n=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!n)return null;let c=n[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]}
@@ -37,7 +37,7 @@ ${t.map((n)=>{let c=new URL(n.loc,r).href,e=` <url>
37
37
  ${o.join(`
38
38
  `)}
39
39
  </channel>
40
- </rss>`}async function Vt(t={}){let r=Date.now();Zt();let o=await a(process.cwd()),n=o.build||{},c=await ut({explicit:t.domain||n.domain,stxConfig:o});if(c.source==="fallback"&&(t.sitemap??n.sitemap??!0))console.warn(dt());let e={router:t.router??o?.router??{},pagesDir:t.pagesDir||n.pagesDir||"pages",outputDir:t.outputDir||n.outputDir||"dist",baseUrl:t.baseUrl||n.baseUrl||"/",domain:c.url,revalidate:t.revalidate??n.revalidate??!1,sitemap:t.sitemap??n.sitemap??!0,sitemapExclude:t.sitemapExclude||n.sitemapExclude||[],robots:t.robots??n.robots??!0,rss:t.rss??n.rss??!1,concurrency:t.concurrency||n.concurrency||10,cache:t.cache??n.cache??!0,cacheDir:t.cacheDir||n.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??n.minify??!0,generate404:t.generate404??n.generate404??!0,publicDir:t.publicDir||n.publicDir||"public",trailingSlash:t.trailingSlash??n.trailingSlash??!1,cleanOutput:t.cleanOutput??n.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||o?.partialsDir||"",componentsDir:t.componentsDir||o?.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:[]},f=new Set,v=0,w={},g={};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-009y9zkg.js");try{E=m(await d(process.cwd()))}catch{}}let{prepareImageDelivery:x}=await import("./chunk-2gg3apz0.js"),R=await x(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-009y9zkg.js");await d('<div class="bg-black"></div>')}catch{}xt();let wt=o?.routeMiddleware?.dir||"middleware";await kt(process.cwd(),wt);let V=St();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let yt=o?.routeMiddleware?.global||[];ja(o?.layoutsDir,l(process.cwd()));let Z=G(".",{pagesDir:e.pagesDir,pagesDirs:o?._layerPageDirs});console.log(`Found ${Z.length} routes`);let M=[];for(let d of Z)try{let m=await Lt(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:p,params:N,props:bt,revalidate:rt}=m;try{await e.hooks.onPageStart?.(p);let A=await Bun.file(k.filePath).text(),O=te(A),vt=O?.middleware?Array.isArray(O.middleware)?O.middleware:[O.middleware]:[],nt=[...yt,...vt];if(nt.length>0){let B=_t(p,N,O||{}),L=Ct(B,null,void 0,{isServer:!0}),j=await Et(nt,L);if(j.redirect){let C=typeof j.redirect==="string"?j.redirect:j.redirect.path||j.redirect,z=ee(String(C),p),U=re(p,e);await D.promises.mkdir(h.dirname(U),{recursive:!0}),await Bun.write(U,z),u.successCount++,u.pages.push({route:p,outputPath:U,size:Buffer.byteLength(z),cached:!1}),_.push({loc:p,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${p} \u2192 redirect to ${C}`);return}if(j.abort){let C=typeof j.abort==="string"?j.abort:j.abort?.error?.message||"aborted";console.warn(` \u21B3 ${p} \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();Zt();let o=await a(process.cwd()),n=o.build||{},c=await ut({explicit:t.domain||n.domain,stxConfig:o});if(c.source==="fallback"&&(t.sitemap??n.sitemap??!0))console.warn(dt());let e={router:t.router??o?.router??{},pagesDir:t.pagesDir||n.pagesDir||"pages",outputDir:t.outputDir||n.outputDir||"dist",baseUrl:t.baseUrl||n.baseUrl||"/",domain:c.url,revalidate:t.revalidate??n.revalidate??!1,sitemap:t.sitemap??n.sitemap??!0,sitemapExclude:t.sitemapExclude||n.sitemapExclude||[],robots:t.robots??n.robots??!0,rss:t.rss??n.rss??!1,concurrency:t.concurrency||n.concurrency||10,cache:t.cache??n.cache??!0,cacheDir:t.cacheDir||n.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??n.minify??!0,generate404:t.generate404??n.generate404??!0,publicDir:t.publicDir||n.publicDir||"public",trailingSlash:t.trailingSlash??n.trailingSlash??!1,cleanOutput:t.cleanOutput??n.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||o?.partialsDir||"",componentsDir:t.componentsDir||o?.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:[]},f=new Set,v=0,w={},g={};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-xb63rsr1.js");try{E=m(await d(process.cwd()))}catch{}}let{prepareImageDelivery:x}=await import("./chunk-aj2mxp6q.js"),R=await x(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-xb63rsr1.js");await d('<div class="bg-black"></div>')}catch{}xt();let wt=o?.routeMiddleware?.dir||"middleware";await kt(process.cwd(),wt);let V=St();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let yt=o?.routeMiddleware?.global||[];ja(o?.layoutsDir,l(process.cwd()));let Z=G(".",{pagesDir:e.pagesDir,pagesDirs:o?._layerPageDirs});console.log(`Found ${Z.length} routes`);let M=[];for(let d of Z)try{let m=await Lt(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:p,params:N,props:bt,revalidate:rt}=m;try{await e.hooks.onPageStart?.(p);let A=await Bun.file(k.filePath).text(),O=te(A),vt=O?.middleware?Array.isArray(O.middleware)?O.middleware:[O.middleware]:[],nt=[...yt,...vt];if(nt.length>0){let B=_t(p,N,O||{}),L=Ct(B,null,void 0,{isServer:!0}),j=await Et(nt,L);if(j.redirect){let C=typeof j.redirect==="string"?j.redirect:j.redirect.path||j.redirect,z=ee(String(C),p),U=re(p,e);await D.promises.mkdir(h.dirname(U),{recursive:!0}),await Bun.write(U,z),u.successCount++,u.pages.push({route:p,outputPath:U,size:Buffer.byteLength(z),cached:!1}),_.push({loc:p,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${p} \u2192 redirect to ${C}`);return}if(j.abort){let C=typeof j.abort==="string"?j.abort:j.abort?.error?.message||"aborted";console.warn(` \u21B3 ${p} \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:N})){console.warn(`Validation failed for ${p}, skipping...`);return}}catch{}let I=null,st=!1;if(e.cache){if(I=T.get(p,k.filePath),I)st=!0,u.cachedCount++}if(!I){let B=await ft(k,N,bt,e,o);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:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.720",
4
+ "version": "0.2.722",
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.720",
132
- "@stacksjs/sanitizer": "0.2.720",
131
+ "@stacksjs/desktop": "0.2.722",
132
+ "@stacksjs/sanitizer": "0.2.722",
133
133
  "@stacksjs/ts-i18n": "^0.1.11",
134
- "bun-plugin-stx": "0.2.720",
134
+ "bun-plugin-stx": "0.2.722",
135
135
  "bunfig": "^0.15.21",
136
- "stx-router": "0.2.720",
136
+ "stx-router": "0.2.722",
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{xg}from"./chunk-hpg5bjzb.js";import"./chunk-8csv4s4f.js";import"./chunk-n0bw2kzs.js";import"./chunk-0wfbhs15.js";import"./chunk-jy8m3dah.js";import"./chunk-gwq82dpy.js";import"./chunk-5rjfaj0b.js";import"./chunk-b8a8900p.js";import"./chunk-4c86wr9a.js";import"./chunk-3fwdxxh1.js";import"./chunk-q7fh1xka.js";import"./chunk-2mqzpzy7.js";import"./chunk-0azq3w1a.js";import"./chunk-xhpf68p4.js";import"./chunk-rbmt5w9v.js";import"./chunk-zkx2m308.js";import"./chunk-zn3c0ew5.js";import"./chunk-ez35607j.js";export{xg as startProductionServer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Zn,i}from"./chunk-rfb00eqz.js";import"./chunk-6h0n7h97.js";import"./chunk-x9wwd2ee.js";import"./chunk-jtf6sxgd.js";import"./chunk-nb65s3b5.js";import"./chunk-kbw75yd7.js";import"./chunk-jy8m3dah.js";import"./chunk-r3j4m04w.js";import"./chunk-5bm0nh5f.js";import{be}from"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-8deed4r2.js";import"./chunk-5rjfaj0b.js";import"./chunk-b8a8900p.js";import"./chunk-4c86wr9a.js";import"./chunk-3fwdxxh1.js";import"./chunk-q7fh1xka.js";import"./chunk-2mqzpzy7.js";import{Ie,As,Ps}from"./chunk-0azq3w1a.js";import"./chunk-xhpf68p4.js";import"./chunk-rbmt5w9v.js";import"./chunk-zkx2m308.js";import"./chunk-zn3c0ew5.js";import"./chunk-ez35607j.js";export{Zn as buildModulesTag,be as injectRouterScript,i as processDirectives,As as processJsonDirective,Ps as processOnceDirective,Ie as validateClientScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Im,Om}from"./chunk-zc116ep8.js";import"./chunk-hsqqhjhr.js";import"./chunk-0wfbhs15.js";import"./chunk-1xjv71dw.js";import"./chunk-5bm0nh5f.js";import"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-5rjfaj0b.js";import"./chunk-b8a8900p.js";import"./chunk-4c86wr9a.js";import"./chunk-3fwdxxh1.js";import"./chunk-q7fh1xka.js";import"./chunk-2mqzpzy7.js";import"./chunk-0azq3w1a.js";import"./chunk-xhpf68p4.js";import"./chunk-rbmt5w9v.js";import"./chunk-zkx2m308.js";import"./chunk-zn3c0ew5.js";import"./chunk-ez35607j.js";export{Om as clearStoreCache,Im as getStoreScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{wg}from"./chunk-e13vngat.js";import"./chunk-rfb00eqz.js";import"./chunk-6h0n7h97.js";import"./chunk-x9wwd2ee.js";import"./chunk-jtf6sxgd.js";import"./chunk-nb65s3b5.js";import"./chunk-kbw75yd7.js";import"./chunk-jy8m3dah.js";import"./chunk-r3j4m04w.js";import"./chunk-5bm0nh5f.js";import"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-8deed4r2.js";import"./chunk-5rjfaj0b.js";import"./chunk-b8a8900p.js";import"./chunk-4c86wr9a.js";import"./chunk-3fwdxxh1.js";import"./chunk-q7fh1xka.js";import"./chunk-2mqzpzy7.js";import"./chunk-0azq3w1a.js";import"./chunk-xhpf68p4.js";import"./chunk-rbmt5w9v.js";import"./chunk-zkx2m308.js";import"./chunk-zn3c0ew5.js";import"./chunk-ez35607j.js";export{wg as startInteractive};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rg}from"./chunk-y0bepgyh.js";import"./chunk-8csv4s4f.js";import"./chunk-k93mp66m.js";import"./chunk-n0bw2kzs.js";import"./chunk-0wfbhs15.js";import"./chunk-rfb00eqz.js";import"./chunk-6h0n7h97.js";import"./chunk-x9wwd2ee.js";import"./chunk-jtf6sxgd.js";import"./chunk-nb65s3b5.js";import"./chunk-kbw75yd7.js";import"./chunk-jy8m3dah.js";import"./chunk-r3j4m04w.js";import"./chunk-5bm0nh5f.js";import"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-8deed4r2.js";import"./chunk-5rjfaj0b.js";import"./chunk-b8a8900p.js";import"./chunk-4c86wr9a.js";import"./chunk-3fwdxxh1.js";import"./chunk-q7fh1xka.js";import"./chunk-2mqzpzy7.js";import"./chunk-0azq3w1a.js";import"./chunk-xhpf68p4.js";import"./chunk-rbmt5w9v.js";import"./chunk-zkx2m308.js";import"./chunk-zn3c0ew5.js";import"./chunk-ez35607j.js";export{Rg as buildForProduction};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cl,ll}from"./chunk-znknf1jt.js";import"./chunk-e13vngat.js";import"./chunk-hpg5bjzb.js";import"./chunk-3xyvc3g1.js";import"./chunk-3e40sm05.js";import"./chunk-11k6atcw.js";import"./chunk-f2c3t1ky.js";import"./chunk-y0bepgyh.js";import"./chunk-8csv4s4f.js";import"./chunk-74fepz6h.js";import"./chunk-serrx31a.js";import"./chunk-xvkqa756.js";import"./chunk-rj4j7qcj.js";import"./chunk-bpds7e9v.js";import"./chunk-39nkd53v.js";import"./chunk-hnqpqtk2.js";import"./chunk-x5dc06p5.js";import"./chunk-9v16zd8h.js";import"./chunk-mwxbdpb1.js";import"./chunk-r1t5dcsn.js";import"./chunk-8fazd6fr.js";import"./chunk-pd89jnqk.js";import"./chunk-fsz9k5k0.js";import"./chunk-72hfqwvk.js";import"./chunk-78x8qfvt.js";import"./chunk-y3w2rc1y.js";import"./chunk-zc116ep8.js";import"./chunk-2f3zw2wy.js";import"./chunk-k93mp66m.js";import"./chunk-kn92y5yd.js";import"./chunk-hez09ssh.js";import"./chunk-dmnncw90.js";import{Jt}from"./chunk-n0bw2kzs.js";import"./chunk-hsqqhjhr.js";import"./chunk-0wfbhs15.js";import"./chunk-1xjv71dw.js";import{Re,i}from"./chunk-rfb00eqz.js";import"./chunk-6h0n7h97.js";import"./chunk-x9wwd2ee.js";import"./chunk-jtf6sxgd.js";import"./chunk-nb65s3b5.js";import"./chunk-kbw75yd7.js";import"./chunk-jy8m3dah.js";import"./chunk-r3j4m04w.js";import"./chunk-5bm0nh5f.js";import{be}from"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import{ir,ar}from"./chunk-8deed4r2.js";import{ls,j,a}from"./chunk-5rjfaj0b.js";import"./chunk-b8a8900p.js";import"./chunk-4c86wr9a.js";import"./chunk-3fwdxxh1.js";import"./chunk-q7fh1xka.js";import"./chunk-2mqzpzy7.js";import{m,Me}from"./chunk-0azq3w1a.js";import"./chunk-xhpf68p4.js";import"./chunk-rbmt5w9v.js";import"./chunk-zkx2m308.js";import"./chunk-zn3c0ew5.js";import"./chunk-ez35607j.js";import"./chunk-62awa752.js";import"./chunk-d9hw6n2d.js";export{ls as buildWebComponents,ar as cacheTemplate,ir as checkCache,Jt as classifyAllScripts,cl as createMiddleware,ll as createRoute,j as defaultConfig,m as extractVariables,be as injectRouterScript,a as loadStxConfig,Me as processClientScript,i as processDirectives,Re as readMarkdownFile};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Yr,nr,gf}from"./chunk-jtf6sxgd.js";import"./chunk-r3j4m04w.js";import"./chunk-5bm0nh5f.js";import"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-5rjfaj0b.js";import"./chunk-b8a8900p.js";import"./chunk-4c86wr9a.js";import"./chunk-3fwdxxh1.js";import"./chunk-q7fh1xka.js";import"./chunk-2mqzpzy7.js";import{Rt}from"./chunk-0azq3w1a.js";import"./chunk-xhpf68p4.js";import"./chunk-rbmt5w9v.js";import"./chunk-zkx2m308.js";import"./chunk-zn3c0ew5.js";import"./chunk-ez35607j.js";export{gf as declareBareLoopHead,Rt as parseLoopBinding,nr as processLoops,Yr as reportDeferredLoopWarnings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{so,Nm,Dm}from"./chunk-2f3zw2wy.js";import"./chunk-hsqqhjhr.js";import"./chunk-0wfbhs15.js";import"./chunk-1xjv71dw.js";import"./chunk-5bm0nh5f.js";import"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-5rjfaj0b.js";import"./chunk-b8a8900p.js";import"./chunk-4c86wr9a.js";import"./chunk-3fwdxxh1.js";import"./chunk-q7fh1xka.js";import"./chunk-2mqzpzy7.js";import"./chunk-0azq3w1a.js";import"./chunk-xhpf68p4.js";import"./chunk-rbmt5w9v.js";import"./chunk-zkx2m308.js";import"./chunk-zn3c0ew5.js";import"./chunk-ez35607j.js";export{Dm as clearComposableCache,Nm as getComposableScript,so as listComposableModules};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{V}from"./chunk-0azq3w1a.js";function n(t){return V(t)}
3
- export{n};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{la,ua,da,pa,qm}from"./chunk-pqrgaahp.js";import"./chunk-x6hqe25e.js";import"./chunk-kn92y5yd.js";import"./chunk-hez09ssh.js";import"./chunk-rfb00eqz.js";import"./chunk-6h0n7h97.js";import"./chunk-x9wwd2ee.js";import"./chunk-jtf6sxgd.js";import"./chunk-nb65s3b5.js";import"./chunk-kbw75yd7.js";import"./chunk-jy8m3dah.js";import"./chunk-r3j4m04w.js";import"./chunk-5bm0nh5f.js";import"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-8deed4r2.js";import"./chunk-5rjfaj0b.js";import"./chunk-b8a8900p.js";import"./chunk-4c86wr9a.js";import"./chunk-3fwdxxh1.js";import"./chunk-q7fh1xka.js";import"./chunk-2mqzpzy7.js";import"./chunk-0azq3w1a.js";import"./chunk-xhpf68p4.js";import"./chunk-rbmt5w9v.js";import"./chunk-zkx2m308.js";import"./chunk-zn3c0ew5.js";import"./chunk-ez35607j.js";export{la as buildNative,qm as default,ua as findCraftBinary,pa as getAvailableFormats,da as getAvailableTargets};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{bl,qi,Cg,vl,wl,Eg,Tg}from"./chunk-11k6atcw.js";import"./chunk-2f3zw2wy.js";import"./chunk-hsqqhjhr.js";import"./chunk-0wfbhs15.js";import"./chunk-1xjv71dw.js";import"./chunk-5bm0nh5f.js";import"./chunk-gwq82dpy.js";import"./chunk-m5nzpjej.js";import"./chunk-5rjfaj0b.js";import"./chunk-b8a8900p.js";import"./chunk-4c86wr9a.js";import"./chunk-3fwdxxh1.js";import"./chunk-q7fh1xka.js";import"./chunk-2mqzpzy7.js";import{At,Of}from"./chunk-0azq3w1a.js";import"./chunk-xhpf68p4.js";import"./chunk-rbmt5w9v.js";import"./chunk-zkx2m308.js";import"./chunk-zn3c0ew5.js";import"./chunk-ez35607j.js";export{bl as buildVirtualSource,At as extractScriptBlocks,Of as extractTemplateExpressions,vl as findRuntimeTypeDeclarations,wl as findStxModuleDeclarations,Tg as formatTypecheckDiagnostics,Cg as sourcePathFor,Eg as typecheckStxFiles,qi as virtualPathFor};