@stacksjs/stx 0.2.281 → 0.2.284

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 (190) hide show
  1. package/dist/a11y.d.ts +3 -3
  2. package/dist/a11y.js +40 -0
  3. package/dist/build-externalize.js +3 -3
  4. package/dist/build-views.d.ts +1 -1
  5. package/dist/build-views.js +2 -2
  6. package/dist/builtins/transition-group.d.ts +1 -1
  7. package/dist/{chunk-0ym08enb.js → chunk-0f1kz0x2.js} +1 -1
  8. package/dist/{chunk-shh4jfwc.js → chunk-0fgcnv6y.js} +1 -1
  9. package/dist/chunk-0h7ty10c.js +2 -0
  10. package/dist/{chunk-6vaa771b.js → chunk-1a8e5xpf.js} +1 -1
  11. package/dist/chunk-1rcn9yfj.js +2 -0
  12. package/dist/{chunk-5vday0wx.js → chunk-2g9jwgs7.js} +1 -1
  13. package/dist/chunk-3828z7q8.js +2 -0
  14. package/dist/{chunk-w1asc0zd.js → chunk-39f40yc4.js} +1 -1
  15. package/dist/{chunk-9y5xb0p4.js → chunk-3bv8h4r6.js} +1 -1
  16. package/dist/{chunk-yqkjgz9q.js → chunk-4ds1cmgq.js} +1 -1
  17. package/dist/chunk-50mpsfpx.js +3 -0
  18. package/dist/{chunk-shyqtvbq.js → chunk-52mh63sp.js} +1 -1
  19. package/dist/{chunk-71r0nchv.js → chunk-5aq35j2e.js} +1 -1
  20. package/dist/chunk-5k3qb1am.js +22 -0
  21. package/dist/chunk-5v6atbsr.js +2 -0
  22. package/dist/{chunk-gex3spzq.js → chunk-7etzqabz.js} +1 -1
  23. package/dist/chunk-7n45tcyf.js +2 -0
  24. package/dist/{chunk-y3r71hx6.js → chunk-7p9ns60j.js} +1 -1
  25. package/dist/{chunk-tyr2z96r.js → chunk-7rxtra1g.js} +1 -1
  26. package/dist/chunk-822x6vhb.js +2 -0
  27. package/dist/{chunk-5v2wk7sj.js → chunk-90qr4f9m.js} +1 -1
  28. package/dist/{chunk-0cdkfqw6.js → chunk-9236skjs.js} +2 -2
  29. package/dist/{chunk-gdja5ak8.js → chunk-9x4jejq0.js} +1 -1
  30. package/dist/{chunk-e8jazdsk.js → chunk-9zndrzb3.js} +1 -1
  31. package/dist/{chunk-3kj7kd8g.js → chunk-a2qghr2x.js} +1 -1
  32. package/dist/{chunk-jj6nrqje.js → chunk-a54n1r1q.js} +1 -1
  33. package/dist/{chunk-37dznstc.js → chunk-a63y3aa0.js} +1 -1
  34. package/dist/chunk-a95mf15m.js +2 -0
  35. package/dist/{chunk-9w2e55wt.js → chunk-abydddye.js} +2 -2
  36. package/dist/{chunk-3tr99nn5.js → chunk-areethga.js} +1 -1
  37. package/dist/{chunk-q4desjj6.js → chunk-ayrjwkyw.js} +1 -1
  38. package/dist/chunk-b29wbjs5.js +2 -0
  39. package/dist/chunk-ba6tthsm.js +2 -0
  40. package/dist/{chunk-sfaayvmn.js → chunk-bf8wf3r2.js} +38 -38
  41. package/dist/{chunk-w1zde8wp.js → chunk-bz2gytfs.js} +1 -1
  42. package/dist/{chunk-6gb72zp2.js → chunk-c0an64km.js} +1 -1
  43. package/dist/{chunk-gfhzedsr.js → chunk-c6fw33zh.js} +1 -1
  44. package/dist/chunk-crmgatrx.js +2 -0
  45. package/dist/{chunk-hghg9hcj.js → chunk-cvhyxt55.js} +1 -1
  46. package/dist/{chunk-2fx2xdre.js → chunk-cvnh7dma.js} +1 -1
  47. package/dist/{chunk-dyd3jdrn.js → chunk-d0c3v7ax.js} +1 -1
  48. package/dist/{chunk-5d0jtpqm.js → chunk-e4hhz9j3.js} +1 -1
  49. package/dist/{chunk-x4w3awav.js → chunk-e7jfpyqy.js} +1 -1
  50. package/dist/{chunk-4k0y2fnh.js → chunk-e9nmf863.js} +1 -1
  51. package/dist/chunk-ef5663vk.js +2 -0
  52. package/dist/{chunk-q2twgdxk.js → chunk-f16kkw9v.js} +1 -1
  53. package/dist/{chunk-e5vy94ck.js → chunk-f3hfk78e.js} +1 -1
  54. package/dist/chunk-f80wwn5x.js +2 -0
  55. package/dist/chunk-ffqddern.js +2 -0
  56. package/dist/{chunk-08q58gc0.js → chunk-fjkstnz3.js} +1 -1
  57. package/dist/{chunk-y1637mma.js → chunk-fskfes13.js} +1 -1
  58. package/dist/chunk-fxyrvwqw.js +2 -0
  59. package/dist/{chunk-zkbgy7kj.js → chunk-g3fy0tw8.js} +1 -1
  60. package/dist/{chunk-vc973skb.js → chunk-gjemavhx.js} +56 -56
  61. package/dist/{chunk-cnbqznms.js → chunk-gn9q45yp.js} +2 -2
  62. package/dist/chunk-gp3s8020.js +2 -0
  63. package/dist/chunk-gzxbnyde.js +2 -0
  64. package/dist/chunk-j03bare5.js +2 -0
  65. package/dist/{chunk-azfjfrns.js → chunk-jn6m8zf7.js} +1 -1
  66. package/dist/{chunk-d8j22791.js → chunk-jt4gqtag.js} +1 -1
  67. package/dist/{chunk-z4mrwx1z.js → chunk-k4qx7jbk.js} +1 -1
  68. package/dist/{chunk-4xbakvp1.js → chunk-kdrpx9ft.js} +1 -1
  69. package/dist/{chunk-4963bekg.js → chunk-kzyhvrp8.js} +1 -1
  70. package/dist/{chunk-9p25rqhp.js → chunk-mb518a4n.js} +1 -1
  71. package/dist/{chunk-04k37rg4.js → chunk-mjkfc2v6.js} +1 -1
  72. package/dist/chunk-mrbw9vts.js +2 -0
  73. package/dist/chunk-mx8k7bwh.js +2 -0
  74. package/dist/{chunk-k484xgz0.js → chunk-nvgxjvnb.js} +1 -1
  75. package/dist/{chunk-b1tjzeb0.js → chunk-p396xrew.js} +1 -1
  76. package/dist/{chunk-gjhwmkw8.js → chunk-pbk8jxe2.js} +1 -1
  77. package/dist/{chunk-zbynjn6g.js → chunk-phhzfeh9.js} +1 -1
  78. package/dist/{chunk-40bzrw9q.js → chunk-pmw28376.js} +1 -1
  79. package/dist/chunk-q68xmak4.js +60 -0
  80. package/dist/chunk-qccdz9t1.js +3756 -0
  81. package/dist/{chunk-ha5zt2y3.js → chunk-qd8ggjdx.js} +1 -1
  82. package/dist/chunk-qp97dx7x.js +2 -0
  83. package/dist/chunk-r5fp0bse.js +2 -0
  84. package/dist/{chunk-gdhyfrst.js → chunk-s2284nbk.js} +1 -1
  85. package/dist/chunk-s5ttqj6h.js +2 -0
  86. package/dist/chunk-s5y267vs.js +2 -0
  87. package/dist/{chunk-4z157x30.js → chunk-s67mgegv.js} +1 -1
  88. package/dist/{chunk-e7avk421.js → chunk-sb7k89hq.js} +1 -1
  89. package/dist/{chunk-y91519ss.js → chunk-se360fvh.js} +1 -1
  90. package/dist/{chunk-kr0r8x5w.js → chunk-snknv47x.js} +1 -1
  91. package/dist/{chunk-z45t29sf.js → chunk-sskbegsz.js} +1 -1
  92. package/dist/{chunk-3p2w5dag.js → chunk-sw16pkqg.js} +1 -1
  93. package/dist/{chunk-82kkkpw2.js → chunk-t1k5dpbr.js} +1 -1
  94. package/dist/{chunk-k47az0ta.js → chunk-vbdca0k1.js} +1 -1
  95. package/dist/{chunk-78yh2zqa.js → chunk-vckr41zn.js} +11 -11
  96. package/dist/{chunk-86d1vte8.js → chunk-vhsrgtcg.js} +1 -1
  97. package/dist/chunk-vrvehb01.js +2 -0
  98. package/dist/chunk-w4eykv3z.js +2 -0
  99. package/dist/{chunk-s6759be9.js → chunk-x0zv8dt4.js} +1 -1
  100. package/dist/chunk-x11dh3a3.js +2 -0
  101. package/dist/{chunk-xay59qky.js → chunk-y6kw0wb7.js} +1 -1
  102. package/dist/{chunk-5mkc9fvx.js → chunk-yq1d9hb3.js} +1 -1
  103. package/dist/{chunk-xqwmj65h.js → chunk-ysnk7x79.js} +1 -1
  104. package/dist/chunk-ytgnzeeb.js +2 -0
  105. package/dist/{chunk-1w9s36v0.js → chunk-zfr4d08r.js} +1 -1
  106. package/dist/chunk-zkzmxy32.js +2 -0
  107. package/dist/chunk-zn5jgmqw.js +5 -0
  108. package/dist/cli.js +14 -14
  109. package/dist/color-mode-boot.js +10 -6
  110. package/dist/component-processing.d.ts +40 -2
  111. package/dist/component-processing.js +13 -2
  112. package/dist/component-renderer.js +18 -6
  113. package/dist/craft-entry.js +1 -1
  114. package/dist/craft.js +1 -1
  115. package/dist/database.js +1 -1
  116. package/dist/dev-server/index.d.ts +2 -2
  117. package/dist/dev-server/index.js +1 -1
  118. package/dist/dev-server/serve-app.js +12 -12
  119. package/dist/dev-server/serve-file.js +6 -6
  120. package/dist/dev-server/serve-multi.js +3 -3
  121. package/dist/dev-server/ts-css.d.ts +108 -0
  122. package/dist/dev-server/{crosswind.js → ts-css.js} +86 -88
  123. package/dist/document-shell.d.ts +1 -1
  124. package/dist/expressions.js +4 -4
  125. package/dist/i18n.d.ts +24 -0
  126. package/dist/i18n.js +45 -0
  127. package/dist/index.d.ts +3 -3
  128. package/dist/index.js +2 -2
  129. package/dist/misc-directives.d.ts +0 -11
  130. package/dist/misc-directives.js +6 -4
  131. package/dist/process.js +2 -2
  132. package/dist/production-builder.js +3 -3
  133. package/dist/pwa.js +2 -2
  134. package/dist/render-memo.d.ts +1 -1
  135. package/dist/render.js +2 -2
  136. package/dist/safe-evaluator.d.ts +0 -15
  137. package/dist/safe-evaluator.js +12 -2
  138. package/dist/site-builder/build.d.ts +1 -1
  139. package/dist/site-builder/build.js +2 -2
  140. package/dist/ssg.d.ts +2 -2
  141. package/dist/ssg.js +10 -10
  142. package/dist/story/collect/analyzer.d.ts +1 -1
  143. package/dist/story/index.d.ts +2 -2
  144. package/dist/story/index.js +1 -1
  145. package/dist/story/renderer.d.ts +3 -3
  146. package/dist/story/renderer.js +2 -2
  147. package/dist/story/ts-css.d.ts +29 -0
  148. package/dist/story/{crosswind.js → ts-css.js} +9 -9
  149. package/dist/story/types.d.ts +1 -1
  150. package/dist/theme-tokens.d.ts +1 -1
  151. package/dist/{crosswind-config.d.ts → ts-css-config.d.ts} +5 -5
  152. package/dist/{crosswind-config.js → ts-css-config.js} +1 -1
  153. package/dist/types/config-types.d.ts +3 -3
  154. package/dist/visual-testing.js +1 -1
  155. package/package.json +6 -6
  156. package/dist/chunk-0kexd0d9.js +0 -2
  157. package/dist/chunk-2218hm3h.js +0 -2
  158. package/dist/chunk-3rbdvrp0.js +0 -2
  159. package/dist/chunk-3yg0f94g.js +0 -5
  160. package/dist/chunk-61rfw29f.js +0 -2
  161. package/dist/chunk-99ppngnm.js +0 -2
  162. package/dist/chunk-bavv2k2z.js +0 -2
  163. package/dist/chunk-bkbnxd7s.js +0 -2
  164. package/dist/chunk-edctags2.js +0 -2
  165. package/dist/chunk-exwdzxbq.js +0 -2
  166. package/dist/chunk-gm2wsf2d.js +0 -3
  167. package/dist/chunk-h0t73k2z.js +0 -3801
  168. package/dist/chunk-hcjmvwnt.js +0 -2
  169. package/dist/chunk-hqsadyfr.js +0 -2
  170. package/dist/chunk-hysmnz0q.js +0 -2
  171. package/dist/chunk-jkd1185y.js +0 -2
  172. package/dist/chunk-k7m8p93y.js +0 -2
  173. package/dist/chunk-nmxc5vnq.js +0 -2
  174. package/dist/chunk-pghw8xrx.js +0 -2
  175. package/dist/chunk-pgvskhg2.js +0 -2
  176. package/dist/chunk-qp1shwek.js +0 -2
  177. package/dist/chunk-qrx23zbx.js +0 -2
  178. package/dist/chunk-ragz3hr7.js +0 -2
  179. package/dist/chunk-rvmt27kv.js +0 -2
  180. package/dist/chunk-t7snemp0.js +0 -2
  181. package/dist/chunk-vxskcekj.js +0 -2
  182. package/dist/chunk-wkb78edm.js +0 -2
  183. package/dist/chunk-x8pbbdp1.js +0 -2
  184. package/dist/chunk-xen25bsv.js +0 -2
  185. package/dist/chunk-xpxw2ked.js +0 -15
  186. package/dist/chunk-y8sqjqwg.js +0 -2
  187. package/dist/chunk-ydzmhy4c.js +0 -22
  188. package/dist/chunk-ztzas1ew.js +0 -2
  189. package/dist/dev-server/crosswind.d.ts +0 -132
  190. package/dist/story/crosswind.d.ts +0 -29
