@stacksjs/stx 0.2.0 → 0.2.3

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 (275) hide show
  1. package/dist/a11y.d.ts +109 -5
  2. package/dist/analytics.d.ts +40 -0
  3. package/dist/animation.d.ts +90 -0
  4. package/dist/app.d.ts +51 -0
  5. package/dist/ast.d.ts +286 -0
  6. package/dist/async-components.d.ts +101 -0
  7. package/dist/auth.d.ts +1 -3
  8. package/dist/browser-composables.d.ts +314 -0
  9. package/dist/build-optimizer.d.ts +126 -0
  10. package/dist/build-views.d.ts +37 -0
  11. package/dist/bundle-analyzer/collector.d.ts +66 -0
  12. package/dist/bundle-analyzer/index.d.ts +60 -0
  13. package/dist/bundle-analyzer/report.d.ts +39 -0
  14. package/dist/bundle-analyzer/treemap.d.ts +19 -0
  15. package/dist/bundle-analyzer.js +499 -0
  16. package/dist/caching.d.ts +7 -0
  17. package/dist/cli.js +10880 -1199
  18. package/dist/client/directive.d.ts +10 -0
  19. package/dist/client/index.d.ts +7 -0
  20. package/dist/client/router.d.ts +36 -0
  21. package/dist/client/stx-router.browser.d.ts +0 -0
  22. package/dist/client-script.d.ts +22 -0
  23. package/dist/component-hmr.d.ts +120 -0
  24. package/dist/components.d.ts +23 -1
  25. package/dist/composables/index.d.ts +277 -0
  26. package/dist/composables/use-battery.d.ts +46 -0
  27. package/dist/composables/use-broadcast-channel.d.ts +58 -0
  28. package/dist/composables/use-clipboard.d.ts +34 -0
  29. package/dist/composables/use-cookie.d.ts +70 -0
  30. package/dist/composables/use-device-orientation.d.ts +109 -0
  31. package/dist/composables/use-event-source.d.ts +77 -0
  32. package/dist/composables/use-eye-dropper.d.ts +107 -0
  33. package/dist/composables/use-fetch.d.ts +84 -0
  34. package/dist/composables/use-fullscreen.d.ts +47 -0
  35. package/dist/composables/use-geolocation.d.ts +62 -0
  36. package/dist/composables/use-idle.d.ts +84 -0
  37. package/dist/composables/use-intersection-observer.d.ts +81 -0
  38. package/dist/composables/use-keyboard.d.ts +100 -0
  39. package/dist/composables/use-media-query.d.ts +56 -0
  40. package/dist/composables/use-mouse.d.ts +64 -0
  41. package/dist/composables/use-mutation-observer.d.ts +101 -0
  42. package/dist/composables/use-network.d.ts +40 -0
  43. package/dist/composables/use-notification.d.ts +89 -0
  44. package/dist/composables/use-permissions.d.ts +109 -0
  45. package/dist/composables/use-resize-observer.d.ts +60 -0
  46. package/dist/composables/use-share.d.ts +70 -0
  47. package/dist/composables/use-speech.d.ts +117 -0
  48. package/dist/composables/use-storage.d.ts +64 -0
  49. package/dist/composables/use-text-selection.d.ts +97 -0
  50. package/dist/composables/use-wake-lock.d.ts +85 -0
  51. package/dist/composables/use-websocket.d.ts +69 -0
  52. package/dist/composables/use-window.d.ts +84 -0
  53. package/dist/composables.d.ts +268 -0
  54. package/dist/composition-api.d.ts +190 -0
  55. package/dist/computed.d.ts +137 -0
  56. package/dist/conditionals.d.ts +14 -2
  57. package/dist/config.d.ts +35 -2
  58. package/dist/craft-bridge.d.ts +319 -0
  59. package/dist/craft-compiler.d.ts +229 -0
  60. package/dist/craft-components.d.ts +411 -0
  61. package/dist/craft-entry.d.ts +5 -0
  62. package/dist/craft-ssr.d.ts +134 -0
  63. package/dist/craft.js +1553 -0
  64. package/dist/csp.d.ts +229 -0
  65. package/dist/database.d.ts +407 -0
  66. package/dist/database.js +5 -0
  67. package/dist/defer.d.ts +4 -0
  68. package/dist/deploy/config-generators.d.ts +75 -0
  69. package/dist/deploy/index.d.ts +84 -0
  70. package/dist/deploy/netlify.d.ts +109 -0
  71. package/dist/dev-server/crosswind.d.ts +54 -0
  72. package/dist/dev-server/index.d.ts +7 -0
  73. package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
  74. package/dist/dev-server/native-window.d.ts +40 -0
  75. package/dist/dev-server/port-utils.d.ts +27 -0
  76. package/dist/dev-server/terminal-colors.d.ts +60 -0
  77. package/dist/dev-server/theme-selector.d.ts +32 -0
  78. package/dist/dev-server/types.d.ts +92 -0
  79. package/dist/dev-server.d.ts +21 -0
  80. package/dist/devtools.d.ts +142 -0
  81. package/dist/directive-api.d.ts +111 -0
  82. package/dist/dynamic-components.d.ts +14 -0
  83. package/dist/edge-runtime.d.ts +200 -0
  84. package/dist/env.d.ts +9 -0
  85. package/dist/error-boundaries.d.ts +71 -0
  86. package/dist/error-handling.d.ts +1 -101
  87. package/dist/errors/codes.d.ts +99 -0
  88. package/dist/errors/formatter.d.ts +64 -0
  89. package/dist/errors/index.d.ts +56 -0
  90. package/dist/errors/logger.d.ts +74 -0
  91. package/dist/errors/sanitizer.d.ts +43 -0
  92. package/dist/errors/types.d.ts +79 -0
  93. package/dist/events.d.ts +106 -0
  94. package/dist/expressions.d.ts +86 -11
  95. package/dist/forms-validation.d.ts +173 -0
  96. package/dist/forms.d.ts +157 -8
  97. package/dist/head.d.ts +225 -0
  98. package/dist/heatmap.d.ts +125 -0
  99. package/dist/hot-reload.d.ts +87 -0
  100. package/dist/hydration-runtime.d.ts +47 -0
  101. package/dist/hydration.d.ts +161 -0
  102. package/dist/i18n.d.ts +239 -3
  103. package/dist/image-optimization/build-plugin.d.ts +53 -0
  104. package/dist/image-optimization/component.d.ts +46 -0
  105. package/dist/image-optimization/directive.d.ts +30 -0
  106. package/dist/image-optimization/index.d.ts +86 -0
  107. package/dist/image-optimization/processor.d.ts +112 -0
  108. package/dist/includes.d.ts +94 -9
  109. package/dist/index.d.ts +63 -3
  110. package/dist/index.js +11603 -1318
  111. package/dist/init.d.ts +32 -2
  112. package/dist/interactive.d.ts +14 -0
  113. package/dist/internal-markdown.d.ts +22 -0
  114. package/dist/jsx-runtime.d.ts +110 -0
  115. package/dist/keep-alive.d.ts +87 -0
  116. package/dist/lazy-loader.d.ts +122 -0
  117. package/dist/loading-indicator.d.ts +40 -0
  118. package/dist/loops.d.ts +22 -1
  119. package/dist/media/client/blur-up.d.ts +65 -0
  120. package/dist/media/client/index.d.ts +77 -0
  121. package/dist/media/client/lazy-load.d.ts +73 -0
  122. package/dist/media/client/upload-handler.d.ts +79 -0
  123. package/dist/media/image/component.d.ts +46 -0
  124. package/dist/media/image/directive.d.ts +9 -0
  125. package/dist/media/image/editing.d.ts +212 -0
  126. package/dist/media/image/index.d.ts +118 -0
  127. package/dist/media/image/placeholder.d.ts +78 -0
  128. package/dist/media/image/processor/cache.d.ts +32 -0
  129. package/dist/media/image/processor/index.d.ts +12 -0
  130. package/dist/media/image/processor/optimizer.d.ts +13 -0
  131. package/dist/media/image/processor/responsive.d.ts +17 -0
  132. package/dist/media/image/srcset.d.ts +158 -0
  133. package/dist/media/index.d.ts +295 -0
  134. package/dist/media/manager/embed.d.ts +25 -0
  135. package/dist/media/protected/component.d.ts +34 -0
  136. package/dist/media/protected/index.d.ts +34 -0
  137. package/dist/media/protected/signature.d.ts +72 -0
  138. package/dist/media/shared/cache.d.ts +54 -0
  139. package/dist/media/shared/hash.d.ts +24 -0
  140. package/dist/media/shared/index.d.ts +2 -0
  141. package/dist/media/types.d.ts +1051 -0
  142. package/dist/media/upload/component.d.ts +23 -0
  143. package/dist/media/upload/index.d.ts +1 -0
  144. package/dist/media/video/directive.d.ts +9 -0
  145. package/dist/media/video/index.d.ts +47 -0
  146. package/dist/media/video/processor/cache.d.ts +33 -0
  147. package/dist/media/video/processor/index.d.ts +21 -0
  148. package/dist/media/video/processor/streaming.d.ts +19 -0
  149. package/dist/media/video/processor/thumbnail.d.ts +28 -0
  150. package/dist/media/video/processor/transcoder.d.ts +9 -0
  151. package/dist/middleware.d.ts +42 -3
  152. package/dist/native-build.d.ts +74 -0
  153. package/dist/parser/directive-parser.d.ts +79 -0
  154. package/dist/parser/expression-parser.d.ts +59 -0
  155. package/dist/parser/index.d.ts +35 -0
  156. package/dist/parser/tokenizer.d.ts +81 -0
  157. package/dist/partial-hydration.d.ts +88 -0
  158. package/dist/performance-utils.d.ts +146 -3
  159. package/dist/plugin-system.d.ts +128 -0
  160. package/dist/precompiler.d.ts +108 -0
  161. package/dist/production-build.d.ts +199 -0
  162. package/dist/props.d.ts +199 -0
  163. package/dist/pwa/audit.d.ts +42 -0
  164. package/dist/pwa/directives.d.ts +29 -0
  165. package/dist/pwa/icons.d.ts +39 -0
  166. package/dist/pwa/index.d.ts +59 -0
  167. package/dist/pwa/inject.d.ts +22 -0
  168. package/dist/pwa/manifest.d.ts +104 -0
  169. package/dist/pwa/offline.d.ts +8 -0
  170. package/dist/pwa/precache.d.ts +29 -0
  171. package/dist/pwa/service-worker.d.ts +21 -0
  172. package/dist/pwa/workbox-strategies.d.ts +100 -0
  173. package/dist/pwa/workbox.d.ts +52 -0
  174. package/dist/pwa.d.ts +51 -0
  175. package/dist/pwa.js +8124 -0
  176. package/dist/reactive-bindings.d.ts +24 -0
  177. package/dist/reactive.d.ts +100 -0
  178. package/dist/reactivity.d.ts +253 -0
  179. package/dist/route-middleware.d.ts +232 -0
  180. package/dist/router.d.ts +31 -0
  181. package/dist/routes.d.ts +0 -7
  182. package/dist/runtime.d.ts +140 -0
  183. package/dist/safe-evaluator.d.ts +117 -3
  184. package/dist/scaffolding.d.ts +113 -0
  185. package/dist/seo.d.ts +120 -7
  186. package/dist/server-components.d.ts +134 -0
  187. package/dist/signals.d.ts +501 -0
  188. package/dist/slots.d.ts +63 -0
  189. package/dist/source-maps.d.ts +117 -0
  190. package/dist/ssg.d.ts +157 -0
  191. package/dist/ssg.js +6831 -0
  192. package/dist/ssr.d.ts +107 -0
  193. package/dist/state-management.d.ts +324 -0
  194. package/dist/stores-client.d.ts +70 -0
  195. package/dist/story/addons.d.ts +123 -0
  196. package/dist/story/analytics.d.ts +92 -0
  197. package/dist/story/auto-stories.d.ts +38 -0
  198. package/dist/story/bookmarks.d.ts +53 -0
  199. package/dist/story/bun-test.d.ts +44 -0
  200. package/dist/story/cli.d.ts +34 -0
  201. package/dist/story/collect/analyzer.d.ts +33 -0
  202. package/dist/story/collect/index.d.ts +27 -0
  203. package/dist/story/collect/parser.d.ts +17 -0
  204. package/dist/story/collect/scanner.d.ts +13 -0
  205. package/dist/story/collect/tree.d.ts +17 -0
  206. package/dist/story/commands/build.d.ts +14 -0
  207. package/dist/story/commands/dev.d.ts +16 -0
  208. package/dist/story/commands/index.d.ts +6 -0
  209. package/dist/story/commands/preview.d.ts +15 -0
  210. package/dist/story/compiled-output.d.ts +26 -0
  211. package/dist/story/composition.d.ts +47 -0
  212. package/dist/story/config-watcher.d.ts +26 -0
  213. package/dist/story/config.d.ts +26 -0
  214. package/dist/story/context.d.ts +21 -0
  215. package/dist/story/controls/index.d.ts +54 -0
  216. package/dist/story/crosswind.d.ts +29 -0
  217. package/dist/story/desktop-preview.d.ts +34 -0
  218. package/dist/story/docs-generator.d.ts +30 -0
  219. package/dist/story/errors.d.ts +47 -0
  220. package/dist/story/figma-export.d.ts +169 -0
  221. package/dist/story/generator.d.ts +21 -0
  222. package/dist/story/hmr.d.ts +64 -0
  223. package/dist/story/hot-swap.d.ts +35 -0
  224. package/dist/story/index.d.ts +51 -0
  225. package/dist/story/interactions.d.ts +52 -0
  226. package/dist/story/keyboard-shortcuts.d.ts +34 -0
  227. package/dist/story/output.d.ts +85 -0
  228. package/dist/story/performance.d.ts +76 -0
  229. package/dist/story/presets.d.ts +62 -0
  230. package/dist/story/props-validation.d.ts +45 -0
  231. package/dist/story/renderer.d.ts +53 -0
  232. package/dist/story/search-index.d.ts +47 -0
  233. package/dist/story/search.d.ts +45 -0
  234. package/dist/story/server.d.ts +21 -0
  235. package/dist/story/setup.d.ts +47 -0
  236. package/dist/story/snapshots.d.ts +65 -0
  237. package/dist/story/testing.d.ts +58 -0
  238. package/dist/story/theme.d.ts +68 -0
  239. package/dist/story/types.d.ts +249 -0
  240. package/dist/story/ui/code-panel.d.ts +42 -0
  241. package/dist/story/ui/controls-panel.d.ts +25 -0
  242. package/dist/story/ui/index.d.ts +4 -0
  243. package/dist/story/ui/navigation.d.ts +55 -0
  244. package/dist/story/ui/preview.d.ts +46 -0
  245. package/dist/story/visual-testing.d.ts +45 -0
  246. package/dist/streaming.d.ts +82 -2
  247. package/dist/suspense.d.ts +83 -0
  248. package/dist/teleport.d.ts +9 -0
  249. package/dist/testing.d.ts +289 -0
  250. package/dist/transitions.d.ts +87 -0
  251. package/dist/type-checker.d.ts +109 -0
  252. package/dist/types/component-types.d.ts +129 -0
  253. package/dist/types/config-types.d.ts +336 -0
  254. package/dist/types/context-types.d.ts +99 -0
  255. package/dist/types/csp-types.d.ts +79 -0
  256. package/dist/types/directive-types.d.ts +259 -0
  257. package/dist/types/index.d.ts +98 -0
  258. package/dist/types/pwa-types.d.ts +218 -0
  259. package/dist/types.d.ts +1 -315
  260. package/dist/typescript-templates.d.ts +178 -0
  261. package/dist/utils.d.ts +52 -6
  262. package/dist/validator.d.ts +77 -0
  263. package/dist/variable-extractor.d.ts +39 -0
  264. package/dist/view-composers.d.ts +154 -9
  265. package/dist/virtual-scrolling.d.ts +103 -0
  266. package/dist/visual-editor.d.ts +209 -0
  267. package/dist/visual-testing.d.ts +109 -0
  268. package/dist/visual-testing.js +126 -0
  269. package/dist/vue-template.d.ts +16 -0
  270. package/dist/web-components/css-scoping.d.ts +54 -0
  271. package/dist/web-components/index.d.ts +20 -0
  272. package/dist/web-components/reactive-generator.d.ts +72 -0
  273. package/dist/web-components.d.ts +222 -2
  274. package/dist/x-element.d.ts +35 -0
  275. package/package.json +41 -11
