@tpitre/story-ui 3.6.2 → 3.7.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.
- package/README.md +36 -32
- package/dist/cli/index.js +0 -5
- package/dist/cli/setup.js +1 -1
- package/dist/mcp-server/routes/generateStory.d.ts.map +1 -1
- package/dist/mcp-server/routes/generateStory.js +142 -87
- package/dist/mcp-server/routes/generateStoryStream.d.ts.map +1 -1
- package/dist/mcp-server/routes/generateStoryStream.js +149 -31
- package/dist/story-generator/dynamicPackageDiscovery.d.ts +35 -2
- package/dist/story-generator/dynamicPackageDiscovery.d.ts.map +1 -1
- package/dist/story-generator/dynamicPackageDiscovery.js +332 -6
- package/dist/story-generator/enhancedComponentDiscovery.d.ts.map +1 -1
- package/dist/story-generator/enhancedComponentDiscovery.js +149 -2
- package/dist/story-generator/framework-adapters/base-adapter.d.ts +1 -0
- package/dist/story-generator/framework-adapters/base-adapter.d.ts.map +1 -1
- package/dist/story-generator/framework-adapters/base-adapter.js +12 -2
- package/dist/story-generator/framework-adapters/react-adapter.d.ts.map +1 -1
- package/dist/story-generator/framework-adapters/react-adapter.js +2 -0
- package/dist/story-generator/framework-adapters/svelte-adapter.d.ts.map +1 -1
- package/dist/story-generator/framework-adapters/svelte-adapter.js +53 -7
- package/dist/story-generator/framework-adapters/vue-adapter.d.ts.map +1 -1
- package/dist/story-generator/framework-adapters/vue-adapter.js +21 -1
- package/dist/story-generator/framework-adapters/web-components-adapter.d.ts.map +1 -1
- package/dist/story-generator/framework-adapters/web-components-adapter.js +4 -0
- package/dist/story-generator/llm-providers/openai-provider.js +2 -2
- package/dist/story-generator/promptGenerator.d.ts.map +1 -1
- package/dist/story-generator/promptGenerator.js +179 -26
- package/dist/story-generator/selfHealingLoop.d.ts +112 -0
- package/dist/story-generator/selfHealingLoop.d.ts.map +1 -0
- package/dist/story-generator/selfHealingLoop.js +202 -0
- package/dist/story-generator/validateStory.d.ts.map +1 -1
- package/dist/story-generator/validateStory.js +81 -12
- package/dist/story-ui.config.d.ts +2 -0
- package/dist/story-ui.config.d.ts.map +1 -1
- package/dist/templates/StoryUI/StoryUIPanel.d.ts +0 -5
- package/dist/templates/StoryUI/StoryUIPanel.d.ts.map +1 -1
- package/dist/templates/StoryUI/StoryUIPanel.js +411 -223
- package/package.json +4 -4
- package/templates/StoryUI/StoryUIPanel.mdx +84 -0
- package/templates/StoryUI/StoryUIPanel.tsx +493 -265
- package/dist/templates/StoryUI/StoryUIPanel.stories.d.ts +0 -18
- package/dist/templates/StoryUI/StoryUIPanel.stories.d.ts.map +0 -1
- package/dist/templates/StoryUI/StoryUIPanel.stories.js +0 -37
- package/templates/StoryUI/StoryUIPanel.stories.tsx +0 -44
- package/templates/StoryUI/manager.tsx +0 -859
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tpitre/story-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "AI-powered Storybook story generator with dynamic component discovery",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -72,10 +72,7 @@
|
|
|
72
72
|
"registry": "https://registry.npmjs.org/"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@emotion/react": "^11.14.0",
|
|
76
|
-
"@emotion/styled": "^11.14.1",
|
|
77
75
|
"@modelcontextprotocol/sdk": "^1.23.0",
|
|
78
|
-
"@mui/material": "^7.2.0",
|
|
79
76
|
"@types/pg": "^8.15.6",
|
|
80
77
|
"chalk": "^5.3.0",
|
|
81
78
|
"commander": "^11.0.0",
|
|
@@ -99,12 +96,15 @@
|
|
|
99
96
|
"@semantic-release/github": "^10.3.5",
|
|
100
97
|
"@semantic-release/npm": "^12.0.1",
|
|
101
98
|
"@semantic-release/release-notes-generator": "^14.0.1",
|
|
99
|
+
"@tpitre/story-ui": "^3.6.2",
|
|
102
100
|
"@types/cors": "^2.8.17",
|
|
103
101
|
"@types/express": "^4.17.21",
|
|
104
102
|
"@types/glob": "^8.1.0",
|
|
105
103
|
"@types/inquirer": "^9.0.0",
|
|
106
104
|
"@types/node": "^20.4.2",
|
|
107
105
|
"@types/node-fetch": "^2.6.12",
|
|
106
|
+
"@types/react": "^19.2.7",
|
|
107
|
+
"@types/react-dom": "^19.2.3",
|
|
108
108
|
"commitizen": "^4.3.1",
|
|
109
109
|
"concurrently": "^8.2.0",
|
|
110
110
|
"cz-conventional-changelog": "^3.3.0",
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{/*
|
|
2
|
+
Story UI Panel - MDX Documentation Page
|
|
3
|
+
|
|
4
|
+
This MDX file renders the Story UI Panel as a standalone documentation page.
|
|
5
|
+
Using MDX instead of a .stories.tsx file ensures the React component renders
|
|
6
|
+
correctly across ALL framework Storybooks (React, Vue, Svelte, Angular, Web Components).
|
|
7
|
+
|
|
8
|
+
Why this works:
|
|
9
|
+
- MDX is processed by @storybook/addon-docs which always uses React
|
|
10
|
+
- Regular .stories.tsx files render in the Preview iframe using the project's framework
|
|
11
|
+
- Non-React frameworks cannot render React components in their Preview
|
|
12
|
+
- MDX pages bypass this limitation by being compiled with React directly
|
|
13
|
+
|
|
14
|
+
Port Configuration:
|
|
15
|
+
- The port is automatically read from VITE_STORY_UI_PORT environment variable
|
|
16
|
+
- This is set during `npx story-ui init` and stored in .env
|
|
17
|
+
- URL parameter override: ?mcp-port=XXXX
|
|
18
|
+
|
|
19
|
+
Reference: Steve Dodier-Lazaro (Storybook team) recommendation
|
|
20
|
+
*/}
|
|
21
|
+
|
|
22
|
+
import { Meta } from '@storybook/addon-docs/blocks';
|
|
23
|
+
import { StoryUIPanel } from './StoryUIPanel';
|
|
24
|
+
import { useEffect, useState, useRef } from 'react';
|
|
25
|
+
|
|
26
|
+
<Meta title="Story UI/Story Generator" />
|
|
27
|
+
|
|
28
|
+
export const StoryUIPanelWrapper = () => {
|
|
29
|
+
const [isReady, setIsReady] = useState(false);
|
|
30
|
+
const hasInitialized = useRef(false);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
// Only run once on mount
|
|
34
|
+
if (hasInitialized.current) return;
|
|
35
|
+
hasInitialized.current = true;
|
|
36
|
+
|
|
37
|
+
if (typeof window !== 'undefined') {
|
|
38
|
+
// Check for URL parameter override for MCP port
|
|
39
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
40
|
+
const mcpPortParam = urlParams.get('mcp-port');
|
|
41
|
+
|
|
42
|
+
if (mcpPortParam) {
|
|
43
|
+
// URL parameter takes highest priority
|
|
44
|
+
window.STORY_UI_MCP_PORT = mcpPortParam;
|
|
45
|
+
}
|
|
46
|
+
// Otherwise, let StoryUIPanel.tsx's getApiBaseUrl() handle port detection
|
|
47
|
+
// from VITE_STORY_UI_PORT environment variable (set during story-ui init)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
setIsReady(true);
|
|
51
|
+
}, []);
|
|
52
|
+
|
|
53
|
+
// Don't render until initialized to prevent hydration issues
|
|
54
|
+
if (!isReady) {
|
|
55
|
+
return (
|
|
56
|
+
<div style={{
|
|
57
|
+
display: 'flex',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
justifyContent: 'center',
|
|
60
|
+
height: '100vh',
|
|
61
|
+
color: '#666'
|
|
62
|
+
}}>
|
|
63
|
+
Loading Story UI...
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return <StoryUIPanel />;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
{/*
|
|
72
|
+
Full-screen container to match the original story layout.
|
|
73
|
+
The StoryUIPanel component handles its own internal styling.
|
|
74
|
+
*/}
|
|
75
|
+
<div style={{
|
|
76
|
+
position: 'fixed',
|
|
77
|
+
top: 0,
|
|
78
|
+
left: 0,
|
|
79
|
+
right: 0,
|
|
80
|
+
bottom: 0,
|
|
81
|
+
overflow: 'hidden'
|
|
82
|
+
}}>
|
|
83
|
+
<StoryUIPanelWrapper />
|
|
84
|
+
</div>
|