@tpitre/story-ui 3.3.0 → 3.4.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 (281) hide show
  1. package/dist/cli/index.js +0 -0
  2. package/dist/cli/index.js.map +1 -0
  3. package/dist/cli/setup.js.map +1 -0
  4. package/dist/cloudflare-edge/src/mcp-session.js +462 -0
  5. package/dist/cloudflare-edge/src/types.js +4 -0
  6. package/dist/cloudflare-edge/src/worker.js +106 -0
  7. package/dist/cloudflare-pages/vite.config.js +14 -0
  8. package/dist/index.d.ts +13 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +12 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/mcp-server/index.js.map +1 -0
  13. package/dist/mcp-server/mcp-stdio-server.js.map +1 -0
  14. package/dist/mcp-server/routes/claude.js.map +1 -0
  15. package/dist/mcp-server/routes/components.js.map +1 -0
  16. package/dist/mcp-server/routes/generateStory.js.map +1 -0
  17. package/dist/mcp-server/routes/hybridStories.d.ts +18 -0
  18. package/dist/mcp-server/routes/hybridStories.d.ts.map +1 -0
  19. package/dist/mcp-server/routes/hybridStories.js +216 -0
  20. package/dist/mcp-server/routes/hybridStories.js.map +1 -0
  21. package/dist/mcp-server/routes/memoryStories.d.ts +26 -0
  22. package/dist/mcp-server/routes/memoryStories.d.ts.map +1 -0
  23. package/dist/mcp-server/routes/memoryStories.js +158 -0
  24. package/dist/mcp-server/routes/memoryStories.js.map +1 -0
  25. package/dist/mcp-server/routes/storySync.d.ts +26 -0
  26. package/dist/mcp-server/routes/storySync.d.ts.map +1 -0
  27. package/dist/mcp-server/routes/storySync.js +147 -0
  28. package/dist/mcp-server/routes/storySync.js.map +1 -0
  29. package/dist/mcp-server/routes/updateStory.js +246 -0
  30. package/dist/mcp-server/sessionManager.d.ts +50 -0
  31. package/dist/mcp-server/sessionManager.d.ts.map +1 -0
  32. package/dist/mcp-server/sessionManager.js +125 -0
  33. package/dist/mcp-server/sessionManager.js.map +1 -0
  34. package/dist/playground/components/AIAssistant/AIAssistant.d.ts +6 -0
  35. package/dist/playground/components/AIAssistant/AIAssistant.d.ts.map +1 -0
  36. package/dist/playground/components/AIAssistant/AIAssistant.js +109 -0
  37. package/dist/playground/components/AIAssistant/AIAssistant.js.map +1 -0
  38. package/dist/playground/components/AIAssistant/AIAssistant.module.css +166 -0
  39. package/dist/playground/components/Canvas/Canvas.d.ts +9 -0
  40. package/dist/playground/components/Canvas/Canvas.d.ts.map +1 -0
  41. package/dist/playground/components/Canvas/Canvas.js +58 -0
  42. package/dist/playground/components/Canvas/Canvas.js.map +1 -0
  43. package/dist/playground/components/Canvas/Canvas.module.css +189 -0
  44. package/dist/playground/components/Canvas/CanvasWithDnd.d.ts +9 -0
  45. package/dist/playground/components/Canvas/CanvasWithDnd.d.ts.map +1 -0
  46. package/dist/playground/components/Canvas/CanvasWithDnd.js +158 -0
  47. package/dist/playground/components/Canvas/CanvasWithDnd.js.map +1 -0
  48. package/dist/playground/components/Canvas/ComponentRenderer.d.ts +15 -0
  49. package/dist/playground/components/Canvas/ComponentRenderer.d.ts.map +1 -0
  50. package/dist/playground/components/Canvas/ComponentRenderer.js +177 -0
  51. package/dist/playground/components/Canvas/ComponentRenderer.js.map +1 -0
  52. package/dist/playground/components/Canvas/DraggableComponent.d.ts +15 -0
  53. package/dist/playground/components/Canvas/DraggableComponent.d.ts.map +1 -0
  54. package/dist/playground/components/Canvas/DraggableComponent.js +49 -0
  55. package/dist/playground/components/Canvas/DraggableComponent.js.map +1 -0
  56. package/dist/playground/components/Canvas/index.d.ts +9 -0
  57. package/dist/playground/components/Canvas/index.d.ts.map +1 -0
  58. package/dist/playground/components/Canvas/index.js +5 -0
  59. package/dist/playground/components/Canvas/index.js.map +1 -0
  60. package/dist/playground/components/CodeView/CodeView.d.ts +12 -0
  61. package/dist/playground/components/CodeView/CodeView.d.ts.map +1 -0
  62. package/dist/playground/components/CodeView/CodeView.js +77 -0
  63. package/dist/playground/components/CodeView/CodeView.js.map +1 -0
  64. package/dist/playground/components/CodeView/CodeView.module.css +178 -0
  65. package/dist/playground/components/ComponentPalette/ComponentPalette.d.ts +17 -0
  66. package/dist/playground/components/ComponentPalette/ComponentPalette.d.ts.map +1 -0
  67. package/dist/playground/components/ComponentPalette/ComponentPalette.js +138 -0
  68. package/dist/playground/components/ComponentPalette/ComponentPalette.js.map +1 -0
  69. package/dist/playground/components/ComponentPalette/ComponentPalette.module.css +217 -0
  70. package/dist/playground/components/ComponentPalette/index.d.ts +3 -0
  71. package/dist/playground/components/ComponentPalette/index.d.ts.map +1 -0
  72. package/dist/playground/components/ComponentPalette/index.js +2 -0
  73. package/dist/playground/components/ComponentPalette/index.js.map +1 -0
  74. package/dist/playground/components/DropZone/DropZone.d.ts +17 -0
  75. package/dist/playground/components/DropZone/DropZone.d.ts.map +1 -0
  76. package/dist/playground/components/DropZone/DropZone.js +73 -0
  77. package/dist/playground/components/DropZone/DropZone.js.map +1 -0
  78. package/dist/playground/components/DropZone/DropZone.module.css +86 -0
  79. package/dist/playground/components/ExportDialog/ExportDialog.d.ts +10 -0
  80. package/dist/playground/components/ExportDialog/ExportDialog.d.ts.map +1 -0
  81. package/dist/playground/components/ExportDialog/ExportDialog.js +57 -0
  82. package/dist/playground/components/ExportDialog/ExportDialog.js.map +1 -0
  83. package/dist/playground/components/ExportDialog/ExportDialog.module.css +328 -0
  84. package/dist/playground/components/LayoutHelpers/LayoutHelpers.d.ts +134 -0
  85. package/dist/playground/components/LayoutHelpers/LayoutHelpers.d.ts.map +1 -0
  86. package/dist/playground/components/LayoutHelpers/LayoutHelpers.js +254 -0
  87. package/dist/playground/components/LayoutHelpers/LayoutHelpers.js.map +1 -0
  88. package/dist/playground/components/LayoutHelpers/index.d.ts +3 -0
  89. package/dist/playground/components/LayoutHelpers/index.d.ts.map +1 -0
  90. package/dist/playground/components/LayoutHelpers/index.js +2 -0
  91. package/dist/playground/components/LayoutHelpers/index.js.map +1 -0
  92. package/dist/playground/components/Playground/Playground.d.ts +10 -0
  93. package/dist/playground/components/Playground/Playground.d.ts.map +1 -0
  94. package/dist/playground/components/Playground/Playground.js +128 -0
  95. package/dist/playground/components/Playground/Playground.js.map +1 -0
  96. package/dist/playground/components/Playground/Playground.module.css +308 -0
  97. package/dist/playground/components/PropertiesPanel/PropertiesPanel.d.ts +10 -0
  98. package/dist/playground/components/PropertiesPanel/PropertiesPanel.d.ts.map +1 -0
  99. package/dist/playground/components/PropertiesPanel/PropertiesPanel.js +150 -0
  100. package/dist/playground/components/PropertiesPanel/PropertiesPanel.js.map +1 -0
  101. package/dist/playground/components/PropertiesPanel/PropertiesPanel.module.css +155 -0
  102. package/dist/playground/components/PropertiesPanel/index.d.ts +3 -0
  103. package/dist/playground/components/PropertiesPanel/index.d.ts.map +1 -0
  104. package/dist/playground/components/PropertiesPanel/index.js +2 -0
  105. package/dist/playground/components/PropertiesPanel/index.js.map +1 -0
  106. package/dist/playground/components/PropertyEditors/BooleanEditor.d.ts +12 -0
  107. package/dist/playground/components/PropertyEditors/BooleanEditor.d.ts.map +1 -0
  108. package/dist/playground/components/PropertyEditors/BooleanEditor.js +14 -0
  109. package/dist/playground/components/PropertyEditors/BooleanEditor.js.map +1 -0
  110. package/dist/playground/components/PropertyEditors/ColorEditor.d.ts +12 -0
  111. package/dist/playground/components/PropertyEditors/ColorEditor.d.ts.map +1 -0
  112. package/dist/playground/components/PropertyEditors/ColorEditor.js +62 -0
  113. package/dist/playground/components/PropertyEditors/ColorEditor.js.map +1 -0
  114. package/dist/playground/components/PropertyEditors/IconEditor.d.ts +12 -0
  115. package/dist/playground/components/PropertyEditors/IconEditor.d.ts.map +1 -0
  116. package/dist/playground/components/PropertyEditors/IconEditor.js +123 -0
  117. package/dist/playground/components/PropertyEditors/IconEditor.js.map +1 -0
  118. package/dist/playground/components/PropertyEditors/NumberEditor.d.ts +15 -0
  119. package/dist/playground/components/PropertyEditors/NumberEditor.d.ts.map +1 -0
  120. package/dist/playground/components/PropertyEditors/NumberEditor.js +46 -0
  121. package/dist/playground/components/PropertyEditors/NumberEditor.js.map +1 -0
  122. package/dist/playground/components/PropertyEditors/PropertyEditors.module.css +432 -0
  123. package/dist/playground/components/PropertyEditors/SelectEditor.d.ts +19 -0
  124. package/dist/playground/components/PropertyEditors/SelectEditor.d.ts.map +1 -0
  125. package/dist/playground/components/PropertyEditors/SelectEditor.js +17 -0
  126. package/dist/playground/components/PropertyEditors/SelectEditor.js.map +1 -0
  127. package/dist/playground/components/PropertyEditors/SpacingEditor.d.ts +19 -0
  128. package/dist/playground/components/PropertyEditors/SpacingEditor.d.ts.map +1 -0
  129. package/dist/playground/components/PropertyEditors/SpacingEditor.js +162 -0
  130. package/dist/playground/components/PropertyEditors/SpacingEditor.js.map +1 -0
  131. package/dist/playground/components/PropertyEditors/SpacingEditor.module.css +214 -0
  132. package/dist/playground/components/PropertyEditors/TextEditor.d.ts +14 -0
  133. package/dist/playground/components/PropertyEditors/TextEditor.d.ts.map +1 -0
  134. package/dist/playground/components/PropertyEditors/TextEditor.js +38 -0
  135. package/dist/playground/components/PropertyEditors/TextEditor.js.map +1 -0
  136. package/dist/playground/components/PropertyEditors/TokenEditor.d.ts +23 -0
  137. package/dist/playground/components/PropertyEditors/TokenEditor.d.ts.map +1 -0
  138. package/dist/playground/components/PropertyEditors/TokenEditor.js +50 -0
  139. package/dist/playground/components/PropertyEditors/TokenEditor.js.map +1 -0
  140. package/dist/playground/components/PropertyEditors/index.d.ts +20 -0
  141. package/dist/playground/components/PropertyEditors/index.d.ts.map +1 -0
  142. package/dist/playground/components/PropertyEditors/index.js +12 -0
  143. package/dist/playground/components/PropertyEditors/index.js.map +1 -0
  144. package/dist/playground/components/TreeView/TreeView.d.ts +10 -0
  145. package/dist/playground/components/TreeView/TreeView.d.ts.map +1 -0
  146. package/dist/playground/components/TreeView/TreeView.js +146 -0
  147. package/dist/playground/components/TreeView/TreeView.js.map +1 -0
  148. package/dist/playground/components/TreeView/TreeView.module.css +214 -0
  149. package/dist/playground/components/TreeView/index.d.ts +3 -0
  150. package/dist/playground/components/TreeView/index.d.ts.map +1 -0
  151. package/dist/playground/components/TreeView/index.js +2 -0
  152. package/dist/playground/components/TreeView/index.js.map +1 -0
  153. package/dist/playground/config/propertyDefinitions.d.ts +73 -0
  154. package/dist/playground/config/propertyDefinitions.d.ts.map +1 -0
  155. package/dist/playground/config/propertyDefinitions.js +809 -0
  156. package/dist/playground/config/propertyDefinitions.js.map +1 -0
  157. package/dist/playground/hooks/useKeyboardShortcuts.d.ts +38 -0
  158. package/dist/playground/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  159. package/dist/playground/hooks/useKeyboardShortcuts.js +191 -0
  160. package/dist/playground/hooks/useKeyboardShortcuts.js.map +1 -0
  161. package/dist/playground/index.d.ts +21 -0
  162. package/dist/playground/index.d.ts.map +1 -0
  163. package/dist/playground/index.js +23 -0
  164. package/dist/playground/index.js.map +1 -0
  165. package/dist/playground/services/CodeGenerator.d.ts +73 -0
  166. package/dist/playground/services/CodeGenerator.d.ts.map +1 -0
  167. package/dist/playground/services/CodeGenerator.js +359 -0
  168. package/dist/playground/services/CodeGenerator.js.map +1 -0
  169. package/dist/playground/services/DragDropManager.d.ts +95 -0
  170. package/dist/playground/services/DragDropManager.d.ts.map +1 -0
  171. package/dist/playground/services/DragDropManager.js +408 -0
  172. package/dist/playground/services/DragDropManager.js.map +1 -0
  173. package/dist/playground/services/StoryParser.d.ts +73 -0
  174. package/dist/playground/services/StoryParser.d.ts.map +1 -0
  175. package/dist/playground/services/StoryParser.js +419 -0
  176. package/dist/playground/services/StoryParser.js.map +1 -0
  177. package/dist/playground/store/playgroundStore.d.ts +86 -0
  178. package/dist/playground/store/playgroundStore.d.ts.map +1 -0
  179. package/dist/playground/store/playgroundStore.js +337 -0
  180. package/dist/playground/store/playgroundStore.js.map +1 -0
  181. package/dist/playground/stories/PlaygroundDragDrop.stories.d.ts +13 -0
  182. package/dist/playground/stories/PlaygroundDragDrop.stories.d.ts.map +1 -0
  183. package/dist/playground/stories/PlaygroundDragDrop.stories.js +227 -0
  184. package/dist/playground/stories/PlaygroundDragDrop.stories.js.map +1 -0
  185. package/dist/playground/stories/PlaygroundPhase4.stories.d.ts +13 -0
  186. package/dist/playground/stories/PlaygroundPhase4.stories.d.ts.map +1 -0
  187. package/dist/playground/stories/PlaygroundPhase4.stories.js +334 -0
  188. package/dist/playground/stories/PlaygroundPhase4.stories.js.map +1 -0
  189. package/dist/playground/stories/PlaygroundPhase5.stories.d.ts +14 -0
  190. package/dist/playground/stories/PlaygroundPhase5.stories.d.ts.map +1 -0
  191. package/dist/playground/stories/PlaygroundPhase5.stories.js +512 -0
  192. package/dist/playground/stories/PlaygroundPhase5.stories.js.map +1 -0
  193. package/dist/playground/stories/PlaygroundProperties.stories.d.ts +13 -0
  194. package/dist/playground/stories/PlaygroundProperties.stories.d.ts.map +1 -0
  195. package/dist/playground/stories/PlaygroundProperties.stories.js +342 -0
  196. package/dist/playground/stories/PlaygroundProperties.stories.js.map +1 -0
  197. package/dist/playground/types/index.d.ts +251 -0
  198. package/dist/playground/types/index.d.ts.map +1 -0
  199. package/dist/playground/types/index.js +5 -0
  200. package/dist/playground/types/index.js.map +1 -0
  201. package/dist/scripts/verify-framework-adapters.js +105 -0
  202. package/dist/story-generator/componentBlacklist.js.map +1 -0
  203. package/dist/story-generator/componentDiscovery.js.map +1 -0
  204. package/dist/story-generator/configLoader.js.map +1 -0
  205. package/dist/story-generator/considerationsLoader.js.map +1 -0
  206. package/dist/story-generator/documentation-sources.js.map +1 -0
  207. package/dist/story-generator/documentationLoader.js.map +1 -0
  208. package/dist/story-generator/dynamicPackageDiscovery.js.map +1 -0
  209. package/dist/story-generator/enhancedComponentDiscovery.js.map +1 -0
  210. package/dist/story-generator/generateStory.js.map +1 -0
  211. package/dist/story-generator/gitignoreManager.js.map +1 -0
  212. package/dist/story-generator/inMemoryStoryService.d.ts +89 -0
  213. package/dist/story-generator/inMemoryStoryService.d.ts.map +1 -0
  214. package/dist/story-generator/inMemoryStoryService.js +128 -0
  215. package/dist/story-generator/inMemoryStoryService.js.map +1 -0
  216. package/dist/story-generator/logger.js.map +1 -0
  217. package/dist/story-generator/postProcessStory.js.map +1 -0
  218. package/dist/story-generator/postgresStoryService.d.ts +56 -0
  219. package/dist/story-generator/postgresStoryService.d.ts.map +1 -0
  220. package/dist/story-generator/postgresStoryService.js +240 -0
  221. package/dist/story-generator/productionGitignoreManager.d.ts +91 -0
  222. package/dist/story-generator/productionGitignoreManager.d.ts.map +1 -0
  223. package/dist/story-generator/productionGitignoreManager.js +340 -0
  224. package/dist/story-generator/productionGitignoreManager.js.map +1 -0
  225. package/dist/story-generator/promptGenerator.js.map +1 -0
  226. package/dist/story-generator/providerPresets.d.ts +54 -0
  227. package/dist/story-generator/providerPresets.d.ts.map +1 -0
  228. package/dist/story-generator/providerPresets.js +214 -0
  229. package/dist/story-generator/storyHistory.js.map +1 -0
  230. package/dist/story-generator/storyServiceFactory.d.ts +22 -0
  231. package/dist/story-generator/storyServiceFactory.d.ts.map +1 -0
  232. package/dist/story-generator/storyServiceFactory.js +97 -0
  233. package/dist/story-generator/storyServiceInterface.d.ts +85 -0
  234. package/dist/story-generator/storyServiceInterface.d.ts.map +1 -0
  235. package/dist/story-generator/storyServiceInterface.js +5 -0
  236. package/dist/story-generator/storySync.d.ts +68 -0
  237. package/dist/story-generator/storySync.d.ts.map +1 -0
  238. package/dist/story-generator/storySync.js +201 -0
  239. package/dist/story-generator/storySync.js.map +1 -0
  240. package/dist/story-generator/storyTracker.js.map +1 -0
  241. package/dist/story-generator/storyValidator.js.map +1 -0
  242. package/dist/story-generator/test_validation.d.ts +2 -0
  243. package/dist/story-generator/test_validation.d.ts.map +1 -0
  244. package/dist/story-generator/test_validation.js +51 -0
  245. package/dist/story-generator/universalDesignSystemAdapter.js.map +1 -0
  246. package/dist/story-generator/urlRedirectService.js.map +1 -0
  247. package/dist/story-generator/validateStory.js.map +1 -0
  248. package/dist/story-ui.config.js.map +1 -0
  249. package/dist/story-ui.config.loader.d.ts +36 -0
  250. package/dist/story-ui.config.loader.d.ts.map +1 -0
  251. package/dist/story-ui.config.loader.js +205 -0
  252. package/dist/story-ui.config.loader.js.map +1 -0
  253. package/dist/temp/package/templates/StoryUI/StoryUIPanel.js +807 -0
  254. package/dist/temp/package/templates/StoryUI/StoryUIPanel.stories.js +37 -0
  255. package/dist/temp/package/templates/StoryUI/index.js +2 -0
  256. package/dist/templates/StoryUI/StoryUIPanel.js.map +1 -0
  257. package/dist/templates/StoryUI/StoryUIPanel.stories.js.map +1 -0
  258. package/dist/templates/StoryUI/index.js.map +1 -0
  259. package/dist/templates/StoryUI/manager.d.ts +14 -0
  260. package/dist/templates/StoryUI/manager.d.ts.map +1 -0
  261. package/dist/templates/production-app/src/App.d.ts +10 -0
  262. package/dist/templates/production-app/src/App.d.ts.map +1 -0
  263. package/dist/templates/production-app/src/App.js +653 -0
  264. package/dist/templates/production-app/src/LivePreviewRenderer.d.ts +24 -0
  265. package/dist/templates/production-app/src/LivePreviewRenderer.d.ts.map +1 -0
  266. package/dist/templates/production-app/src/LivePreviewRenderer.js +199 -0
  267. package/dist/templates/production-app/src/componentRegistry.d.ts +20 -0
  268. package/dist/templates/production-app/src/componentRegistry.d.ts.map +1 -0
  269. package/dist/templates/production-app/src/componentRegistry.js +316 -0
  270. package/dist/templates/production-app/src/main.d.ts +9 -0
  271. package/dist/templates/production-app/src/main.d.ts.map +1 -0
  272. package/dist/templates/production-app/src/main.js +18 -0
  273. package/dist/templates/production-app/vite.config.d.ts +3 -0
  274. package/dist/templates/production-app/vite.config.d.ts.map +1 -0
  275. package/dist/templates/production-app/vite.config.js +71 -0
  276. package/dist/test-storybooks/angular-material-storybook/src/main.js +66 -0
  277. package/dist/test-storybooks/chakra-storybook/vite.config.js +6 -0
  278. package/dist/test-storybooks/mantine-storybook/vite.config.js +93 -0
  279. package/dist/test-storybooks/web-components-shoelace/vite.config.js +9 -0
  280. package/dist/tsconfig.tsbuildinfo +1 -0
  281. package/package.json +1 -1
