appos 0.4.3-0 → 0.5.1-0

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 (206) hide show
  1. package/dist/exports/api/index.d.mts +3 -3
  2. package/dist/exports/api/index.mjs +34 -9
  3. package/dist/exports/api/workflows/index.d.mts +2 -2
  4. package/dist/exports/api/workflows/index.mjs +2 -2
  5. package/dist/exports/{auth-By0xx0MI.d.mts → auth-BCOIpGDO.d.mts} +325 -214
  6. package/dist/exports/cli/index.d.mts +105 -106
  7. package/dist/exports/cli/index.mjs +87 -13
  8. package/dist/exports/{constants-BePPc_yF.mjs → constants-BicCnEiJ.mjs} +7 -1
  9. package/dist/exports/{index-Bpo5QE7k.d.mts → index-CiuTp085.d.mts} +580 -614
  10. package/dist/exports/{openapi-crG3j4xx.mjs → openapi-uisUTLq7.mjs} +45 -102
  11. package/dist/exports/{send-email-Bgcdjy-e.mjs → send-email-CXxlkfFL.mjs} +1 -1
  12. package/dist/exports/{server-BlNxgHUc.mjs → server-CA4aI0U6.mjs} +6 -2
  13. package/dist/exports/storybook/index.d.ts +40 -0
  14. package/dist/exports/storybook/index.js +43 -0
  15. package/dist/exports/tests/api.d.mts +2 -2
  16. package/dist/exports/tests/api.mjs +3 -3
  17. package/dist/exports/vite/index.d.mts +19 -3
  18. package/dist/exports/vite/index.mjs +82 -6
  19. package/dist/exports/web/index.d.ts +2247 -700
  20. package/dist/exports/web/index.js +2445 -754
  21. package/dist/exports/web/routes.d.mts +41 -43
  22. package/dist/exports/web/ssr.d.mts +2 -2
  23. package/package.json +48 -31
  24. package/src/storybook/.storybook/main.ts +119 -0
  25. package/src/storybook/.storybook/manager.ts +75 -0
  26. package/src/storybook/.storybook/preview.tsx +76 -0
  27. package/src/storybook/components/ColorGrid.tsx +324 -0
  28. package/src/storybook/components/IconGallery.tsx +268 -0
  29. package/src/storybook/components/SpacingScale.tsx +236 -0
  30. package/src/storybook/components/TypographyScale.tsx +277 -0
  31. package/src/storybook/components/index.ts +3 -0
  32. package/src/storybook/docs/Introduction.mdx +29 -0
  33. package/src/storybook/docs/foundations/Colors.mdx +27 -0
  34. package/src/storybook/docs/foundations/Icons.mdx +26 -0
  35. package/src/storybook/docs/foundations/Spacing.mdx +23 -0
  36. package/src/storybook/docs/foundations/Typography.mdx +39 -0
  37. package/src/storybook/index.ts +147 -0
  38. package/src/storybook/shims/void-elements.js +18 -0
  39. package/src/web/client/auth-paths.ts +148 -0
  40. package/src/web/client/auth.ts +218 -0
  41. package/src/web/client/i18n.d.ts +9 -0
  42. package/src/web/client/i18n.ts +127 -0
  43. package/src/web/client/react-router.ts +84 -0
  44. package/src/web/hooks/index.ts +1 -0
  45. package/src/web/hooks/use-mobile.ts +19 -0
  46. package/src/web/index.ts +42 -0
  47. package/src/web/lib/colors.ts +220 -0
  48. package/src/web/lib/utils.ts +52 -0
  49. package/src/web/routes/auth/_layout.tsx +5 -11
  50. package/src/web/routes.ts +101 -0
  51. package/src/web/server/context.ts +14 -0
  52. package/src/web/server/render.ts +11 -0
  53. package/src/web/ssr.ts +17 -0
  54. package/src/web/ui/accordion.stories.tsx +183 -0
  55. package/src/web/ui/accordion.tsx +134 -0
  56. package/src/web/ui/alert-dialog.stories.tsx +215 -0
  57. package/src/web/ui/alert-dialog.tsx +328 -0
  58. package/src/web/ui/alert.stories.tsx +224 -0
  59. package/src/web/ui/alert.tsx +136 -0
  60. package/src/web/ui/animated-check.stories.tsx +200 -0
  61. package/src/web/ui/animated-check.tsx +98 -0
  62. package/src/web/ui/aspect-ratio.stories.tsx +204 -0
  63. package/src/web/ui/aspect-ratio.tsx +36 -0
  64. package/src/web/ui/auth/__mocks__/auth-context.tsx +273 -0
  65. package/src/web/ui/auth/auth-card.stories.tsx +295 -0
  66. package/src/web/ui/auth/auth-card.tsx +124 -0
  67. package/src/web/ui/auth/auth-layout.stories.tsx +330 -0
  68. package/src/web/ui/auth/auth-layout.tsx +269 -0
  69. package/src/web/ui/auth/captcha-widget.stories.tsx +200 -0
  70. package/src/web/ui/auth/captcha-widget.tsx +197 -0
  71. package/src/web/ui/auth/context.tsx +87 -0
  72. package/src/web/ui/auth/email-input.stories.tsx +167 -0
  73. package/src/web/ui/auth/email-input.tsx +84 -0
  74. package/src/web/ui/auth/forms/email-otp-form.tsx +377 -0
  75. package/src/web/ui/auth/forms/forgot-password-form.tsx +240 -0
  76. package/src/web/ui/auth/forms/index.ts +40 -0
  77. package/src/web/ui/auth/forms/login-form.tsx +486 -0
  78. package/src/web/ui/auth/forms/phone-otp-form.tsx +388 -0
  79. package/src/web/ui/auth/forms/reset-password-form.tsx +331 -0
  80. package/src/web/ui/auth/forms/signup-form.tsx +499 -0
  81. package/src/web/ui/auth/forms/two-factor-form.tsx +410 -0
  82. package/src/web/ui/auth/forms/verify-email-form.tsx +373 -0
  83. package/src/web/ui/auth/hooks.ts +266 -0
  84. package/src/web/ui/auth/index.ts +31 -0
  85. package/src/web/ui/auth/magic-link-form.tsx +191 -0
  86. package/src/web/ui/auth/otp-input.stories.tsx +199 -0
  87. package/src/web/ui/auth/otp-input.tsx +157 -0
  88. package/src/web/ui/auth/passkey-button.stories.tsx +115 -0
  89. package/src/web/ui/auth/passkey-button.tsx +113 -0
  90. package/src/web/ui/auth/passkey-register-button.stories.tsx +109 -0
  91. package/src/web/ui/auth/passkey-register-button.tsx +106 -0
  92. package/src/web/ui/auth/password-input.stories.tsx +287 -0
  93. package/src/web/ui/auth/password-input.tsx +306 -0
  94. package/src/web/ui/auth/phone-input.stories.tsx +160 -0
  95. package/src/web/ui/auth/phone-input.tsx +89 -0
  96. package/src/web/ui/auth/social-buttons.stories.tsx +217 -0
  97. package/src/web/ui/auth/social-buttons.tsx +196 -0
  98. package/src/web/ui/auth/sso-button.stories.tsx +160 -0
  99. package/src/web/ui/auth/sso-button.tsx +108 -0
  100. package/src/web/ui/auth/trust-signals.stories.tsx +208 -0
  101. package/src/web/ui/auth/trust-signals.tsx +260 -0
  102. package/src/web/ui/avatar.stories.tsx +302 -0
  103. package/src/web/ui/avatar.tsx +189 -0
  104. package/src/web/ui/badge.stories.tsx +225 -0
  105. package/src/web/ui/badge.tsx +66 -0
  106. package/src/web/ui/brand.stories.tsx +266 -0
  107. package/src/web/ui/brand.tsx +162 -0
  108. package/src/web/ui/breadcrumb.stories.tsx +271 -0
  109. package/src/web/ui/breadcrumb.tsx +214 -0
  110. package/src/web/ui/button-group.stories.tsx +251 -0
  111. package/src/web/ui/button-group.tsx +87 -0
  112. package/src/web/ui/button.stories.tsx +264 -0
  113. package/src/web/ui/button.tsx +120 -0
  114. package/src/web/ui/calendar.stories.tsx +235 -0
  115. package/src/web/ui/calendar.tsx +221 -0
  116. package/src/web/ui/card.stories.tsx +262 -0
  117. package/src/web/ui/card.tsx +199 -0
  118. package/src/web/ui/carousel.stories.tsx +244 -0
  119. package/src/web/ui/carousel.tsx +241 -0
  120. package/src/web/ui/chart.stories.tsx +833 -0
  121. package/src/web/ui/chart.tsx +390 -0
  122. package/src/web/ui/checkbox.stories.tsx +208 -0
  123. package/src/web/ui/checkbox.tsx +39 -0
  124. package/src/web/ui/collapsible.stories.tsx +239 -0
  125. package/src/web/ui/collapsible.tsx +21 -0
  126. package/src/web/ui/command.stories.tsx +291 -0
  127. package/src/web/ui/command.tsx +189 -0
  128. package/src/web/ui/context-menu.stories.tsx +255 -0
  129. package/src/web/ui/context-menu.tsx +263 -0
  130. package/src/web/ui/dialog.stories.tsx +263 -0
  131. package/src/web/ui/dialog.tsx +273 -0
  132. package/src/web/ui/drawer.stories.tsx +299 -0
  133. package/src/web/ui/drawer.tsx +130 -0
  134. package/src/web/ui/dropdown-menu.stories.tsx +320 -0
  135. package/src/web/ui/dropdown-menu.tsx +263 -0
  136. package/src/web/ui/empty.stories.tsx +204 -0
  137. package/src/web/ui/empty.tsx +101 -0
  138. package/src/web/ui/error-page.stories.tsx +181 -0
  139. package/src/web/ui/error-page.tsx +136 -0
  140. package/src/web/ui/field.stories.tsx +364 -0
  141. package/src/web/ui/field.tsx +252 -0
  142. package/src/web/ui/globals.css +3 -0
  143. package/src/web/ui/hover-card.stories.tsx +261 -0
  144. package/src/web/ui/hover-card.tsx +50 -0
  145. package/src/web/ui/index.ts +55 -0
  146. package/src/web/ui/input-group.stories.tsx +290 -0
  147. package/src/web/ui/input-group.tsx +157 -0
  148. package/src/web/ui/input-otp.stories.tsx +235 -0
  149. package/src/web/ui/input-otp.tsx +86 -0
  150. package/src/web/ui/input.stories.tsx +205 -0
  151. package/src/web/ui/input.tsx +30 -0
  152. package/src/web/ui/item.stories.tsx +348 -0
  153. package/src/web/ui/item.tsx +200 -0
  154. package/src/web/ui/kbd.stories.tsx +236 -0
  155. package/src/web/ui/kbd.tsx +27 -0
  156. package/src/web/ui/label.stories.tsx +180 -0
  157. package/src/web/ui/label.tsx +32 -0
  158. package/src/web/ui/locales/en/ui.json +13 -30
  159. package/src/web/ui/locales/zh-CN/ui.json +17 -34
  160. package/src/web/ui/locales/zh-TW/ui.json +17 -34
  161. package/src/web/ui/menubar.stories.tsx +385 -0
  162. package/src/web/ui/menubar.tsx +273 -0
  163. package/src/web/ui/navigation-menu.stories.tsx +361 -0
  164. package/src/web/ui/navigation-menu.tsx +168 -0
  165. package/src/web/ui/pagination.stories.tsx +312 -0
  166. package/src/web/ui/pagination.tsx +221 -0
  167. package/src/web/ui/popover.stories.tsx +315 -0
  168. package/src/web/ui/popover.tsx +89 -0
  169. package/src/web/ui/progress.stories.tsx +239 -0
  170. package/src/web/ui/progress.tsx +128 -0
  171. package/src/web/ui/radio-group.stories.tsx +315 -0
  172. package/src/web/ui/radio-group.tsx +38 -0
  173. package/src/web/ui/resizable.stories.tsx +304 -0
  174. package/src/web/ui/resizable.tsx +53 -0
  175. package/src/web/ui/scroll-area.stories.tsx +276 -0
  176. package/src/web/ui/scroll-area.tsx +53 -0
  177. package/src/web/ui/select.stories.tsx +314 -0
  178. package/src/web/ui/select.tsx +312 -0
  179. package/src/web/ui/separator.stories.tsx +246 -0
  180. package/src/web/ui/separator.tsx +36 -0
  181. package/src/web/ui/sheet.stories.tsx +417 -0
  182. package/src/web/ui/sheet.tsx +133 -0
  183. package/src/web/ui/sidebar.stories.tsx +402 -0
  184. package/src/web/ui/sidebar.tsx +723 -0
  185. package/src/web/ui/skeleton.stories.tsx +235 -0
  186. package/src/web/ui/skeleton.tsx +26 -0
  187. package/src/web/ui/slider.stories.tsx +294 -0
  188. package/src/web/ui/slider.tsx +75 -0
  189. package/src/web/ui/sonner.stories.tsx +279 -0
  190. package/src/web/ui/sonner.tsx +46 -0
  191. package/src/web/ui/spinner.stories.tsx +204 -0
  192. package/src/web/ui/spinner.tsx +28 -0
  193. package/src/web/ui/switch.stories.tsx +285 -0
  194. package/src/web/ui/switch.tsx +43 -0
  195. package/src/web/ui/table.stories.tsx +362 -0
  196. package/src/web/ui/table.tsx +115 -0
  197. package/src/web/ui/tabs.stories.tsx +401 -0
  198. package/src/web/ui/tabs.tsx +136 -0
  199. package/src/web/ui/textarea.stories.tsx +272 -0
  200. package/src/web/ui/textarea.tsx +28 -0
  201. package/src/web/ui/toggle-group.stories.tsx +334 -0
  202. package/src/web/ui/toggle-group.tsx +88 -0
  203. package/src/web/ui/toggle.stories.tsx +264 -0
  204. package/src/web/ui/toggle.tsx +57 -0
  205. package/src/web/ui/tooltip.stories.tsx +342 -0
  206. package/src/web/ui/tooltip.tsx +116 -0
