@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
@@ -1,6 +1,3 @@
1
- import { SourceMapGenerator } from './source-maps';
2
- import { TemplateParser, } from './ast';
3
- import type { ASTNode, AttributeNode, ComponentNode, DirectiveNode, DocumentNode, ElementNode, ExpressionNode, } from './ast';
4
1
  import type { SourceMapV3 } from './source-maps';
5
2
  // Export singleton instance
6
3
  export declare const compiler: TemplateCompiler;
@@ -25,84 +22,22 @@ export declare interface CompileResult {
25
22
  code: string
26
23
  map?: SourceMapV3
27
24
  analysis: {
28
- /** Variables used in expressions */
29
25
  usedVariables: Set<string>
30
- /** Directives used */
31
26
  usedDirectives: Set<string>
32
- /** Components used */
33
27
  usedComponents: Set<string>
34
- /** Whether template has dynamic content */
35
28
  isDynamic: boolean
36
- /** Whether template uses slots */
37
29
  hasSlots: boolean
38
30
  }
39
31
  }
40
- declare interface CodegenContext {
41
- code: string
42
- indentLevel: number
43
- sourceMapGenerator?: SourceMapGenerator
44
- currentLine: number
45
- currentColumn: number
46
- sourceFile: string
47
- mode: CompileMode
48
- optimize: boolean
49
- dev: boolean
50
- usedVariables: Set<string>
51
- usedDirectives: Set<string>
52
- usedComponents: Set<string>
53
- hasSlots: boolean
54
- varCounter: number
55
- }
56
32
  /**
57
33
  * Compilation mode
58
34
  */
59
- export type CompileMode = 'ssr' | 'client' | 'universal'
35
+ export type CompileMode = 'ssr' | 'client' | 'universal';
60
36
  /**
61
37
  * Template pre-compiler
62
38
  */
