@stacksjs/stx 0.2.5 → 0.2.6

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 (293) hide show
  1. package/dist/a11y.d.ts +2 -6
  2. package/dist/analytics.d.ts +1 -1
  3. package/dist/analyzer.d.ts +1 -1
  4. package/dist/animation.d.ts +10 -86
  5. package/dist/app.d.ts +2 -4
  6. package/dist/assets.d.ts +1 -1
  7. package/dist/ast.d.ts +3 -24
  8. package/dist/async-components.d.ts +1 -1
  9. package/dist/auth.d.ts +1 -1
  10. package/dist/browser-composables.d.ts +6 -4
  11. package/dist/build-optimizer.d.ts +4 -29
  12. package/dist/build-views.d.ts +20 -1
  13. package/dist/bundle-analyzer/collector.d.ts +1 -1
  14. package/dist/bundle-analyzer/index.d.ts +40 -4
  15. package/dist/bundle-analyzer/report.d.ts +1 -1
  16. package/dist/bundle-analyzer/treemap.d.ts +1 -1
  17. package/dist/caching.d.ts +1 -1
  18. package/dist/cli.js +1323 -511
  19. package/dist/client/directive.d.ts +1 -1
  20. package/dist/client/index.d.ts +6 -1
  21. package/dist/client/router.d.ts +3 -11
  22. package/dist/client/stx-router.browser.d.ts +1 -0
  23. package/dist/client-script.d.ts +2 -1
  24. package/dist/client.d.ts +2 -2
  25. package/dist/component-hmr.d.ts +4 -18
  26. package/dist/components.d.ts +1 -1
  27. package/dist/composables/index.d.ts +114 -1
  28. package/dist/composables/use-battery.d.ts +1 -1
  29. package/dist/composables/use-broadcast-channel.d.ts +2 -2
  30. package/dist/composables/use-clipboard.d.ts +1 -1
  31. package/dist/composables/use-color-mode.d.ts +52 -0
  32. package/dist/composables/use-cookie.d.ts +1 -1
  33. package/dist/composables/use-device-orientation.d.ts +1 -1
  34. package/dist/composables/use-event-listener.d.ts +35 -0
  35. package/dist/composables/use-event-source.d.ts +1 -1
  36. package/dist/composables/use-eye-dropper.d.ts +3 -2
  37. package/dist/composables/use-fetch.d.ts +1 -1
  38. package/dist/composables/use-fullscreen.d.ts +1 -1
  39. package/dist/composables/use-geolocation.d.ts +1 -1
  40. package/dist/composables/use-idle.d.ts +2 -2
  41. package/dist/composables/use-intersection-observer.d.ts +1 -1
  42. package/dist/composables/use-keyboard.d.ts +1 -2
  43. package/dist/composables/use-media-query.d.ts +1 -1
  44. package/dist/composables/use-meta.d.ts +35 -0
  45. package/dist/composables/use-mouse.d.ts +1 -1
  46. package/dist/composables/use-mutation-observer.d.ts +1 -1
  47. package/dist/composables/use-network.d.ts +1 -1
  48. package/dist/composables/use-notification.d.ts +10 -1
  49. package/dist/composables/use-permissions.d.ts +17 -7
  50. package/dist/composables/use-query.d.ts +43 -0
  51. package/dist/composables/use-resize-observer.d.ts +1 -1
  52. package/dist/composables/use-router.d.ts +59 -0
  53. package/dist/composables/use-share.d.ts +1 -1
  54. package/dist/composables/use-speech.d.ts +1 -1
  55. package/dist/composables/use-storage.d.ts +1 -1
  56. package/dist/composables/use-text-selection.d.ts +1 -1
  57. package/dist/composables/use-timer.d.ts +92 -0
  58. package/dist/composables/use-utilities.d.ts +103 -0
  59. package/dist/composables/use-wake-lock.d.ts +1 -1
  60. package/dist/composables/use-websocket.d.ts +3 -3
  61. package/dist/composables/use-window.d.ts +1 -1
  62. package/dist/composables.d.ts +10 -7
  63. package/dist/composition-api.d.ts +1 -14
  64. package/dist/computed.d.ts +10 -4
  65. package/dist/conditionals.d.ts +1 -1
  66. package/dist/config.d.ts +1 -1
  67. package/dist/craft-bridge.d.ts +1 -1
  68. package/dist/craft-compiler.d.ts +6 -3
  69. package/dist/craft-components.d.ts +1 -8
  70. package/dist/craft-entry.d.ts +1 -1
  71. package/dist/craft-ssr.d.ts +1 -1
  72. package/dist/csp.d.ts +2 -2
  73. package/dist/csrf.d.ts +1 -1
  74. package/dist/custom-directives.d.ts +1 -1
  75. package/dist/database.d.ts +8 -26
  76. package/dist/defer.d.ts +1 -1
  77. package/dist/deploy/config-generators.d.ts +1 -1
  78. package/dist/deploy/index.d.ts +6 -3
  79. package/dist/deploy/netlify.d.ts +1 -1
  80. package/dist/dev-server/crosswind.d.ts +11 -1
  81. package/dist/dev-server/index.d.ts +16 -1
  82. package/dist/dev-server/keyboard-shortcuts.d.ts +1 -1
  83. package/dist/dev-server/native-window.d.ts +1 -1
  84. package/dist/dev-server/port-utils.d.ts +2 -2
  85. package/dist/dev-server/terminal-colors.d.ts +1 -5
  86. package/dist/dev-server/theme-selector.d.ts +1 -1
  87. package/dist/dev-server/types.d.ts +3 -8
  88. package/dist/dev-server.d.ts +1 -4
  89. package/dist/devtools.d.ts +4 -1
  90. package/dist/directive-api.d.ts +3 -3
  91. package/dist/docs.d.ts +2 -2
  92. package/dist/dynamic-components.d.ts +1 -1
  93. package/dist/edge-runtime.d.ts +3 -3
  94. package/dist/env.d.ts +1 -1
  95. package/dist/error-boundaries.d.ts +1 -1
  96. package/dist/error-handling.d.ts +14 -1
  97. package/dist/errors/codes.d.ts +2 -17
  98. package/dist/errors/formatter.d.ts +1 -1
  99. package/dist/errors/index.d.ts +13 -1
  100. package/dist/errors/logger.d.ts +2 -15
  101. package/dist/errors/sanitizer.d.ts +1 -1
  102. package/dist/errors/types.d.ts +1 -1
  103. package/dist/events.d.ts +1 -1
  104. package/dist/expressions.d.ts +64 -90
  105. package/dist/formatter.d.ts +1 -1
  106. package/dist/forms-validation.d.ts +23 -24
  107. package/dist/forms.d.ts +5 -22
  108. package/dist/head.d.ts +5 -1
  109. package/dist/heatmap.d.ts +4 -7
  110. package/dist/hot-reload.d.ts +3 -8
  111. package/dist/hydration-runtime.d.ts +1 -1
  112. package/dist/hydration.d.ts +5 -32
  113. package/dist/i18n.d.ts +1 -9
  114. package/dist/image-optimization/build-plugin.d.ts +2 -2
  115. package/dist/image-optimization/component.d.ts +2 -2
  116. package/dist/image-optimization/directive.d.ts +2 -2
  117. package/dist/image-optimization/index.d.ts +55 -1
  118. package/dist/image-optimization/processor.d.ts +9 -4
  119. package/dist/includes.d.ts +1 -1
  120. package/dist/index.d.ts +29 -1
  121. package/dist/index.js +1387 -542
  122. package/dist/init.d.ts +1 -1
  123. package/dist/interactive.d.ts +1 -1
  124. package/dist/internal-markdown.d.ts +1 -1
  125. package/dist/js-ts.d.ts +1 -1
  126. package/dist/jsx-runtime.d.ts +1 -20
  127. package/dist/keep-alive.d.ts +1 -1
  128. package/dist/lazy-loader.d.ts +3 -35
  129. package/dist/loading-indicator.d.ts +2 -1
  130. package/dist/loops.d.ts +1 -1
  131. package/dist/markdown.d.ts +1 -1
  132. package/dist/media/client/blur-up.d.ts +1 -1
  133. package/dist/media/client/index.d.ts +17 -1
  134. package/dist/media/client/lazy-load.d.ts +1 -1
  135. package/dist/media/client/upload-handler.d.ts +1 -1
  136. package/dist/media/image/component.d.ts +2 -4
  137. package/dist/media/image/directive.d.ts +1 -1
  138. package/dist/media/image/editing.d.ts +1 -1
  139. package/dist/media/image/index.d.ts +25 -1
  140. package/dist/media/image/placeholder.d.ts +1 -1
  141. package/dist/media/image/processor/cache.d.ts +3 -4
  142. package/dist/media/image/processor/index.d.ts +9 -1
  143. package/dist/media/image/processor/optimizer.d.ts +2 -2
  144. package/dist/media/image/processor/responsive.d.ts +3 -2
  145. package/dist/media/image/srcset.d.ts +6 -4
  146. package/dist/media/index.d.ts +37 -1
  147. package/dist/media/manager/embed.d.ts +1 -1
  148. package/dist/media/protected/component.d.ts +2 -3
  149. package/dist/media/protected/index.d.ts +14 -1
  150. package/dist/media/protected/signature.d.ts +2 -2
  151. package/dist/media/shared/cache.d.ts +1 -1
  152. package/dist/media/shared/hash.d.ts +1 -1
  153. package/dist/media/shared/index.d.ts +6 -1
  154. package/dist/media/types.d.ts +16 -72
  155. package/dist/media/upload/component.d.ts +2 -16
  156. package/dist/media/upload/index.d.ts +8 -1
  157. package/dist/media/video/directive.d.ts +1 -1
  158. package/dist/media/video/index.d.ts +11 -2
  159. package/dist/media/video/processor/cache.d.ts +3 -4
  160. package/dist/media/video/processor/index.d.ts +9 -1
  161. package/dist/media/video/processor/streaming.d.ts +2 -2
  162. package/dist/media/video/processor/thumbnail.d.ts +2 -2
  163. package/dist/media/video/processor/transcoder.d.ts +2 -2
  164. package/dist/method-spoofing.d.ts +1 -1
  165. package/dist/middleware.d.ts +1 -1
  166. package/dist/native-build.d.ts +3 -6
  167. package/dist/parser/directive-parser.d.ts +1 -1
  168. package/dist/parser/expression-parser.d.ts +2 -1
  169. package/dist/parser/index.d.ts +14 -1
  170. package/dist/parser/tokenizer.d.ts +2 -18
  171. package/dist/partial-hydration.d.ts +5 -6
  172. package/dist/performance-utils.d.ts +5 -18
  173. package/dist/plugin-system.d.ts +2 -8
  174. package/dist/plugin.d.ts +1 -1
  175. package/dist/precompiler.d.ts +2 -67
  176. package/dist/process.d.ts +12 -2
  177. package/dist/production-build.d.ts +1 -37
  178. package/dist/props.d.ts +3 -30
  179. package/dist/pwa/audit.d.ts +1 -1
  180. package/dist/pwa/directives.d.ts +1 -1
  181. package/dist/pwa/icons.d.ts +7 -4
  182. package/dist/pwa/index.d.ts +46 -1
  183. package/dist/pwa/inject.d.ts +1 -1
  184. package/dist/pwa/manifest.d.ts +1 -1
  185. package/dist/pwa/offline.d.ts +1 -1
  186. package/dist/pwa/precache.d.ts +1 -1
  187. package/dist/pwa/service-worker.d.ts +1 -1
  188. package/dist/pwa/workbox-strategies.d.ts +1 -1
  189. package/dist/pwa/workbox.d.ts +1 -10
  190. package/dist/pwa.d.ts +1 -1
  191. package/dist/pwa.js +1242 -430
  192. package/dist/reactive-bindings.d.ts +1 -1
  193. package/dist/reactive.d.ts +1 -1
  194. package/dist/reactivity.d.ts +6 -50
  195. package/dist/release.d.ts +1 -1
  196. package/dist/route-middleware.d.ts +3 -3
  197. package/dist/router.d.ts +1 -1
  198. package/dist/routes.d.ts +2 -2
  199. package/dist/runtime.d.ts +4 -4
  200. package/dist/safe-evaluator.d.ts +1 -4
  201. package/dist/scaffolding.d.ts +1 -1
  202. package/dist/seo.d.ts +1 -5
  203. package/dist/serve.d.ts +1 -1
  204. package/dist/server-components.d.ts +1 -1
  205. package/dist/signals.d.ts +8 -168
  206. package/dist/slots.d.ts +2 -2
  207. package/dist/source-maps.d.ts +3 -22
  208. package/dist/spa-shell.d.ts +20 -0
  209. package/dist/ssg.d.ts +4 -6
  210. package/dist/ssg.js +1242 -430
  211. package/dist/ssr.d.ts +6 -14
  212. package/dist/state-management.d.ts +5 -45
  213. package/dist/stores-client.d.ts +3 -3
  214. package/dist/story/addons.d.ts +1 -1
  215. package/dist/story/analytics.d.ts +4 -11
  216. package/dist/story/auto-stories.d.ts +1 -1
  217. package/dist/story/bookmarks.d.ts +2 -6
  218. package/dist/story/bun-test.d.ts +1 -1
  219. package/dist/story/cli.d.ts +0 -25
  220. package/dist/story/collect/analyzer.d.ts +1 -1
  221. package/dist/story/collect/index.d.ts +5 -1
  222. package/dist/story/collect/parser.d.ts +1 -1
  223. package/dist/story/collect/scanner.d.ts +1 -1
  224. package/dist/story/collect/tree.d.ts +2 -2
  225. package/dist/story/commands/build.d.ts +1 -1
  226. package/dist/story/commands/dev.d.ts +1 -1
  227. package/dist/story/commands/index.d.ts +4 -1
  228. package/dist/story/commands/preview.d.ts +1 -1
  229. package/dist/story/compiled-output.d.ts +1 -1
  230. package/dist/story/composition.d.ts +1 -1
  231. package/dist/story/config-watcher.d.ts +1 -1
  232. package/dist/story/config.d.ts +2 -2
  233. package/dist/story/context.d.ts +1 -1
  234. package/dist/story/controls/index.d.ts +1 -1
  235. package/dist/story/crosswind.d.ts +1 -1
  236. package/dist/story/desktop-preview.d.ts +1 -1
  237. package/dist/story/docs-generator.d.ts +1 -1
  238. package/dist/story/errors.d.ts +1 -1
  239. package/dist/story/figma-export.d.ts +2 -2
  240. package/dist/story/generator.d.ts +1 -1
  241. package/dist/story/hmr.d.ts +1 -1
  242. package/dist/story/hot-swap.d.ts +1 -1
  243. package/dist/story/index.d.ts +49 -1
  244. package/dist/story/interactions.d.ts +1 -1
  245. package/dist/story/keyboard-shortcuts.d.ts +1 -1
  246. package/dist/story/output.d.ts +1 -1
  247. package/dist/story/performance.d.ts +3 -12
  248. package/dist/story/presets.d.ts +3 -8
  249. package/dist/story/props-validation.d.ts +11 -1
  250. package/dist/story/renderer.d.ts +1 -1
  251. package/dist/story/search-index.d.ts +2 -2
  252. package/dist/story/search.d.ts +2 -2
  253. package/dist/story/server.d.ts +1 -1
  254. package/dist/story/setup.d.ts +1 -1
  255. package/dist/story/snapshots.d.ts +1 -1
  256. package/dist/story/testing.d.ts +1 -1
  257. package/dist/story/theme.d.ts +1 -1
  258. package/dist/story/types.d.ts +3 -12
  259. package/dist/story/ui/code-panel.d.ts +1 -1
  260. package/dist/story/ui/controls-panel.d.ts +1 -1
  261. package/dist/story/ui/index.d.ts +5 -1
  262. package/dist/story/ui/navigation.d.ts +1 -1
  263. package/dist/story/ui/preview.d.ts +1 -1
  264. package/dist/story/visual-testing.d.ts +1 -1
  265. package/dist/streaming.d.ts +0 -59
  266. package/dist/suspense.d.ts +1 -1
  267. package/dist/teleport.d.ts +1 -1
  268. package/dist/testing.d.ts +62 -80
  269. package/dist/transitions.d.ts +1 -1
  270. package/dist/type-checker.d.ts +2 -26
  271. package/dist/types/component-types.d.ts +3 -3
  272. package/dist/types/config-types.d.ts +15 -30
  273. package/dist/types/context-types.d.ts +6 -5
  274. package/dist/types/csp-types.d.ts +2 -2
  275. package/dist/types/directive-types.d.ts +5 -5
  276. package/dist/types/index.d.ts +21 -1
  277. package/dist/types/pwa-types.d.ts +1 -6
  278. package/dist/types.d.ts +28 -1
  279. package/dist/typescript-templates.d.ts +1 -34
  280. package/dist/utils.d.ts +2 -1
  281. package/dist/validator.d.ts +1 -1
  282. package/dist/variable-extractor.d.ts +1 -1
  283. package/dist/view-composers.d.ts +1 -1
  284. package/dist/virtual-scrolling.d.ts +4 -1
  285. package/dist/visual-editor.d.ts +2 -30
  286. package/dist/visual-testing.d.ts +4 -1
  287. package/dist/vue-template.d.ts +1 -1
  288. package/dist/web-components/css-scoping.d.ts +1 -1
  289. package/dist/web-components/index.d.ts +10 -1
  290. package/dist/web-components/reactive-generator.d.ts +1 -1
  291. package/dist/web-components.d.ts +1 -1
  292. package/dist/x-element.d.ts +13 -6
  293. package/package.json +4 -4