@@ -1,5 +1,5 @@
1
- import "../auth-By0xx0MI.mjs";
2
- import { z as Container } from "../index-Bpo5QE7k.mjs";
1
+ import "../auth-BCOIpGDO.mjs";
2
+ import { z as Container } from "../index-CiuTp085.mjs";
3
3
  import "../orm-CJrd147z.mjs";
4
4
  import "../instrumentation-CFIspF8-.mjs";
5
5
  import { z } from "zod";
@@ -7,7 +7,6 @@ import { ChildProcess } from "node:child_process";
7
7
  import * as p from "@clack/prompts";
8
8
 
9
9
  //#region src/cli/context.d.ts
10
-
11
10
  /**
12
11
  * Command context providing beautiful output, prompts, and utilities.
13
12
  * Uses @clack/prompts for consistent, professional CLI formatting.
@@ -18,168 +17,168 @@ import * as p from "@clack/prompts";
18
17
  */
19
18
  interface CommandContext<C extends Container = Container, A = readonly unknown[], O = Record<string, unknown>> {
20
19
  /**
21
- * The parsed command-line arguments.
22
- * Type is inferred from the command's Zod args schema.
23
- */
20
+ * The parsed command-line arguments.
21
+ * Type is inferred from the command's Zod args schema.
22
+ */
24
23
  readonly args: A;
25
24
  /**
26
- * Prompts the user for single-line text input.
27
- * @see https://www.clack.cc for prompt options
28
- */
25
+ * Prompts the user for single-line text input.
26
+ * @see https://www.clack.cc for prompt options
27
+ */
29
28
  ask: typeof p.text;
30
29
  /**
31
- * Displays a cancellation message and exits the process with code 0.
32
- * @param message - Optional cancellation message (defaults to "Cancelled")
33
- */
30
+ * Displays a cancellation message and exits the process with code 0.
31
+ * @param message - Optional cancellation message (defaults to "Cancelled")
32
+ */
34
33
  cancel(message?: string): never;
35
34
  /**
36
- * Prompts the user for dropdown selection from a list of options.
37
- * @see https://www.clack.cc for prompt options
38
- */
35
+ * Prompts the user for dropdown selection from a list of options.
36
+ * @see https://www.clack.cc for prompt options
37
+ */
39
38
  choice: typeof p.select;
40
39
  /**
41
- * Releases all container resources including database connections and cache clients.
42
- * Must be called before the command exits to prevent resource leaks.
43
- */
40
+ * Releases all container resources including database connections and cache clients.
41
+ * Must be called before the command exits to prevent resource leaks.
42
+ */
44
43
  cleanup(): Promise<void>;
45
44
  /**
46
- * Displays a dimmed comment line for secondary information.
47
- * @param message - The comment text to display
48
- */
45
+ * Displays a dimmed comment line for secondary information.
46
+ * @param message - The comment text to display
47
+ */
49
48
  comment(message: string): void;
50
49
  /**
51
- * Prompts the user for yes/no confirmation.
52
- * @see https://www.clack.cc for prompt options
53
- */
50
+ * Prompts the user for yes/no confirmation.
51
+ * @see https://www.clack.cc for prompt options
52
+ */
54
53
  confirm: typeof p.confirm;
55
54
  /**
56
- * The dependency injection container providing access to services.
57
- * Includes database connections, cache clients, logger, mailer, and configuration.
58
- */
55
+ * The dependency injection container providing access to services.
56
+ * Includes database connections, cache clients, logger, mailer, and configuration.
57
+ */
59
58
  readonly container: C;
60
59
  /**
61
- * Displays an error message with the error symbol.
62
- * @param message - The error message to display
63
- */
60
+ * Displays an error message with the error symbol.
61
+ * @param message - The error message to display
62
+ */
64
63
  error(message: string): void;
65
64
  /**
66
- * Executes a shell command asynchronously.
67
- * @param command - The command to execute
68
- * @param args - Array of command arguments
69
- * @throws Error if the command exits with a non-zero code
70
- */
65
+ * Executes a shell command asynchronously.
66
+ * @param command - The command to execute
67
+ * @param args - Array of command arguments
68
+ * @throws Error if the command exits with a non-zero code
69
+ */
71
70
  exec(command: string, args: string[]): Promise<void>;
72
71
  /**
73
- * Displays an error message and terminates the process with exit code 1.
74
- * @param message - The error message to display before exiting
75
- */
72
+ * Displays an error message and terminates the process with exit code 1.
73
+ * @param message - The error message to display before exiting
74
+ */
76
75
  fail(message: string): never;
77
76
  /**
78
- * Executes a shell command with inherited stdio so output is visible.
79
- * Returns both the process handle and a promise that resolves on completion.
80
- * @param command - The command to execute
81
- * @param args - Array of command arguments
82
- * @returns Object with `proc` (ChildProcess) and `promise` (Promise)
83
- */
77
+ * Executes a shell command with inherited stdio so output is visible.
78
+ * Returns both the process handle and a promise that resolves on completion.
79
+ * @param command - The command to execute
80
+ * @param args - Array of command arguments
81
+ * @returns Object with `proc` (ChildProcess) and `promise` (Promise)
82
+ */
84
83
  run(command: string, args: string[]): {
85
84
  proc: ChildProcess;
86
85
  promise: Promise<void>;
87
86
  };
88
87
  /**
89
- * Groups multiple prompts together for sequential execution.
90
- * @see https://www.clack.cc for group options
91
- */
88
+ * Groups multiple prompts together for sequential execution.
89
+ * @see https://www.clack.cc for group options
90
+ */
92
91
  group: typeof p.group;
93
92
  /**
94
- * Displays an informational message with the info symbol.
95
- * @param message - The info message to display
96
- */
93
+ * Displays an informational message with the info symbol.
94
+ * @param message - The info message to display
95
+ */
97
96
  info(message: string): void;
98
97
  /**
99
- * Displays the command intro header.
100
- * @param title - The command name or title to display
101
- */
98
+ * Displays the command intro header.
99
+ * @param title - The command name or title to display
100
+ */
102
101
  intro(title: string): void;
103
102
  /**
104
- * Checks if a prompt result indicates user cancellation (Ctrl+C).
105
- * @param value - The prompt result to check
106
- * @returns True if the user cancelled the prompt
107
- */
103
+ * Checks if a prompt result indicates user cancellation (Ctrl+C).
104
+ * @param value - The prompt result to check
105
+ * @returns True if the user cancelled the prompt
106
+ */
108
107
  isCancel: typeof p.isCancel;
109
108
  /**
110
- * Displays a plain text line.
111
- * @param message - The text to display
112
- */
109
+ * Displays a plain text line.
110
+ * @param message - The text to display
111
+ */
113
112
  line(message: string): void;
114
113
  /**
115
- * Prompts the user to select multiple options from a list.
116
- * @see https://www.clack.cc for multiselect options
117
- */
114
+ * Prompts the user to select multiple options from a list.
115
+ * @see https://www.clack.cc for multiselect options
116
+ */
118
117
  multiselect: typeof p.multiselect;
119
118
  /**
120
- * Displays a formatted note box with optional title.
121
- * @param message - The note content
122
- * @param title - Optional title for the note
123
- */
119
+ * Displays a formatted note box with optional title.
120
+ * @param message - The note content
121
+ * @param title - Optional title for the note
122
+ */
124
123
  note(message: string, title?: string): void;
125
124
  /**
126
- * The parsed command-line options.
127
- * Type is inferred from the command's Zod opts schema.
128
- */
125
+ * The parsed command-line options.
126
+ * Type is inferred from the command's Zod opts schema.
127
+ */
129
128
  readonly opts: O;
130
129
  /**
131
- * Displays the command outro footer.
132
- * @param message - Optional completion message (defaults to "Done")
133
- */
130
+ * Displays the command outro footer.
131
+ * @param message - Optional completion message (defaults to "Done")
132
+ */
134
133
  outro(message?: string): void;
135
134
  /**
136
- * Prompts the user for password input with hidden characters.
137
- * @see https://www.clack.cc for prompt options
138
- */
135
+ * Prompts the user for password input with hidden characters.
136
+ * @see https://www.clack.cc for prompt options
137
+ */
139
138
  secret: typeof p.password;
140
139
  /**
141
- * Executes an async function while displaying an animated spinner.
142
- * Use for long-running operations like starting containers.
143
- * @template T - Return type of the task function
144
- * @param message - Message to display while spinning
145
- * @param fn - Async function to execute
146
- * @returns The result of the task function
147
- */
140
+ * Executes an async function while displaying an animated spinner.
141
+ * Use for long-running operations like starting containers.
142
+ * @template T - Return type of the task function
143
+ * @param message - Message to display while spinning
144
+ * @param fn - Async function to execute
145
+ * @returns The result of the task function
146
+ */
148
147
  spinner<T>(message: string, fn: () => Promise<T>): Promise<T>;
149
148
  /**
150
- * Displays a step message indicating progress.
151
- * @param message - The step description
152
- */
149
+ * Displays a step message indicating progress.
150
+ * @param message - The step description
151
+ */
153
152
  step(message: string): void;
154
153
  /**
155
- * Displays a success message with the success symbol.
156
- * @param message - The success message to display
157
- */
154
+ * Displays a success message with the success symbol.
155
+ * @param message - The success message to display
156
+ */
158
157
  success(message: string): void;
159
158
  /**
160
- * Displays data in a formatted note box as a table.
161
- * @param headers - Array of column header strings
162
- * @param rows - 2D array of cell values
163
- */
159
+ * Displays data in a formatted note box as a table.
160
+ * @param headers - Array of column header strings
161
+ * @param rows - 2D array of cell values
162
+ */
164
163
  table(headers: string[], rows: string[][]): void;
165
164
  /**
166
- * Executes an async function and displays the result with timing.
167
- * @template T - Return type of the task function
168
- * @param name - Display name for the task
169
- * @param fn - Async function to execute
170
- * @returns The result of the task function
171
- */
165
+ * Executes an async function and displays the result with timing.
166
+ * @template T - Return type of the task function
167
+ * @param name - Display name for the task
168
+ * @param fn - Async function to execute
169
+ * @returns The result of the task function
170
+ */
172
171
  task<T>(name: string, fn: () => Promise<T>): Promise<T>;
173
172
  /**
174
- * Displays a task status line without executing any function.
175
- * @param name - Display name for the task
176
- * @param status - Status text to display
177
- */
173
+ * Displays a task status line without executing any function.
174
+ * @param name - Display name for the task
175
+ * @param status - Status text to display
176
+ */
178
177
  taskStatus(name: string, status: string): void;
179
178
  /**
180
- * Displays a warning message with the warning symbol.
181
- * @param message - The warning message to display
182
- */
179
+ * Displays a warning message with the warning symbol.
180
+ * @param message - The warning message to display
181
+ */
183
182
  warn(message: string): void;
184
183
  }