@@ -0,0 +1,340 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { logger } from './logger.js';
4
+ /**
5
+ * Production-ready gitignore manager that handles both development and server environments
6
+ */
7
+ export class ProductionGitignoreManager {
8
+ constructor(config, projectRoot = process.cwd()) {
9
+ this.config = config;
10
+ this.projectRoot = projectRoot;
11
+ this.isProduction = this.detectProductionEnvironment();
12
+ }
13
+ /**
14
+ * Detects if we're running in a production/read-only environment
15
+ */
16
+ detectProductionEnvironment() {
17
+ // Explicit override: Force development mode for file-based story generation
18
+ // Use this on Railway/Render when running Storybook dev mode
19
+ if (process.env.STORY_UI_DEV_MODE === 'true') {
20
+ logger.log('📁 STORY_UI_DEV_MODE=true - forcing file-based story generation');
21
+ return false;
22
+ }
23
+ // Check common production environment indicators
24
+ const prodIndicators = [
25
+ process.env.NODE_ENV === 'production',
26
+ process.env.VERCEL === '1',
27
+ process.env.NETLIFY === 'true',
28
+ process.env.CF_PAGES === '1', // Cloudflare Pages
29
+ process.env.RENDER === 'true',
30
+ process.env.RAILWAY_ENVIRONMENT === 'production',
31
+ // Check if we can't write to project root
32
+ !this.canWriteToProjectRoot()
33
+ ];
34
+ return prodIndicators.some(indicator => indicator);
35
+ }
36
+ /**
37
+ * Tests if we can write to the project root
38
+ */
39
+ canWriteToProjectRoot() {
40
+ try {
41
+ const testFile = path.join(this.projectRoot, '.story-ui-write-test');
42
+ fs.writeFileSync(testFile, 'test');
43
+ fs.unlinkSync(testFile);
44
+ return true;
45
+ }
46
+ catch {
47
+ return false;
48
+ }
49
+ }
50
+ /**
51
+ * Main setup method that adapts to environment
52
+ */
53
+ setupGitignoreIntegration() {
54
+ if (this.isProduction) {
55
+ this.handleProductionEnvironment();
56
+ }
57
+ else {
58
+ this.handleDevelopmentEnvironment();
59
+ }
60
+ }
61
+ /**
62
+ * Production environment: Use in-memory story generation
63
+ */
64
+ handleProductionEnvironment() {
65
+ logger.log('🌐 Production environment detected - using in-memory story generation');
66
+ // Validate that gitignore is already set up
67
+ this.validateProductionSetup();
68
+ // Set up temporary directory for story generation if needed
69
+ this.setupTemporaryDirectory();
70
+ }
71
+ /**
72
+ * Development environment: Full gitignore management
73
+ */
74
+ handleDevelopmentEnvironment() {
75
+ logger.log('🔧 Development environment - setting up gitignore integration');
76
+ this.ensureGeneratedDirectoryExists();
77
+ this.ensureGeneratedDirectoryIgnored();
78
+ this.createGeneratedDirectoryReadme();
79
+ }
80
+ /**
81
+ * Validates that production environment is properly configured
82
+ */
83
+ validateProductionSetup() {
84
+ const gitignorePath = path.join(this.projectRoot, '.gitignore');
85
+ if (!fs.existsSync(gitignorePath)) {
86
+ console.warn('⚠️ No .gitignore found in production. Stories will be generated in memory only.');
87
+ return;
88
+ }
89
+ const gitignoreContent = fs.readFileSync(gitignorePath, 'utf-8');
90
+ const generatedPath = this.getRelativeGeneratedPath();
91
+ if (generatedPath && !this.isPathIgnored(gitignoreContent, generatedPath)) {
92
+ console.warn(`⚠️ Generated path not in .gitignore: ${generatedPath}`);
93
+ console.warn(' Run "npx story-ui setup-gitignore" in development to fix this.');
94
+ }
95
+ else {
96
+ logger.log('✅ Production gitignore configuration validated');
97
+ }
98
+ }
99
+ /**
100
+ * Sets up temporary directory for production story generation
101
+ */
102
+ setupTemporaryDirectory() {
103
+ try {
104
+ const tempDir = this.getProductionTempDirectory();
105
+ if (!fs.existsSync(tempDir)) {
106
+ fs.mkdirSync(tempDir, { recursive: true });
107
+ logger.log(`✅ Created temporary directory: ${tempDir}`);
108
+ }
109
+ }
110
+ catch (error) {
111
+ console.warn('⚠️ Could not create temporary directory, using in-memory generation only');
112
+ }
113
+ }
114
+ /**
115
+ * Gets a writable temporary directory for production
116
+ */
117
+ getProductionTempDirectory() {
118
+ // Try various temporary directory locations
119
+ const tempOptions = [
120
+ process.env.TMPDIR,
121
+ process.env.TMP,
122
+ process.env.TEMP,
123
+ '/tmp',
124
+ path.join(process.cwd(), '.tmp')
125
+ ].filter(Boolean);
126
+ for (const tempPath of tempOptions) {
127
+ try {
128
+ const storyTempDir = path.join(tempPath, 'story-ui-generated');
129
+ fs.mkdirSync(storyTempDir, { recursive: true });
130
+ return storyTempDir;
131
+ }
132
+ catch {
133
+ continue;
134
+ }
135
+ }
136
+ throw new Error('No writable temporary directory found');
137
+ }
138
+ /**
139
+ * Creates the generated directory if it doesn't exist (development only)
140
+ */
141
+ ensureGeneratedDirectoryExists() {
142
+ const generatedDir = this.config.generatedStoriesPath;
143
+ if (!fs.existsSync(generatedDir)) {
144
+ fs.mkdirSync(generatedDir, { recursive: true });
145
+ logger.log(`✅ Created generated stories directory: ${generatedDir}`);
146
+ }
147
+ }
148
+ /**
149
+ * Ensures the generated stories directory is added to .gitignore (development only)
150
+ */
151
+ ensureGeneratedDirectoryIgnored() {
152
+ const gitignorePath = path.join(this.projectRoot, '.gitignore');
153
+ const generatedPath = this.getRelativeGeneratedPath();
154
+ if (!generatedPath) {
155
+ console.warn('Could not determine relative path for generated stories directory');
156
+ return;
157
+ }
158
+ // Create .gitignore if it doesn't exist
159
+ if (!fs.existsSync(gitignorePath)) {
160
+ this.createGitignore(gitignorePath, generatedPath);
161
+ return;
162
+ }
163
+ // Check if the path is already ignored
164
+ const gitignoreContent = fs.readFileSync(gitignorePath, 'utf-8');
165
+ if (this.isPathIgnored(gitignoreContent, generatedPath)) {
166
+ logger.log(`✅ Generated stories directory already ignored: ${generatedPath}`);
167
+ return;
168
+ }
169
+ // Add the ignore rule
170
+ this.addIgnoreRule(gitignorePath, generatedPath);
171
+ }
172
+ /**
173
+ * Gets the relative path from project root to generated stories directory
174
+ */
175
+ getRelativeGeneratedPath() {
176
+ try {
177
+ const absoluteGeneratedPath = path.resolve(this.config.generatedStoriesPath);
178
+ const absoluteProjectRoot = path.resolve(this.projectRoot);
179
+ let relativePath = path.relative(absoluteProjectRoot, absoluteGeneratedPath);
180
+ relativePath = relativePath.replace(/\\/g, '/');
181
+ if (!relativePath.startsWith('../') && !relativePath.startsWith('/')) {
182
+ relativePath = './' + relativePath;
183
+ }
184
+ return relativePath;
185
+ }
186
+ catch (error) {
187
+ console.error('Error calculating relative path:', error);
188
+ return null;
189
+ }
190
+ }
191
+ /**
192
+ * Creates a new .gitignore file with Story UI section
193
+ */
194
+ createGitignore(gitignorePath, generatedPath) {
195
+ const content = this.generateGitignoreSection(generatedPath);
196
+ fs.writeFileSync(gitignorePath, content);
197
+ logger.log(`✅ Created .gitignore with Story UI generated directory: ${generatedPath}`);
198
+ }
199
+ /**
200
+ * Checks if the generated path is already ignored
201
+ */
202
+ isPathIgnored(gitignoreContent, generatedPath) {
203
+ const lines = gitignoreContent.split('\n').map(line => line.trim());
204
+ const pathVariations = [
205
+ generatedPath,
206
+ generatedPath.replace(/^\.\//, ''),
207
+ generatedPath + '/',
208
+ generatedPath.replace(/^\.\//, '') + '/',
209
+ generatedPath + '/**',
210
+ generatedPath.replace(/^\.\//, '') + '/**'
211
+ ];
212
+ return pathVariations.some(variation => lines.includes(variation) ||
213
+ lines.includes(variation.replace(/\/$/, '')));
214
+ }
215
+ /**
216
+ * Adds ignore rule to existing .gitignore
217
+ */
218
+ addIgnoreRule(gitignorePath, generatedPath) {
219
+ const existingContent = fs.readFileSync(gitignorePath, 'utf-8');
220
+ const newSection = this.generateGitignoreSection(generatedPath);
221
+ const separator = existingContent.endsWith('\n') ? '\n' : '\n\n';
222
+ const updatedContent = existingContent + separator + newSection;
223
+ fs.writeFileSync(gitignorePath, updatedContent);
224
+ logger.log(`✅ Added Story UI generated directory to .gitignore: ${generatedPath}`);
225
+ }
226
+ /**
227
+ * Generates the gitignore section for Story UI
228
+ */
229
+ generateGitignoreSection(generatedPath) {
230
+ return `# Story UI - AI Generated Stories (ephemeral, not for version control)
231
+ # These are temporary stories for testing layouts and should not be committed
232
+ ${generatedPath}/
233
+ ${generatedPath}/**`;
234
+ }
235
+ /**
236
+ * Creates a README in the generated directory explaining its purpose (development only)
237
+ */
238
+ createGeneratedDirectoryReadme() {
239
+ const generatedDir = this.config.generatedStoriesPath;
240
+ const readmePath = path.join(generatedDir, 'README.md');
241
+ if (fs.existsSync(readmePath)) {
242
+ return; // Don't overwrite existing README
243
+ }
244
+ const readmeContent = `# AI Generated Stories
245
+
246
+ This directory contains stories generated by Story UI for testing and iteration purposes.
247
+
248
+ ## ⚠️ Important Notes
249
+
250
+ - **These stories are ephemeral** - they are meant for testing layouts and sharing with stakeholders
251
+ - **Do not commit these files** - they are automatically ignored by git
252
+ - **Stories are regenerated** - feel free to delete and regenerate as needed
253
+
254
+ ## Purpose
255
+
256
+ These stories are designed for:
257
+ - 🎨 **Layout Testing** - Test different component arrangements
258
+ - 👥 **Stakeholder Review** - Share layouts with product owners, designers, and project managers
259
+ - 🔄 **Rapid Iteration** - Quickly generate and modify layouts
260
+ - 📱 **Design Validation** - Validate designs before implementation
261
+
262
+ ## Usage
263
+
264
+ Stories in this directory will appear in Storybook under the "${this.config.storyPrefix}" section.
265
+
266
+ Generated by [Story UI](https://github.com/your-org/story-ui) - AI-powered Storybook story generator.
267
+ `;
268
+ try {
269
+ fs.writeFileSync(readmePath, readmeContent);
270
+ logger.log(`✅ Created README in generated directory`);
271
+ }
272
+ catch (error) {
273
+ console.warn('⚠️ Could not create README in generated directory');
274
+ }
275
+ }
276
+ /**
277
+ * Cleans up old generated stories (safe for both environments)
278
+ */
279
+ cleanupOldStories(maxAge = 7 * 24 * 60 * 60 * 1000) {
280
+ const directories = [
281
+ this.config.generatedStoriesPath,
282
+ this.isProduction ? this.getProductionTempDirectory() : null
283
+ ].filter(Boolean);
284
+ for (const dir of directories) {
285
+ if (!dir || !fs.existsSync(dir))
286
+ continue;
287
+ try {
288
+ const files = fs.readdirSync(dir);
289
+ const now = Date.now();
290
+ let cleanedCount = 0;
291
+ for (const file of files) {
292
+ if (!file.endsWith('.stories.tsx'))
293
+ continue;
294
+ const filePath = path.join(dir, file);
295
+ const stats = fs.statSync(filePath);
296
+ const age = now - stats.mtime.getTime();
297
+ if (age > maxAge) {
298
+ fs.unlinkSync(filePath);
299
+ cleanedCount++;
300
+ }
301
+ }
302
+ if (cleanedCount > 0) {
303
+ logger.log(`🧹 Cleaned up ${cleanedCount} old generated stories from ${dir}`);
304
+ }
305
+ }
306
+ catch (error) {
307
+ console.warn(`⚠️ Could not clean up stories in ${dir}`);
308
+ }
309
+ }
310
+ }
311
+ /**
312
+ * Gets the appropriate directory for story generation based on environment
313
+ */
314
+ getStoryGenerationPath() {
315
+ if (this.isProduction) {
316
+ try {
317
+ return this.getProductionTempDirectory();
318
+ }
319
+ catch {
320
+ // Fallback to in-memory only
321
+ return '';
322
+ }
323
+ }
324
+ return this.config.generatedStoriesPath;
325
+ }
326
+ /**
327
+ * Checks if we're in production mode
328
+ */
329
+ isProductionMode() {
330
+ return this.isProduction;
331
+ }
332
+ }
333
+ /**
334
+ * Convenience function to set up gitignore for Story UI (production-ready)
335
+ */
336
+ export function setupProductionGitignore(config, projectRoot) {
337
+ const manager = new ProductionGitignoreManager(config, projectRoot);
338
+ manager.setupGitignoreIntegration();
339
+ return manager;
340
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"productionGitignoreManager.js","sourceRoot":"","sources":["../../story-generator/productionGitignoreManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC;;GAEG;AACH,MAAM,OAAO,0BAA0B;IAKrC,YAAY,MAAqB,EAAE,cAAsB,OAAO,CAAC,GAAG,EAAE;QACpE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACzD,CAAC;IAED;;OAEG;IACK,2BAA2B;QACjC,iDAAiD;QACjD,MAAM,cAAc,GAAG;YACrB,OAAO,CAAC,GAAG,CA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oBACzE,OAAO,UAAU,aAAa,UAAU,gBAAgB,CAAC,IAAI,IAAI,CAAC;gBACpE,CAAC;qBAAM,CAAC;oBACN,OAAO,YAAY,aAAa,YAAY,gBAAgB,CAAC,IAAI,IAAI,CAAC;gBACxE,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;gBAClC,WAAW,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,iGAAiG;IAEjG,qCAAqC;IACrC,WAAW,CAAC,IAAI,CACd,EAAE,EACF,qDAAqD,EACrD,sEAAsE,EACtE,EAAE,CACH,CAAC;IAEF,WAAW,CAAC,IAAI,CACd,0OAA0O,EAC1O,EAAE,EACF,SAAS,EACT,gCAAgC,EAChC,mDAAmD,EACnD,+CAA+C,EAC/C,EAAE,EACF,uBAAuB,EACvB,0FAA0F,EAC1F,iFAAiF,EACjF,gFAAgF,EAChF,8EAA8E,EAC9E,0EAA0E,EAC1E,+DAA+D,EAC/D,4EAA4E,EAC5E,sFAAsF,EACtF,kHAAkH,EAClH,2FAA2F,EAC3F,kDAAkD,EAClD,mFAAmF,EACnF,2DAA2D,EAC3D,oGAAoG,EACpG,2CAA2C,EAC3C,kDAAkD,EAClD,iFAAiF,EACjF,mEAAmE,EACnE,6CAA6C,EAC7C,iEAAiE,EACjE,4GAA4G,EAC5G,UAAU,EACV,EAAE,EACF,sBAAsB,EACtB,SAAS,CAAC,WAAW,EACrB,EAAE,EACF,eAAe,EACf,UAAU,CACX,CAAC;IAEF,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Provider Presets for React Design Systems
3
+ *
4
+ * These presets are used during deployment to auto-detect and configure
5
+ * the production app for the correct design system based on the importPath
6
+ * in story-ui.config.js
7
+ */
8
+ export interface ProviderPreset {
9
+ name: string;
10
+ /** Regex pattern to match against importPath */
11
+ pattern: RegExp;
12
+ /** NPM dependencies required */
13
+ dependencies: string[];
14
+ /** CSS imports needed in main.tsx */
15
+ cssImports: string[];
16
+ /** Provider import statements */
17
+ imports: string[];
18
+ /** Provider wrapper JSX - use {children} placeholder */
19
+ wrapper: string;
20
+ /** Additional notes for the AI */
21
+ designSystemNotes?: string;
22
+ }
23
+ /**
24
+ * Known React design system presets
25
+ * Order matters - first match wins
26
+ */
27
+ export declare const providerPresets: ProviderPreset[];
28
+ /**
29
+ * Detect the provider preset based on importPath
30
+ * @param importPath - The import path from story-ui.config.js
31
+ * @returns The matching provider preset or null
32
+ */
33
+ export declare function detectProviderPreset(importPath: string): ProviderPreset | null;
34
+ /**
35
+ * Get provider configuration for a given importPath
36
+ * Falls back to a minimal default if no preset matches
37
+ * @param importPath - The import path from story-ui.config.js
38
+ * @param customProvider - Optional custom provider config from story-ui.config.js
39
+ * @returns Provider configuration object
40
+ */
41
+ export declare function getProviderConfig(importPath: string, customProvider?: Partial<ProviderPreset>): {
42
+ cssImports: string[];
43
+ imports: string[];
44
+ wrapper: string;
45
+ dependencies: string[];
46
+ name: string;
47
+ };
48
+ /**
49
+ * Generate design system notes for AI context
50
+ * @param importPath - The import path from story-ui.config.js
51
+ * @returns Design system notes string or undefined
52
+ */
53
+ export declare function getDesignSystemNotes(importPath: string): string | undefined;
54
+ //# sourceMappingURL=providerPresets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providerPresets.d.ts","sourceRoot":"","sources":["../../story-generator/providerPresets.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,qCAAqC;IACrC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,iCAAiC;IACjC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,EAyJ3C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAO9E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GACvC;IACD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd,CAkCA;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG3E"}
@@ -0,0 +1,214 @@
1
+ /**
2
+ * Provider Presets for React Design Systems
3
+ *
4
+ * These presets are used during deployment to auto-detect and configure
5
+ * the production app for the correct design system based on the importPath
6
+ * in story-ui.config.js
7
+ */
8
+ /**
9
+ * Known React design system presets
10
+ * Order matters - first match wins
11
+ */
12
+ export const providerPresets = [
13
+ // Mantine
14
+ {
15
+ name: 'Mantine',
16
+ pattern: /@mantine\/core/,
17
+ dependencies: ['@mantine/core', '@mantine/hooks'],
18
+ cssImports: ['@mantine/core/styles.css'],
19
+ imports: ["import { MantineProvider } from '@mantine/core';"],
20
+ wrapper: '<MantineProvider>{children}</MantineProvider>',
21
+ designSystemNotes: 'Mantine v7+ uses MantineProvider. Import components from @mantine/core. Use props like c="dimmed" for colors, fw={500} for font weight.'
22
+ },
23
+ // Chakra UI
24
+ {
25
+ name: 'Chakra UI',
26
+ pattern: /@chakra-ui\/react/,
27
+ dependencies: ['@chakra-ui/react', '@emotion/react', '@emotion/styled', 'framer-motion'],
28
+ cssImports: [],
29
+ imports: ["import { ChakraProvider } from '@chakra-ui/react';"],
30
+ wrapper: '<ChakraProvider>{children}</ChakraProvider>',
31
+ designSystemNotes: 'Chakra UI uses ChakraProvider. Import components from @chakra-ui/react. Uses style props like colorScheme, size, variant.'
32
+ },
33
+ // Material UI (MUI)
34
+ {
35
+ name: 'Material UI',
36
+ pattern: /@mui\/material/,
37
+ dependencies: ['@mui/material', '@emotion/react', '@emotion/styled'],
38
+ cssImports: [],
39
+ imports: [
40
+ "import { ThemeProvider, createTheme } from '@mui/material/styles';",
41
+ "import CssBaseline from '@mui/material/CssBaseline';"
42
+ ],
43
+ wrapper: '<ThemeProvider theme={createTheme()}><CssBaseline />{children}</ThemeProvider>',
44
+ designSystemNotes: 'MUI uses ThemeProvider with createTheme(). Import components from @mui/material. Uses props like variant, color, size.'
45
+ },
46
+ // Ant Design
47
+ {
48
+ name: 'Ant Design',
49
+ pattern: /antd/,
50
+ dependencies: ['antd'],
51
+ cssImports: [],
52
+ imports: ["import { ConfigProvider } from 'antd';"],
53
+ wrapper: '<ConfigProvider>{children}</ConfigProvider>',
54
+ designSystemNotes: 'Ant Design uses ConfigProvider. Import components from antd. Uses props like type, size, danger.'
55
+ },
56
+ // shadcn/ui (Tailwind-based)
57
+ {
58
+ name: 'shadcn/ui',
59
+ pattern: /@\/components\/ui|shadcn/,
60
+ dependencies: [],
61
+ cssImports: ['./index.css'],
62
+ imports: [],
63
+ wrapper: '{children}',
64
+ designSystemNotes: 'shadcn/ui uses Tailwind CSS classes. Components are copied into your project. Uses className prop with Tailwind utilities.'
65
+ },
66
+ // Radix UI Themes
67
+ {
68
+ name: 'Radix Themes',
69
+ pattern: /@radix-ui\/themes/,
70
+ dependencies: ['@radix-ui/themes'],
71
+ cssImports: ['@radix-ui/themes/styles.css'],
72
+ imports: ["import { Theme } from '@radix-ui/themes';"],
73
+ wrapper: '<Theme>{children}</Theme>',
74
+ designSystemNotes: 'Radix Themes uses Theme provider. Import components from @radix-ui/themes. Uses props like size, variant, color.'
75
+ },
76
+ // Blueprint
77
+ {
78
+ name: 'Blueprint',
79
+ pattern: /@blueprintjs\/core/,
80
+ dependencies: ['@blueprintjs/core', '@blueprintjs/icons'],
81
+ cssImports: [
82
+ '@blueprintjs/core/lib/css/blueprint.css',
83
+ '@blueprintjs/icons/lib/css/blueprint-icons.css'
84
+ ],
85
+ imports: [],
86
+ wrapper: '<div className="bp5-dark">{children}</div>',
87
+ designSystemNotes: 'Blueprint uses CSS classes for theming. Import components from @blueprintjs/core. Uses props like intent, minimal, large.'
88
+ },
89
+ // Semantic UI React
90
+ {
91
+ name: 'Semantic UI',
92
+ pattern: /semantic-ui-react/,
93
+ dependencies: ['semantic-ui-react', 'semantic-ui-css'],
94
+ cssImports: ['semantic-ui-css/semantic.min.css'],
95
+ imports: [],
96
+ wrapper: '{children}',
97
+ designSystemNotes: 'Semantic UI uses CSS for styling. Import components from semantic-ui-react. Uses props like size, color, basic, inverted.'
98
+ },
99
+ // Fluent UI
100
+ {
101
+ name: 'Fluent UI',
102
+ pattern: /@fluentui\/react-components/,
103
+ dependencies: ['@fluentui/react-components'],
104
+ cssImports: [],
105
+ imports: ["import { FluentProvider, webLightTheme } from '@fluentui/react-components';"],
106
+ wrapper: '<FluentProvider theme={webLightTheme}>{children}</FluentProvider>',
107
+ designSystemNotes: 'Fluent UI v9 uses FluentProvider. Import components from @fluentui/react-components. Uses appearance, size props.'
108
+ },
109
+ // React Bootstrap
110
+ {
111
+ name: 'React Bootstrap',
112
+ pattern: /react-bootstrap/,
113
+ dependencies: ['react-bootstrap', 'bootstrap'],
114
+ cssImports: ['bootstrap/dist/css/bootstrap.min.css'],
115
+ imports: [],
116
+ wrapper: '{children}',
117
+ designSystemNotes: 'React Bootstrap uses Bootstrap CSS. Import components from react-bootstrap. Uses variant, size props.'
118
+ },
119
+ // Evergreen
120
+ {
121
+ name: 'Evergreen',
122
+ pattern: /evergreen-ui/,
123
+ dependencies: ['evergreen-ui'],
124
+ cssImports: [],
125
+ imports: [],
126
+ wrapper: '{children}',
127
+ designSystemNotes: 'Evergreen is a React UI framework. Import components from evergreen-ui. Uses appearance, intent, size props.'
128
+ },
129
+ // Grommet
130
+ {
131
+ name: 'Grommet',
132
+ pattern: /grommet/,
133
+ dependencies: ['grommet', 'grommet-icons', 'styled-components'],
134
+ cssImports: [],
135
+ imports: ["import { Grommet } from 'grommet';"],
136
+ wrapper: '<Grommet>{children}</Grommet>',
137
+ designSystemNotes: 'Grommet uses Grommet provider. Import components from grommet. Uses props and theme objects.'
138
+ },
139
+ // PrimeReact
140
+ {
141
+ name: 'PrimeReact',
142
+ pattern: /primereact/,
143
+ dependencies: ['primereact', 'primeicons'],
144
+ cssImports: [
145
+ 'primereact/resources/themes/lara-light-indigo/theme.css',
146
+ 'primereact/resources/primereact.min.css',
147
+ 'primeicons/primeicons.css'
148
+ ],
149
+ imports: [],
150
+ wrapper: '{children}',
151
+ designSystemNotes: 'PrimeReact uses CSS themes. Import components from primereact. Uses severity, size, outlined props.'
152
+ }
153
+ ];
154
+ /**
155
+ * Detect the provider preset based on importPath
156
+ * @param importPath - The import path from story-ui.config.js
157
+ * @returns The matching provider preset or null
158
+ */
159
+ export function detectProviderPreset(importPath) {
160
+ for (const preset of providerPresets) {
161
+ if (preset.pattern.test(importPath)) {
162
+ return preset;
163
+ }
164
+ }
165
+ return null;
166
+ }
167
+ /**
168
+ * Get provider configuration for a given importPath
169
+ * Falls back to a minimal default if no preset matches
170
+ * @param importPath - The import path from story-ui.config.js
171
+ * @param customProvider - Optional custom provider config from story-ui.config.js
172
+ * @returns Provider configuration object
173
+ */
174
+ export function getProviderConfig(importPath, customProvider) {
175
+ // If custom provider is fully specified, use it
176
+ if (customProvider?.imports && customProvider?.wrapper) {
177
+ return {
178
+ name: customProvider.name || 'Custom',
179
+ cssImports: customProvider.cssImports || [],
180
+ imports: customProvider.imports || [],
181
+ wrapper: customProvider.wrapper,
182
+ dependencies: customProvider.dependencies || []
183
+ };
184
+ }
185
+ // Try to detect from importPath
186
+ const preset = detectProviderPreset(importPath);
187
+ if (preset) {
188
+ // Merge with any custom overrides
189
+ return {
190
+ name: customProvider?.name || preset.name,
191
+ cssImports: customProvider?.cssImports || preset.cssImports,
192
+ imports: customProvider?.imports || preset.imports,
193
+ wrapper: customProvider?.wrapper || preset.wrapper,
194
+ dependencies: customProvider?.dependencies || preset.dependencies
195
+ };
196
+ }
197
+ // Fallback for unknown design systems (no provider wrapper needed)
198
+ return {
199
+ name: customProvider?.name || 'Custom',
200
+ cssImports: customProvider?.cssImports || [],
201
+ imports: customProvider?.imports || [],
202
+ wrapper: customProvider?.wrapper || '{children}',
203
+ dependencies: customProvider?.dependencies || []
204
+ };
205
+ }
206
+ /**
207
+ * Generate design system notes for AI context
208
+ * @param importPath - The import path from story-ui.config.js
209
+ * @returns Design system notes string or undefined
210
+ */
211
+ export function getDesignSystemNotes(importPath) {
212
+ const preset = detectProviderPreset(importPath);
213
+ return preset?.designSystemNotes;
214
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storyHistory.js","sourceRoot":"","sources":["../../story-generator/storyHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAkB5B,MAAM,OAAO,mBAAmB;IAI9B,YAAY,WAAmB;QAFvB,cAAS,GAA8B,IAAI,GAAG,EAAE,CAAC;QAGvD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;QAC9D,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAA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