package/dist/render.js CHANGED
@@ -146,8 +146,8 @@ ${scriptsHtml}`;
146
146
  }
147
147
  if (renderOptions.injectCSS)
148
148
  try {
149
- const { injectCrosswindCSS } = await import("./dev-server/crosswind.js");
150
- output = await injectCrosswindCSS(output);
149
+ const { injectCss } = await import("./dev-server/ts-css.js");
150
+ output = await injectCss(output);
151
151
  } catch {}
152
152
  return output;
153
153
  }
@@ -105,21 +105,6 @@ export declare function safeEvaluateArray(expression: string, context: Record<st
105
105
  * @returns Object result, defaults to empty object on error
106
106
  */
107
107
  export declare function safeEvaluateObject(expression: string, context: Record<string, unknown>): Record<string, unknown>;
108
- /**
109
- * Create a sandboxed function that can only access the provided context
110
- * This is a safer alternative to `new Function()` that validates expressions first
111
- *
112
- * @param expression - The expression to compile into a function
113
- * @param contextKeys - Variable names that will be available
114
- * @returns A function that takes context values and returns the result
115
- * @throws Error if expression contains dangerous patterns
116
- *
117
- * @example
118
- * ```typescript
119
- * const fn = createSafeFunction('x + y', ['x', 'y'])
120
- * const result = fn(1, 2) // returns 3
121
- * ```
122
- */
123
108
  /**
124
109
  * The variables an expression actually reads from its surrounding scope.
125
110
  *
@@ -298,7 +298,17 @@ const RESERVED_PARAM_NAMES = new Set([
298
298
  "arguments",
299
299
  "eval",
300
300
  "await"
301
- ]);
301
+ ]), COMPILED_EXPRESSION_LIMIT = 2000, compiledExpressions = new Map;
302
+ function compileFunctionBody(params, body) {
303
+ const key = `${params.join(",")}\x00${body}`, cached = compiledExpressions.get(key);
304
+ if (cached)
305
+ return cached;
306
+ const compiled = Function(...params, body);
307
+ if (compiledExpressions.size >= COMPILED_EXPRESSION_LIMIT)
308
+ compiledExpressions.clear();
309
+ compiledExpressions.set(key, compiled);
310
+ return compiled;
311
+ }
302
312
  export function freeIdentifiers(expression) {
303
313
  return expression.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g, " ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g, " ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g, "$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g) || [];
304
314
  }
@@ -313,7 +323,7 @@ export function createSafeFunction(expression, contextKeys) {
313
323
  validIndices.push(i);
314
324
  filteredKeys.push(key);
315
325
  }
316
- const buildFunc = (extraParams) => Function(...filteredKeys, ...extraParams, `
326
+ const buildFunc = (extraParams) => compileFunctionBody([...filteredKeys, ...extraParams], `
317
327
  'use strict';
318
328
  try {
319
329
  return ${sanitizedExpr};
@@ -2,7 +2,7 @@ import type { BuildOptions, SiteConfig } from './types';
2
2
  /**
3
3
  * Build a static stx site end-to-end:
4
4
  * 1. Bundle all pages with bun-plugin-stx
5
- * 2. Inject Crosswind CSS into each HTML file
5
+ * 2. Inject Css CSS into each HTML file
6
6
  * 3. Replace stx default SEO tags with site-specific ones
7
7
  * 4. Drop the empty bundle chunks bun-plugin-stx leaves behind
8
8
  * 5. Copy public/ assets verbatim
@@ -16,7 +16,7 @@ import stxPlugin from "bun-plugin-stx";
16
16
  import { CONVENTIONAL_ASSET_OUTPUT, resolveConventionalAssetRoot } from "../asset-roots.js";
17
17
  import { externalizeSharedAssets } from "../build-externalize.js";
18
18
  import { externalizeRepeatedAssets } from "../build-externalize-repeated.js";
19
- import { injectCrosswindCSS } from "../dev-server/crosswind.js";
19
+ import { injectCss } from "../dev-server/ts-css.js";
20
20
  import { injectSeo } from "./seo.js";
21
21
  import { generateSitemap } from "./sitemap.js";
22
22
  import { generateRobots } from "./robots.js";
@@ -71,7 +71,7 @@ export async function buildStaticSite(options) {
71
71
  html = stripDeadScriptTags(html);
72
72
  if (i18n)
73
73
  html = applyTranslations(html, i18n, locale);
74
- html = await injectCrosswindCSS(html, process.cwd());
74
+ html = await injectCss(html, process.cwd());
75
75
  html = injectSeo(html, options, options.pages?.[basePath], basePath);
76
76
  if (i18n) {
77
77
  html = applyLocaleHead(html, options, i18n, locale, basePath);
package/dist/ssg.d.ts CHANGED
@@ -138,11 +138,11 @@ export interface SSGConfig {
138
138
  *
139
139
  * A page's key is its own file plus the dependencies collected while
140
140
  * rendering it, which covers templates, components and layouts and nothing
141
- * else. Anything build-wide — the Crosswind config, an env var the pages read
141
+ * else. Anything build-wide — the Css config, an env var the pages read
142
142
  * — is invisible to it, and a build that reports every route `Cached` and
143
143
  * exits 0 gives no signal that it used the old value (#1940).
144
144
  *
145
- * Defaults to a digest of the resolved Crosswind config. Set it to add your
145
+ * Defaults to a digest of the resolved Css config. Set it to add your
146
146
  * own build inputs; set it to a constant to opt out of that default.
147
147
  */
148
148
  cacheSalt?: string;
package/dist/ssg.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{Dk as Fq,yk as Uq,zk as Iq}from"./chunk-3yg0f94g.js";import{Ek as Eq,Fk as Tq,Gk as Dq}from"./chunk-58f0mthg.js";import{$k as _q,cl as zq,dl as Aq}from"./chunk-yqkjgz9q.js";import{Jm as Oq,Mq as P,Zp as Bq,fp as l,ip as Hq,js as n}from"./chunk-h0t73k2z.js";import"./chunk-xpxw2ked.js";import"./chunk-6gb72zp2.js";import"./chunk-82kkkpw2.js";import"./chunk-shyqtvbq.js";import{nt as Xq}from"./chunk-ydzmhy4c.js";import{st as d}from"./chunk-w1asc0zd.js";import"./chunk-xqwmj65h.js";import"./chunk-0ym08enb.js";import"./chunk-q4desjj6.js";import"./chunk-gfhzedsr.js";import{Gu as Yq,Hu as Vq,Iu as jq,Ju as Gq,Ku as Lq,Lu as Nq}from"./chunk-sfaayvmn.js";import"./chunk-azfjfrns.js";import{$u as y}from"./chunk-z45t29sf.js";import O from"fs";import j from"path";import{createHash as xq}from"crypto";function yq(q){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(q).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return q}}var Pq=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Cq(q){return Bun.hash(q).toString(16)}function Qq(q,Z={}){if(!q.includes('type="stx/island"'))return{html:q,chunks:[]};let $=new Map,Q=q.replace(Pq,(J,W,z,A)=>{let G=A.trim();if(!G)return J;if(/\bdata-stx-src=/.test(z))return J;if(Z.minify)G=yq(G);let X=Cq(G);if(!$.has(X))$.set(X,G);let B=Z.integrity?` data-stx-integrity="sha384-${xq("sha384").update(G).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${W}" data-stx-src="/_stx/islands/${X}.js"${B}${z}></script>`}),K=Array.from($,([J,W])=>({hash:J,code:W}));return{html:Q,chunks:K}}var gq=new Set(["visible","idle"]);function Zq(q){if(!q.includes("data-stx-src="))return q;let Z=new Map,$=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,Q;while((Q=$.exec(q))!==null)Z.set(Q[1],Q[2]);let K=new Set,J=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,W;while((W=J.exec(q))!==null)if(gq.has(Z.get(W[1])||""))K.add(W[2]);let z=q.lastIndexOf("</head>");if(K.size===0||z===-1)return q;let A=Array.from(K).filter((G)=>!q.includes(`rel="prefetch" href="${G}"`)).map((G)=>`<link rel="prefetch" href="${G}" as="script">`).join("");if(!A)return q;return q.slice(0,z)+A+q.slice(z)}var fq=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function h(q){let Z=q.trim();if(!Z)return null;let $=/^https?:\/\//i.test(Z)?Z:`https://${Z}`;try{return new URL($).origin+new URL($).pathname.replace(/\/$/,"")}catch{return null}}function mq(q){for(let Z of fq){let $=q[Z];if(!$)continue;let Q=h($);if(Q)return{url:Q,source:"env",via:Z}}return null}function $q(q){if(!q||typeof q!=="object")return null;let Z=q,$=Z.site?.url??Z.url??Z.app?.url;return typeof $==="string"?h($):null}async function dq(q){let{existsSync:Z}=await import("fs"),$=await import("path");for(let Q of["site.config.ts","site.config.js",".config/site.config.ts"]){let K=$.resolve(q,Q);if(!Z(K))continue;try{let J=await import(K),W=$q(J.default??J);if(W)return W}catch{}}return null}async function Kq(q={}){let Z=q.cwd??process.cwd(),$=q.env??process.env;if(q.explicit){let W=h(q.explicit);if(W)return{url:W,source:"option"}}let Q=$q(q.stxConfig);if(Q)return{url:Q,source:"stx.config",via:"site.url"};let K=await dq(Z);if(K)return{url:K,source:"site.config",via:"url"};let J=mq($);if(J)return J;return{url:"http://localhost",source:"fallback"}}function Wq(){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
- `)}class Rq{cacheDir;cache=new Map;loaded=!1;salt;constructor(q,Z=""){this.cacheDir=q,this.salt=Z}async load(){if(this.loaded)return;let q=j.join(this.cacheDir,"build-cache.json");if(await Bun.file(q).exists())try{let Z=JSON.parse(await Bun.file(q).text());for(let[$,Q]of Object.entries(Z))this.cache.set($,Q)}catch{}this.loaded=!0}async save(){await O.promises.mkdir(this.cacheDir,{recursive:!0});let q=j.join(this.cacheDir,"build-cache.json"),Z={};for(let[$,Q]of this.cache)Z[$]=Q;await Bun.write(q,JSON.stringify(Z))}getHash(q,Z){let $=O.statSync(q),Q=`${this.salt}|${q}:${$.mtimeMs}`;for(let J of Z)if(O.existsSync(J)){let W=O.statSync(J);Q+=`:${J}:${W.mtimeMs}`}let K=0;for(let J=0;J<Q.length;J++){let W=Q.charCodeAt(J);K=(K<<5)-K+W,K=K&K}return Math.abs(K).toString(36)}get(q,Z){let $=this.cache.get(q);if(!$)return null;let Q=this.getHash(Z,$.dependencies??[]);if($.hash!==Q)return this.cache.delete(q),null;return $.html}set(q,Z,$,Q){let K=this.getHash(Z,$);this.cache.set(q,{hash:K,html:Q,generatedAt:Date.now(),dependencies:$})}}class Mq{cacheDir;constructor(q){this.cacheDir=q}getFilePath(q){let Z=q.replace(/[^a-zA-Z0-9]/g,"_")+".json";return j.join(this.cacheDir,"isr",Z)}async get(q){let Z=this.getFilePath(q);if(!await Bun.file(Z).exists())return null;try{return JSON.parse(await Bun.file(Z).text())}catch{return null}}async set(q,Z){let $=this.getFilePath(q);await O.promises.mkdir(j.dirname($),{recursive:!0}),await Bun.write($,JSON.stringify(Z))}async invalidate(q){let Z=this.getFilePath(q);if(await Bun.file(Z).exists())await O.promises.unlink(Z)}async invalidatePattern(q){let Z=j.join(this.cacheDir,"isr");if(!O.existsSync(Z))return;let $=await O.promises.readdir(Z);for(let Q of $){let K=Q.replace(/_/g,"/").replace(".json","");if(q.test(K))await O.promises.unlink(j.join(Z,Q))}}async needsRevalidation(q){let Z=await this.get(q);if(!Z)return!0;return Date.now()>Z.revalidateAfter}}async function pq(q){try{let $=(await Bun.file(q).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!$)return null;let Q=$[1];if(!Q.includes("getStaticPaths"))return null;let K=Q.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!K)return null;return await Function(`
2
+ import{Dk as Fq,yk as Uq,zk as Iq}from"./chunk-zn5jgmqw.js";import{Ek as Eq,Fk as Tq,Gk as Dq}from"./chunk-58f0mthg.js";import{$k as _q,cl as zq,dl as Aq}from"./chunk-4ds1cmgq.js";import{Fm as Oq,Fp as P,So as Bq,_n as l,bo as Hq,cr as n}from"./chunk-qccdz9t1.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import{rt as Xq}from"./chunk-5k3qb1am.js";import{wt as d}from"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import{Ku as Yq,Lu as Vq,Mu as jq,Nu as Gq,Ou as Lq,Pu as Nq}from"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import{dv as y}from"./chunk-sskbegsz.js";import O from"fs";import j from"path";import{createHash as xq}from"crypto";function yq(q){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(q).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return q}}var Pq=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Cq(q){return Bun.hash(q).toString(16)}function Qq(q,Z={}){if(!q.includes('type="stx/island"'))return{html:q,chunks:[]};let $=new Map,Q=q.replace(Pq,(J,W,z,A)=>{let G=A.trim();if(!G)return J;if(/\bdata-stx-src=/.test(z))return J;if(Z.minify)G=yq(G);let X=Cq(G);if(!$.has(X))$.set(X,G);let B=Z.integrity?` data-stx-integrity="sha384-${xq("sha384").update(G).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${W}" data-stx-src="/_stx/islands/${X}.js"${B}${z}></script>`}),K=Array.from($,([J,W])=>({hash:J,code:W}));return{html:Q,chunks:K}}var gq=new Set(["visible","idle"]);function Zq(q){if(!q.includes("data-stx-src="))return q;let Z=new Map,$=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,Q;while((Q=$.exec(q))!==null)Z.set(Q[1],Q[2]);let K=new Set,J=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,W;while((W=J.exec(q))!==null)if(gq.has(Z.get(W[1])||""))K.add(W[2]);let z=q.lastIndexOf("</head>");if(K.size===0||z===-1)return q;let A=Array.from(K).filter((G)=>!q.includes(`rel="prefetch" href="${G}"`)).map((G)=>`<link rel="prefetch" href="${G}" as="script">`).join("");if(!A)return q;return q.slice(0,z)+A+q.slice(z)}var fq=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function h(q){let Z=q.trim();if(!Z)return null;let $=/^https?:\/\//i.test(Z)?Z:`https://${Z}`;try{return new URL($).origin+new URL($).pathname.replace(/\/$/,"")}catch{return null}}function mq(q){for(let Z of fq){let $=q[Z];if(!$)continue;let Q=h($);if(Q)return{url:Q,source:"env",via:Z}}return null}function $q(q){if(!q||typeof q!=="object")return null;let Z=q,$=Z.site?.url??Z.url??Z.app?.url;return typeof $==="string"?h($):null}async function dq(q){let{existsSync:Z}=await import("fs"),$=await import("path");for(let Q of["site.config.ts","site.config.js",".config/site.config.ts"]){let K=$.resolve(q,Q);if(!Z(K))continue;try{let J=await import(K),W=$q(J.default??J);if(W)return W}catch{}}return null}async function Kq(q={}){let Z=q.cwd??process.cwd(),$=q.env??process.env;if(q.explicit){let W=h(q.explicit);if(W)return{url:W,source:"option"}}let Q=$q(q.stxConfig);if(Q)return{url:Q,source:"stx.config",via:"site.url"};let K=await dq(Z);if(K)return{url:K,source:"site.config",via:"url"};let J=mq($);if(J)return J;return{url:"http://localhost",source:"fallback"}}function Wq(){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
+ `)}class wq{cacheDir;cache=new Map;loaded=!1;salt;constructor(q,Z=""){this.cacheDir=q,this.salt=Z}async load(){if(this.loaded)return;let q=j.join(this.cacheDir,"build-cache.json");if(await Bun.file(q).exists())try{let Z=JSON.parse(await Bun.file(q).text());for(let[$,Q]of Object.entries(Z))this.cache.set($,Q)}catch{}this.loaded=!0}async save(){await O.promises.mkdir(this.cacheDir,{recursive:!0});let q=j.join(this.cacheDir,"build-cache.json"),Z={};for(let[$,Q]of this.cache)Z[$]=Q;await Bun.write(q,JSON.stringify(Z))}getHash(q,Z){let $=O.statSync(q),Q=`${this.salt}|${q}:${$.mtimeMs}`;for(let J of Z)if(O.existsSync(J)){let W=O.statSync(J);Q+=`:${J}:${W.mtimeMs}`}let K=0;for(let J=0;J<Q.length;J++){let W=Q.charCodeAt(J);K=(K<<5)-K+W,K=K&K}return Math.abs(K).toString(36)}get(q,Z){let $=this.cache.get(q);if(!$)return null;let Q=this.getHash(Z,$.dependencies??[]);if($.hash!==Q)return this.cache.delete(q),null;return $.html}set(q,Z,$,Q){let K=this.getHash(Z,$);this.cache.set(q,{hash:K,html:Q,generatedAt:Date.now(),dependencies:$})}}class Rq{cacheDir;constructor(q){this.cacheDir=q}getFilePath(q){let Z=q.replace(/[^a-zA-Z0-9]/g,"_")+".json";return j.join(this.cacheDir,"isr",Z)}async get(q){let Z=this.getFilePath(q);if(!await Bun.file(Z).exists())return null;try{return JSON.parse(await Bun.file(Z).text())}catch{return null}}async set(q,Z){let $=this.getFilePath(q);await O.promises.mkdir(j.dirname($),{recursive:!0}),await Bun.write($,JSON.stringify(Z))}async invalidate(q){let Z=this.getFilePath(q);if(await Bun.file(Z).exists())await O.promises.unlink(Z)}async invalidatePattern(q){let Z=j.join(this.cacheDir,"isr");if(!O.existsSync(Z))return;let $=await O.promises.readdir(Z);for(let Q of $){let K=Q.replace(/_/g,"/").replace(".json","");if(q.test(K))await O.promises.unlink(j.join(Z,Q))}}async needsRevalidation(q){let Z=await this.get(q);if(!Z)return!0;return Date.now()>Z.revalidateAfter}}async function pq(q){try{let $=(await Bun.file(q).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!$)return null;let Q=$[1];if(!Q.includes("getStaticPaths"))return null;let K=Q.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!K)return null;return await Function(`
4
4
  return (async function getStaticPaths() {
5
5
  ${K[1]}
6
6
  })()
@@ -8,7 +8,7 @@ import{Dk as Fq,yk as Uq,zk as Iq}from"./chunk-3yg0f94g.js";import{Ek as Eq,Fk a
8
8
  return (async function getStaticProps() {
9
9
  ${J[1]}
10
10
  })()
11
- `)(Z)}catch(J){return console.error(`Error executing getStaticProps in ${$}:`,J),null}}function lq(q){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(q)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(q)}async function wq(q,Z,$={},Q,K){let J=await Bun.file(q.filePath).text(),W=await hq(q.filePath),z=await cq(J,Z,q.filePath),A={...W||{},...z||{},...$,params:Z,$route:{path:q.pattern,params:Z}},G=new Set,X=[],B={...K,...Q.partialsDir?{partialsDir:Q.partialsDir}:{},...Q.componentsDir?{componentsDir:Q.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(_)=>{X.push(`${j.relative(process.cwd(),_.templatePath)}: ${_.message}
11
+ `)(Z)}catch(J){return console.error(`Error executing getStaticProps in ${$}:`,J),null}}function lq(q){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(q)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(q)}async function Mq(q,Z,$={},Q,K){let J=await Bun.file(q.filePath).text(),W=await hq(q.filePath),z=await cq(J,Z,q.filePath),A={...W||{},...z||{},...$,params:Z,$route:{path:q.pattern,params:Z}},G=new Set,X=[],B={...K,...Q.partialsDir?{partialsDir:Q.partialsDir}:{},...Q.componentsDir?{componentsDir:Q.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(_)=>{X.push(`${j.relative(process.cwd(),_.templatePath)}: ${_.message}
12
12
  resolved against partialsDir: ${_.partialsDir}`)}};if(lq(J))console.warn(`Warning: ${q.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let L=await P(J,A,q.filePath,B,G);for(let _ of[q.filePath,...G])for(let F of _q(_))G.add(F);if(Object.keys(Z).length>0){let _=`<script>if(window.stx)window.stx._rp=${JSON.stringify(Z)};else window.__stx_rp=${JSON.stringify(Z)};</script>`;if(L.includes("</head>"))L=L.replace("</head>",`${_}
13
13
  </head>`);else L=`${_}
14
14
  ${L}`}if(L=await Hq(L,{router:Q.router}),L=await Xq(L),Q.minify!==!1)return{html:nq(L),dependencies:Array.from(G),includeFailures:X};return{html:L,dependencies:Array.from(G),includeFailures:X}}function nq(q){let Z=[],$=0,Q=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,K;while((K=Q.exec(q))!==null){let W=q.slice($,K.index);Z.push(W.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let z=K[1],A=K[2],G=K[3];A=A.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),Z.push(z+A+G),$=K.index+K[0].length}let J=q.slice($);return Z.push(J.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),Z.join("").trim()}function iq(q){let Z=0;for(let $=0;$<q.length;$++){let Q=q.charCodeAt($);Z=(Z<<5)-Z+Q,Z=Z&Z}return`"${Math.abs(Z).toString(36)}"`}function sq(q,Z,$,Q){if($?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(Z))return!0;return Q.some((K)=>{if(K instanceof RegExp)return K.test(q);return K.endsWith("/")?q===K.slice(0,-1)||q.startsWith(K):q===K})}function oq(q,Z){return`<?xml version="1.0" encoding="UTF-8"?>
@@ -20,7 +20,7 @@ ${q.map((Q)=>{let K=new URL(Q.loc,Z).href,J=` <url>
20
20
  <priority>${Q.priority}</priority>`;return J+=`
21
21
  </url>`,J}).join(`
22
22
  `)}
23
- </urlset>`}function T(q){return q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function aq(q,Z){let $=Z.map((Q)=>{let K=" <item>";if(K+=`
23
+ </urlset>`}function T(q){return q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function rq(q,Z){let $=Z.map((Q)=>{let K=" <item>";if(K+=`
24
24
  <title>${T(Q.title)}</title>`,K+=`
25
25
  <link>${T(Q.link)}</link>`,Q.description)K+=`
26
26
  <description>${T(Q.description)}</description>`;if(Q.pubDate)K+=`
@@ -41,13 +41,13 @@ ${q.map((Q)=>{let K=new URL(Q.loc,Z).href,J=` <url>
41
41
  ${$.join(`
42
42
  `)}
43
43
  </channel>
44
- </rss>`}async function rq(q={}){let Z=Date.now();Aq();let $=await n(process.cwd()),Q=$.build||{},K=await Kq({explicit:q.domain||Q.domain,stxConfig:$});if(K.source==="fallback"&&(q.sitemap??Q.sitemap??!0))console.warn(Wq());let J={router:q.router??$?.router??{},pagesDir:q.pagesDir||Q.pagesDir||"pages",outputDir:q.outputDir||Q.outputDir||"dist",baseUrl:q.baseUrl||Q.baseUrl||"/",domain:K.url,revalidate:q.revalidate??Q.revalidate??!1,sitemap:q.sitemap??Q.sitemap??!0,sitemapExclude:q.sitemapExclude||Q.sitemapExclude||[],robots:q.robots??Q.robots??!0,rss:q.rss??Q.rss??!1,concurrency:q.concurrency||Q.concurrency||10,cache:q.cache??Q.cache??!0,cacheDir:q.cacheDir||Q.cacheDir||d(process.cwd(),"ssg-cache"),contentLoaders:q.contentLoaders||[],hooks:q.hooks||{},minify:q.minify??Q.minify??!0,generate404:q.generate404??Q.generate404??!0,publicDir:q.publicDir||Q.publicDir||"public",trailingSlash:q.trailingSlash??Q.trailingSlash??!1,cleanOutput:q.cleanOutput??Q.cleanOutput??!0,cacheSalt:q.cacheSalt??"",partialsDir:q.partialsDir||$?.partialsDir||"",componentsDir:q.componentsDir||$?.componentsDir||"",failOnIncludeError:q.failOnIncludeError??!0,chunkIslands:q.chunkIslands===!0,prefetchIslands:q.prefetchIslands===!0,integrityIslands:q.integrityIslands===!0},W={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},z=new Set,A=0,G={},X={};await J.hooks.onBuildStart?.();try{if(J.cleanOutput&&O.existsSync(J.outputDir))await O.promises.rm(J.outputDir,{recursive:!0});await O.promises.mkdir(J.outputDir,{recursive:!0});let L=J.cacheSalt;if(!L){let{resolveUserCrosswindConfig:Y,fingerprintConfig:N}=await import("./chunk-99ppngnm.js");try{L=N(await Y(process.cwd()))}catch{}}let{prepareImageDelivery:_}=await import("./chunk-jkd1185y.js"),F=await _(J.publicDir,J.outputDir);if(F.count>0)console.log(`Optimized ${F.count} image(s) for responsive delivery`),L=[L,F.fingerprint].filter(Boolean).join(":");let C=new Rq(J.cacheDir,L);if(J.cache)await C.load();try{let{generateCrosswindCSS:Y}=await import("./chunk-99ppngnm.js");await Y('<div class="bg-black"></div>')}catch{}Yq();let kq=$?.routeMiddleware?.dir||"middleware";await jq(process.cwd(),kq);let p=Vq();if(p.length>0)console.log(`Loaded ${p.length} middleware: ${p.join(", ")}`);let bq=$?.routeMiddleware?.global||[];Fq($?.layoutsDir,d(process.cwd()));let i=l(".",{pagesDir:J.pagesDir});console.log(`Found ${i.length} routes`);let g=[];for(let Y of i){let N=await uq(Y);for(let H of N)g.push({route:Y,url:H.url,params:H.params,props:H.props,revalidate:H.revalidate??J.revalidate})}W.totalPages=g.length,console.log(`Generating ${W.totalPages} pages...`);let b=[],s=[];for(let Y=0;Y<g.length;Y+=J.concurrency)s.push(g.slice(Y,Y+J.concurrency));for(let Y of s)await Promise.all(Y.map(async(N)=>{let{route:H,url:V,params:S,props:Sq,revalidate:r}=N;try{await J.hooks.onPageStart?.(V);let R=await Bun.file(H.filePath).text(),M=JJ(R),vq=M?.middleware?Array.isArray(M.middleware)?M.middleware:[M.middleware]:[],t=[...bq,...vq];if(t.length>0){let D=Gq(V,S,M||{}),w=Lq(D,null,void 0,{isServer:!0}),E=await Nq(t,w);if(E.redirect){let U=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,x=QJ(String(U),V),k=ZJ(V,J);await O.promises.mkdir(j.dirname(k),{recursive:!0}),await Bun.write(k,x),W.successCount++,W.pages.push({route:V,outputPath:k,size:Buffer.byteLength(x),cached:!1}),b.push({loc:V,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${V} \u2192 redirect to ${U}`);return}if(E.abort){let U=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${V} \u2014 middleware aborted: ${U}`);return}}let e=R.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(e)try{if(!await Function("route",`
44
+ </rss>`}async function aq(q={}){let Z=Date.now();Aq();let $=await n(process.cwd()),Q=$.build||{},K=await Kq({explicit:q.domain||Q.domain,stxConfig:$});if(K.source==="fallback"&&(q.sitemap??Q.sitemap??!0))console.warn(Wq());let J={router:q.router??$?.router??{},pagesDir:q.pagesDir||Q.pagesDir||"pages",outputDir:q.outputDir||Q.outputDir||"dist",baseUrl:q.baseUrl||Q.baseUrl||"/",domain:K.url,revalidate:q.revalidate??Q.revalidate??!1,sitemap:q.sitemap??Q.sitemap??!0,sitemapExclude:q.sitemapExclude||Q.sitemapExclude||[],robots:q.robots??Q.robots??!0,rss:q.rss??Q.rss??!1,concurrency:q.concurrency||Q.concurrency||10,cache:q.cache??Q.cache??!0,cacheDir:q.cacheDir||Q.cacheDir||d(process.cwd(),"ssg-cache"),contentLoaders:q.contentLoaders||[],hooks:q.hooks||{},minify:q.minify??Q.minify??!0,generate404:q.generate404??Q.generate404??!0,publicDir:q.publicDir||Q.publicDir||"public",trailingSlash:q.trailingSlash??Q.trailingSlash??!1,cleanOutput:q.cleanOutput??Q.cleanOutput??!0,cacheSalt:q.cacheSalt??"",partialsDir:q.partialsDir||$?.partialsDir||"",componentsDir:q.componentsDir||$?.componentsDir||"",failOnIncludeError:q.failOnIncludeError??!0,chunkIslands:q.chunkIslands===!0,prefetchIslands:q.prefetchIslands===!0,integrityIslands:q.integrityIslands===!0},W={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},z=new Set,A=0,G={},X={};await J.hooks.onBuildStart?.();try{if(J.cleanOutput&&O.existsSync(J.outputDir))await O.promises.rm(J.outputDir,{recursive:!0});await O.promises.mkdir(J.outputDir,{recursive:!0});let L=J.cacheSalt;if(!L){let{resolveUserCssConfig:Y,fingerprintConfig:N}=await import("./chunk-x11dh3a3.js");try{L=N(await Y(process.cwd()))}catch{}}let{prepareImageDelivery:_}=await import("./chunk-ytgnzeeb.js"),F=await _(J.publicDir,J.outputDir);if(F.count>0)console.log(`Optimized ${F.count} image(s) for responsive delivery`),L=[L,F.fingerprint].filter(Boolean).join(":");let C=new wq(J.cacheDir,L);if(J.cache)await C.load();try{let{generateCss:Y}=await import("./chunk-x11dh3a3.js");await Y('<div class="bg-black"></div>')}catch{}Yq();let kq=$?.routeMiddleware?.dir||"middleware";await jq(process.cwd(),kq);let p=Vq();if(p.length>0)console.log(`Loaded ${p.length} middleware: ${p.join(", ")}`);let bq=$?.routeMiddleware?.global||[];Fq($?.layoutsDir,d(process.cwd()));let i=l(".",{pagesDir:J.pagesDir});console.log(`Found ${i.length} routes`);let g=[];for(let Y of i){let N=await uq(Y);for(let H of N)g.push({route:Y,url:H.url,params:H.params,props:H.props,revalidate:H.revalidate??J.revalidate})}W.totalPages=g.length,console.log(`Generating ${W.totalPages} pages...`);let b=[],s=[];for(let Y=0;Y<g.length;Y+=J.concurrency)s.push(g.slice(Y,Y+J.concurrency));for(let Y of s)await Promise.all(Y.map(async(N)=>{let{route:H,url:V,params:S,props:Sq,revalidate:a}=N;try{await J.hooks.onPageStart?.(V);let w=await Bun.file(H.filePath).text(),R=JJ(w),vq=R?.middleware?Array.isArray(R.middleware)?R.middleware:[R.middleware]:[],t=[...bq,...vq];if(t.length>0){let D=Gq(V,S,R||{}),M=Lq(D,null,void 0,{isServer:!0}),E=await Nq(t,M);if(E.redirect){let U=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,x=QJ(String(U),V),k=ZJ(V,J);await O.promises.mkdir(j.dirname(k),{recursive:!0}),await Bun.write(k,x),W.successCount++,W.pages.push({route:V,outputPath:k,size:Buffer.byteLength(x),cached:!1}),b.push({loc:V,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${V} \u2192 redirect to ${U}`);return}if(E.abort){let U=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${V} \u2014 middleware aborted: ${U}`);return}}let e=w.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(e)try{if(!await Function("route",`
45
45
  const validate = ${e[1]};
46
46
  return validate(route);
47
- `)({params:S})){console.warn(`Validation failed for ${V}, skipping...`);return}}catch{}let I=null,qq=!1;if(J.cache){if(I=C.get(V,H.filePath),I)qq=!0,W.cachedCount++}if(!I){let D=await wq(H,S,Sq,J,$);if(I=D.html,J.failOnIncludeError&&D.includeFailures.length>0)throw Error(`${D.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
47
+ `)({params:S})){console.warn(`Validation failed for ${V}, skipping...`);return}}catch{}let I=null,qq=!1;if(J.cache){if(I=C.get(V,H.filePath),I)qq=!0,W.cachedCount++}if(!I){let D=await Mq(H,S,Sq,J,$);if(I=D.html,J.failOnIncludeError&&D.includeFailures.length>0)throw Error(`${D.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
48
48
  ${D.includeFailures.join(`
49
49
  `)}
50
- Set ssg.failOnIncludeError to false to build anyway.`);if(J.cache)C.set(V,H.filePath,D.dependencies,I)}let v;if(J.trailingSlash)v=j.join(J.outputDir,V,"index.html");else v=V==="/"?j.join(J.outputDir,"index.html"):j.join(J.outputDir,`${V}.html`);if(J.chunkIslands){let{html:D,chunks:w}=Qq(I,{integrity:J.integrityIslands,minify:J.minify});if(w.length>0){let E=j.join(J.outputDir,"_stx","islands");await O.promises.mkdir(E,{recursive:!0});for(let U of w){let x=j.join(E,`${U.hash}.js`);if(!await Bun.file(x).exists())await Bun.write(x,U.code);if(!z.has(U.hash)){z.add(U.hash);let k=Buffer.byteLength(U.code,"utf8");A+=k,G[U.hash]={bytes:k,file:`/_stx/islands/${U.hash}.js`}}}if(X[V]=w.map((U)=>U.hash),I=D,J.prefetchIslands)I=Zq(I)}}if(await O.promises.mkdir(j.dirname(v),{recursive:!0}),await Bun.write(v,I),!sq(V,I,M,J.sitemapExclude))b.push({loc:V,lastmod:new Date().toISOString().split("T")[0],priority:V==="/"?1:0.8});let Jq={route:V,outputPath:v,size:Buffer.byteLength(I,"utf8"),cached:qq};if(r!==!1)Jq.revalidateAt=Date.now()+r*1000;W.pages.push(Jq),W.successCount++,await J.hooks.onPageEnd?.(V,I)}catch(R){W.failedCount++,W.errors.push({route:V,error:R}),await J.hooks.onError?.(R,V),console.error(`Error generating ${V}:`,R)}}));let o=zq();if(o.length>0){let Y=o.map((N)=>`${N.filePath}: ${N.message}`).join(`
50
+ Set ssg.failOnIncludeError to false to build anyway.`);if(J.cache)C.set(V,H.filePath,D.dependencies,I)}let v;if(J.trailingSlash)v=j.join(J.outputDir,V,"index.html");else v=V==="/"?j.join(J.outputDir,"index.html"):j.join(J.outputDir,`${V}.html`);if(J.chunkIslands){let{html:D,chunks:M}=Qq(I,{integrity:J.integrityIslands,minify:J.minify});if(M.length>0){let E=j.join(J.outputDir,"_stx","islands");await O.promises.mkdir(E,{recursive:!0});for(let U of M){let x=j.join(E,`${U.hash}.js`);if(!await Bun.file(x).exists())await Bun.write(x,U.code);if(!z.has(U.hash)){z.add(U.hash);let k=Buffer.byteLength(U.code,"utf8");A+=k,G[U.hash]={bytes:k,file:`/_stx/islands/${U.hash}.js`}}}if(X[V]=M.map((U)=>U.hash),I=D,J.prefetchIslands)I=Zq(I)}}if(await O.promises.mkdir(j.dirname(v),{recursive:!0}),await Bun.write(v,I),!sq(V,I,R,J.sitemapExclude))b.push({loc:V,lastmod:new Date().toISOString().split("T")[0],priority:V==="/"?1:0.8});let Jq={route:V,outputPath:v,size:Buffer.byteLength(I,"utf8"),cached:qq};if(a!==!1)Jq.revalidateAt=Date.now()+a*1000;W.pages.push(Jq),W.successCount++,await J.hooks.onPageEnd?.(V,I)}catch(w){W.failedCount++,W.errors.push({route:V,error:w}),await J.hooks.onError?.(w,V),console.error(`Error generating ${V}:`,w)}}));let o=zq();if(o.length>0){let Y=o.map((N)=>`${N.filePath}: ${N.message}`).join(`
51
51
  `);throw Error(`Client script bundling failed:
52
52
  ${Y}`)}if(J.cache)await C.save();if(J.generate404){let Y=j.join(J.pagesDir,"404.stx");if(await Bun.file(Y).exists()){let N=new Set,H={...$,debug:!1,cache:!1},V=await P(await Bun.file(Y).text(),{},Y,H,N);await Bun.write(j.join(J.outputDir,"404.html"),V)}else await Bun.write(j.join(J.outputDir,"404.html"),`<!DOCTYPE html>
53
53
  <html lang="en">
@@ -70,7 +70,7 @@ ${Y}`)}if(J.cache)await C.save();if(J.generate404){let Y=j.join(J.pagesDir,"404.
70
70
  <a href="/">Go home</a>
71
71
  </div>
72
72
  </body>
73
- </html>`)}for(let Y of[500]){let N=j.join(J.pagesDir,`${Y}.stx`);if(await Bun.file(N).exists()){let H=new Set,V={...$,debug:!1,cache:!1},S=await P(await Bun.file(N).text(),{},N,V,H);await Bun.write(j.join(J.outputDir,`${Y}.html`),S)}}let u=j.join(J.pagesDir,"error.stx");if(await Bun.file(u).exists()){let Y=new Set,N={...$,debug:!1,cache:!1},H=await P(await Bun.file(u).text(),{},u,N,Y);await Bun.write(j.join(J.outputDir,"error.html"),H)}if(J.sitemap&&b.length>0){let Y=oq(b,J.domain),N=j.join(J.outputDir,"sitemap.xml");await Bun.write(N,Y),W.sitemapPath=N,console.log(`Generated sitemap.xml with ${b.length} URLs`)}if(J.robots!==!1){let Y=typeof J.robots==="object"?J.robots:{},N=[...J.sitemapExclude.filter((V)=>typeof V==="string"),...Y.disallow||[]],H=Bq({rules:[{userAgent:Y.userAgent||"*",allow:Y.allow||["/"],...N.length>0?{disallow:N}:{}}],...Y.sitemap!==!1&&W.sitemapPath?{sitemap:new URL("/sitemap.xml",J.domain).href}:{}});await Bun.write(j.join(J.outputDir,"robots.txt"),H),console.log("Generated robots.txt")}if(J.rss){let Y=typeof J.rss==="object"?J.rss:{title:"Site Feed",description:"Latest updates",link:J.domain},N=[];if(Y.getItems)N=await Y.getItems();let H=aq(Y,N),V=j.join(J.outputDir,"rss.xml");await Bun.write(V,H),W.rssPath=V,console.log(`Generated rss.xml with ${N.length} items`)}let f=Uq(J.outputDir);if(f.assets>0)console.log(`Externalized ${f.assets} asset(s) from ${f.pages} page(s) (${(f.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let m=Iq(J.outputDir);if(m.assets>0)console.log(`Externalized ${m.assets} repeated asset(s) from ${m.pages} page(s) (${(m.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(J.publicDir&&O.existsSync(J.publicDir))await c(J.publicDir,J.outputDir),console.log(`Copied public assets from ${J.publicDir}`);let a=Dq();if(a)await c(a,j.join(J.outputDir,Tq)),console.log(`Copied assets from ${Eq}`)}catch(L){throw await J.hooks.onError?.(L),L}if(W.buildTime=Date.now()-Z,z.size>0){W.islandChunks={count:z.size,totalBytes:A};let L={generatedChunks:z.size,totalBytes:A,chunks:G,pages:X};await Bun.write(j.join(J.outputDir,"_stx","islands-manifest.json"),JSON.stringify(L,null,2))}await J.hooks.onBuildEnd?.(W);let B=W.islandChunks?`
73
+ </html>`)}for(let Y of[500]){let N=j.join(J.pagesDir,`${Y}.stx`);if(await Bun.file(N).exists()){let H=new Set,V={...$,debug:!1,cache:!1},S=await P(await Bun.file(N).text(),{},N,V,H);await Bun.write(j.join(J.outputDir,`${Y}.html`),S)}}let u=j.join(J.pagesDir,"error.stx");if(await Bun.file(u).exists()){let Y=new Set,N={...$,debug:!1,cache:!1},H=await P(await Bun.file(u).text(),{},u,N,Y);await Bun.write(j.join(J.outputDir,"error.html"),H)}if(J.sitemap&&b.length>0){let Y=oq(b,J.domain),N=j.join(J.outputDir,"sitemap.xml");await Bun.write(N,Y),W.sitemapPath=N,console.log(`Generated sitemap.xml with ${b.length} URLs`)}if(J.robots!==!1){let Y=typeof J.robots==="object"?J.robots:{},N=[...J.sitemapExclude.filter((V)=>typeof V==="string"),...Y.disallow||[]],H=Bq({rules:[{userAgent:Y.userAgent||"*",allow:Y.allow||["/"],...N.length>0?{disallow:N}:{}}],...Y.sitemap!==!1&&W.sitemapPath?{sitemap:new URL("/sitemap.xml",J.domain).href}:{}});await Bun.write(j.join(J.outputDir,"robots.txt"),H),console.log("Generated robots.txt")}if(J.rss){let Y=typeof J.rss==="object"?J.rss:{title:"Site Feed",description:"Latest updates",link:J.domain},N=[];if(Y.getItems)N=await Y.getItems();let H=rq(Y,N),V=j.join(J.outputDir,"rss.xml");await Bun.write(V,H),W.rssPath=V,console.log(`Generated rss.xml with ${N.length} items`)}let f=Uq(J.outputDir);if(f.assets>0)console.log(`Externalized ${f.assets} asset(s) from ${f.pages} page(s) (${(f.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let m=Iq(J.outputDir);if(m.assets>0)console.log(`Externalized ${m.assets} repeated asset(s) from ${m.pages} page(s) (${(m.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(J.publicDir&&O.existsSync(J.publicDir))await c(J.publicDir,J.outputDir),console.log(`Copied public assets from ${J.publicDir}`);let r=Dq();if(r)await c(r,j.join(J.outputDir,Tq)),console.log(`Copied assets from ${Eq}`)}catch(L){throw await J.hooks.onError?.(L),L}if(W.buildTime=Date.now()-Z,z.size>0){W.islandChunks={count:z.size,totalBytes:A};let L={generatedChunks:z.size,totalBytes:A,chunks:G,pages:X};await Bun.write(j.join(J.outputDir,"_stx","islands-manifest.json"),JSON.stringify(L,null,2))}await J.hooks.onBuildEnd?.(W);let B=W.islandChunks?`
74
74
  Island chunks: ${W.islandChunks.count} (${(W.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
75
75
  Build complete!
76
76
  Total: ${W.totalPages} pages
@@ -78,7 +78,7 @@ Build complete!
78
78
  Cached: ${W.cachedCount}
79
79
  Failed: ${W.failedCount}
80
80
  Time: ${W.buildTime}ms${B}
81
- `),W}async function c(q,Z){await O.promises.mkdir(Z,{recursive:!0});let $=await O.promises.readdir(q,{withFileTypes:!0});for(let Q of $){let K=j.join(q,Q.name),J=j.join(Z,Q.name);if(Q.isDirectory())await O.promises.mkdir(J,{recursive:!0}),await c(K,J);else await O.promises.copyFile(K,J)}}function tq(q={}){let Z=q.cacheDir||d(process.cwd(),"ssg-cache"),$=new Mq(Z),Q=q.revalidate||3600;return{async get(K){let J=await $.get(K);if(!J)return null;if(Date.now()>J.revalidateAfter)this.revalidate(K).catch(console.error);return{html:J.html,headers:{"Cache-Control":`public, max-age=${Q}, stale-while-revalidate=${Q*2}`,ETag:J.etag,"X-ISR-Generated":new Date(J.generatedAt).toISOString(),...J.headers}}},async revalidate(K){let W=l(".",{pagesDir:q.pagesDir||"pages"}).find((B)=>{return K.match(B.regex)!==null});if(!W){console.warn(`Route not found for revalidation: ${K}`);return}let z=K.match(W.regex),A={};if(z)W.params.forEach((B,L)=>{A[B]=z[L+1]});let G=await n(),{html:X}=await wq(W,A,{},q,G);await $.set(K,{html:X,generatedAt:Date.now(),revalidateAfter:Date.now()+Q*1000,etag:iq(X)}),console.log(`Revalidated: ${K}`)},async invalidate(K){if(typeof K==="string")await $.invalidate(K);else await $.invalidatePattern(K)}}}function eq(q){return async()=>{return{paths:await q(),fallback:!1}}}function qJ(){return{name:"markdown",extensions:[".md",".mdx"],async load(q){let Z=await Bun.file(q).text(),$=Z.match(/^---\n([\s\S]*?)\n---/),Q={},K=Z;if($){let G=$[1];K=Z.slice($[0].length).trim();for(let X of G.split(`
81
+ `),W}async function c(q,Z){await O.promises.mkdir(Z,{recursive:!0});let $=await O.promises.readdir(q,{withFileTypes:!0});for(let Q of $){let K=j.join(q,Q.name),J=j.join(Z,Q.name);if(Q.isDirectory())await O.promises.mkdir(J,{recursive:!0}),await c(K,J);else await O.promises.copyFile(K,J)}}function tq(q={}){let Z=q.cacheDir||d(process.cwd(),"ssg-cache"),$=new Rq(Z),Q=q.revalidate||3600;return{async get(K){let J=await $.get(K);if(!J)return null;if(Date.now()>J.revalidateAfter)this.revalidate(K).catch(console.error);return{html:J.html,headers:{"Cache-Control":`public, max-age=${Q}, stale-while-revalidate=${Q*2}`,ETag:J.etag,"X-ISR-Generated":new Date(J.generatedAt).toISOString(),...J.headers}}},async revalidate(K){let W=l(".",{pagesDir:q.pagesDir||"pages"}).find((B)=>{return K.match(B.regex)!==null});if(!W){console.warn(`Route not found for revalidation: ${K}`);return}let z=K.match(W.regex),A={};if(z)W.params.forEach((B,L)=>{A[B]=z[L+1]});let G=await n(),{html:X}=await Mq(W,A,{},q,G);await $.set(K,{html:X,generatedAt:Date.now(),revalidateAfter:Date.now()+Q*1000,etag:iq(X)}),console.log(`Revalidated: ${K}`)},async invalidate(K){if(typeof K==="string")await $.invalidate(K);else await $.invalidatePattern(K)}}}function eq(q){return async()=>{return{paths:await q(),fallback:!1}}}function qJ(){return{name:"markdown",extensions:[".md",".mdx"],async load(q){let Z=await Bun.file(q).text(),$=Z.match(/^---\n([\s\S]*?)\n---/),Q={},K=Z;if($){let G=$[1];K=Z.slice($[0].length).trim();for(let X of G.split(`
82
82
  `)){let B=X.indexOf(":");if(B>0){let L=X.slice(0,B).trim(),_=X.slice(B+1).trim();if(_==="true")_=!0;else if(_==="false")_=!1;else if(/^\d+$/.test(_))_=parseInt(_,10);else if(/^\d+\.\d+$/.test(_))_=parseFloat(_);else if(_.startsWith("[")&&_.endsWith("]"))_=_.slice(1,-1).split(",").map((F)=>F.trim().replace(/^['"]|['"]$/g,""));Q[L]=_}}}let J=K.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),W=[],z=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,A;while((A=z.exec(J))!==null){let G=parseInt(A[1],10),X=A[2],B=X.toLowerCase().replace(/[^a-z0-9]+/g,"-");W.push({id:B,text:X,level:G})}return{content:J,data:Q,toc:W}}}}function JJ(q){return Oq(q)}function QJ(q,Z){return`<!DOCTYPE html>
83
83
  <html>
84
84
  <head>
@@ -91,4 +91,4 @@ Build complete!
91
91
  <p>Redirecting to <a href="${q}">${q}</a>...</p>
92
92
  <script>window.location.replace('${q}')</script>
93
93
  </body>
94
- </html>`}function ZJ(q,Z){if(q==="/"||q==="")return j.join(Z.outputDir,"index.html");let $=q.replace(/^\/|\/$/g,"");if(Z.trailingSlash)return j.join(Z.outputDir,$,"index.html");return j.join(Z.outputDir,`${$}.html`)}var FJ={generateStaticSite:rq,createISRHandler:tq,defineStaticPaths:eq,createMarkdownLoader:qJ};export{sq as isExcludedFromSitemap,rq as generateStaticSite,eq as defineStaticPaths,FJ as default,lq as declaresPageAction,qJ as createMarkdownLoader,tq as createISRHandler};
94
+ </html>`}function ZJ(q,Z){if(q==="/"||q==="")return j.join(Z.outputDir,"index.html");let $=q.replace(/^\/|\/$/g,"");if(Z.trailingSlash)return j.join(Z.outputDir,$,"index.html");return j.join(Z.outputDir,`${$}.html`)}var FJ={generateStaticSite:aq,createISRHandler:tq,defineStaticPaths:eq,createMarkdownLoader:qJ};export{sq as isExcludedFromSitemap,aq as generateStaticSite,eq as defineStaticPaths,FJ as default,lq as declaresPageAction,qJ as createMarkdownLoader,tq as createISRHandler};
@@ -24,7 +24,7 @@ export declare function extractDescription(content: string): string | undefined;
24
24
  */
25
25
  export declare function extractDependencies(content: string): string[];
26
26
  /**
27
- * Extract CSS classes from template (for Crosswind integration)
27
+ * Extract CSS classes from template (for Css integration)
28
28
  */
29
29
  export declare function extractCssClasses(content: string): string[];
30
30
  /**
@@ -57,8 +57,8 @@ export * from './errors';
57
57
  export * from './figma-export';
58
58
  // Generator
59
59
  export * from './generator';
60
- // Crosswind CSS
61
- export * from './crosswind';
60
+ // Css CSS
61
+ export * from './ts-css';
62
62
  // HMR
63
63
  export * from './hmr';
64
64
  // Hot Swap
@@ -27,7 +27,7 @@ export * from "./docs-generator.js";
27
27
  export * from "./errors.js";
28
28
  export * from "./figma-export.js";
29
29
  export * from "./generator.js";
30
- export * from "./crosswind.js";
30
+ export * from "./ts-css.js";
31
31
  export * from "./hmr.js";
32
32
  export * from "./hot-swap.js";
33
33
  export * from "./interactions.js";
@@ -13,8 +13,8 @@ export interface StoryRenderOptions {
13
13
  slots?: Record<string, string>;
14
14
  /** Include global styles */
15
15
  includeStyles?: boolean;
16
- /** Include Crosswind CSS */
17
- includeCrosswind?: boolean;
16
+ /** Include Css CSS */
17
+ includeCss?: boolean;
18
18
  }
19
19
  /**
20
20
  * Story render result
@@ -65,5 +65,5 @@ export declare function generatePreviewDocument(result: StoryRenderResult, optio
65
65
  title?: string;
66
66
  theme?: 'light' | 'dark';
67
67
  background?: string;
68
- crosswindCss?: string;
68
+ cssCss?: string;
69
69
  }): string;
@@ -171,7 +171,7 @@ export async function preloadComponents(paths) {
171
171
  return loaded;
172
172
  }
173
173
  export function generatePreviewDocument(result, options = {}) {
174
- const { title = "Preview", theme = "light", background = "#ffffff", crosswindCss = "" } = options;
174
+ const { title = "Preview", theme = "light", background = "#ffffff", cssCss = "" } = options;
175
175
  return `<!DOCTYPE html>
176
176
  <html lang="en" class="${theme === "dark" ? "dark" : ""}">
177
177
  <head>
@@ -195,7 +195,7 @@ export function generatePreviewDocument(result, options = {}) {
195
195
  font-family: monospace;
196
196
  white-space: pre-wrap;
197
197
  }
198
- ${crosswindCss}
198
+ ${cssCss}
199
199
  ${result.css}
200
200
  </style>
201
201
  </head>
@@ -0,0 +1,29 @@
1
+ import type { StoryContext } from './types';
2
+ /**
3
+ * Check if Css is available
4
+ */
5
+ export declare function isCssEngineAvailable(root: string): Promise<boolean>;
6
+ /**
7
+ * Load Css CSS
8
+ */
9
+ export declare function loadCss(ctx: StoryContext, options?: CssOptions): Promise<string>;
10
+ /**
11
+ * Generate style tag with Css CSS
12
+ */
13
+ export declare function generateCssStyleTag(ctx: StoryContext, options?: CssOptions): Promise<string>;
14
+ /**
15
+ * Extract used utility classes from HTML
16
+ */
17
+ export declare function extractUsedClasses(html: string): string[];
18
+ /**
19
+ * Generate optimized CSS with only used classes
20
+ */
21
+ export declare function generateOptimizedCSS(fullCSS: string, usedClasses: string[]): string;
22
+ /**
23
+ * Css CSS options
24
+ */
25
+ export declare interface CssOptions {
26
+ cssPath?: string
27
+ includeReset?: boolean
28
+ includeBase?: boolean
29
+ }
@@ -1,16 +1,16 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
- const DEFAULT_HEADWIND_PATH = "node_modules/@stacksjs/crosswind/dist/crosswind.css";
4
- export async function isCrosswindAvailable(root) {
5
- const crosswindPath = path.join(root, DEFAULT_HEADWIND_PATH);
3
+ const DEFAULT_HEADWIND_PATH = "node_modules/@stacksjs/ts-css/dist/css.css";
4
+ export async function isCssEngineAvailable(root) {
5
+ const cssPath = path.join(root, DEFAULT_HEADWIND_PATH);
6
6
  try {
7
- await fs.promises.access(crosswindPath);
7
+ await fs.promises.access(cssPath);
8
8
  return !0;
9
9
  } catch {
10
10
  return !1;
11
11
  }
12
12
  }
13
- export async function loadCrosswindCSS(ctx, options = {}) {
13
+ export async function loadCss(ctx, options = {}) {
14
14
  const cssPath = options.cssPath || path.join(ctx.root, DEFAULT_HEADWIND_PATH);
15
15
  try {
16
16
  return await fs.promises.readFile(cssPath, "utf-8");
@@ -20,7 +20,7 @@ export async function loadCrosswindCSS(ctx, options = {}) {
20
20
  }
21
21
  function getMinimalUtilityCSS() {
22
22
  return `
23
- /* Minimal utility classes (Crosswind fallback) */
23
+ /* Minimal utility classes (Css fallback) */
24
24
 
25
25
  /* Display */
26
26
  .block { display: block; }
@@ -141,9 +141,9 @@ function getMinimalUtilityCSS() {
141
141
  .duration-300 { transition-duration: 300ms; }
142
142
  `;
143
143
  }
144
- export async function generateCrosswindStyleTag(ctx, options = {}) {
145
- return `<style id="crosswind-css">
146
- ${await loadCrosswindCSS(ctx, options)}
144
+ export async function generateCssStyleTag(ctx, options = {}) {
145
+ return `<style id="css-css">
146
+ ${await loadCss(ctx, options)}
147
147
  </style>`;
148
148
  }
149
149
  export function extractUsedClasses(html) {
@@ -276,7 +276,7 @@ export interface AnalyzedComponent {
276
276
  slots: AnalyzedSlot[];
277
277
  /** Component dependencies (other components used) */
278
278
  dependencies: string[];
279
- /** CSS classes used (for Crosswind) */
279
+ /** CSS classes used (for Css) */
280
280
  cssClasses: string[];
281
281
  /** Directives used in the component */
282
282
  directives?: DirectiveUsage[];
@@ -17,7 +17,7 @@
17
17
  *
18
18
  * ## Where the values come from
19
19
  *
20
- * Each token names a shade in crosswind's own palette rather than carrying a hex
20
+ * Each token names a shade in css's own palette rather than carrying a hex
21
21
  * value, and the light/dark pairs are the ones the component library already
22
22
  * used most — measured, not invented:
23
23
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * One merge for the crosswind config, used by every render path.
2
+ * One merge for the css config, used by every render path.
3
3
  *
4
4
  * There were two, and they disagreed (stacksjs/stx#1867). The dev-server path
5
5
  * read only `theme.extend` and pinned the result after the user spread, so a
@@ -25,7 +25,7 @@
25
25
  * So base and user theme keys deep-merge, and `extend` is passed through
26
26
  * untouched for CSSGenerator to apply on top.
27
27
  *
28
- * @module crosswind-config
28
+ * @module ts-css-config
29
29
  */
30
30
  type Dict = Record<string, any>;
31
31
  /**
@@ -35,7 +35,7 @@ type Dict = Record<string, any>;
35
35
  * 'sans-serif']` is a complete stack, not an addition to one.
36
36
  */
37
37
  export declare function deepMergeThemes(target: Dict, source: Dict): Dict;
38
- export interface MergedCrosswindConfig {
38
+ export interface MergedCssConfig {
39
39
  /** Ready to hand to `new CSSGenerator(...)`. */
40
40
  config: Dict;
41
41
  /** Merged safelist, also needed by callers to pre-generate those classes. */
@@ -61,11 +61,11 @@ export interface MergedCrosswindConfig {
61
61
  tokenCSS: string;
62
62
  }
63
63
  /**
64
- * Merge a project's crosswind config over the package defaults.
64
+ * Merge a project's css config over the package defaults.
65
65
  *
66
66
  * `content` and `output` are stx-owned and pinned last: classes come from
67
67
  * scanning the rendered page, not from globbing, and the CSS is returned rather
68
68
  * than written to disk (#1822).
69
69
  */
70
- export declare function mergeCrosswindConfig(base?: Dict, user?: Dict): MergedCrosswindConfig;
70
+ export declare function mergeCssConfig(base?: Dict, user?: Dict): MergedCssConfig;
71
71
  export {};
@@ -8,7 +8,7 @@ export function deepMergeThemes(target, source) {
8
8
  out[key] = isPlainObject(value) && isPlainObject(out[key]) ? deepMergeThemes(out[key], value) : value;
9
9
  return out;
10
10
  }
11
- export function mergeCrosswindConfig(base = {}, user = {}) {
11
+ export function mergeCssConfig(base = {}, user = {}) {
12
12
  const baseTheme = base.theme || {}, userTheme = user.theme || {}, { extend: userExtend, ...userThemeKeys } = userTheme, { extend: baseExtend, ...baseThemeKeys } = baseTheme, basePalette = baseThemeKeys.colors || {};
13
13
  baseThemeKeys.colors = { ...basePalette, ...semanticColors(basePalette) };
14
14
  const theme = deepMergeThemes(baseThemeKeys, userThemeKeys), extend = deepMergeThemes(baseExtend || {}, userExtend || {});
@@ -522,7 +522,7 @@ export interface StxConfig {
522
522
  root?: string;
523
523
  /**
524
524
  * Where stx keeps its generated state: the compiled-template cache, the
525
- * Crosswind CSS cache, the client-script bundle cache and temp dir, the
525
+ * Css CSS cache, the client-script bundle cache and temp dir, the
526
526
  * generated route manifest and route types, dev-server output, SSG and media
527
527
  * caches, story snapshots.
528
528
  *
@@ -693,8 +693,8 @@ export interface StxConfig {
693
693
  /** Environment variable prefix for client-side exposure (e.g. 'STX_PUBLIC_') */
694
694
  envPrefix?: string;
695
695
  /**
696
- * Path to a `crosswind.config.*` file, or an inline Crosswind config. The
697
- * inline object accepts any Crosswind field (`theme`, `fonts`, `safelist`,
696
+ * Path to a `css.config.*` file, or an inline Css config. The
697
+ * inline object accepts any Css field (`theme`, `fonts`, `safelist`,
698
698
  * `shortcuts`, …) — e.g. load web fonts with
699
699
  * `css: { fonts: { google: ['Inter:wght@400;700'] } }`.
700
700
  */
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-z45t29sf.js";import B from"fs";import $ from"path";import k from"crypto";var V=[{name:"mobile",width:375,height:667,isMobile:!0,hasTouch:!0},{name:"tablet",width:768,height:1024,isMobile:!0,hasTouch:!0},{name:"desktop",width:1280,height:800,isMobile:!1,hasTouch:!1},{name:"wide",width:1920,height:1080,isMobile:!1,hasTouch:!1}];function J(N={}){let Y={snapshotDir:N.snapshotDir||"__snapshots__",screenshotDir:N.screenshotDir||"__screenshots__",updateSnapshots:N.updateSnapshots||process.env.UPDATE_SNAPSHOTS==="true",threshold:N.threshold??0.01,viewports:N.viewports||V,generateDiff:N.generateDiff??!0,diffDir:N.diffDir||"__diffs__",compare:N.compare||b,ci:N.ci??process.env.CI==="true",retries:N.retries??(N.ci?3:1)};return{async snapshot(M,X){let q=$.join(Y.snapshotDir,`${X}.html`),G=C(M),Q=K(G);if(await Bun.file(q).exists()){let W=await Bun.file(q).text(),Z=K(C(W));if(Q===Z)return{passed:!0,snapshotPath:q,message:"Snapshot matches"};if(Y.updateSnapshots)return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"Snapshot updated"};let F=$.join(Y.diffDir,`${X}.actual.html`),U=$.join(Y.diffDir,`${X}.diff.html`);return await B.promises.mkdir(Y.diffDir,{recursive:!0}),await Bun.write(F,G),await Bun.write(U,I(W,G)),{passed:!1,snapshotPath:q,actualPath:F,diffPath:U,message:"Snapshot does not match"}}return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"New snapshot created"}},async snapshotJson(M,X){let q=$.join(Y.snapshotDir,`${X}.json`),G=JSON.stringify(M,null,2);if(await Bun.file(q).exists()){let Q=await Bun.file(q).text();if(G===Q)return{passed:!0,snapshotPath:q};if(Y.updateSnapshots)return await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"Snapshot updated"};return{passed:!1,snapshotPath:q,message:`JSON snapshot mismatch:
2
+ import"./chunk-sskbegsz.js";import B from"fs";import $ from"path";import k from"crypto";var V=[{name:"mobile",width:375,height:667,isMobile:!0,hasTouch:!0},{name:"tablet",width:768,height:1024,isMobile:!0,hasTouch:!0},{name:"desktop",width:1280,height:800,isMobile:!1,hasTouch:!1},{name:"wide",width:1920,height:1080,isMobile:!1,hasTouch:!1}];function J(N={}){let Y={snapshotDir:N.snapshotDir||"__snapshots__",screenshotDir:N.screenshotDir||"__screenshots__",updateSnapshots:N.updateSnapshots||process.env.UPDATE_SNAPSHOTS==="true",threshold:N.threshold??0.01,viewports:N.viewports||V,generateDiff:N.generateDiff??!0,diffDir:N.diffDir||"__diffs__",compare:N.compare||b,ci:N.ci??process.env.CI==="true",retries:N.retries??(N.ci?3:1)};return{async snapshot(M,X){let q=$.join(Y.snapshotDir,`${X}.html`),G=C(M),Q=K(G);if(await Bun.file(q).exists()){let W=await Bun.file(q).text(),Z=K(C(W));if(Q===Z)return{passed:!0,snapshotPath:q,message:"Snapshot matches"};if(Y.updateSnapshots)return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"Snapshot updated"};let F=$.join(Y.diffDir,`${X}.actual.html`),U=$.join(Y.diffDir,`${X}.diff.html`);return await B.promises.mkdir(Y.diffDir,{recursive:!0}),await Bun.write(F,G),await Bun.write(U,I(W,G)),{passed:!1,snapshotPath:q,actualPath:F,diffPath:U,message:"Snapshot does not match"}}return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"New snapshot created"}},async snapshotJson(M,X){let q=$.join(Y.snapshotDir,`${X}.json`),G=JSON.stringify(M,null,2);if(await Bun.file(q).exists()){let Q=await Bun.file(q).text();if(G===Q)return{passed:!0,snapshotPath:q};if(Y.updateSnapshots)return await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"Snapshot updated"};return{passed:!1,snapshotPath:q,message:`JSON snapshot mismatch:
3
3
  ${z(Q,G)}`}}return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"New snapshot created"}},matchInlineSnapshot(M,X){let q=C(M);if(X===void 0)return{passed:!0,expected:q};let G=C(X);return{passed:q===G,expected:q}},getConfig(){return Y}}}function D(N={}){let Y=J(N),M=Y.getConfig();return{async compareScreenshots(X,q,G="desktop"){let Q=$.join(M.screenshotDir,G,`${X}.png`),W=$.join(M.diffDir,G,`${X}.actual.png`),Z=$.join(M.diffDir,G,`${X}.diff.png`);if(await Bun.file(Q).exists()){let F=await Bun.file(Q).arrayBuffer(),U=Buffer.from(F),_=await M.compare(q,U);if(_.match||_.diffPercentage<=M.threshold)return{viewport:G,passed:!0,baselinePath:Q};if(M.updateSnapshots)return await B.promises.mkdir($.dirname(Q),{recursive:!0}),await Bun.write(Q,q),{viewport:G,passed:!0,baselinePath:Q};if(await B.promises.mkdir($.dirname(W),{recursive:!0}),await Bun.write(W,q),_.diffImage&&M.generateDiff)await Bun.write(Z,_.diffImage);return{viewport:G,passed:!1,baselinePath:Q,actualPath:W,diffPath:M.generateDiff?Z:void 0,diffPercentage:_.diffPercentage}}return await B.promises.mkdir($.dirname(Q),{recursive:!0}),await Bun.write(Q,q),{viewport:G,passed:!0,baselinePath:Q}},async testViewports(X,q,G=M.viewports){let Q=[];for(let W of G){let Z=null;for(let F=0;F<M.retries;F++)try{let U=await q(W),_=await this.compareScreenshots(X,U,W.name);Q.push(_),Z=null;break}catch(U){if(Z=U,F<M.retries-1)await new Promise((_)=>setTimeout(_,100*(F+1)))}if(Z)Q.push({viewport:W.name,passed:!1,baselinePath:"",diffPercentage:100})}return Q},getSnapshotTester(){return Y}}}function L(N={}){let M=D(N).getSnapshotTester(),X=new Map;return{addStory(q){X.set(`${q.component}/${q.name}`,q)},addStories(q){for(let G of q)this.addStory(G)},getStories(){return Array.from(X.values())},getStoriesForComponent(q){return Array.from(X.values()).filter((G)=>G.component===q)},async testStory(q){let G=X.get(q);if(!G)return{name:q,passed:!1,duration:0,snapshots:[],screenshots:[],errors:[Error(`Story not found: ${q}`)]};let Q=Date.now(),W={name:q,passed:!0,duration:0,snapshots:[],screenshots:[],errors:[]};try{let Z=await G.render(),F=await M.snapshot(Z,q.replace(/\//g,"-"));if(W.snapshots.push(F),!F.passed)W.passed=!1}catch(Z){W.passed=!1,W.errors.push(Z)}return W.duration=Date.now()-Q,W},async testAllStories(){let q=[];for(let G of X.keys()){let Q=await this.testStory(G);q.push(Q)}return q},async generateStoryIndex(){let q={};for(let G of X.values()){if(!q[G.component])q[G.component]=[];q[G.component].push({name:G.name,args:G.args})}return JSON.stringify(q,null,2)}}}async function S(N,Y={}){let M={outputDir:Y.outputDir||"visual-test-report",format:Y.format||"html",title:Y.title||"Visual Test Report",includeScreenshots:Y.includeScreenshots??!0};await B.promises.mkdir(M.outputDir,{recursive:!0});let X=N.length,q=N.filter((F)=>F.passed).length,G=X-q,Q=N.reduce((F,U)=>F+U.duration,0);if(M.format==="json"){let F={title:M.title,summary:{total:X,passed:q,failed:G,duration:Q},results:N,generatedAt:new Date().toISOString()},U=$.join(M.outputDir,"report.json");return await Bun.write(U,JSON.stringify(F,null,2)),U}if(M.format==="markdown"){let F=`# ${M.title}
4
4
 
5
5
  `;F+=`## Summary
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.281",
4
+ "version": "0.2.284",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -115,14 +115,14 @@
115
115
  "typecheck": "bun tsc -p tsconfig.src.json --noEmit"
116
116
  },
117
117
  "dependencies": {
118
- "@cwcss/crosswind": "^0.2.19",
118
+ "@stacksjs/ts-css": "^0.3.2",
119
119
  "@stacksjs/clapp": "^0.2.14",
120
- "@stacksjs/desktop": "0.2.281",
121
- "@stacksjs/sanitizer": "0.2.281",
120
+ "@stacksjs/desktop": "0.2.284",
121
+ "@stacksjs/sanitizer": "0.2.284",
122
122
  "@stacksjs/ts-i18n": "^0.1.11",
123
- "bun-plugin-stx": "0.2.281",
123
+ "bun-plugin-stx": "0.2.284",
124
124
  "bunfig": "^0.15.17",
125
- "stx-router": "0.2.281",
125
+ "stx-router": "0.2.284",
126
126
  "ts-broadcasting": "^0.0.9",
127
127
  "ts-images": "^0.2.17",
128
128
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Oj as a,Pj as b,Qj as c,Rj as d,Sj as e,Tj as f,Uj as g,Vj as h,Wj as i,Xj as j,Yj as k}from"./chunk-6vaa771b.js";import"./chunk-h0t73k2z.js";import"./chunk-xpxw2ked.js";import"./chunk-6gb72zp2.js";import"./chunk-82kkkpw2.js";import"./chunk-shyqtvbq.js";import"./chunk-ydzmhy4c.js";import"./chunk-w1asc0zd.js";import"./chunk-xqwmj65h.js";import"./chunk-0ym08enb.js";import"./chunk-q4desjj6.js";import"./chunk-gfhzedsr.js";import"./chunk-sfaayvmn.js";import"./chunk-azfjfrns.js";import"./chunk-z45t29sf.js";export{a as templateCache,b as readFileCached,d as invalidateFileCacheByDir,c as invalidateFileCache,k as hashFilePath,f as getCachedSignalsRuntime,g as getCachedRouterScript,h as clearDevCaches,i as checkCache,j as cacheTemplate,e as __setSignalsGeneratorsForTest};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{bj as a}from"./chunk-7q9mwh4v.js";import"./chunk-z45t29sf.js";export{a as processDeferDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Fp as a,Gp as b}from"./chunk-h0t73k2z.js";import"./chunk-xpxw2ked.js";import"./chunk-6gb72zp2.js";import"./chunk-82kkkpw2.js";import"./chunk-shyqtvbq.js";import"./chunk-ydzmhy4c.js";import"./chunk-w1asc0zd.js";import"./chunk-xqwmj65h.js";import"./chunk-0ym08enb.js";import"./chunk-q4desjj6.js";import"./chunk-gfhzedsr.js";import"./chunk-sfaayvmn.js";import"./chunk-azfjfrns.js";import"./chunk-z45t29sf.js";export{b as processLoops,a as parseLoopBinding};
@@ -1,5 +0,0 @@
1
- // @bun
2
- import{Ru as y}from"./chunk-sfaayvmn.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-crosswind=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"crosswind",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-crosswind="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
3
- `);return C.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...M.map((v)=>` '${v}': true`)," }","}","","export {}",""),C.join(`
4
- `)}function HM(M,C){if(!M)return[];let v=F.isAbsolute(M)?M:F.resolve(process.cwd(),M),q=f(v),g=c(q),j=F.join(C,h);try{if(Z.existsSync(j)&&Z.readFileSync(j,"utf8")===g)return q;Z.mkdirSync(C,{recursive:!0}),Z.writeFileSync(j,g)}catch{}return q}
5
- export{Y as wk,_ as xk,a as yk,s as zk,h as Ak,f as Bk,c as Ck,HM as Dk};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Xi as a,Yi as b,Zi as c}from"./chunk-e7avk421.js";import"./chunk-9n0gvfrg.js";import"./chunk-h0t73k2z.js";import"./chunk-xpxw2ked.js";import"./chunk-6gb72zp2.js";import"./chunk-82kkkpw2.js";import"./chunk-shyqtvbq.js";import"./chunk-ydzmhy4c.js";import"./chunk-w1asc0zd.js";import"./chunk-xqwmj65h.js";import"./chunk-0ym08enb.js";import"./chunk-q4desjj6.js";import"./chunk-gfhzedsr.js";import"./chunk-sfaayvmn.js";import"./chunk-azfjfrns.js";import"./chunk-z45t29sf.js";export{a as listComposableModules,b as getComposableScript,c as clearComposableCache};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{bt as a,ct as b,dt as c,et as d,ft as e,gt as f,ht as g,it as h,jt as i,kt as j,lt as k,mt as l,nt as m}from"./chunk-ydzmhy4c.js";import"./chunk-w1asc0zd.js";import"./chunk-z45t29sf.js";export{f as resolveUserCrosswindConfig,c as resetCssCache,d as resetCrosswindCache,i as rebuildCrosswindCSS,e as loadCrosswindConfig,b as loadCrosswind,m as injectCrosswindCSS,a as getCrosswindServeAsset,j as getCachedCSS,l as generateCrosswindCSS,g as fingerprintConfig,k as extractClassNames,h as buildCrosswindCSS};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{hs as a,is as b,js as c,ks as d,ls as e,ms as f}from"./chunk-h0t73k2z.js";import"./chunk-xpxw2ked.js";import"./chunk-6gb72zp2.js";import"./chunk-82kkkpw2.js";import"./chunk-shyqtvbq.js";import"./chunk-ydzmhy4c.js";import"./chunk-w1asc0zd.js";import"./chunk-xqwmj65h.js";import"./chunk-0ym08enb.js";import"./chunk-q4desjj6.js";import"./chunk-gfhzedsr.js";import"./chunk-sfaayvmn.js";import"./chunk-azfjfrns.js";import"./chunk-z45t29sf.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{hf as c,if as d,jf as e,kf as f,lf as g,mf as h}from"./chunk-y91519ss.js";import{Ug as a,Xg as b}from"./chunk-gex3spzq.js";import"./chunk-e7avk421.js";import"./chunk-9n0gvfrg.js";import"./chunk-h0t73k2z.js";import"./chunk-xpxw2ked.js";import"./chunk-6gb72zp2.js";import"./chunk-82kkkpw2.js";import"./chunk-shyqtvbq.js";import"./chunk-ydzmhy4c.js";import"./chunk-w1asc0zd.js";import"./chunk-xqwmj65h.js";import"./chunk-0ym08enb.js";import"./chunk-q4desjj6.js";import"./chunk-gfhzedsr.js";import"./chunk-sfaayvmn.js";import"./chunk-azfjfrns.js";import"./chunk-z45t29sf.js";export{d as virtualPathFor,g as typecheckStxFiles,e as sourcePathFor,h as formatTypecheckDiagnostics,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{jp as a,kp as b,lp as c,mp as d,np as e,op as f,pp as g,qp as h,rp as i,sp as j,tp as k,up as l}from"./chunk-h0t73k2z.js";import"./chunk-xpxw2ked.js";import"./chunk-6gb72zp2.js";import"./chunk-82kkkpw2.js";import"./chunk-shyqtvbq.js";import"./chunk-ydzmhy4c.js";import"./chunk-w1asc0zd.js";import"./chunk-xqwmj65h.js";import"./chunk-0ym08enb.js";import"./chunk-q4desjj6.js";import"./chunk-gfhzedsr.js";import"./chunk-sfaayvmn.js";import"./chunk-azfjfrns.js";import"./chunk-z45t29sf.js";export{l as stripStxRuntimeImports,a as scanScriptTags,k as rewriteStxImportSpecifiers,i as processSignals,g as processScriptSetup,e as preEvalLiteralReactiveIfs,b as parseLoopExpression,c as hasSignalsSyntax,j as findMarkupIndexOutsideScripts,h as extractExports,f as convertSignalLoopsToAttributes,d as convertSignalDirectivesToAttributes};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ef as a}from"./chunk-hghg9hcj.js";import"./chunk-h0t73k2z.js";import"./chunk-xpxw2ked.js";import"./chunk-6gb72zp2.js";import"./chunk-82kkkpw2.js";import"./chunk-shyqtvbq.js";import"./chunk-ydzmhy4c.js";import"./chunk-w1asc0zd.js";import"./chunk-xqwmj65h.js";import"./chunk-0ym08enb.js";import"./chunk-q4desjj6.js";import"./chunk-gfhzedsr.js";import"./chunk-sfaayvmn.js";import"./chunk-azfjfrns.js";import"./chunk-z45t29sf.js";export{a as buildApp};