185
184
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import "../app-context-LF4QmPUC.mjs";
2
- import { a as loadWorkflows, h as loadEvents } from "../send-email-Bgcdjy-e.mjs";
3
- import { a as DATABASES_DIR, c as FIXTURES_DIR, h as WEB_DIR, i as COMMANDS_DIR, m as TEST_EXTENSIONS, n as BUILD_DIR, s as FILE_EXT, t as APPOS_DIR, u as MAIN_ENTRY } from "../constants-BePPc_yF.mjs";
4
- import { _ as defineMigrationOpts } from "../openapi-crG3j4xx.mjs";
2
+ import { a as loadWorkflows, h as loadEvents } from "../send-email-CXxlkfFL.mjs";
3
+ import { a as DATABASES_DIR, c as FILE_EXT, d as MAIN_ENTRY, g as WEB_DIR, h as TEST_EXTENSIONS, i as COMMANDS_DIR, l as FIXTURES_DIR, n as BUILD_DIR, t as APPOS_DIR } from "../constants-BicCnEiJ.mjs";
4
+ import { _ as defineMigrationOpts } from "../openapi-uisUTLq7.mjs";
5
5
  import "../instrumentation-DkoLNAtz.mjs";
6
- import { t as defineServer } from "../server-BlNxgHUc.mjs";
6
+ import { t as defineServer } from "../server-CA4aI0U6.mjs";
7
7
  import "../ssr-BsfNjYlJ.mjs";
