@tpitre/story-ui 1.5.1 โ 1.6.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/.env.sample +0 -3
- package/README.md +4 -1
- package/dist/mcp-server/index.js +1 -1
- package/dist/story-generator/configLoader.js +21 -6
- package/dist/story-ui.config.js +1 -1
- package/package.json +1 -1
package/.env.sample
CHANGED
|
@@ -13,9 +13,6 @@ CLAUDE_API_KEY=your-claude-api-key-here
|
|
|
13
13
|
# claude-3-5-haiku-20241022 - Fastest, good for simple tasks
|
|
14
14
|
CLAUDE_MODEL=claude-sonnet-4-20250514
|
|
15
15
|
|
|
16
|
-
# Story UI Server Configuration
|
|
17
|
-
# Port for the MCP server (defaults to 4001)
|
|
18
|
-
PORT=4001
|
|
19
16
|
|
|
20
17
|
# Optional: Story UI configuration file path
|
|
21
18
|
# STORY_UI_CONFIG_PATH=./story-ui.config.js
|
package/README.md
CHANGED
|
@@ -17,6 +17,10 @@ Story UI is a flexible, AI-powered tool that generates Storybook stories for any
|
|
|
17
17
|
- ๐งน **Cleanup Utilities**: Built-in cleanup for old generated stories
|
|
18
18
|
- ๐จ **Built-in UI**: Includes a Storybook panel for easy interaction
|
|
19
19
|
|
|
20
|
+
## Roadmap
|
|
21
|
+
|
|
22
|
+
Check out our [development roadmap](./ROADMAP.md) to see what's coming next and how you can contribute to the future of Story UI. We're planning exciting features like multi-framework support, story sharing, and advanced collaboration tools.
|
|
23
|
+
|
|
20
24
|
## Quick Start
|
|
21
25
|
|
|
22
26
|
### 1. Installation
|
|
@@ -694,4 +698,3 @@ module.exports = {
|
|
|
694
698
|
|
|
695
699
|
- ๐ [Documentation](https://github.com/southleft/story-ui#readme)
|
|
696
700
|
- ๐ [Issues](https://github.com/southleft/story-ui/issues)
|
|
697
|
-
- ๐ฌ [Discussions](https://github.com/southleft/story-ui/discussions)
|
package/dist/mcp-server/index.js
CHANGED
|
@@ -55,7 +55,7 @@ app.listen(PORT, () => {
|
|
|
55
55
|
console.error(`\nโ Port ${PORT} is already in use!`);
|
|
56
56
|
console.error(`\n๐ก To fix this:`);
|
|
57
57
|
console.error(` 1. Kill the process using port ${PORT}: lsof -ti:${PORT} | xargs kill`);
|
|
58
|
-
console.error(` 2. Or
|
|
58
|
+
console.error(` 2. Or use a different port: story-ui start --port=4002`);
|
|
59
59
|
console.error(` 3. Make sure to update your Storybook StoryUI panel to use the same port\n`);
|
|
60
60
|
process.exit(1);
|
|
61
61
|
}
|
|
@@ -83,12 +83,18 @@ export function validateConfig(config) {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
// Determine if we're using an external package (like antd, @mui/material, etc.)
|
|
87
|
+
const isExternalPackage = config.importPath &&
|
|
88
|
+
!config.importPath.startsWith('.') &&
|
|
89
|
+
!config.importPath.startsWith('/') &&
|
|
90
|
+
config.importPath !== 'your-component-library' &&
|
|
91
|
+
config.importPath.trim() !== '';
|
|
86
92
|
// Check if components can be discovered
|
|
87
|
-
if (!config.componentsPath && !config.componentsMetadataPath && (!config.components || config.components.length === 0)) {
|
|
93
|
+
if (!isExternalPackage && !config.componentsPath && !config.componentsMetadataPath && (!config.components || config.components.length === 0)) {
|
|
88
94
|
errors.push('Either componentsPath, componentsMetadataPath, or a components array must be specified');
|
|
89
95
|
}
|
|
90
|
-
// Only validate componentsPath if it's provided
|
|
91
|
-
if (config.componentsPath && config.componentsPath !== null && !fs.existsSync(config.componentsPath)) {
|
|
96
|
+
// Only validate componentsPath if it's provided AND we're not using an external package
|
|
97
|
+
if (!isExternalPackage && config.componentsPath && config.componentsPath !== null && !fs.existsSync(config.componentsPath)) {
|
|
92
98
|
errors.push(`Components path does not exist: ${config.componentsPath}`);
|
|
93
99
|
}
|
|
94
100
|
if (config.componentsMetadataPath && !fs.existsSync(config.componentsMetadataPath)) {
|
|
@@ -217,8 +223,14 @@ export function autoDetectDesignSystem() {
|
|
|
217
223
|
// Analyze existing Storybook files for patterns
|
|
218
224
|
const analysis = analyzeExistingStories(cwd);
|
|
219
225
|
console.log(`๐ Analysis found: ${analysis.storyFiles.length} story files, ${analysis.componentDirs.length} component directories`);
|
|
220
|
-
// Determine
|
|
221
|
-
const
|
|
226
|
+
// Determine if we're using an external package
|
|
227
|
+
const isExternalPackage = knownSystems && knownSystems.importPath &&
|
|
228
|
+
!knownSystems.importPath.startsWith('.') &&
|
|
229
|
+
!knownSystems.importPath.startsWith('/');
|
|
230
|
+
// Only determine component path if we're not using an external package
|
|
231
|
+
const componentPath = !isExternalPackage ?
|
|
232
|
+
findMostLikelyComponentDirectory(analysis.componentDirs, cwd) :
|
|
233
|
+
undefined;
|
|
222
234
|
// Determine the most likely import path
|
|
223
235
|
const importPath = findMostLikelyImportPath(analysis.importPaths, packageJson.name);
|
|
224
236
|
// Determine component prefix
|
|
@@ -228,11 +240,14 @@ export function autoDetectDesignSystem() {
|
|
|
228
240
|
// Build configuration
|
|
229
241
|
const config = {
|
|
230
242
|
generatedStoriesPath: path.join(cwd, 'src/stories/generated/'),
|
|
231
|
-
componentsPath: componentPath,
|
|
232
243
|
importPath: importPath,
|
|
233
244
|
componentPrefix: componentPrefix,
|
|
234
245
|
layoutRules: layoutRules
|
|
235
246
|
};
|
|
247
|
+
// Only set componentsPath for local component libraries
|
|
248
|
+
if (componentPath && !isExternalPackage) {
|
|
249
|
+
config.componentsPath = componentPath;
|
|
250
|
+
}
|
|
236
251
|
// Merge with known system config if available
|
|
237
252
|
if (knownSystems) {
|
|
238
253
|
return { ...knownSystems, ...config };
|
package/dist/story-ui.config.js
CHANGED
|
@@ -5,7 +5,7 @@ const __dirname = path.dirname(__filename);
|
|
|
5
5
|
// Default generic configuration
|
|
6
6
|
export const DEFAULT_CONFIG = {
|
|
7
7
|
generatedStoriesPath: path.resolve(process.cwd(), './src/stories/generated/'),
|
|
8
|
-
componentsPath:
|
|
8
|
+
componentsPath: undefined, // No default path - should be set only for local component libraries
|
|
9
9
|
componentsMetadataPath: undefined,
|
|
10
10
|
storyPrefix: 'Generated/',
|
|
11
11
|
defaultAuthor: 'Story UI AI',
|