@betterstart/cli 0.1.2 → 0.1.4

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 (234) hide show
  1. package/README.md +133 -0
  2. package/dist/cli.d.ts +1 -9
  3. package/dist/cli.js +13484 -354
  4. package/dist/cli.js.map +1 -1
  5. package/dist/index.d.ts +24 -260
  6. package/dist/index.js +4 -11373
  7. package/dist/index.js.map +1 -1
  8. package/package.json +29 -42
  9. package/templates/schema.json +959 -0
  10. package/templates/tiptap/hooks/use-composed-ref.ts +43 -0
  11. package/templates/tiptap/hooks/use-cursor-visibility.ts +68 -0
  12. package/templates/tiptap/hooks/use-element-rect.ts +166 -0
  13. package/templates/tiptap/hooks/use-is-breakpoint.ts +32 -0
  14. package/templates/tiptap/hooks/use-menu-navigation.ts +182 -0
  15. package/templates/tiptap/hooks/use-scrolling.ts +64 -0
  16. package/templates/tiptap/hooks/use-throttled-callback.ts +146 -0
  17. package/templates/tiptap/hooks/use-tiptap-editor.ts +46 -0
  18. package/templates/tiptap/hooks/use-unmount.ts +21 -0
  19. package/templates/tiptap/hooks/use-window-size.ts +87 -0
  20. package/templates/tiptap/lib/tiptap-utils.ts +587 -0
  21. package/templates/tiptap/styles/_keyframe-animations.scss +91 -0
  22. package/templates/tiptap/styles/_variables.scss +296 -0
  23. package/templates/tiptap/tiptap-extension/node-background-extension.ts +138 -0
  24. package/templates/tiptap/tiptap-icons/align-center-icon.tsx +38 -0
  25. package/templates/tiptap/tiptap-icons/align-justify-icon.tsx +38 -0
  26. package/templates/tiptap/tiptap-icons/align-left-icon.tsx +38 -0
  27. package/templates/tiptap/tiptap-icons/align-right-icon.tsx +38 -0
  28. package/templates/tiptap/tiptap-icons/arrow-left-icon.tsx +24 -0
  29. package/templates/tiptap/tiptap-icons/ban-icon.tsx +26 -0
  30. package/templates/tiptap/tiptap-icons/blockquote-icon.tsx +44 -0
  31. package/templates/tiptap/tiptap-icons/bold-icon.tsx +26 -0
  32. package/templates/tiptap/tiptap-icons/chevron-down-icon.tsx +26 -0
  33. package/templates/tiptap/tiptap-icons/close-icon.tsx +24 -0
  34. package/templates/tiptap/tiptap-icons/code-block-icon.tsx +38 -0
  35. package/templates/tiptap/tiptap-icons/code2-icon.tsx +32 -0
  36. package/templates/tiptap/tiptap-icons/corner-down-left-icon.tsx +26 -0
  37. package/templates/tiptap/tiptap-icons/external-link-icon.tsx +28 -0
  38. package/templates/tiptap/tiptap-icons/heading-five-icon.tsx +28 -0
  39. package/templates/tiptap/tiptap-icons/heading-four-icon.tsx +28 -0
  40. package/templates/tiptap/tiptap-icons/heading-icon.tsx +24 -0
  41. package/templates/tiptap/tiptap-icons/heading-one-icon.tsx +28 -0
  42. package/templates/tiptap/tiptap-icons/heading-six-icon.tsx +30 -0
  43. package/templates/tiptap/tiptap-icons/heading-three-icon.tsx +36 -0
  44. package/templates/tiptap/tiptap-icons/heading-two-icon.tsx +28 -0
  45. package/templates/tiptap/tiptap-icons/highlighter-icon.tsx +26 -0
  46. package/templates/tiptap/tiptap-icons/image-plus-icon.tsx +26 -0
  47. package/templates/tiptap/tiptap-icons/italic-icon.tsx +24 -0
  48. package/templates/tiptap/tiptap-icons/link-icon.tsx +28 -0
  49. package/templates/tiptap/tiptap-icons/list-icon.tsx +56 -0
  50. package/templates/tiptap/tiptap-icons/list-ordered-icon.tsx +56 -0
  51. package/templates/tiptap/tiptap-icons/list-todo-icon.tsx +50 -0
  52. package/templates/tiptap/tiptap-icons/moon-star-icon.tsx +30 -0
  53. package/templates/tiptap/tiptap-icons/redo2-icon.tsx +26 -0
  54. package/templates/tiptap/tiptap-icons/strike-icon.tsx +28 -0
  55. package/templates/tiptap/tiptap-icons/subscript-icon.tsx +38 -0
  56. package/templates/tiptap/tiptap-icons/sun-icon.tsx +58 -0
  57. package/templates/tiptap/tiptap-icons/superscript-icon.tsx +38 -0
  58. package/templates/tiptap/tiptap-icons/trash-icon.tsx +26 -0
  59. package/templates/tiptap/tiptap-icons/underline-icon.tsx +26 -0
  60. package/templates/tiptap/tiptap-icons/undo2-icon.tsx +26 -0
  61. package/templates/tiptap/tiptap-node/blockquote-node/blockquote-node.scss +37 -0
  62. package/templates/tiptap/tiptap-node/code-block-node/code-block-node.scss +54 -0
  63. package/templates/tiptap/tiptap-node/heading-node/heading-node.scss +45 -0
  64. package/templates/tiptap/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.ts +10 -0
  65. package/templates/tiptap/tiptap-node/horizontal-rule-node/horizontal-rule-node.scss +25 -0
  66. package/templates/tiptap/tiptap-node/image-node/image-node.scss +35 -0
  67. package/templates/tiptap/tiptap-node/image-upload-node/image-upload-node-extension.ts +154 -0
  68. package/templates/tiptap/tiptap-node/image-upload-node/image-upload-node.scss +249 -0
  69. package/templates/tiptap/tiptap-node/image-upload-node/image-upload-node.tsx +522 -0
  70. package/templates/tiptap/tiptap-node/image-upload-node/index.tsx +1 -0
  71. package/templates/tiptap/tiptap-node/list-node/list-node.scss +208 -0
  72. package/templates/tiptap/tiptap-node/paragraph-node/paragraph-node.scss +273 -0
  73. package/templates/tiptap/tiptap-ui/blockquote-button/blockquote-button.tsx +104 -0
  74. package/templates/tiptap/tiptap-ui/blockquote-button/index.tsx +2 -0
  75. package/templates/tiptap/tiptap-ui/blockquote-button/use-blockquote.ts +252 -0
  76. package/templates/tiptap/tiptap-ui/code-block-button/code-block-button.tsx +106 -0
  77. package/templates/tiptap/tiptap-ui/code-block-button/index.tsx +2 -0
  78. package/templates/tiptap/tiptap-ui/code-block-button/use-code-block.ts +261 -0
  79. package/templates/tiptap/tiptap-ui/color-highlight-button/color-highlight-button.scss +49 -0
  80. package/templates/tiptap/tiptap-ui/color-highlight-button/color-highlight-button.tsx +153 -0
  81. package/templates/tiptap/tiptap-ui/color-highlight-button/index.tsx +2 -0
  82. package/templates/tiptap/tiptap-ui/color-highlight-button/use-color-highlight.ts +345 -0
  83. package/templates/tiptap/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx +207 -0
  84. package/templates/tiptap/tiptap-ui/color-highlight-popover/index.tsx +1 -0
  85. package/templates/tiptap/tiptap-ui/heading-button/heading-button.tsx +107 -0
  86. package/templates/tiptap/tiptap-ui/heading-button/index.tsx +2 -0
  87. package/templates/tiptap/tiptap-ui/heading-button/use-heading.ts +314 -0
  88. package/templates/tiptap/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx +131 -0
  89. package/templates/tiptap/tiptap-ui/heading-dropdown-menu/index.tsx +2 -0
  90. package/templates/tiptap/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.ts +130 -0
  91. package/templates/tiptap/tiptap-ui/image-upload-button/image-upload-button.tsx +114 -0
  92. package/templates/tiptap/tiptap-ui/image-upload-button/index.tsx +2 -0
  93. package/templates/tiptap/tiptap-ui/image-upload-button/use-image-upload.ts +192 -0
  94. package/templates/tiptap/tiptap-ui/link-popover/index.tsx +2 -0
  95. package/templates/tiptap/tiptap-ui/link-popover/link-popover.tsx +285 -0
  96. package/templates/tiptap/tiptap-ui/link-popover/use-link-popover.ts +286 -0
  97. package/templates/tiptap/tiptap-ui/list-button/index.tsx +2 -0
  98. package/templates/tiptap/tiptap-ui/list-button/list-button.tsx +108 -0
  99. package/templates/tiptap/tiptap-ui/list-button/use-list.ts +329 -0
  100. package/templates/tiptap/tiptap-ui/list-dropdown-menu/index.tsx +1 -0
  101. package/templates/tiptap/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx +123 -0
  102. package/templates/tiptap/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.ts +203 -0
  103. package/templates/tiptap/tiptap-ui/mark-button/index.tsx +2 -0
  104. package/templates/tiptap/tiptap-ui/mark-button/mark-button.tsx +107 -0
  105. package/templates/tiptap/tiptap-ui/mark-button/use-mark.ts +206 -0
  106. package/templates/tiptap/tiptap-ui/text-align-button/index.tsx +2 -0
  107. package/templates/tiptap/tiptap-ui/text-align-button/text-align-button.tsx +118 -0
  108. package/templates/tiptap/tiptap-ui/text-align-button/use-text-align.ts +212 -0
  109. package/templates/tiptap/tiptap-ui/undo-redo-button/index.tsx +2 -0
  110. package/templates/tiptap/tiptap-ui/undo-redo-button/undo-redo-button.tsx +105 -0
  111. package/templates/tiptap/tiptap-ui/undo-redo-button/use-undo-redo.ts +173 -0
  112. package/templates/tiptap/tiptap-ui-primitive/badge/badge-colors.scss +395 -0
  113. package/templates/tiptap/tiptap-ui-primitive/badge/badge-group.scss +16 -0
  114. package/templates/tiptap/tiptap-ui-primitive/badge/badge.scss +99 -0
  115. package/templates/tiptap/tiptap-ui-primitive/badge/badge.tsx +46 -0
  116. package/templates/tiptap/tiptap-ui-primitive/badge/index.tsx +1 -0
  117. package/templates/tiptap/tiptap-ui-primitive/button/button-colors.scss +429 -0
  118. package/templates/tiptap/tiptap-ui-primitive/button/button-group.scss +22 -0
  119. package/templates/tiptap/tiptap-ui-primitive/button/button.scss +314 -0
  120. package/templates/tiptap/tiptap-ui-primitive/button/button.tsx +102 -0
  121. package/templates/tiptap/tiptap-ui-primitive/button/index.tsx +1 -0
  122. package/templates/tiptap/tiptap-ui-primitive/card/card.scss +77 -0
  123. package/templates/tiptap/tiptap-ui-primitive/card/card.tsx +59 -0
  124. package/templates/tiptap/tiptap-ui-primitive/card/index.tsx +1 -0
  125. package/templates/tiptap/tiptap-ui-primitive/dropdown-menu/dropdown-menu.scss +63 -0
  126. package/templates/tiptap/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx +95 -0
  127. package/templates/tiptap/tiptap-ui-primitive/dropdown-menu/index.tsx +1 -0
  128. package/templates/tiptap/tiptap-ui-primitive/input/index.tsx +1 -0
  129. package/templates/tiptap/tiptap-ui-primitive/input/input.scss +45 -0
  130. package/templates/tiptap/tiptap-ui-primitive/input/input.tsx +18 -0
  131. package/templates/tiptap/tiptap-ui-primitive/popover/index.tsx +1 -0
  132. package/templates/tiptap/tiptap-ui-primitive/popover/popover.scss +63 -0
  133. package/templates/tiptap/tiptap-ui-primitive/popover/popover.tsx +33 -0
  134. package/templates/tiptap/tiptap-ui-primitive/separator/index.tsx +1 -0
  135. package/templates/tiptap/tiptap-ui-primitive/separator/separator.scss +23 -0
  136. package/templates/tiptap/tiptap-ui-primitive/separator/separator.tsx +33 -0
  137. package/templates/tiptap/tiptap-ui-primitive/spacer/index.tsx +1 -0
  138. package/templates/tiptap/tiptap-ui-primitive/spacer/spacer.tsx +21 -0
  139. package/templates/tiptap/tiptap-ui-primitive/toolbar/index.tsx +1 -0
  140. package/templates/tiptap/tiptap-ui-primitive/toolbar/toolbar.scss +98 -0
  141. package/templates/tiptap/tiptap-ui-primitive/toolbar/toolbar.tsx +113 -0
  142. package/templates/tiptap/tiptap-ui-primitive/tooltip/index.tsx +1 -0
  143. package/templates/tiptap/tiptap-ui-primitive/tooltip/tooltip.scss +43 -0
  144. package/templates/tiptap/tiptap-ui-primitive/tooltip/tooltip.tsx +223 -0
  145. package/templates/ui/accordion.tsx +52 -0
  146. package/templates/ui/alert-dialog.tsx +116 -0
  147. package/templates/ui/alert.tsx +48 -0
  148. package/templates/ui/aspect-ratio.tsx +7 -0
  149. package/templates/ui/avatar.tsx +46 -0
  150. package/templates/ui/badge.tsx +32 -0
  151. package/templates/ui/breadcrumb.tsx +98 -0
  152. package/templates/ui/button-group.tsx +77 -0
  153. package/templates/ui/button.tsx +48 -0
  154. package/templates/ui/calendar.tsx +176 -0
  155. package/templates/ui/card.tsx +54 -0
  156. package/templates/ui/carousel.tsx +234 -0
  157. package/templates/ui/chart.tsx +349 -0
  158. package/templates/ui/checkbox.tsx +27 -0
  159. package/templates/ui/collapsible.tsx +11 -0
  160. package/templates/ui/command.tsx +142 -0
  161. package/templates/ui/context-menu.tsx +188 -0
  162. package/templates/ui/curriculum-editor.tsx +601 -0
  163. package/templates/ui/date-picker.tsx +70 -0
  164. package/templates/ui/dialog.tsx +103 -0
  165. package/templates/ui/drawer.tsx +99 -0
  166. package/templates/ui/dropdown-menu.tsx +185 -0
  167. package/templates/ui/dynamic-list-field.tsx +95 -0
  168. package/templates/ui/empty.tsx +90 -0
  169. package/templates/ui/field.tsx +231 -0
  170. package/templates/ui/file-upload-example.tsx +113 -0
  171. package/templates/ui/form.tsx +172 -0
  172. package/templates/ui/hover-card.tsx +28 -0
  173. package/templates/ui/icon-picker.tsx +435 -0
  174. package/templates/ui/icons-data.ts +6 -0
  175. package/templates/ui/image-upload-field.tsx +360 -0
  176. package/templates/ui/input-group.tsx +160 -0
  177. package/templates/ui/input-otp.tsx +70 -0
  178. package/templates/ui/input.tsx +21 -0
  179. package/templates/ui/item.tsx +171 -0
  180. package/templates/ui/kbd.tsx +28 -0
  181. package/templates/ui/label.tsx +20 -0
  182. package/templates/ui/logo.tsx +113 -0
  183. package/templates/ui/markdown-editor.tsx +303 -0
  184. package/templates/ui/markdown-utils.ts +128 -0
  185. package/templates/ui/media-upload-field.tsx +255 -0
  186. package/templates/ui/menubar.tsx +230 -0
  187. package/templates/ui/navigation-menu.tsx +119 -0
  188. package/templates/ui/pagination.tsx +96 -0
  189. package/templates/ui/placeholder.tsx +25 -0
  190. package/templates/ui/popover.tsx +32 -0
  191. package/templates/ui/progress.tsx +24 -0
  192. package/templates/ui/radio-group.tsx +37 -0
  193. package/templates/ui/resizable.tsx +41 -0
  194. package/templates/ui/rich-text-editor.tsx +374 -0
  195. package/templates/ui/scroll-area.tsx +45 -0
  196. package/templates/ui/select.tsx +151 -0
  197. package/templates/ui/separator.tsx +25 -0
  198. package/templates/ui/sheet.tsx +120 -0
  199. package/templates/ui/sidebar.tsx +684 -0
  200. package/templates/ui/skeleton.tsx +7 -0
  201. package/templates/ui/slider.tsx +24 -0
  202. package/templates/ui/sonner.tsx +29 -0
  203. package/templates/ui/spinner.tsx +15 -0
  204. package/templates/ui/switch.tsx +28 -0
  205. package/templates/ui/table.tsx +93 -0
  206. package/templates/ui/tabs.tsx +54 -0
  207. package/templates/ui/textarea.tsx +20 -0
  208. package/templates/ui/toast.tsx +127 -0
  209. package/templates/ui/toggle-group.tsx +56 -0
  210. package/templates/ui/toggle.tsx +43 -0
  211. package/templates/ui/tooltip.tsx +31 -0
  212. package/templates/ui/use-mobile.tsx +19 -0
  213. package/templates/ui/video-upload-field.tsx +368 -0
  214. package/dist/chunk-G4KI4DVB.js +0 -179
  215. package/dist/chunk-G4KI4DVB.js.map +0 -1
  216. package/dist/chunk-NKRQYAS6.js +0 -260
  217. package/dist/chunk-NKRQYAS6.js.map +0 -1
  218. package/dist/chunk-QLVSHP7X.js +0 -235
  219. package/dist/chunk-QLVSHP7X.js.map +0 -1
  220. package/dist/chunk-WY6BC55D.js +0 -357
  221. package/dist/chunk-WY6BC55D.js.map +0 -1
  222. package/dist/config/index.d.ts +0 -93
  223. package/dist/config/index.js +0 -58
  224. package/dist/config/index.js.map +0 -1
  225. package/dist/core/index.d.ts +0 -415
  226. package/dist/core/index.js +0 -906
  227. package/dist/core/index.js.map +0 -1
  228. package/dist/import-resolver-BaZ-rzkH.d.ts +0 -123
  229. package/dist/logger-awLb347n.d.ts +0 -81
  230. package/dist/plugins/index.d.ts +0 -213
  231. package/dist/plugins/index.js +0 -365
  232. package/dist/plugins/index.js.map +0 -1
  233. package/dist/types-ByX_gl6y.d.ts +0 -232
  234. package/dist/types-eI549DEG.d.ts +0 -331