package/dist/csp.d.ts CHANGED
@@ -108,7 +108,7 @@ export declare function getCspPreset(preset: CspPreset): CspConfig;
108
108
  * // }
109
109
  * ```
110
110
  */
111
- export declare function mergeCspDirectives(base: CspDirectives, override: CspDirectives): CspDirectives;
111
+ export declare function mergeCspDirectives(base: CspDirectives, : CspDirectives): CspDirectives;
112
112
  /**
113
113
  * Inject CSP meta tag into HTML head
114
114
  *
@@ -226,4 +226,4 @@ export declare const cspNonceDirective: CustomDirective;
226
226
  /**
227
227
  * Default CSP configuration - moderate preset
228
228
  */
229
- export declare const defaultCspConfig: CspConfig;
229
+ export declare const defaultCspConfig: CspConfig;
package/dist/csrf.d.ts CHANGED
@@ -25,4 +25,4 @@ export declare function processCsrfDirectives(template: string): string;
25
25
  /**
26
26
  * Middleware-like function to verify CSRF token
27
27
  */
28
- export declare function verifyCsrfToken(token: string): boolean;
28
+ export declare function verifyCsrfToken(token: string): boolean;
@@ -2,4 +2,4 @@ import type { StxOptions } from './types';
2
2
  /**
3
3
  * Process all custom directives registered in the app
4
4
  */
5
- export declare function processCustomDirectives(template: string, context: Record<string, any>, filePath: string, options: StxOptions): Promise<string>;
5
+ export declare function processCustomDirectives(template: string, context: Record<string, any>, filePath: string, options: StxOptions): Promise<string>;
@@ -249,6 +249,7 @@ export declare interface ModelInstance {
249
249
  original: Row
250
250
  attributes: Row
251
251
  isDirty: (key?: string) => boolean
252
+ [key: string]: unknown
252
253
  }
253
254
  /**
254
255
  * Model class
@@ -285,38 +286,25 @@ export declare interface DatabaseAdapter {
285
286
  /**
286
287
  * Supported database drivers
287
288
  */
288
- export type DatabaseDriver = 'sqlite' | 'postgres' | 'mysql' | 'custom'
289
+ export type DatabaseDriver = 'sqlite' | 'postgres' | 'mysql' | 'custom';
289
290
  /**
290
291
  * Query operator types
291
292
  */
292
- export type QueryOperator = '=' | '!=' | '<' | '<=' | '>' | '>=' | 'like' | 'in' | 'not in' | 'between' | 'is null' | 'is not null'
293
+ export type QueryOperator = '=' | '!=' | '<' | '<=' | '>' | '>=' | 'like' | 'in' | 'not in' | 'between' | 'is null' | 'is not null';
293
294
  /**
294
295
  * Query result row
295
296
  */
296
- export type Row = Record<string, unknown>
297
+ export type Row = Record<string, unknown>;
297
298
  /**
298
299
  * Fluent query builder class
299
300
  */
300
301
  export declare class QueryBuilder {
301
- private _table: string;
302
- private _columns: (string | RawExpression)[];
303
- private _wheres: WhereCondition[];
304
- private _orders: OrderByClause[];
305
- private _joins: JoinClause[];
306
- private _groupBy: string[];
307
- private _having: WhereCondition[];
308
- private _limit?: number;
309
- private _offset?: number;
310
- private _distinct: boolean;
311
- private _connection?: string;
312
- private _bindings: unknown[];
313
- private _modelDefinition?: ModelDefinition;
314
302
  constructor(table?: string);
315
303
  table(name: string): this;
316
304
  from(name: string): this;
317
305
  connection(name: string): this;
318
- select(columns: (string | RawExpression)[]): this;
319
- addSelect(columns: (string | RawExpression)[]): this;
306
+ select(...columns: (string | RawExpression)[]): this;
307
+ addSelect(...columns: (string | RawExpression)[]): this;
320
308
  distinct(): this;
321
309
  where(column: string, operatorOrValue: QueryOperator | unknown, value?: unknown): this;
322
310
  orWhere(column: string, operatorOrValue: QueryOperator | unknown, value?: unknown): this;
@@ -331,7 +319,7 @@ export declare class QueryBuilder {
331
319
  rightJoin(table: string, first: string, operator: string, second: string): this;
332
320
  orderBy(column: string, direction?: 'asc' | 'desc'): this;
333
321
  orderByDesc(column: string): this;
334
- groupBy(columns: string[]): this;
322
+ groupBy(...columns: string[]): this;
335
323
  having(column: string, operator: QueryOperator, value: unknown): this;
336
324
  limit(count: number): this;
337
325
  take(count: number): this;
@@ -359,8 +347,6 @@ export declare class QueryBuilder {
359
347
  delete(): Promise<number>;
360
348
  truncate(): Promise<void>;
361
349
  toSql(): { sql: string, bindings: unknown[] };
362
- private buildWhereClause(): string;
363
- private getCacheKey(sql: string, bindings: unknown[]): string;
364
350
  clone(): QueryBuilder;
365
351
  }
366
352
  /**
@@ -375,7 +361,6 @@ export declare class DatabaseError extends Error {
375
361
  * Schema builder for database migrations
376
362
  */
377
363
  export declare class SchemaBuilder {
378
- private _connection?: string;
379
364
  connection(name: string): this;
380
365
  create(table: string, callback: (blueprint: Blueprint) => void): Promise<void>;
381
366
  drop(table: string): Promise<void>;
@@ -386,9 +371,6 @@ export declare class SchemaBuilder {
386
371
  * Table blueprint for schema definitions
387
372
  */
388
373
  export declare class Blueprint {
389
- private columns: string[];
390
- private indices: string[];
391
- private table: string;
392
374
  constructor(table: string);
393
375
  id(name?: string): this;
394
376
  string(name: string, length?: number): this;
@@ -404,4 +386,4 @@ export declare class Blueprint {
404
386
  unique(columns: string | string[]): this;
405
387
  toCreateSQL(): string;
406
388
  getIndexSQL(): string[];
407
- }
389
+ }
package/dist/defer.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Process @defer directives in template
3
3
  */
4
- export declare function processDeferDirectives(template: string, _context: Record<string, unknown>, _filePath: string): string;
4
+ export declare function processDeferDirectives(template: string, _context: Record<string, unknown>, _filePath: string): string;
@@ -72,4 +72,4 @@ export declare interface ProjectConfig {
72
72
  edgeFunctionsDir?: string
73
73
  nodeVersion?: string
74
74
  isSPA?: boolean
75
- }
75
+ }
@@ -1,5 +1,5 @@
1
- import { createNetlifyClient, collectDeployFiles, createFileManifest, filterRequiredFiles, formatSize, getTotalSize, } from './netlify';
2
- import { detectProjectConfig, createDefaultNetlifyConfig, generateNetlifyToml, writeNetlifyConfig, hasNetlifyConfig, } from './config-generators';
1
+ import { createNetlifyClient, collectDeployFiles, createFileManifest, filterRequiredFiles, formatSize, getTotalSize, type NetlifyClient, type NetlifyDeploy, type DeployFile } from './netlify';
2
+ import { detectProjectConfig, createDefaultNetlifyConfig, generateNetlifyToml, writeNetlifyConfig, hasNetlifyConfig } from './config-generators';
3
3
  export type {
4
4
  NetlifyClient,
5
5
  NetlifySite,
@@ -66,6 +66,9 @@ export declare class DeployError extends Error {
66
66
  code: string;
67
67
  constructor(message: string, code: string);
68
68
  }
69
+ // ============================================================================
70
+ // Re-exports
71
+ // ============================================================================
69
72
  export {
70
73
  createNetlifyClient,
71
74
  collectDeployFiles,
@@ -81,4 +84,4 @@ export {
81
84
  createDefaultNetlifyConfig,
82
85
  writeNetlifyConfig,
83
86
  hasNetlifyConfig,
84
- } from './config-generators';
87
+ } from './config-generators';
@@ -106,4 +106,4 @@ export declare interface WaitOptions {
106
106
  timeout?: number
107
107
  pollInterval?: number
108
108
  onProgress?: (deploy: NetlifyDeploy) => void
109
- }
109
+ }
@@ -51,4 +51,14 @@ declare interface CrosswindConfig {
51
51
  minify?: boolean
52
52
  preflights?: unknown[]
53
53
  safelist?: string[]
54
- }
54
+ [key: string]: unknown
55
+ }
56
+ declare interface CrosswindBuildResult {
57
+ css: string
58
+ classes: Set<string>
59
+ duration: number
60
+ }
61
+ declare interface CSSGenerator {
62
+ generate(className: string): void
63
+ toCSS(preflight: boolean, minify: boolean): string
64
+ }
@@ -1,7 +1,22 @@
1
+ /**
2
+ * Dev Server Module
3
+ *
4
+ * This module provides a development server for STX templates and Markdown files.
5
+ * It has been split into focused sub-modules:
6
+ *
7
+ * - terminal-colors.ts - ANSI color codes for terminal output
8
+ * - crosswind.ts - Crosswind CSS generation
9
+ * - theme-selector.ts - Theme selector UI components
10
+ * - port-utils.ts - Port availability checking
11
+ * - native-window.ts - Native window handling
12
+ * - keyboard-shortcuts.ts - Keyboard shortcut handling
13
+ * - types.ts - Type definitions
14
+ */
15
+ // Re-export all sub-modules
1
16
  export * from './terminal-colors';
2
17
  export * from './crosswind';
3
18
  export * from './theme-selector';
4
19
  export * from './port-utils';
5
20
  export * from './native-window';
6
21
  export * from './keyboard-shortcuts';
7
- export * from './types';
22
+ export * from './types';
@@ -31,4 +31,4 @@ export declare interface KeyboardCommandHandlers {
31
31
  onClear?: () => void
32
32
  onQuit?: () => void
33
33
  onHelp?: () => void
34
- }
34
+ }
@@ -37,4 +37,4 @@ export declare interface NativeWindowConfig {
37
37
  nativeSidebar?: boolean
38
38
  sidebarWidth?: number
39
39
  sidebarConfig?: SidebarConfig
40
- }
40
+ }
@@ -9,7 +9,7 @@ export declare function isPortAvailable(port: number): Promise<boolean>;
9
9
  * @param maxAttempts - Maximum number of ports to try (default: 20)
10
10
  * @throws Error if no available port is found within maxAttempts
11
11
  */
12
- export declare function findAvailablePort(startPort: number, maxAttempts?: any): Promise<number>;
12
+ export declare function findAvailablePort(startPort: number, maxAttempts?: number): Promise<number>;
13
13
  /**
14
14
  * Find an available port within a specific range
15
15
  */
@@ -24,4 +24,4 @@ export declare const DEFAULT_PORT: 3000;
24
24
  export declare interface PortRange {
25
25
  start: number
26
26
  end: number
27
- }
27
+ }
@@ -27,16 +27,13 @@ export declare function dim(text: string): string;
27
27
  * Provides consistent coloring for CLI messages
28
28
  */
29
29
  export declare const colors: {
30
- // Reset
31
30
  reset: '\x1B[0m';
32
- // Text styles
33
31
  bright: '\x1B[1m';
34
32
  dim: '\x1B[2m';
35
33
  underscore: '\x1B[4m';
36
34
  blink: '\x1B[5m';
37
35
  reverse: '\x1B[7m';
38
36
  hidden: '\x1B[8m';
39
- // Foreground colors
40
37
  black: '\x1B[30m';
41
38
  red: '\x1B[31m';
42
39
  green: '\x1B[32m';
@@ -46,7 +43,6 @@ export declare const colors: {
46
43
  cyan: '\x1B[36m';
47
44
  white: '\x1B[37m';
48
45
  gray: '\x1B[90m';
49
- // Background colors
50
46
  bgBlack: '\x1B[40m';
51
47
  bgRed: '\x1B[41m';
52
48
  bgGreen: '\x1B[42m';
@@ -57,4 +53,4 @@ export declare const colors: {
57
53
  bgWhite: '\x1B[47m';
58
54
  bgGray: '\x1B[100m'
59
55
  };
60
- export type ColorName = keyof typeof colors
56
+ export type ColorName = keyof typeof colors;
@@ -29,4 +29,4 @@ export declare function isDarkTheme(themeName: string): boolean;
29
29
  /**
30
30
  * List of dark theme keywords for theme detection
31
31
  */
32
- export declare const DARK_THEME_KEYWORDS: readonly ['dark', 'night', 'monokai', 'dracula', 'nord', 'material', 'ayu', 'one-dark', 'tokyo', 'gruvbox', 'solarized-dark'];
32
+ export declare const DARK_THEME_KEYWORDS: readonly ['dark', 'night', 'monokai', 'dracula', 'nord', 'material', 'ayu', 'one-dark', 'tokyo', 'gruvbox', 'solarized-dark'];
@@ -44,15 +44,10 @@ export declare const DEFAULT_DEV_OPTIONS: Required<Omit<DevServerOptions, 'stxOp
44
44
  */
45
45
  export declare interface MarkdownOptions {
46
46
  syntaxHighlighting?: {
47
- /** Enable server-side syntax highlighting */
48
47
  serverSide?: boolean
49
- /** Enable syntax highlighting (default: true) */
50
48
  enabled?: boolean
51
- /** Default theme for code blocks */
52
49
  defaultTheme?: SyntaxHighlightTheme
53
- /** Highlight code blocks with unknown languages */
54
50
  highlightUnknownLanguages?: boolean
55
- /** Additional themes to make available */
56
51
  additionalThemes?: SyntaxHighlightTheme[]
57
52
  }
58
53
  }
@@ -81,12 +76,12 @@ export declare interface ServerInstance {
81
76
  /**
82
77
  * File watcher event types
83
78
  */
84
- export type WatchEventType = 'change' | 'rename' | 'delete' | 'add'
79
+ export type WatchEventType = 'change' | 'rename' | 'delete' | 'add';
85
80
  /**
86
81
  * File watcher callback
87
82
  */
88
- export type WatchCallback = (eventType: WatchEventType, filename: string) => void
83
+ export type WatchCallback = (eventType: WatchEventType, filename: string) => void;
89
84
  /**
90
85
  * Route handler function
91
86
  */
92
- export type RouteHandler = (request: Request) => Promise<Response> | Response
87
+ export type RouteHandler = (request: Request) => Promise<Response> | Response;
@@ -1,6 +1,3 @@
1
- import { } from './dev-server/index';
2
- import { } from './hot-reload';
3
- import { } from './route-middleware';
4
1
  import type { SyntaxHighlightTheme } from './types';
5
2
  // Build and serve a specific stx file
6
3
  export declare function serveStxFile(filePath: string, options?: DevServerOptions): Promise<boolean>;
@@ -40,4 +37,4 @@ export declare interface DevServerOptions {
40
37
  cache?: boolean
41
38
  hotReload?: boolean
42
39
  hmrPort?: number
43
- }
40
+ }
@@ -129,6 +129,9 @@ export declare interface DevToolsState {
129
129
  maxEvents: number
130
130
  maxPerformance: number
131
131
  }
132
+ // =============================================================================
133
+ // Exports
134
+ // =============================================================================
132
135
  export {
133
136
  devToolsState,
134
137
  selectComponent,
@@ -139,4 +142,4 @@ export {
139
142
  logComponentTree,
140
143
  logStoreState,
141
144
  timeTravel,
142
- };
145
+ };
@@ -50,7 +50,7 @@ export declare function unregisterDirective(name: string): boolean;
50
50
  * })
51
51
  * ```