63
39
  export declare class TemplateCompiler {
64
- private parser: TemplateParser;
65
40
  constructor();
66
41
  compile(template: string, options?: CompileOptions): CompileResult;
67
42
  compileFile(filePath: string, options?: CompileOptions): Promise<CompileResult>;
68
- private createContext(options: {
69
- sourceFile: string
70
- mode: CompileMode
71
- optimize: boolean
72
- dev: boolean
73
- sourceMaps: boolean
74
- }): CodegenContext;
75
- private generateRenderFunction(ast: DocumentNode, ctx: CodegenContext): string;
76
- private analyzeAST(ast: DocumentNode, ctx: CodegenContext): void;
77
- private generateNode(node: ASTNode, ctx: CodegenContext): string;
78
- private generateText(text: string, _ctx: CodegenContext): string;
79
- private generateExpression(node: ExpressionNode, _ctx: CodegenContext): string;
80
- private generateDirective(node: DirectiveNode, ctx: CodegenContext): string;
81
- private generateIf(condition: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
82
- private generateUnless(condition: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
83
- private generateForeach(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
84
- private generateFor(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
85
- private generateWhile(condition: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
86
- private generateIsset(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
87
- private generateEmpty(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
88
- private generateAuth(body: ASTNode[] | null, ctx: CodegenContext): string;
89
- private generateGuest(body: ASTNode[] | null, ctx: CodegenContext): string;
90
- private generateEnv(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
91
- private generateSwitch(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
92
- private generateSlot(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
93
- private generateSection(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
94
- private generatePush(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
95
- private generateOnce(body: ASTNode[] | null, ctx: CodegenContext): string;
96
- private generateScript(body: ASTNode[] | null, _ctx: CodegenContext): string;
97
- private generateStyle(node: { content: string, scoped: boolean }, _ctx: CodegenContext): string;
98
- private generateElement(node: ElementNode, ctx: CodegenContext): string;
99
- private generateAttribute(attr: AttributeNode, ctx: CodegenContext): string;
100
- private parseAttributeValue(value: string, ctx: CodegenContext): string;
101
- private generateComponent(node: ComponentNode, ctx: CodegenContext): string;
102
- private splitConditionalBody(body: ASTNode[]): {
103
- ifBody: ASTNode[]
104
- elseifs: Array<{ condition: string, body: ASTNode[] }>
105
- elseBody: ASTNode[]
106
- };
107
- private wrapModule(functionCode: string, functionName: string, format: 'esm' | 'cjs' | 'iife', _ctx: CodegenContext): string;
108
- }
43
+ }
package/dist/process.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { StxOptions } from './types';
1
+ import type { StxOptions, StrictModeConfig } from './types';
2
2
  /**
3
3
  * Process all template directives with enhanced error handling and performance monitoring
4
4
  */
@@ -10,4 +10,14 @@ export declare function processJsonDirective(template: string, context: Record<s
10
10
  /**
11
11
  * Process @once directive blocks
12
12
  */
13
- export declare function processOnceDirective(template: string): string;
13
+ export declare function processOnceDirective(template: string): string;
14
+ /**
15
+ * Validate client script content for prohibited DOM API patterns.
16
+ * When strict mode is enabled with `failOnViolation`, throws an error.
17
+ * Otherwise, emits warnings.
18
+ *
19
+ * @param content - The script content to validate
20
+ * @param filePath - The file path for error reporting
21
+ * @param strict - Strict mode configuration
22
+ */
23
+ export declare function validateClientScript(content: string, filePath: string, strict?: boolean | StrictModeConfig): void;
@@ -158,42 +158,6 @@ export declare interface AssetInfo {
158
158
  * Production Build orchestrator
159
159
  */
160
160
  export declare class ProductionBuild {
161
- private config: ProductionBuildConfig;
162
- private startTime: number;
163
- private outputs: OutputFile[];
164
- private chunks: ChunkInfo[];
165
- private assets: AssetInfo[];
166
- private warnings: string[];
167
- private errors: string[];
168
- private moduleGraph: Map<string, Set<string>>;
169
- private assetHashes: Map<string, string>;
170
161
  constructor(config: ProductionBuildConfig);
171
162
  build(): Promise<BuildResult>;
172
- private collectEntries(): Map<string, string>;
173
- private buildEntry(name: string, entryPath: string): Promise<void>;
174
- private resolveRelativePath(from: string, to: string): string;
175
- private processTemplate(content: string, filePath: string): Promise<string>;
176
- private processCss(content: string, filePath: string): Promise<string>;
177
- private processScript(content: string, filePath: string): Promise<string>;
178
- private extractCss(): Promise<void>;
179
- private processAssets(): Promise<void>;
180
- private performCodeSplitting(): Promise<void>;
181
- private minifyOutputs(): Promise<void>;
182
- private minifyJs(code: string): string;
183
- private minifyCss(css: string): string;
184
- private minifyHtml(html: string): string;
185
- private generateSourceMaps(): Promise<void>;
186
- private fingerprintAssets(): Promise<void>;
187
- private compressOutputs(): Promise<void>;
188
- private analyzeBundle(): Promise<void>;
189
- private generateAnalysisHtml(analysis: any): string;
190
- private generateAnalysisText(analysis: any): string;
191
- private runPluginHook(hook: string, arg?: any): Promise<void>;
192
- private runPluginTransform(code: string, id: string): Promise<string>;
193
- private generateHash(content: string | Buffer): string;
194
- private getOutputName(name: string, type: OutputFile['type'], hash: string): string;
195
- private formatSize(bytes: number): string;
196
- private ensureDir(dir: string): void;
197
- private walkDir(dir: string, callback: (path: string) => void): void;
198
- private getResult(): BuildResult;
199
- }
163
+ }
package/dist/props.d.ts CHANGED
@@ -140,33 +140,6 @@ export declare interface PropValidationResult {
140
140
  errors: PropValidationError[]
141
141
  warnings: string[]
142
142
  }
143
- /**
144
- * STX Props System
145
- *
146
- * Provides type-safe component props with runtime validation.
147
- *
148
- * @module props
149
- *
150
- * @example
151
- * ```html
152
- * <script>
153
- * import { defineProps } from 'stx'
154
- *
155
- * const props = defineProps<{
156
- * title: string
157
- * count?: number
158
- * items: string[]
159
- * }>({
160
- * title: { required: true },
161
- * count: { default: 0 },
162
- * items: { default: () => [] }
163
- * })
164
- * </script>
165
- *
166
- * <h1>{{ props.title }}</h1>
167
- * <p>Count: {{ props.count }}</p>
168
- * ```
169
- */
170
143
  /** Supported prop types */
171
144
  export type PropType<T> = | StringConstructor
172
145
  | NumberConstructor
@@ -177,7 +150,7 @@ export type PropType<T> = | StringConstructor
177
150
  | DateConstructor
178
151
  | SymbolConstructor
179
152
  | { new (...args: unknown[]): T }
180
- | PropType<T>[]
153
+ | PropType<T>[];
181
154
  /** Props definition object */
182
155
  export type PropsDefinition<T> = {
183
156
  [K in keyof T]?: PropOptions<T[K]> | PropType<T[K]>
@@ -191,9 +164,9 @@ export type ExtractPropTypes<T extends PropsDefinition<unknown>> = {
191
164
  : unknown
192
165
  }
193
166
  /** Event handler type */
194
- export type EventHandler<T = unknown> = (payload: T) => void
167
+ export type EventHandler<T = unknown> = (payload: T) => void;
195
168
  /** Emit function type */
196
169
  export type EmitFn<E extends Record<string, unknown>> = <K extends keyof E>(
197
170
  event: K,
198
171
  payload: E[K],
199
- ) => void
172
+ ) => void;
@@ -39,4 +39,4 @@ export declare interface AuditResult {
39
39
  failed: number
40
40
  warnings: number
41
41
  checks: AuditCheck[]
42
- }
42
+ }
@@ -26,4 +26,4 @@ export declare const pwaPushDirective: CustomDirective;
26
26
  /**
27
27
  * All PWA directives
28
28
  */
29
- export declare const pwaDirectives: CustomDirective[];
29
+ export declare const pwaDirectives: CustomDirective[];
@@ -18,16 +18,19 @@ export declare function getExpectedIconPaths(config: PwaIconConfig): string[];
18
18
  export declare function isSharpAvailable(): Promise<boolean>;
19
19
  /**
20
20
  * Default icon sizes for PWA
21
+ * @defaultValue `[72, 96, 128, 144, 152, 192, 384, 512]`
21
22
  */
22
- export declare const DEFAULT_ICON_SIZES: readonly [72, 96, 128, 144, 152, 192, 384, 512];
23
+ export declare const DEFAULT_ICON_SIZES: number[];
23
24
  /**
24
25
  * Apple touch icon sizes
26
+ * @defaultValue `[120, 152, 167, 180]`
25
27
  */
26
- export declare const APPLE_TOUCH_ICON_SIZES: readonly [120, 152, 167, 180];
28
+ export declare const APPLE_TOUCH_ICON_SIZES: number[];
27
29
  /**
28
30
  * Favicon sizes
31
+ * @defaultValue `[16, 32]`
29
32
  */
30
- export declare const FAVICON_SIZES: readonly [16, 32];
33
+ export declare const FAVICON_SIZES: number[];
31
34
  /**
32
35
  * Icon generation result
33
36
  */
@@ -36,4 +39,4 @@ export declare interface IconGenerationResult {
36
39
  generatedFiles: string[]
37
40
  errors: string[]
38
41
  warnings: string[]
39
- }
42
+ }
@@ -1,9 +1,33 @@
1
+ /**
2
+ * STX PWA Module
3
+ *
4
+ * Progressive Web App support including service worker generation,
5
+ * manifest generation, icon processing, and Workbox integration.
6
+ *
7
+ * @module pwa
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import {
12
+ * generateServiceWorkerAuto,
13
+ * generateManifest,
14
+ * generateWorkboxServiceWorker,
15
+ * isWorkboxEnabled,
16
+ * } from 'stx/pwa'
17
+ * ```
18
+ */
19
+ // ============================================================================
20
+ // Service Worker
21
+ // ============================================================================
1
22
  export {
2
23
  generateServiceWorker,
3
24
  generateServiceWorkerAuto,
4
25
  getServiceWorkerFileName,
5
26
  isWorkboxEnabled,
6
27
  } from './service-worker';
28
+ // ============================================================================
29
+ // Workbox Integration
30
+ // ============================================================================
7
31
  export {
8
32
  generateWorkboxConfig,
9
33
  generateWorkboxServiceWorker,
@@ -29,31 +53,52 @@ export {
29
53
  type WorkboxRoute,
30
54
  type RuntimeCachingConfig,
31
55
  } from './workbox-strategies';
56
+ // ============================================================================
57
+ // Manifest
58
+ // ============================================================================
32
59
  export {
33
60
  generateManifest,
34
61
  } from './manifest';
62
+ // ============================================================================
63
+ // Icons
64
+ // ============================================================================
35
65
  export {
36
66
  generatePwaIcons,
37
67
  type IconGenerationResult,
38
68
  } from './icons';
69
+ // ============================================================================
70
+ // Precache
71
+ // ============================================================================
39
72
  export {
40
73
  generatePrecacheManifest,
41
74
  generatePrecacheManifestJs,
42
75
  formatSize,
43
76
  type PrecacheEntry,
44
77
  } from './precache';
78
+ // ============================================================================
79
+ // Offline
80
+ // ============================================================================
45
81
  export {
46
82
  generateOfflinePage,
47
83
  } from './offline';
84
+ // ============================================================================
85
+ // Injection
86
+ // ============================================================================
48
87
  export {
49
88
  injectPwaTags,
50
89
  generateSwRegistrationScript,
51
90
  } from './inject';
91
+ // ============================================================================
92
+ // Audit
93
+ // ============================================================================
52
94
  export {
53
95
  runPwaAudit,
54
96
  type AuditResult,
55
97
  type AuditCheck,
56
98
  } from './audit';
99
+ // ============================================================================
100
+ // Directives
101
+ // ============================================================================
57
102
  export {
58
103
  pwaDirectives,
59
- } from './directives';
104
+ } from './directives';
@@ -19,4 +19,4 @@ export declare function generateManifestLink(): string;
19
19
  /**
20
20
  * Generate theme color meta tag
21
21
  */
22
- export declare function generateThemeColorMeta(color: string): string;
22
+ export declare function generateThemeColorMeta(color: string): string;
@@ -101,4 +101,4 @@ export declare interface WebAppManifest {
101
101
  edge_side_panel?: {
102
102
  preferred_width?: number
103
103
  }
104
- }
104
+ }
@@ -5,4 +5,4 @@ import type { StxOptions } from '../types';
5
5
  * If a custom offline page is specified in config, it will be processed.
6
6
  * Otherwise, a default styled offline page is generated.
7
7
  */
8
- export declare function generateOfflinePage(options: StxOptions): Promise<string>;
8
+ export declare function generateOfflinePage(options: StxOptions): Promise<string>;
@@ -26,4 +26,4 @@ export declare interface PrecacheManifest {
26
26
  entries: PrecacheEntry[]
27
27
  totalSize: number
28
28
  fileCount: number
29
- }
29
+ }
@@ -18,4 +18,4 @@ export declare function isWorkboxEnabled(options: StxOptions): boolean;
18
18
  * @param outputDir - optional output directory for precache manifest
19
19
  * @returns Generated service worker JavaScript code
20
20
  */
21
- export declare function generateServiceWorkerAuto(options: StxOptions, outputDir?: string): string;
21
+ export declare function generateServiceWorkerAuto(options: StxOptions, outputDir?: string): string;
@@ -97,4 +97,4 @@ export type StxCacheStrategy = | 'cache-first'
97
97
  | 'network-first'
98
98
  | 'stale-while-revalidate'
99
99
  | 'network-only'
100
- | 'cache-only'
100
+ | 'cache-only';
@@ -1,4 +1,3 @@
1
- import { } from './workbox-strategies';
2
1
  import type { StxOptions } from '../types';
3
2
  /**
4
3
  * Generate Workbox configuration from stx options
@@ -8,14 +7,6 @@ export declare function generateWorkboxConfig(options: StxOptions, outputDir?: s
8
7
  * Generate Workbox service worker JavaScript code
9
8
  */
10
9
  export declare function generateWorkboxServiceWorker(options: StxOptions, outputDir?: string): string;
11
- /**
12
- * Check if Workbox mode is enabled in config
13
- */
14
- export declare function isWorkboxEnabled(options: StxOptions): boolean;
15
- /**
16
- * Get the appropriate service worker generator based on config
17
- */
18
- export declare function getServiceWorkerGenerator(options: StxOptions): (options: StxOptions, outputDir?: string) => string;
19
10
  // ============================================================================
20
11
  // Types
21
12
  // ============================================================================
@@ -49,4 +40,4 @@ export declare interface RuntimeCacheRule {
49
40
  }
50
41
  networkTimeoutSeconds?: number
51
42
  }
52
- }
43
+ }
package/dist/pwa.d.ts CHANGED
@@ -48,4 +48,4 @@ export * from './pwa/inject';
48
48
  export * from './pwa/manifest';
49
49
  export * from './pwa/offline';
50
50
  export * from './pwa/precache';
51
- export * from './pwa/service-worker';
51
+ export * from './pwa/service-worker';