@@ -1,331 +0,0 @@
1
- import { a as Logger } from './logger-awLb347n.js';
2
-
3
- /**
4
- * Configuration types for the @betterstart/cli package
5
- * Defines the configuration schema for project setup and generation
6
- */
7
- /**
8
- * Output path configuration for generated files
9
- */
10
- interface OutputPaths {
11
- /** Where to generate server actions (relative to lib path) */
12
- actions: string;
13
- /** Where to generate React Query hooks (relative to hooks path) */
14
- hooks: string;
15
- /** Where to generate UI components (relative to app path) */
16
- components: string;
17
- /** Where to generate admin pages (relative to app path) */
18
- pages: string;
19
- /** Where to generate email templates (relative to app path) */
20
- emails: string;
21
- }
22
- /**
23
- * Project structure paths configuration
24
- */
25
- interface ProjectPaths {
26
- /** Main app directory (e.g., 'apps/web', 'src', '.') */
27
- app: string;
28
- /** Database package directory (e.g., 'packages/database', 'src/db') */
29
- database: string;
30
- /** Lib package directory (e.g., 'packages/lib', 'src/lib') */
31
- lib: string;
32
- /** Hooks package directory (e.g., 'packages/hooks', 'src/hooks') */
33
- hooks: string;
34
- /** Schemas directory (e.g., 'schemas', 'src/schemas') */
35
- schemas: string;
36
- /** Output paths for generated files */
37
- output: OutputPaths;
38
- }
39
- /**
40
- * Supported database providers
41
- */
42
- type DatabaseProvider = 'drizzle';
43
- /**
44
- * Database configuration
45
- */
46
- interface DatabaseConfig {
47
- /** Database ORM provider (currently only 'drizzle' is supported) */
48
- provider: DatabaseProvider;
49
- /** Path to the schema file relative to database directory */
50
- schemaFile: string;
51
- /** Path to migrations directory relative to database directory */
52
- migrationsDir: string;
53
- /** Whether to auto-run migrations after generation */
54
- autoMigrate: boolean;
55
- }
56
- /**
57
- * Supported UI frameworks
58
- */
59
- type UIFramework = 'shadcn';
60
- /**
61
- * UI framework configuration
62
- */
63
- interface UIConfig {
64
- /** UI component framework (currently only 'shadcn' is supported) */
65
- framework: UIFramework;
66
- /** Component library configuration */
67
- components: {
68
- /** Import path for UI components (e.g., '@/components/ui', '@betterstart/admin-ui') */
69
- path: string;
70
- /** Import path for admin components (e.g., '@/components/admin', '@betterstart/admin-ui') */
71
- adminPath: string;
72
- };
73
- }
74
- /**
75
- * Generator configuration
76
- */
77
- interface GeneratorConfig {
78
- /** Core generators that are always included */
79
- core: string[];
80
- /** Optional generators that can be enabled */
81
- optional: string[];
82
- }
83
- /**
84
- * Generator names type (for convenience)
85
- */
86
- type GeneratorName = string;
87
- /**
88
- * Plugin lifecycle hooks
89
- */
90
- interface PluginHooks {
91
- /** Called when plugin is initialized */
92
- onInit?: (context: PluginContext) => Promise<void>;
93
- /** Called before generation starts */
94
- onBeforeGenerate?: (context: PluginContext, schema: unknown) => Promise<void>;
95
- /** Called after generation completes */
96
- onAfterGenerate?: (context: PluginContext, files: GeneratedFile[]) => Promise<void>;
97
- }
98
- /**
99
- * Plugin context passed to lifecycle hooks
100
- */
101
- interface PluginContext {
102
- /** The resolved configuration */
103
- config: BetterstartConfig;
104
- /** Resolved paths */
105
- paths: ResolvedPaths;
106
- /** Logger instance */
107
- logger: Logger;
108
- }
109
- /**
110
- * Generated file metadata
111
- */
112
- interface GeneratedFile {
113
- /** Absolute path to the generated file */
114
- path: string;
115
- /** Type of file generated */
116
- type: 'action' | 'hook' | 'component' | 'page' | 'database' | 'migration' | 'navigation' | 'other';
117
- /** Whether the file was created or updated */
118
- operation: 'created' | 'updated' | 'skipped';
119
- }
120
- /**
121
- * Custom field type handler for plugins
122
- */
123
- interface FieldTypeHandler {
124
- /** Generate Zod validation type */
125
- zodType: (field: unknown) => string;
126
- /** Generate Drizzle column type */
127
- drizzleType: (field: unknown, imports: Set<string>) => string;
128
- /** Generate TypeScript type */
129
- typescriptType: (field: unknown, mode: 'input' | 'output') => string;
130
- /** Generate form component */
131
- formComponent?: (field: unknown) => string;
132
- }
133
- /**
134
- * Custom generator for plugins
135
- */
136
- interface CustomGenerator {
137
- /** Generator name */
138
- name: string;
139
- /** Generator description */
140
- description: string;
141
- /** Generator function */
142
- generate: (context: PluginContext, schema: unknown) => Promise<GeneratedFile[]>;
143
- }
144
- /**
145
- * CLI command for plugins
146
- */
147
- interface PluginCommand {
148
- /** Command name */
149
- name: string;
150
- /** Command description */
151
- description: string;
152
- /** Command options */
153
- options?: Array<{
154
- flags: string;
155
- description: string;
156
- default?: unknown;
157
- }>;
158
- /** Command handler */
159
- handler: (options: Record<string, unknown>) => Promise<void>;
160
- }
161
- /**
162
- * Plugin definition
163
- */
164
- interface BetterstartPlugin {
165
- /** Plugin name */
166
- name: string;
167
- /** Plugin version */
168
- version: string;
169
- /** Plugin description */
170
- description?: string;
171
- /** Lifecycle hooks */
172
- hooks?: PluginHooks;
173
- /** Custom generators provided by this plugin */
174
- generators?: Record<string, CustomGenerator>;
175
- /** Custom field types provided by this plugin */
176
- fieldTypes?: Record<string, FieldTypeHandler>;
177
- /** CLI commands provided by this plugin */
178
- commands?: PluginCommand[];
179
- }
180
- /**
181
- * Import path mappings for generated code.
182
- * These control the `from '...'` part of import statements
183
- * in all generated TypeScript/React files.
184
- */
185
- interface ImportPaths {
186
- /** Database package import path (e.g., '@betterstart/database', '@/lib/db') */
187
- database: string;
188
- /** Admin UI components import path (e.g., '@betterstart/admin-ui', '@/components/ui') */
189
- adminUi: string;
190
- /** Public/web UI components import path (e.g., '@betterstart/web-ui', '@/components/ui') */
191
- webUi: string;
192
- /** Hooks package import path (e.g., '@betterstart/hooks', '@/hooks') */
193
- hooks: string;
194
- /** Utils package import path (e.g., '@betterstart/utils', '@/lib/utils') */
195
- utils: string;
196
- /** Types package import path (e.g., '@betterstart/types', '@/types') */
197
- types: string;
198
- /** Lib package base import path (e.g., '@betterstart/lib', '@/lib') */
199
- lib: string;
200
- /**
201
- * Pattern for action imports. Use `{name}` as placeholder for the schema name.
202
- * @example '@betterstart/lib/actions/{name}' (monorepo)
203
- * @example '@/lib/actions/{name}' (standalone)
204
- */
205
- actions: string;
206
- /** Lib markdown sub-module import path (e.g., '@betterstart/lib/markdown', '@/lib/markdown') */
207
- libMarkdown: string;
208
- }
209
- /**
210
- * Main configuration for @betterstart/cli
211
- */
212
- interface BetterstartConfig {
213
- /** Project structure paths */
214
- paths: ProjectPaths;
215
- /** Import path mappings for generated code */
216
- imports: ImportPaths;
217
- /** Database configuration */
218
- database: DatabaseConfig;
219
- /** UI framework configuration */
220
- ui: UIConfig;
221
- /** Generator configuration */
222
- generators: GeneratorConfig;
223
- /** Registered plugins */
224
- plugins: BetterstartPlugin[];
225
- }
226
- /**
227
- * Partial configuration for user-provided config files
228
- * All fields are optional and will be merged with defaults
229
- */
230
- type UserConfig = DeepPartial<BetterstartConfig>;
231
- /**
232
- * Deep partial type utility
233
- */
234
- type DeepPartial<T> = {
235
- [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
236
- };
237
- /**
238
- * Resolved paths with absolute paths
239
- */
240
- interface ResolvedPaths {
241
- /** Project root directory (absolute) */
242
- root: string;
243
- /** Main app directory (absolute) */
244
- app: string;
245
- /** Database package directory (absolute) */
246
- database: string;
247
- /** Lib package directory (absolute) */
248
- lib: string;
249
- /** Hooks package directory (absolute) */
250
- hooks: string;
251
- /** Schemas directory (absolute) */
252
- schemas: string;
253
- /** Output paths for generated files (absolute) */
254
- output: {
255
- actions: string;
256
- hooks: string;
257
- components: string;
258
- pages: string;
259
- emails: string;
260
- };
261
- }
262
- /**
263
- * Fully resolved configuration with absolute paths
264
- */
265
- interface ResolvedConfig extends Omit<BetterstartConfig, 'paths'> {
266
- /** Resolved paths with absolute paths */
267
- paths: ResolvedPaths;
268
- }
269
- /**
270
- * Project type detection result
271
- */
272
- type ProjectType = 'nextjs-monorepo' | 'nextjs-standalone' | 'custom' | 'unknown';
273
- /**
274
- * Preset configuration
275
- */
276
- interface Preset {
277
- /** Preset name */
278
- name: string;
279
- /** Preset description */
280
- description: string;
281
- /** Detect if this preset applies to the current project */
282
- detect?: (cwd: string) => boolean | Promise<boolean>;
283
- /** Configuration for this preset */
284
- config: UserConfig;
285
- }
286
- /**
287
- * Options passed to generators
288
- */
289
- interface GeneratorOptions {
290
- /** Skip database migration */
291
- skipMigration?: boolean;
292
- /** Number of dummy records to generate */
293
- dummyCount?: number;
294
- /** Force overwrite existing files */
295
- force?: boolean;
296
- /** Specific generators to run (overrides config) */
297
- generators?: GeneratorName[];
298
- /** Project root override */
299
- projectRoot?: string;
300
- }
301
- /**
302
- * CLI init command options
303
- */
304
- interface InitOptions {
305
- /** Preset to use */
306
- preset?: string;
307
- /** Skip interactive prompts */
308
- yes?: boolean;
309
- /** Project root path */
310
- cwd?: string;
311
- }
312
- /**
313
- * CLI generate command options
314
- */
315
- interface GenerateOptions extends GeneratorOptions {
316
- /** Schema name to generate */
317
- schemaName: string;
318
- }
319
- /**
320
- * CLI remove command options
321
- */
322
- interface RemoveOptions {
323
- /** Schema name to remove */
324
- schemaName: string;
325
- /** Skip confirmation prompt */
326
- force?: boolean;
327
- /** Project root path */
328
- projectRoot?: string;
329
- }
330
-
331
- export type { BetterstartConfig as B, CustomGenerator as C, DatabaseProvider as D, FieldTypeHandler as F, GeneratorConfig as G, ImportPaths as I, OutputPaths as O, Preset as P, ResolvedPaths as R, UserConfig as U, ProjectPaths as a, DatabaseConfig as b, UIFramework as c, UIConfig as d, GeneratorName as e, PluginHooks as f, PluginContext as g, GeneratedFile as h, PluginCommand as i, BetterstartPlugin as j, DeepPartial as k, ResolvedConfig as l, ProjectType as m, GeneratorOptions as n, InitOptions as o, GenerateOptions as p, RemoveOptions as q };