@@ -0,0 +1,75 @@
1
+ import path from 'node:path';
2
+ /**
3
+ * Generate netlify.toml content from config
4
+ */
5
+ export declare function generateNetlifyToml(config: NetlifyConfig): string;
6
+ /**
7
+ * Detect project configuration from filesystem
8
+ */
9
+ export declare function detectProjectConfig(directory: string): Promise<ProjectConfig>;
10
+ /**
11
+ * Generate default Netlify config for an stx project
12
+ */
13
+ export declare function createDefaultNetlifyConfig(projectConfig?: ProjectConfig): NetlifyConfig;
14
+ /**
15
+ * Write netlify.toml to a directory
16
+ */
17
+ export declare function writeNetlifyConfig(directory: string, config?: NetlifyConfig): Promise<string>;
18
+ /**
19
+ * Check if netlify.toml exists
20
+ */
21
+ export declare function hasNetlifyConfig(directory: string): boolean;
22
+ /**
23
+ * Read existing netlify.toml (basic parsing)
24
+ */
25
+ export declare function readNetlifyConfig(directory: string): Promise<string | null>;
26
+ // ============================================================================
27
+ // Types
28
+ // ============================================================================
29
+ export declare interface NetlifyConfig {
30
+ build: {
31
+ command: string
32
+ publish: string
33
+ functions?: string
34
+ edge_functions?: string
35
+ environment?: Record<string, string>
36
+ }
37
+ functions?: {
38
+ directory?: string
39
+ node_bundler?: 'esbuild' | 'nft'
40
+ external_node_modules?: string[]
41
+ }
42
+ edge_functions?: Array<{
43
+ function: string
44
+ path: string
45
+ }>
46
+ redirects?: Array<{
47
+ from: string
48
+ to: string
49
+ status?: number
50
+ force?: boolean
51
+ conditions?: Record<string, string>
52
+ }>
53
+ headers?: Array<{
54
+ for: string
55
+ values: Record<string, string>
56
+ }>
57
+ plugins?: Array<{
58
+ package: string
59
+ inputs?: Record<string, unknown>
60
+ }>
61
+ context?: Record<string, {
62
+ command?: string
63
+ publish?: string
64
+ environment?: Record<string, string>
65
+ }>
66
+ }
67
+ export declare interface ProjectConfig {
68
+ framework?: 'stx' | 'static' | 'spa'
69
+ buildCommand?: string
70
+ outputDir?: string
71
+ functionsDir?: string
72
+ edgeFunctionsDir?: string
73
+ nodeVersion?: string
74
+ isSPA?: boolean
75
+ }
@@ -0,0 +1,84 @@
1
+ import { createNetlifyClient, collectDeployFiles, createFileManifest, filterRequiredFiles, formatSize, getTotalSize, } from './netlify';
2
+ import { detectProjectConfig, createDefaultNetlifyConfig, generateNetlifyToml, writeNetlifyConfig, hasNetlifyConfig, } from './config-generators';
3
+ export type {
4
+ NetlifyClient,
5
+ NetlifySite,
6
+ NetlifyDeploy,
7
+ DeployFile,
8
+ } from './netlify';
9
+ export type {
10
+ NetlifyConfig,
11
+ ProjectConfig,
12
+ } from './config-generators';
13
+ /**
14
+ * Deploy to Netlify
15
+ */
16
+ export declare function deploy(config?: DeployConfig): Promise<DeployResult>;
17
+ /**
18
+ * Initialize Netlify configuration for a project
19
+ */
20
+ export declare function initNetlify(config?: InitConfig): Promise<{
21
+ configPath: string
22
+ siteId?: string
23
+ }>;
24
+ // ============================================================================
25
+ // Types
26
+ // ============================================================================
27
+ export declare interface DeployConfig {
28
+ directory?: string
29
+ siteId?: string
30
+ token?: string
31
+ production?: boolean
32
+ message?: string
33
+ build?: boolean
34
+ open?: boolean
35
+ dryRun?: boolean
36
+ functions?: string
37
+ cwd?: string
38
+ onProgress?: (status: DeployProgress) => void
39
+ }
40
+ export declare interface DeployProgress {
41
+ stage: 'build' | 'collect' | 'upload' | 'process' | 'done' | 'error'
42
+ message: string
43
+ percent?: number
44
+ details?: unknown
45
+ }
46
+ export declare interface DeployResult {
47
+ success: boolean
48
+ url: string
49
+ siteUrl?: string
50
+ deployId: string
51
+ logs: string[]
52
+ duration: number
53
+ filesUploaded: number
54
+ totalSize: number
55
+ }
56
+ export declare interface InitConfig {
57
+ directory?: string
58
+ siteId?: string
59
+ createSite?: boolean
60
+ siteName?: string
61
+ }
62
+ // ============================================================================
63
+ // Error Handling
64
+ // ============================================================================
65
+ export declare class DeployError extends Error {
66
+ code: string;
67
+ constructor(message: string, code: string);
68
+ }
69
+ export {
70
+ createNetlifyClient,
71
+ collectDeployFiles,
72
+ createFileManifest,
73
+ filterRequiredFiles,
74
+ formatSize,
75
+ getTotalSize,
76
+ calculateSha1,
77
+ } from './netlify';
78
+ export {
79
+ generateNetlifyToml,
80
+ detectProjectConfig,
81
+ createDefaultNetlifyConfig,
82
+ writeNetlifyConfig,
83
+ hasNetlifyConfig,
84
+ } from './config-generators';
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Create a Netlify API client
3
+ */
4
+ export declare function createNetlifyClient(config: NetlifyClientConfig): NetlifyClient;
5
+ /**
6
+ * Calculate SHA1 hash of file content
7
+ */
8
+ export declare function calculateSha1(content: ArrayBuffer | Uint8Array): Promise<string>;
9
+ /**
10
+ * Collect files from a directory for deployment
11
+ */
12
+ export declare function collectDeployFiles(directory: string, options?: { ignore?: string[] }): Promise<DeployFile[]>;
13
+ /**
14
+ * Create file manifest (path -> sha1 hash mapping)
15
+ */
16
+ export declare function createFileManifest(files: DeployFile[]): Record<string, string>;
17
+ /**
18
+ * Filter files that need uploading (not already on Netlify)
19
+ */
20
+ export declare function filterRequiredFiles(files: DeployFile[], required: string[]): DeployFile[];
21
+ /**
22
+ * Format file size for display
23
+ */
24
+ export declare function formatSize(bytes: number): string;
25
+ /**
26
+ * Get total size of files
27
+ */
28
+ export declare function getTotalSize(files: DeployFile[]): number;
29
+ // ============================================================================
30
+ // Types
31
+ // ============================================================================
32
+ export declare interface NetlifySite {
33
+ id: string
34
+ name: string
35
+ url: string
36
+ ssl_url: string
37
+ admin_url: string
38
+ created_at: string
39
+ updated_at: string
40
+ custom_domain?: string
41
+ default_domain: string
42
+ deploy_url: string
43
+ published_deploy?: NetlifyDeploy
44
+ }
45
+ export declare interface NetlifyDeploy {
46
+ id: string
47
+ site_id: string
48
+ state: 'new' | 'pending_review' | 'uploading' | 'uploaded' | 'preparing' | 'prepared' | 'processing' | 'ready' | 'error' | 'retrying'
49
+ name: string
50
+ url: string
51
+ ssl_url: string
52
+ admin_url: string
53
+ deploy_url: string
54
+ deploy_ssl_url: string
55
+ created_at: string
56
+ updated_at: string
57
+ published_at?: string
58
+ title?: string
59
+ context: string
60
+ branch?: string
61
+ commit_ref?: string
62
+ commit_url?: string
63
+ review_url?: string
64
+ error_message?: string
65
+ required: string[]
66
+ required_functions?: string[]
67
+ }
68
+ export declare interface CreateDeployOptions {
69
+ title?: string
70
+ branch?: string
71
+ draft?: boolean
72
+ files: Record<string, string>
73
+ functions?: Record<string, string>
74
+ async?: boolean
75
+ }
76
+ export declare interface DeployFile {
77
+ path: string
78
+ content: ArrayBuffer | Uint8Array
79
+ sha1: string
80
+ }
81
+ export declare interface NetlifyClientConfig {
82
+ token: string
83
+ baseUrl?: string
84
+ }
85
+ export declare interface NetlifyError extends Error {
86
+ status: number
87
+ code?: string
88
+ details?: unknown
89
+ }
90
+ // ============================================================================
91
+ // Netlify Client
92
+ // ============================================================================
93
+ export declare interface NetlifyClient {
94
+ getSite(siteId: string): Promise<NetlifySite>
95
+ listSites(): Promise<NetlifySite[]>
96
+ createSite(name?: string): Promise<NetlifySite>
97
+ createDeploy(siteId: string, options: CreateDeployOptions): Promise<NetlifyDeploy>
98
+ uploadFile(deployId: string, path: string, content: ArrayBuffer | Uint8Array): Promise<void>
99
+ uploadFiles(deployId: string, files: DeployFile[]): Promise<void>
100
+ getDeploy(deployId: string): Promise<NetlifyDeploy>
101
+ waitForDeploy(deployId: string, options?: WaitOptions): Promise<NetlifyDeploy>
102
+ lockDeploy(deployId: string): Promise<NetlifyDeploy>
103
+ unlockDeploy(deployId: string): Promise<NetlifyDeploy>
104
+ }
105
+ export declare interface WaitOptions {
106
+ timeout?: number
107
+ pollInterval?: number
108
+ onProgress?: (deploy: NetlifyDeploy) => void
109
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Lazily load the Crosswind module
3
+ * Returns null if Crosswind is not installed
4
+ */
5
+ export declare function loadCrosswind(): Promise<CrosswindModule | null>;
6
+ /**
7
+ * Reset the Crosswind module cache (useful for testing)
8
+ */
9
+ export declare function resetCrosswindCache(): void;
10
+ /**
11
+ * Load crosswind config from the working directory
12
+ */
13
+ export declare function loadCrosswindConfig(cwd: string): Promise<CrosswindConfig | null>;
14
+ /**
15
+ * Build Crosswind CSS using the build() API
16
+ * This scans content files and generates CSS for all used classes
17
+ */
18
+ export declare function buildCrosswindCSS(cwd: string): Promise<string>;
19
+ /**
20
+ * Rebuild Crosswind CSS (called on file changes)
21
+ */
22
+ export declare function rebuildCrosswindCSS(cwd: string): Promise<void>;
23
+ /**
24
+ * Get the cached CSS (for serving)
25
+ */
26
+ export declare function getCachedCSS(): string;
27
+ /**
28
+ * Extract all CSS class names from HTML content
29
+ */
30
+ export declare function extractClassNames(htmlContent: string): Set<string>;
31
+ /**
32
+ * Extract utility classes from HTML content and generate CSS using Crosswind
33
+ */
34
+ export declare function generateCrosswindCSS(htmlContent: string): Promise<string>;
35
+ /**
36
+ * Inject generated CSS into HTML content
37
+ * Tries to inject before </head>, falls back to <body> or prepends
38
+ */
39
+ export declare function injectCrosswindCSS(htmlContent: string): Promise<string>;
40
+ // Type for Crosswind module
41
+ declare interface CrosswindModule {
42
+ CSSGenerator: new (config: CrosswindConfig) => CSSGenerator
43
+ config: CrosswindConfig
44
+ build?: (config: CrosswindConfig) => Promise<CrosswindBuildResult>
45
+ defaultConfig?: CrosswindConfig
46
+ }
47
+ declare interface CrosswindConfig {
48
+ content?: string[]
49
+ output?: string
50
+ preflight?: boolean
51
+ minify?: boolean
52
+ preflights?: unknown[]
53
+ safelist?: string[]
54
+ }
@@ -0,0 +1,7 @@
1
+ export * from './terminal-colors';
2
+ export * from './crosswind';
3
+ export * from './theme-selector';
4
+ export * from './port-utils';
5
+ export * from './native-window';
6
+ export * from './keyboard-shortcuts';
7
+ export * from './types';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Print keyboard shortcuts help
3
+ */
4
+ export declare function printShortcutsHelp(): void;
5
+ /**
6
+ * Print server status with URL
7
+ */
8
+ export declare function printServerStatus(serverUrl: string): void;
9
+ /**
10
+ * Open URL in the default browser
11
+ */
12
+ export declare function openInBrowser(url: string): void;
13
+ /**
14
+ * Setup keyboard shortcuts for the server
15
+ * Enables raw mode for handling single keystrokes
16
+ *
17
+ * @param serverUrl - The URL of the dev server
18
+ * @param stopServer - Function to call when stopping the server
19
+ * @param customHandlers - Optional custom command handlers
20
+ */
21
+ export declare function setupKeyboardShortcuts(serverUrl: string, stopServer: () => void, customHandlers?: KeyboardCommandHandlers): void;
22
+ /**
23
+ * Cleanup keyboard shortcuts (restore terminal state)
24
+ */
25
+ export declare function cleanupKeyboardShortcuts(): void;
26
+ /**
27
+ * Keyboard shortcut command handlers
28
+ */
29
+ export declare interface KeyboardCommandHandlers {
30
+ onOpen?: () => void
31
+ onClear?: () => void
32
+ onQuit?: () => void
33
+ onHelp?: () => void
34
+ }
@@ -0,0 +1,40 @@
1
+ import type { SidebarConfig } from '@stacksjs/desktop';
2
+ /**
3
+ * Open a native window for development
4
+ * Uses the desktop package to create a webview window
5
+ *
6
+ * @param port - The port the dev server is running on
7
+ * @param config - Optional configuration overrides
8
+ * @returns true if window opened successfully, false otherwise
9
+ */
10
+ export declare function openNativeWindow(port: number, config?: NativeWindowConfig): Promise<boolean>;
11
+ /**
12
+ * Check if native window support is available
13
+ * Returns true if the desktop package can be used
14
+ */
15
+ export declare function isNativeWindowSupported(): Promise<boolean>;
16
+ /**
17
+ * Extract sidebar configuration from template content
18
+ * Looks for:
19
+ * 1. <Sidebar variant="tahoe"> component with props
20
+ * 2. @nativeSidebar directive
21
+ * 3. <script native-sidebar> (deprecated)
22
+ */
23
+ export declare function extractSidebarConfig(templateContent: string): SidebarConfig | undefined;
24
+ /**
25
+ * Default configuration for the native window
26
+ */
27
+ export declare const DEFAULT_NATIVE_WINDOW_CONFIG: Required<Omit<NativeWindowConfig, 'sidebarConfig'>> & { sidebarConfig?: SidebarConfig };
28
+ /**
29
+ * Configuration for the native development window
30
+ */
31
+ export declare interface NativeWindowConfig {
32
+ title?: string
33
+ width?: number
34
+ height?: number
35
+ darkMode?: boolean
36
+ hotReload?: boolean
37
+ nativeSidebar?: boolean
38
+ sidebarWidth?: number
39
+ sidebarConfig?: SidebarConfig
40
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Check if a port is available by attempting to bind to it
3
+ * Checks both IPv4 and IPv6
4
+ */
5
+ export declare function isPortAvailable(port: number): Promise<boolean>;
6
+ /**
7
+ * Find an available port starting from the given port
8
+ * @param startPort - The port to start searching from
9
+ * @param maxAttempts - Maximum number of ports to try (default: 20)
10
+ * @throws Error if no available port is found within maxAttempts
11
+ */
12
+ export declare function findAvailablePort(startPort: number, maxAttempts?: any): Promise<number>;
13
+ /**
14
+ * Find an available port within a specific range
15
+ */
16
+ export declare function findAvailablePortInRange(range: PortRange): Promise<number>;
17
+ /**
18
+ * Default port for the dev server
19
+ */
20
+ export declare const DEFAULT_PORT: 3000;
21
+ /**
22
+ * Port range configuration
23
+ */
24
+ export declare interface PortRange {
25
+ start: number
26
+ end: number
27
+ }
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Colorize a string with the specified color
3
+ */
4
+ export declare function colorize(text: string, color: ColorName): string;
5
+ /**
6
+ * Create a success message (green)
7
+ */
8
+ export declare function success(text: string): string;
9
+ /**
10
+ * Create a warning message (yellow)
11
+ */
12
+ export declare function warning(text: string): string;
13
+ /**
14
+ * Create an error message (red)
15
+ */
16
+ export declare function error(text: string): string;
17
+ /**
18
+ * Create an info message (cyan)
19
+ */
20
+ export declare function info(text: string): string;
21
+ /**
22
+ * Create a dim/muted message (gray)
23
+ */
24
+ export declare function dim(text: string): string;
25
+ /**
26
+ * ANSI color codes for terminal output
27
+ * Provides consistent coloring for CLI messages
28
+ */
29
+ export declare const colors: {
30
+ // Reset
31
+ reset: '\x1B[0m';
32
+ // Text styles
33
+ bright: '\x1B[1m';
34
+ dim: '\x1B[2m';
35
+ underscore: '\x1B[4m';
36
+ blink: '\x1B[5m';
37
+ reverse: '\x1B[7m';
38
+ hidden: '\x1B[8m';
39
+ // Foreground colors
40
+ black: '\x1B[30m';
41
+ red: '\x1B[31m';
42
+ green: '\x1B[32m';
43
+ yellow: '\x1B[33m';
44
+ blue: '\x1B[34m';
45
+ magenta: '\x1B[35m';
46
+ cyan: '\x1B[36m';
47
+ white: '\x1B[37m';
48
+ gray: '\x1B[90m';
49
+ // Background colors
50
+ bgBlack: '\x1B[40m';
51
+ bgRed: '\x1B[41m';
52
+ bgGreen: '\x1B[42m';
53
+ bgYellow: '\x1B[43m';
54
+ bgBlue: '\x1B[44m';
55
+ bgMagenta: '\x1B[45m';
56
+ bgCyan: '\x1B[46m';
57
+ bgWhite: '\x1B[47m';
58
+ bgGray: '\x1B[100m'
59
+ };
60
+ export type ColorName = keyof typeof colors
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Theme Selector Module
3
+ * Provides UI components for syntax highlighting theme selection
4
+ */
5
+ /**
6
+ * Generate theme selector CSS styles
7
+ * Used in markdown preview pages for syntax highlighting theme selection
8
+ */
9
+ export declare function getThemeSelectorStyles(): string;
10
+ /**
11
+ * Generate theme selector HTML with dropdown
12
+ * @param themeOptions - HTML string of option elements
13
+ */
14
+ export declare function getThemeSelectorHtml(themeOptions: string): string;
15
+ /**
16
+ * Generate theme change JavaScript
17
+ * Handles toggling dark mode based on theme selection
18
+ */
19
+ export declare function getThemeSelectorScript(): string;
20
+ /**
21
+ * Generate frontmatter display HTML
22
+ * @param data - Frontmatter key-value pairs
23
+ */
24
+ export declare function getFrontmatterHtml(data: Record<string, unknown>): string;
25
+ /**
26
+ * Check if a theme name indicates a dark theme
27
+ */
28
+ export declare function isDarkTheme(themeName: string): boolean;
29
+ /**
30
+ * List of dark theme keywords for theme detection
31
+ */
32
+ export declare const DARK_THEME_KEYWORDS: readonly ['dark', 'night', 'monokai', 'dracula', 'nord', 'material', 'ayu', 'one-dark', 'tokyo', 'gruvbox', 'solarized-dark'];
@@ -0,0 +1,92 @@
1
+ import type { SyntaxHighlightTheme, StxOptions } from '../types';
2
+ /**
3
+ * Get MIME type for a file extension
4
+ */
5
+ export declare function getMimeType(ext: string): string;
6
+ /**
7
+ * MIME type mapping
8
+ */
9
+ export declare const MIME_TYPES: {
10
+ '.html': 'text/html';
11
+ '.css': 'text/css';
12
+ '.js': 'application/javascript';
13
+ '.mjs': 'application/javascript';
14
+ '.json': 'application/json';
15
+ '.png': 'image/png';
16
+ '.jpg': 'image/jpeg';
17
+ '.jpeg': 'image/jpeg';
18
+ '.gif': 'image/gif';
19
+ '.svg': 'image/svg+xml';
20
+ '.ico': 'image/x-icon';
21
+ '.webp': 'image/webp';
22
+ '.woff': 'font/woff';
23
+ '.woff2': 'font/woff2';
24
+ '.ttf': 'font/ttf';
25
+ '.eot': 'application/vnd.ms-fontobject';
26
+ '.otf': 'font/otf';
27
+ '.mp4': 'video/mp4';
28
+ '.webm': 'video/webm';
29
+ '.mp3': 'audio/mpeg';
30
+ '.wav': 'audio/wav';
31
+ '.pdf': 'application/pdf';
32
+ '.zip': 'application/zip';
33
+ '.xml': 'application/xml';
34
+ '.txt': 'text/plain';
35
+ '.md': 'text/markdown';
36
+ '.stx': 'text/html'
37
+ };
38
+ /**
39
+ * Default dev server options
40
+ */
41
+ export declare const DEFAULT_DEV_OPTIONS: Required<Omit<DevServerOptions, 'stxOptions' | 'markdown'>>;
42
+ /**
43
+ * Markdown rendering options
44
+ */
45
+ export declare interface MarkdownOptions {
46
+ syntaxHighlighting?: {
47
+ /** Enable server-side syntax highlighting */
48
+ serverSide?: boolean
49
+ /** Enable syntax highlighting (default: true) */
50
+ enabled?: boolean
51
+ /** Default theme for code blocks */
52
+ defaultTheme?: SyntaxHighlightTheme
53
+ /** Highlight code blocks with unknown languages */
54
+ highlightUnknownLanguages?: boolean
55
+ /** Additional themes to make available */
56
+ additionalThemes?: SyntaxHighlightTheme[]
57
+ }
58
+ }
59
+ /**
60
+ * Dev server configuration options
61
+ */
62
+ export declare interface DevServerOptions {
63
+ port?: number
64
+ watch?: boolean
65
+ native?: boolean
66
+ stxOptions?: StxOptions
67
+ markdown?: MarkdownOptions
68
+ cache?: boolean
69
+ hotReload?: boolean
70
+ hmrPort?: number
71
+ }
72
+ /**
73
+ * Server instance returned by serve functions
74
+ */
75
+ export declare interface ServerInstance {
76
+ stop: () => void
77
+ url: string
78
+ port: number
79
+ hmrPort?: number
80
+ }
81
+ /**
82
+ * File watcher event types
83
+ */
84
+ export type WatchEventType = 'change' | 'rename' | 'delete' | 'add'
85
+ /**
86
+ * File watcher callback
87
+ */
88
+ export type WatchCallback = (eventType: WatchEventType, filename: string) => void
89
+ /**
90
+ * Route handler function
91
+ */
92
+ export type RouteHandler = (request: Request) => Promise<Response> | Response
@@ -1,8 +1,27 @@
1
+ import { } from './dev-server/index';
2
+ import { } from './hot-reload';
3
+ import { } from './route-middleware';
1
4
  import type { SyntaxHighlightTheme } from './types';
2
5
  // Build and serve a specific stx file
3
6
  export declare function serveStxFile(filePath: string, options?: DevServerOptions): Promise<boolean>;
4
7
  // Build and serve multiple files (stx and Markdown)
5
8
  export declare function serveMultipleStxFiles(filePaths: string[], options?: DevServerOptions): Promise<boolean>;
9
+ /**
10
+ * Serve a full STX application with file-based routing
11
+ *
12
+ * Directory structure:
13
+ * pages/
14
+ * index.stx → /
15
+ * about.stx → /about
16
+ * chat/
17
+ * index.stx → /chat
18
+ * [id].stx → /chat/:id (dynamic route)
19
+ * components/ → Shared components
20
+ * public/ → Static assets
21
+ */
22
+ export declare function serveApp(appDir?: string, options?: DevServerOptions): Promise<boolean>;
23
+ // NOTE: Crosswind CSS, theme selector, port utils, and native window functions
24
+ // have been extracted to dev-server/ modules for better organization
6
25
  // Define types for dev server options
7
26
  export declare interface DevServerOptions {
8
27
  port?: number
@@ -19,4 +38,6 @@ export declare interface DevServerOptions {
19
38
  }
20
39
  }
21
40
  cache?: boolean
41
+ hotReload?: boolean
42
+ hmrPort?: number
22
43
  }