8
8
  import { createRequire } from "node:module";
9
9
  import { z } from "zod";
@@ -431,14 +431,33 @@ var build_default = defineCommand({
431
431
  } catch {
432
432
  hasWebDir = false;
433
433
  }
434
- if (hasWebDir) try {
435
- await ctx.spinner("Building React Router app", async () => {
436
- const viteBin = await findBin("vite");
437
- await ctx.exec(viteBin, ["build"]);
438
- });
439
- ctx.success("Built React Router app successfully");
440
- } catch (error) {
441
- ctx.fail(error instanceof Error ? error.message : String(error));
434
+ if (hasWebDir) {
435
+ try {
436
+ await ctx.spinner("Building React Router app", async () => {
437
+ const viteBin = await findBin("vite");
438
+ await ctx.exec(viteBin, ["build"]);
439
+ });
440
+ ctx.success("Built React Router app successfully");
441
+ } catch (error) {
442
+ ctx.fail(error instanceof Error ? error.message : String(error));
443
+ }
444
+ const configDir = join(dirname(createRequire(import.meta.url).resolve("appos/package.json")), "src/storybook/.storybook");
445
+ if (existsSync(configDir)) try {
446
+ await ctx.spinner("Building design system", async () => {
447
+ const storybookBin = await findBin("storybook");
448
+ await ctx.exec(storybookBin, [
449
+ "build",
450
+ "-o",
451
+ `${BUILD_DIR}/storybook`,
452
+ "--config-dir",
453
+ configDir,
454
+ "--quiet"
455
+ ]);
456
+ });
457
+ ctx.success("Built design system successfully");
458
+ } catch (error) {
459
+ ctx.warn(`Storybook build failed: ${error instanceof Error ? error.message : String(error)}`);
460
+ }
442
461
  }
443
462
  const entryPoints = await collectEntryPoints();
444
463
  const outdir = `./${BUILD_DIR}`;
@@ -1404,7 +1423,7 @@ var preview_default = defineCommand({
1404
1423
 
1405
1424
  //#endregion
1406
1425
  //#region package.json
1407
- var version = "0.4.3-0";
1426
+ var version = "0.5.1-0";
1408
1427
 
1409
1428
  //#endregion
1410
1429
  //#region src/cli/commands/repl.ts
@@ -1526,6 +1545,7 @@ var start_default = defineCommand({
1526
1545
  const startWorker = !opts.service || opts.service === "worker";
1527
1546
  let server = null;
1528
1547
  let worker = null;
1548
+ let storybookProc = null;
1529
1549
  let isShuttingDown = false;
1530
1550
  /**
1531
1551
  * Graceful shutdown handler.
@@ -1535,6 +1555,10 @@ var start_default = defineCommand({
1535
1555
  isShuttingDown = true;
1536
1556
  logger.info(`Shutdown initiated (${signal})`);
1537
1557
  try {
1558
+ if (storybookProc && !storybookProc.killed) {
1559
+ storybookProc.kill("SIGKILL");
1560
+ logger.info("Design system stopped");
1561
+ }
1538
1562
  if (server) {
1539
1563
  await server.stop();
1540
1564
  logger.info("HTTP server stopped");
@@ -1560,6 +1584,56 @@ var start_default = defineCommand({
1560
1584
  server = await defineServer({ container });
1561
1585
  await server.start();
1562
1586
  logger.info(`HTTP server ready at http://${server.host}:${server.port} ${runtimeInfo}`);
1587
+ if (process.env.NODE_ENV !== "production") {
1588
+ const configDir = join(dirname(createRequire(import.meta.url).resolve("appos/package.json")), "src/storybook/.storybook");
1589
+ let binPath = "";
1590
+ let dir = process.cwd();
1591
+ while (dir !== "/") {
1592
+ const candidate = join(dir, "node_modules", ".bin");
1593
+ if (existsSync(candidate)) {
1594
+ binPath = candidate;
1595
+ break;
1596
+ }
1597
+ dir = dirname(dir);
1598
+ }
1599
+ const { spawn: spawn$1 } = await import("node:child_process");
1600
+ storybookProc = spawn$1("storybook", [
1601
+ "dev",
1602
+ "-p",
1603
+ "6006",
1604
+ "--no-open",
1605
+ "--config-dir",
1606
+ configDir
1607
+ ], {
1608
+ stdio: "ignore",
1609
+ cwd: process.cwd(),
1610
+ env: {
1611
+ ...process.env,
1612
+ PATH: binPath ? `${binPath}:${process.env.PATH}` : process.env.PATH
1613
+ }
1614
+ });
1615
+ storybookProc.on("exit", (code) => {
1616
+ if (code !== 0 && code !== null && !isShuttingDown) logger.error(`Design system exited with code ${code}`);
1617
+ storybookProc = null;
1618
+ });
1619
+ storybookProc.on("error", (err) => {
1620
+ if (!isShuttingDown) logger.error(`Design system spawn error: ${err.message}`);
1621
+ });
1622
+ /**
1623
+ * Waits for a port to become available by polling.
1624
+ */
1625
+ const waitForPort = async (port, timeout) => {
1626
+ const start = Date.now();
1627
+ while (Date.now() - start < timeout) try {
1628
+ await fetch(`http://localhost:${port}`);
1629
+ return true;
1630
+ } catch {
1631
+ await new Promise((r) => setTimeout(r, 200));
1632
+ }
1633
+ return false;
1634
+ };
1635
+ if (!await waitForPort(6006, 3e4) && storybookProc && !storybookProc.killed) logger.warn("Design system slow to start, /design may not be ready yet");
1636
+ }
1563
1637
  }
1564
1638
  }
1565
1639
  });
@@ -163,6 +163,12 @@ const FIXTURES_DIR = "__fixtures__";
163
163
  * @default [".test.ts", ".spec.ts"]
164
164
  */
165
165
  const TEST_EXTENSIONS = [".test.ts", ".spec.ts"];
166
+ /**
167
+ * URL path for Storybook design system.
168
+ *
169
+ * @default "/design"
170
+ */
171
+ const DESIGN_SYSTEM_PATH = "/design";
166
172
 
167
173
  //#endregion
168
- export { DATABASES_DIR as a, FIXTURES_DIR as c, MIDDLEWARE_DIR as d, PUBLIC_DIR as f, WORKFLOWS_DIR as g, WEB_DIR as h, COMMANDS_DIR as i, LOCALES_DIR as l, TEST_EXTENSIONS as m, BUILD_DIR as n, EVENTS_DIR as o, ROUTES_DIR as p, BUILD_OUTPUT_DIR as r, FILE_EXT as s, APPOS_DIR as t, MAIN_ENTRY as u };
174
+ export { WORKFLOWS_DIR as _, DATABASES_DIR as a, FILE_EXT as c, MAIN_ENTRY as d, MIDDLEWARE_DIR as f, WEB_DIR as g, TEST_EXTENSIONS as h, COMMANDS_DIR as i, FIXTURES_DIR as l, ROUTES_DIR as m, BUILD_DIR as n, DESIGN_SYSTEM_PATH as o, PUBLIC_DIR as p, BUILD_OUTPUT_DIR as r, EVENTS_DIR as s, APPOS_DIR as t, LOCALES_DIR as u };