52
52
  */
53
- export declare function defineDirective<P extends DirectiveParams = DirectiveParams, T = unknown>(definition: FullDirectiveDefinition<P, T>): CustomDirective;
53
+ export declare function defineDirective<P extends DirectiveParams = DirectiveParams, T = unknown,>(definition: FullDirectiveDefinition<P, T>): CustomDirective;
54
54
  /**
55
55
  * Define a client-only directive.
56
56
  */
@@ -104,8 +104,8 @@ export declare interface ClientDirectiveDefinition<T = unknown> {
104
104
  unmounted?: (el: HTMLElement, binding: DirectiveBinding<T>) => void
105
105
  }
106
106
  /** Combined directive (server + client) */
107
- export declare interface FullDirectiveDefinition<P extends DirectiveParams = DirectiveParams, T = unknown> extends DirectiveDefinition<P> {
107
+ export declare interface FullDirectiveDefinition<P extends DirectiveParams = DirectiveParams, T = unknown,> extends DirectiveDefinition<P> {
108
108
  client?: ClientDirectiveDefinition<T>
109
109
  }
110
110
  /** Directive parameter types */
111
- export type DirectiveParams = Record<string, unknown>
111
+ export type DirectiveParams = Record<string, unknown>;
package/dist/docs.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare function extractComponentDescription(componentPath: string): Prom
11
11
  /**
12
12
  * Generate documentation for a component
13
13
  */
14
- export declare function generateComponentDoc(componentPath: string, isWebComponent?: any, webComponentTag?: string): Promise<ComponentDoc>;
14
+ export declare function generateComponentDoc(componentPath: string, isWebComponent?: boolean, webComponentTag?: string): Promise<ComponentDoc>;
15
15
  /**
16
16
  * Find all component files in a directory
17
17
  */
@@ -53,4 +53,4 @@ export declare function generateDocs(options: {
53
53
  /**
54
54
  * Documentation generation command handler for CLI
55
55
  */
56
- export declare function docsCommand(options: any): Promise<boolean>;
56
+ export declare function docsCommand(options: any): Promise<boolean>;
@@ -11,4 +11,4 @@ import type { StxOptions } from './types';
11
11
  * @param dependencies - Dependency tracking set
12
12
  * @returns Processed template with dynamic components resolved
13
13
  */
14
- export declare function processDynamicComponents(template: string, context: Record<string, any>, filePath: string, options: StxOptions, dependencies?: Set<string>): Promise<string>;
14
+ export declare function processDynamicComponents(template: string, context: Record<string, any>, filePath: string, options: StxOptions, dependencies?: Set<string>): Promise<string>;
@@ -83,7 +83,7 @@ export declare function redirect(url: string, status?: 301 | 302 | 303 | 307 | 3
83
83
  /**
84
84
  * Not found response helper.
85
85
  */
86
- export declare function notFound(message?: any): Response;
86
+ export declare function notFound(message?: string): Response;
87
87
  /** Edge runtime detection result */
88
88
  export declare interface RuntimeInfo {
89
89
  platform: EdgePlatform
@@ -191,10 +191,10 @@ export type EdgePlatform = | 'cloudflare'
191
191
  | 'fastly'
192
192
  | 'node'
193
193
  | 'bun'
194
- | 'unknown'
194
+ | 'unknown';
195
195
  /** Middleware function */
196
196
  export type EdgeMiddleware = (
197
197
  request: Request,
198
198
  context: EdgeContext,
199
199
  next: () => Promise<Response>
200
- ) => Promise<Response>
200
+ ) => Promise<Response>;
package/dist/env.d.ts CHANGED
@@ -6,4 +6,4 @@ export declare function isProduction(): boolean;
6
6
  * Returns true when NOT in production mode, or when debug is enabled.
7
7
  * This covers development, test, and unset environments.
8
8
  */
9
- export declare function isDevelopment(): boolean;
9
+ export declare function isDevelopment(): boolean;
@@ -68,4 +68,4 @@ export declare interface ErrorBoundaryState {
68
68
  hasError: boolean
69
69
  error: Error | null
70
70
  info: ErrorInfo | null
71
- }
71
+ }
@@ -1 +1,14 @@
1
- export * from './errors';
1
+ /**
2
+ * Error Handling Module
3
+ *
4
+ * This module has been refactored into smaller, more focused files.
5
+ * All exports are re-exported from the errors/ directory.
6
+ *
7
+ * @module error-handling
8
+ * @see ./errors/codes.ts - Error codes and localized messages
9
+ * @see ./errors/types.ts - Error classes and configuration
10
+ * @see ./errors/formatter.ts - Error formatting utilities
11
+ * @see ./errors/sanitizer.ts - Parameter sanitization
12
+ * @see ./errors/logger.ts - Error logging and recovery
13
+ */
14
+ export * from './errors';
@@ -40,50 +40,35 @@ export declare function getErrorCodeName(code: number): string | undefined;
40
40
  * - 1600-1699: Expression errors
41
41
  */
42
42
  export declare const ErrorCodes: {
43
- // Syntax errors (1000-1099)
44
43
  UNCLOSED_DIRECTIVE: 1001;
45
44
  UNCLOSED_EXPRESSION: 1002;
46
45
  INVALID_DIRECTIVE_SYNTAX: 1003;
47
46
  MALFORMED_EXPRESSION: 1004;
48
47
  UNEXPECTED_TOKEN: 1005;
49
- // Runtime errors (1100-1199)
50
48
  UNDEFINED_VARIABLE: 1101;
51
49
  TYPE_ERROR: 1102;
52
50
  EVALUATION_ERROR: 1103;
53
51
  INFINITE_LOOP: 1104;
54
52
  CIRCULAR_REFERENCE: 1105;
55
- // Security errors (1200-1299)
56
53
  UNSAFE_EXPRESSION: 1201;
57
54
  PATH_TRAVERSAL: 1202;
58
55
  XSS_ATTEMPT: 1203;
59
56
  CODE_INJECTION: 1204;
60
57
  DOM_API_VIOLATION: 1205;
61
- // File errors (1300-1399)
62
58
  FILE_NOT_FOUND: 1301;
63
59
  FILE_READ_ERROR: 1302;
64
60
  INVALID_FILE_PATH: 1303;
65
61
  PERMISSION_DENIED: 1304;
66
- // Configuration errors (1400-1499)
67
62
  INVALID_CONFIG: 1401;
68
63
  MISSING_REQUIRED_CONFIG: 1402;
69
64
  DEPRECATED_CONFIG: 1403;
70
- // Component errors (1500-1599)
71
65
  COMPONENT_NOT_FOUND: 1501;
72
66
  INVALID_PROPS: 1502;
73
67
  COMPONENT_RENDER_ERROR: 1503;
74
- // Expression errors (1600-1699)
75
68
  FILTER_NOT_FOUND: 1601;
76
69
  INVALID_FILTER_ARGS: 1602;
77
70
  EXPRESSION_TIMEOUT: 1603
78
71
  };
79
- /**
80
- * Error Codes and Localized Messages
81
- *
82
- * Provides numeric error codes for programmatic error handling
83
- * and localized error message templates.
84
- *
85
- * @module errors/codes
86
- */
87
72
  /**
88
73
  * Error message template with placeholder support
89
74
  * Placeholders use {{name}} syntax
@@ -95,5 +80,5 @@ export declare interface ErrorMessageTemplate {
95
80
  /**
96
81
  * Localized error messages by error code
97
82
  */
98
- export type ErrorMessages = Record<number, ErrorMessageTemplate>
99
- export type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes]
83
+ export type ErrorMessages = Record<number, ErrorMessageTemplate>;
84
+ export type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];
@@ -61,4 +61,4 @@ export declare interface StandardizedError {
61
61
  /**
62
62
  * Error output format options
63
63
  */
64
- export type ErrorOutputFormat = 'html' | 'text' | 'json' | 'console'
64
+ export type ErrorOutputFormat = 'html' | 'text' | 'json' | 'console';
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Error Handling Module
3
+ *
4
+ * Provides comprehensive error handling utilities for the stx framework.
5
+ *
6
+ * @module errors
7
+ */
8
+ // Error codes and localization
1
9
  export {
2
10
  clearErrorMessages,
3
11
  type ErrorCode,
@@ -11,6 +19,7 @@ export {
11
19
  registerErrorMessages,
12
20
  setErrorLocale,
13
21
  } from './codes';
22
+ // Error formatting
14
23
  export {
15
24
  consoleError,
16
25
  createEnhancedError,
@@ -22,6 +31,7 @@ export {
22
31
  safeExecuteAsync,
23
32
  type StandardizedError,
24
33
  } from './formatter';
34
+ // Logger and recovery
25
35
  export {
26
36
  devHelpers,
27
37
  type ErrorLogEntry,
@@ -30,6 +40,7 @@ export {
30
40
  type ErrorLoggerOptions,
31
41
  errorRecovery,
32
42
  } from './logger';
43
+ // Sanitization
33
44
  export {
34
45
  sanitizeComponentProps,
35
46
  sanitizeDirectiveParam,
@@ -40,6 +51,7 @@ export {
40
51
  type SanitizeOptions,
41
52
  validators,
42
53
  } from './sanitizer';
54
+ // Error types and classes
43
55
  export {
44
56
  configureErrorHandling,
45
57
  type ErrorConfig,
@@ -53,4 +65,4 @@ export {
53
65
  StxSecurityError,
54
66
  StxSyntaxError,
55
67
  StxValidationError,
56
- } from './types';
68
+ } from './types';
@@ -47,23 +47,10 @@ export declare interface DevHelpers {
47
47
  * Error logging and monitoring with optional file persistence
48
48
  */
49
49
  export declare class ErrorLogger {
50
- private errors: ErrorLogEntry[];
51
- private maxErrors: number;
52
- private enableFileLogging: boolean;
53
- private logFilePath: string;
54
- private logFormat: 'json' | 'text';
55
- private maxFileSize: number;
56
- private maxLogFiles: number;
57
- private minLevel: 'all' | 'error' | 'warning';
58
- private writeQueue: Promise<void>;
59
50
  constructor(options?: ErrorLoggerOptions);
60
51
  configure(options: ErrorLoggerOptions): void;
61
52
  log(error: Error, context?: unknown, level?: 'error' | 'warning' | 'info'): void;
62
- private shouldLog(level: 'error' | 'warning' | 'info'): boolean;
63
- private formatEntry(entry: ErrorLogEntry): string;
64
- private writeToFile(entry: ErrorLogEntry): void;
65
- private rotateIfNeeded(fs: typeof import('node:fs')): Promise<void>;
66
- getRecentErrors(limit?: any): ErrorLogEntry[];
53
+ getRecentErrors(limit?: number): ErrorLogEntry[];
67
54
  getErrorsByType(errorType: string): ErrorLogEntry[];
68
55
  getErrorsByLevel(level: 'error' | 'warning' | 'info'): ErrorLogEntry[];
69
56
  clear(): void;
@@ -71,4 +58,4 @@ export declare class ErrorLogger {
71
58
  getStats(): { total: number, byType: Record<string, number>, byLevel: Record<string, number> };
72
59
  exportToFile(filePath: string, format?: 'json' | 'text'): Promise<void>;
73
60
  flush(): Promise<void>;
74
- }
61
+ }
@@ -40,4 +40,4 @@ export declare interface SanitizedParam {
40
40
  value: string
41
41
  modified: boolean
42
42
  warnings: string[]
43
- }
43
+ }
@@ -76,4 +76,4 @@ export declare class StxFileError extends StxError {
76
76
  export declare class StxValidationError extends StxError {
77
77
  readonly isFatal: boolean;
78
78
  constructor(message: string, filePath?: string, line?: number, column?: number, context?: string, numericCode?: ErrorCode);
79
- }
79
+ }
package/dist/events.d.ts CHANGED
@@ -103,4 +103,4 @@ export declare interface EventModifiers {
103
103
  mouse: string | null
104
104
  debounce: number | null
105
105
  throttle: number | null
106
- }
106
+ }