@tpitre/story-ui 2.2.0 → 2.3.1
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 +82 -11
- package/README.md +89 -0
- package/dist/cli/deploy.d.ts +17 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +696 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +26 -2
- package/dist/cli/setup.d.ts +11 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +437 -110
- package/dist/mcp-server/index.d.ts +2 -0
- package/dist/mcp-server/index.d.ts.map +1 -0
- package/dist/mcp-server/index.js +120 -2
- package/dist/mcp-server/mcp-stdio-server.d.ts +3 -0
- package/dist/mcp-server/mcp-stdio-server.d.ts.map +1 -0
- package/dist/mcp-server/mcp-stdio-server.js +8 -1
- package/dist/mcp-server/routes/claude.d.ts +3 -0
- package/dist/mcp-server/routes/claude.d.ts.map +1 -0
- package/dist/mcp-server/routes/claude.js +60 -23
- package/dist/mcp-server/routes/components.d.ts +4 -0
- package/dist/mcp-server/routes/components.d.ts.map +1 -0
- package/dist/mcp-server/routes/frameworks.d.ts +38 -0
- package/dist/mcp-server/routes/frameworks.d.ts.map +1 -0
- package/dist/mcp-server/routes/frameworks.js +183 -0
- package/dist/mcp-server/routes/generateStory.d.ts +3 -0
- package/dist/mcp-server/routes/generateStory.d.ts.map +1 -0
- package/dist/mcp-server/routes/generateStory.js +160 -76
- package/dist/mcp-server/routes/generateStoryStream.d.ts +12 -0
- package/dist/mcp-server/routes/generateStoryStream.d.ts.map +1 -0
- package/dist/mcp-server/routes/generateStoryStream.js +947 -0
- package/dist/mcp-server/routes/hybridStories.d.ts +18 -0
- package/dist/mcp-server/routes/hybridStories.d.ts.map +1 -0
- package/dist/mcp-server/routes/mcpRemote.d.ts +14 -0
- package/dist/mcp-server/routes/mcpRemote.d.ts.map +1 -0
- package/dist/mcp-server/routes/mcpRemote.js +489 -0
- package/dist/mcp-server/routes/memoryStories.d.ts +26 -0
- package/dist/mcp-server/routes/memoryStories.d.ts.map +1 -0
- package/dist/mcp-server/routes/providers.d.ts +89 -0
- package/dist/mcp-server/routes/providers.d.ts.map +1 -0
- package/dist/mcp-server/routes/providers.js +369 -0
- package/dist/mcp-server/routes/storySync.d.ts +26 -0
- package/dist/mcp-server/routes/storySync.d.ts.map +1 -0
- package/dist/mcp-server/routes/streamTypes.d.ts +110 -0
- package/dist/mcp-server/routes/streamTypes.d.ts.map +1 -0
- package/dist/mcp-server/routes/streamTypes.js +18 -0
- package/dist/mcp-server/sessionManager.d.ts +50 -0
- package/dist/mcp-server/sessionManager.d.ts.map +1 -0
- package/dist/story-generator/componentBlacklist.d.ts +21 -0
- package/dist/story-generator/componentBlacklist.d.ts.map +1 -0
- package/dist/story-generator/componentDiscovery.d.ts +28 -0
- package/dist/story-generator/componentDiscovery.d.ts.map +1 -0
- package/dist/story-generator/componentRegistryGenerator.d.ts +49 -0
- package/dist/story-generator/componentRegistryGenerator.d.ts.map +1 -0
- package/dist/story-generator/componentRegistryGenerator.js +205 -0
- package/dist/story-generator/configLoader.d.ts +33 -0
- package/dist/story-generator/configLoader.d.ts.map +1 -0
- package/dist/story-generator/considerationsLoader.d.ts +32 -0
- package/dist/story-generator/considerationsLoader.d.ts.map +1 -0
- package/dist/story-generator/documentation-sources.d.ts +28 -0
- package/dist/story-generator/documentation-sources.d.ts.map +1 -0
- package/dist/story-generator/documentationLoader.d.ts +64 -0
- package/dist/story-generator/documentationLoader.d.ts.map +1 -0
- package/dist/story-generator/dynamicPackageDiscovery.d.ts +97 -0
- package/dist/story-generator/dynamicPackageDiscovery.d.ts.map +1 -0
- package/dist/story-generator/enhancedComponentDiscovery.d.ts +125 -0
- package/dist/story-generator/enhancedComponentDiscovery.d.ts.map +1 -0
- package/dist/story-generator/enhancedComponentDiscovery.js +111 -11
- package/dist/story-generator/framework-adapters/angular-adapter.d.ts +40 -0
- package/dist/story-generator/framework-adapters/angular-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/angular-adapter.js +427 -0
- package/dist/story-generator/framework-adapters/base-adapter.d.ts +75 -0
- package/dist/story-generator/framework-adapters/base-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/base-adapter.js +147 -0
- package/dist/story-generator/framework-adapters/framework-detector.d.ts +55 -0
- package/dist/story-generator/framework-adapters/framework-detector.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/framework-detector.js +323 -0
- package/dist/story-generator/framework-adapters/index.d.ts +97 -0
- package/dist/story-generator/framework-adapters/index.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/index.js +198 -0
- package/dist/story-generator/framework-adapters/react-adapter.d.ts +40 -0
- package/dist/story-generator/framework-adapters/react-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/react-adapter.js +316 -0
- package/dist/story-generator/framework-adapters/svelte-adapter.d.ts +40 -0
- package/dist/story-generator/framework-adapters/svelte-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/svelte-adapter.js +372 -0
- package/dist/story-generator/framework-adapters/types.d.ts +182 -0
- package/dist/story-generator/framework-adapters/types.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/types.js +8 -0
- package/dist/story-generator/framework-adapters/vue-adapter.d.ts +36 -0
- package/dist/story-generator/framework-adapters/vue-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/vue-adapter.js +336 -0
- package/dist/story-generator/framework-adapters/web-components-adapter.d.ts +54 -0
- package/dist/story-generator/framework-adapters/web-components-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/web-components-adapter.js +387 -0
- package/dist/story-generator/generateStory.d.ts +7 -0
- package/dist/story-generator/generateStory.d.ts.map +1 -0
- package/dist/story-generator/gitignoreManager.d.ts +50 -0
- package/dist/story-generator/gitignoreManager.d.ts.map +1 -0
- package/dist/story-generator/imageProcessor.d.ts +80 -0
- package/dist/story-generator/imageProcessor.d.ts.map +1 -0
- package/dist/story-generator/imageProcessor.js +391 -0
- package/dist/story-generator/inMemoryStoryService.d.ts +89 -0
- package/dist/story-generator/inMemoryStoryService.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/base-provider.d.ts +36 -0
- package/dist/story-generator/llm-providers/base-provider.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/base-provider.js +135 -0
- package/dist/story-generator/llm-providers/claude-provider.d.ts +23 -0
- package/dist/story-generator/llm-providers/claude-provider.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/claude-provider.js +414 -0
- package/dist/story-generator/llm-providers/gemini-provider.d.ts +24 -0
- package/dist/story-generator/llm-providers/gemini-provider.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/gemini-provider.js +406 -0
- package/dist/story-generator/llm-providers/index.d.ts +63 -0
- package/dist/story-generator/llm-providers/index.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/index.js +169 -0
- package/dist/story-generator/llm-providers/openai-provider.d.ts +24 -0
- package/dist/story-generator/llm-providers/openai-provider.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/openai-provider.js +458 -0
- package/dist/story-generator/llm-providers/settings-manager.d.ts +75 -0
- package/dist/story-generator/llm-providers/settings-manager.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/settings-manager.js +173 -0
- package/dist/story-generator/llm-providers/story-llm-service.d.ts +79 -0
- package/dist/story-generator/llm-providers/story-llm-service.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/story-llm-service.js +240 -0
- package/dist/story-generator/llm-providers/types.d.ts +153 -0
- package/dist/story-generator/llm-providers/types.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/types.js +8 -0
- package/dist/story-generator/logger.d.ts +14 -0
- package/dist/story-generator/logger.d.ts.map +1 -0
- package/dist/story-generator/logger.js +96 -29
- package/dist/story-generator/postProcessStory.d.ts +6 -0
- package/dist/story-generator/postProcessStory.d.ts.map +1 -0
- package/dist/story-generator/productionGitignoreManager.d.ts +91 -0
- package/dist/story-generator/productionGitignoreManager.d.ts.map +1 -0
- package/dist/story-generator/promptGenerator.d.ts +48 -0
- package/dist/story-generator/promptGenerator.d.ts.map +1 -0
- package/dist/story-generator/promptGenerator.js +186 -1
- package/dist/story-generator/storyHistory.d.ts +44 -0
- package/dist/story-generator/storyHistory.d.ts.map +1 -0
- package/dist/story-generator/storySync.d.ts +68 -0
- package/dist/story-generator/storySync.d.ts.map +1 -0
- package/dist/story-generator/storyTracker.d.ts +48 -0
- package/dist/story-generator/storyTracker.d.ts.map +1 -0
- package/dist/story-generator/storyValidator.d.ts +6 -0
- package/dist/story-generator/storyValidator.d.ts.map +1 -0
- package/dist/story-generator/universalDesignSystemAdapter.d.ts +68 -0
- package/dist/story-generator/universalDesignSystemAdapter.d.ts.map +1 -0
- package/dist/story-generator/universalDesignSystemAdapter.js +138 -1
- package/dist/story-generator/urlRedirectService.d.ts +21 -0
- package/dist/story-generator/urlRedirectService.d.ts.map +1 -0
- package/dist/story-generator/validateStory.d.ts +19 -0
- package/dist/story-generator/validateStory.d.ts.map +1 -0
- package/dist/story-generator/validateStory.js +6 -2
- package/dist/story-generator/visionPrompts.d.ts +88 -0
- package/dist/story-generator/visionPrompts.d.ts.map +1 -0
- package/dist/story-generator/visionPrompts.js +462 -0
- package/dist/story-ui.config.d.ts +78 -0
- package/dist/story-ui.config.d.ts.map +1 -0
- package/dist/templates/StoryUI/StoryUIPanel.d.ts +4 -0
- package/dist/templates/StoryUI/StoryUIPanel.d.ts.map +1 -0
- package/dist/templates/StoryUI/StoryUIPanel.js +1874 -0
- package/dist/templates/StoryUI/StoryUIPanel.stories.d.ts +18 -0
- package/dist/templates/StoryUI/StoryUIPanel.stories.d.ts.map +1 -0
- package/dist/templates/StoryUI/StoryUIPanel.stories.js +37 -0
- package/dist/templates/StoryUI/index.d.ts +3 -0
- package/dist/templates/StoryUI/index.d.ts.map +1 -0
- package/dist/templates/StoryUI/index.js +2 -0
- package/package.json +17 -3
- package/templates/StoryUI/StoryUIPanel.tsx +1960 -384
- package/templates/StoryUI/index.tsx +1 -1
- package/templates/StoryUI/manager.tsx +264 -0
- package/templates/production-app/.env.example +11 -0
- package/templates/production-app/index.html +66 -0
- package/templates/production-app/package.json +30 -0
- package/templates/production-app/public/favicon.svg +5 -0
- package/templates/production-app/src/App.tsx +1560 -0
- package/templates/production-app/src/LivePreviewRenderer.tsx +420 -0
- package/templates/production-app/src/componentRegistry.ts +315 -0
- package/templates/production-app/src/considerations.ts +16 -0
- package/templates/production-app/src/index.css +284 -0
- package/templates/production-app/src/main.tsx +25 -0
- package/templates/production-app/tsconfig.json +32 -0
- package/templates/production-app/tsconfig.node.json +11 -0
- package/templates/production-app/vite.config.ts +83 -0
- package/templates/react-import-rule.json +2 -2
- package/dist/index.js +0 -12
- package/dist/story-ui.config.loader.js +0 -205
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Svelte Framework Adapter
|
|
3
|
+
*
|
|
4
|
+
* Generates Storybook stories for Svelte components.
|
|
5
|
+
* Supports both Svelte 4 and Svelte 5 (runes).
|
|
6
|
+
*/
|
|
7
|
+
import { BaseFrameworkAdapter } from './base-adapter.js';
|
|
8
|
+
export class SvelteAdapter extends BaseFrameworkAdapter {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.type = 'svelte';
|
|
12
|
+
this.name = 'Svelte';
|
|
13
|
+
this.supportedStoryFrameworks = [
|
|
14
|
+
'storybook-svelte',
|
|
15
|
+
'chromatic',
|
|
16
|
+
];
|
|
17
|
+
this.defaultExtension = '.stories.ts';
|
|
18
|
+
}
|
|
19
|
+
generateSystemPrompt(config, options) {
|
|
20
|
+
if (config.systemPrompt) {
|
|
21
|
+
return config.systemPrompt;
|
|
22
|
+
}
|
|
23
|
+
const componentSystemName = config.componentPrefix
|
|
24
|
+
? `${config.componentPrefix.replace(/^[A-Z]+/, '')} design system`
|
|
25
|
+
: 'component library';
|
|
26
|
+
return `You are an expert Svelte developer creating Storybook stories using CSF 3.0 format.
|
|
27
|
+
Use ONLY the Svelte components from the ${componentSystemName} listed below.
|
|
28
|
+
|
|
29
|
+
MANDATORY IMPORTS - First lines of every story file:
|
|
30
|
+
1. import type { Meta, StoryObj } from '@storybook/svelte';
|
|
31
|
+
2. import ComponentName from '${config.importPath || 'your-library'}/ComponentName.svelte';
|
|
32
|
+
|
|
33
|
+
SVELTE STORY FORMAT:
|
|
34
|
+
- Import .svelte files directly
|
|
35
|
+
- Props are passed via args object
|
|
36
|
+
- Use render function for complex templates
|
|
37
|
+
|
|
38
|
+
STORY STRUCTURE (CSF 3.0):
|
|
39
|
+
- Meta object with component, title, and parameters
|
|
40
|
+
- Stories use args for simple prop passing
|
|
41
|
+
- Use render for component composition
|
|
42
|
+
|
|
43
|
+
CRITICAL RULES:
|
|
44
|
+
- Import Svelte components (default export from .svelte files)
|
|
45
|
+
- For slots, use render with a wrapper component
|
|
46
|
+
- Events use on: directive in Svelte templates
|
|
47
|
+
|
|
48
|
+
Example structure:
|
|
49
|
+
\`\`\`typescript
|
|
50
|
+
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
51
|
+
import Button from 'your-library/Button.svelte';
|
|
52
|
+
|
|
53
|
+
const meta: Meta<Button> = {
|
|
54
|
+
title: 'Components/Button',
|
|
55
|
+
component: Button,
|
|
56
|
+
tags: ['autodocs'],
|
|
57
|
+
argTypes: {
|
|
58
|
+
variant: {
|
|
59
|
+
control: 'select',
|
|
60
|
+
options: ['primary', 'secondary', 'ghost'],
|
|
61
|
+
},
|
|
62
|
+
onclick: { action: 'clicked' },
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default meta;
|
|
67
|
+
type Story = StoryObj<typeof meta>;
|
|
68
|
+
|
|
69
|
+
export const Primary: Story = {
|
|
70
|
+
args: {
|
|
71
|
+
variant: 'primary',
|
|
72
|
+
children: 'Click me',
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
\`\`\`
|
|
76
|
+
|
|
77
|
+
For stories with slots (using wrapper component):
|
|
78
|
+
\`\`\`svelte
|
|
79
|
+
<!-- ButtonWithIcon.stories.svelte -->
|
|
80
|
+
<script context="module" lang="ts">
|
|
81
|
+
import type { Meta } from '@storybook/svelte';
|
|
82
|
+
import Button from 'your-library/Button.svelte';
|
|
83
|
+
import Icon from 'your-library/Icon.svelte';
|
|
84
|
+
|
|
85
|
+
export const meta: Meta<Button> = {
|
|
86
|
+
title: 'Components/Button/WithIcon',
|
|
87
|
+
component: Button,
|
|
88
|
+
};
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<script lang="ts">
|
|
92
|
+
import { Story } from '@storybook/svelte';
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<Story name="With Icon">
|
|
96
|
+
<Button variant="primary">
|
|
97
|
+
<Icon slot="icon" name="star" />
|
|
98
|
+
Starred
|
|
99
|
+
</Button>
|
|
100
|
+
</Story>
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
SVELTE TEMPLATE SYNTAX:
|
|
104
|
+
- Props: property={value}
|
|
105
|
+
- Events: on:event={handler}
|
|
106
|
+
- Two-way binding: bind:value
|
|
107
|
+
- Conditionals: {#if condition}...{/if}
|
|
108
|
+
- Loops: {#each items as item}...{/each}
|
|
109
|
+
|
|
110
|
+
SLOTS:
|
|
111
|
+
- Default slot: Content between tags
|
|
112
|
+
- Named slots: <span slot="name">content</span>
|
|
113
|
+
- Slot props: let:prop
|
|
114
|
+
|
|
115
|
+
${this.getCommonRules()}`;
|
|
116
|
+
}
|
|
117
|
+
generateExamples(config) {
|
|
118
|
+
const lib = config.importPath || 'your-library';
|
|
119
|
+
return `
|
|
120
|
+
## Example Stories for Svelte
|
|
121
|
+
|
|
122
|
+
### TypeScript Stories File
|
|
123
|
+
\`\`\`typescript
|
|
124
|
+
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
125
|
+
import Button from 'your-library/Button.svelte';
|
|
126
|
+
|
|
127
|
+
const meta: Meta<Button> = {
|
|
128
|
+
title: 'Components/Button',
|
|
129
|
+
component: Button,
|
|
130
|
+
tags: ['autodocs'],
|
|
131
|
+
argTypes: {
|
|
132
|
+
variant: {
|
|
133
|
+
control: 'select',
|
|
134
|
+
options: ['primary', 'secondary', 'ghost'],
|
|
135
|
+
},
|
|
136
|
+
size: {
|
|
137
|
+
control: 'select',
|
|
138
|
+
options: ['small', 'medium', 'large'],
|
|
139
|
+
},
|
|
140
|
+
onclick: { action: 'clicked' },
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export default meta;
|
|
145
|
+
type Story = StoryObj<typeof meta>;
|
|
146
|
+
|
|
147
|
+
export const Default: Story = {
|
|
148
|
+
args: {
|
|
149
|
+
variant: 'primary',
|
|
150
|
+
size: 'medium',
|
|
151
|
+
children: 'Button',
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const Disabled: Story = {
|
|
156
|
+
args: {
|
|
157
|
+
variant: 'primary',
|
|
158
|
+
disabled: true,
|
|
159
|
+
children: 'Disabled',
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
\`\`\`
|
|
163
|
+
|
|
164
|
+
### Svelte Stories File (for complex templates)
|
|
165
|
+
\`\`\`svelte
|
|
166
|
+
<!-- Card.stories.svelte -->
|
|
167
|
+
<script context="module" lang="ts">
|
|
168
|
+
import type { Meta } from '@storybook/svelte';
|
|
169
|
+
import Card from '${lib}/Card.svelte';
|
|
170
|
+
import Button from 'your-library/Button.svelte';
|
|
171
|
+
import Text from '${lib}/Text.svelte';
|
|
172
|
+
|
|
173
|
+
export const meta: Meta<Card> = {
|
|
174
|
+
title: 'Components/Card',
|
|
175
|
+
component: Card,
|
|
176
|
+
};
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<script lang="ts">
|
|
180
|
+
import { Story, Template } from '@storybook/svelte';
|
|
181
|
+
</script>
|
|
182
|
+
|
|
183
|
+
<Story name="Product Card">
|
|
184
|
+
<Card style="width: 300px">
|
|
185
|
+
<img
|
|
186
|
+
slot="media"
|
|
187
|
+
src="https://picsum.photos/300/200"
|
|
188
|
+
alt="Product"
|
|
189
|
+
/>
|
|
190
|
+
<Text slot="title" variant="heading">Product Name</Text>
|
|
191
|
+
<Text>$99.00</Text>
|
|
192
|
+
<Button slot="actions" variant="primary">Add to Cart</Button>
|
|
193
|
+
</Card>
|
|
194
|
+
</Story>
|
|
195
|
+
|
|
196
|
+
<Story name="Simple Card">
|
|
197
|
+
<Card>
|
|
198
|
+
<Text>Simple card content</Text>
|
|
199
|
+
</Card>
|
|
200
|
+
</Story>
|
|
201
|
+
\`\`\`
|
|
202
|
+
|
|
203
|
+
### With Reactive State
|
|
204
|
+
\`\`\`svelte
|
|
205
|
+
<!-- Input.stories.svelte -->
|
|
206
|
+
<script context="module" lang="ts">
|
|
207
|
+
import type { Meta } from '@storybook/svelte';
|
|
208
|
+
import Input from '${lib}/Input.svelte';
|
|
209
|
+
|
|
210
|
+
export const meta: Meta<Input> = {
|
|
211
|
+
title: 'Components/Input',
|
|
212
|
+
component: Input,
|
|
213
|
+
};
|
|
214
|
+
</script>
|
|
215
|
+
|
|
216
|
+
<script lang="ts">
|
|
217
|
+
import { Story } from '@storybook/svelte';
|
|
218
|
+
let value = '';
|
|
219
|
+
</script>
|
|
220
|
+
|
|
221
|
+
<Story name="Controlled">
|
|
222
|
+
<div>
|
|
223
|
+
<Input bind:value placeholder="Type here..." />
|
|
224
|
+
<p>Value: {value}</p>
|
|
225
|
+
</div>
|
|
226
|
+
</Story>
|
|
227
|
+
\`\`\`
|
|
228
|
+
|
|
229
|
+
### With Event Handling
|
|
230
|
+
\`\`\`typescript
|
|
231
|
+
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
232
|
+
import { action } from '@storybook/addon-actions';
|
|
233
|
+
import Button from 'your-library/Button.svelte';
|
|
234
|
+
|
|
235
|
+
const meta: Meta<Button> = {
|
|
236
|
+
title: 'Components/Button',
|
|
237
|
+
component: Button,
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export default meta;
|
|
241
|
+
type Story = StoryObj<typeof meta>;
|
|
242
|
+
|
|
243
|
+
export const WithClickHandler: Story = {
|
|
244
|
+
args: {
|
|
245
|
+
variant: 'primary',
|
|
246
|
+
children: 'Click me',
|
|
247
|
+
onclick: action('button-clicked'),
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
\`\`\`
|
|
251
|
+
`;
|
|
252
|
+
}
|
|
253
|
+
generateSampleStory(config, components) {
|
|
254
|
+
const lib = config.importPath || 'your-library';
|
|
255
|
+
const firstComponent = components[0];
|
|
256
|
+
if (!firstComponent) {
|
|
257
|
+
return `
|
|
258
|
+
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
259
|
+
|
|
260
|
+
const meta: Meta = {
|
|
261
|
+
title: 'Examples/Sample',
|
|
262
|
+
parameters: { layout: 'centered' },
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
export default meta;
|
|
266
|
+
type Story = StoryObj;
|
|
267
|
+
|
|
268
|
+
export const Default: Story = {
|
|
269
|
+
render: () => ({
|
|
270
|
+
template: '<div>Sample story content</div>',
|
|
271
|
+
}),
|
|
272
|
+
};
|
|
273
|
+
`;
|
|
274
|
+
}
|
|
275
|
+
return `
|
|
276
|
+
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
277
|
+
import ${firstComponent.name} from '${lib}/${firstComponent.name}.svelte';
|
|
278
|
+
|
|
279
|
+
const meta: Meta<${firstComponent.name}> = {
|
|
280
|
+
title: 'Components/${firstComponent.name}',
|
|
281
|
+
component: ${firstComponent.name},
|
|
282
|
+
tags: ['autodocs'],
|
|
283
|
+
parameters: { layout: 'centered' },
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export default meta;
|
|
287
|
+
type Story = StoryObj<typeof meta>;
|
|
288
|
+
|
|
289
|
+
export const Default: Story = {
|
|
290
|
+
args: {},
|
|
291
|
+
};
|
|
292
|
+
`;
|
|
293
|
+
}
|
|
294
|
+
getStoryTemplate(options) {
|
|
295
|
+
return `
|
|
296
|
+
// {{componentName}}.stories.ts
|
|
297
|
+
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
298
|
+
import {{componentName}} from '{{importPath}}/{{componentName}}.svelte';
|
|
299
|
+
|
|
300
|
+
const meta: Meta<{{componentName}}> = {
|
|
301
|
+
title: '{{category}}/{{componentName}}',
|
|
302
|
+
component: {{componentName}},
|
|
303
|
+
tags: ['autodocs'],
|
|
304
|
+
parameters: { layout: 'centered' },
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export default meta;
|
|
308
|
+
type Story = StoryObj<typeof meta>;
|
|
309
|
+
|
|
310
|
+
export const Default: Story = {
|
|
311
|
+
args: {},
|
|
312
|
+
};
|
|
313
|
+
`;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Post-process Svelte stories
|
|
317
|
+
*/
|
|
318
|
+
postProcess(storyContent) {
|
|
319
|
+
let processed = super.postProcess(storyContent);
|
|
320
|
+
// Remove React imports if present
|
|
321
|
+
processed = processed.replace(/import React from ['"]react['"];?\n?/g, '');
|
|
322
|
+
// Fix JSX to Svelte syntax
|
|
323
|
+
processed = processed
|
|
324
|
+
// Fix className to class
|
|
325
|
+
.replace(/className=/g, 'class=')
|
|
326
|
+
// Fix onClick to on:click
|
|
327
|
+
.replace(/onClick=/g, 'on:click=')
|
|
328
|
+
.replace(/onChange=/g, 'on:change=')
|
|
329
|
+
.replace(/onInput=/g, 'on:input=');
|
|
330
|
+
return processed;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Validate Svelte story
|
|
334
|
+
*/
|
|
335
|
+
validate(storyContent) {
|
|
336
|
+
const baseValidation = super.validate(storyContent);
|
|
337
|
+
const errors = [...baseValidation.errors];
|
|
338
|
+
// Svelte-specific validations
|
|
339
|
+
if (!storyContent.includes('@storybook/svelte')) {
|
|
340
|
+
errors.push("Missing '@storybook/svelte' import");
|
|
341
|
+
}
|
|
342
|
+
if (storyContent.includes("import React from 'react'")) {
|
|
343
|
+
errors.push('React import found in Svelte story');
|
|
344
|
+
}
|
|
345
|
+
// Check for JSX-style event handlers in .ts files
|
|
346
|
+
if (storyContent.includes('.ts') && /onClick=\{/.test(storyContent)) {
|
|
347
|
+
errors.push('Using JSX-style event handlers instead of Svelte on: syntax');
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
valid: errors.length === 0,
|
|
351
|
+
errors,
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Generate imports for Svelte components
|
|
356
|
+
*/
|
|
357
|
+
generateImports(components, config) {
|
|
358
|
+
const lib = config.importPath || 'your-library';
|
|
359
|
+
const imports = [];
|
|
360
|
+
// Svelte components are default imports from .svelte files
|
|
361
|
+
for (const component of components) {
|
|
362
|
+
imports.push(`import ${component.name} from '${lib}/${component.name}.svelte';`);
|
|
363
|
+
}
|
|
364
|
+
return imports.join('\n');
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Factory function
|
|
369
|
+
*/
|
|
370
|
+
export function createSvelteAdapter() {
|
|
371
|
+
return new SvelteAdapter();
|
|
372
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework Adapters - Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Defines the interface for framework-specific story generation.
|
|
5
|
+
* Each framework adapter implements this interface to provide
|
|
6
|
+
* framework-specific prompt generation and story templates.
|
|
7
|
+
*/
|
|
8
|
+
import { StoryUIConfig } from '../../story-ui.config.js';
|
|
9
|
+
import { DiscoveredComponent } from '../componentDiscovery.js';
|
|
10
|
+
/**
|
|
11
|
+
* Supported component frameworks
|
|
12
|
+
*/
|
|
13
|
+
export type FrameworkType = 'react' | 'web-components' | 'vue' | 'angular' | 'svelte' | 'solid' | 'qwik';
|
|
14
|
+
/**
|
|
15
|
+
* Supported story testing frameworks
|
|
16
|
+
*/
|
|
17
|
+
export type StoryFramework = 'storybook-react' | 'storybook-vue3' | 'storybook-angular' | 'storybook-svelte' | 'storybook-web-components' | 'histoire' | 'ladle' | 'chromatic' | 'custom';
|
|
18
|
+
/**
|
|
19
|
+
* Detected framework information
|
|
20
|
+
*/
|
|
21
|
+
export interface DetectedFramework {
|
|
22
|
+
/** The component framework used (React, Vue, etc.) */
|
|
23
|
+
componentFramework: FrameworkType;
|
|
24
|
+
/** The story framework to use (Storybook, Histoire, etc.) */
|
|
25
|
+
storyFramework: StoryFramework;
|
|
26
|
+
/** Version of the component framework if detectable */
|
|
27
|
+
version?: string;
|
|
28
|
+
/** Framework-specific configuration */
|
|
29
|
+
config?: FrameworkConfig;
|
|
30
|
+
/** Confidence level of detection (0-1) */
|
|
31
|
+
confidence: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Framework-specific configuration options
|
|
35
|
+
*/
|
|
36
|
+
export interface FrameworkConfig {
|
|
37
|
+
/** Import style (named, default, namespace) */
|
|
38
|
+
importStyle?: 'named' | 'default' | 'namespace';
|
|
39
|
+
/** File extension for generated stories */
|
|
40
|
+
storyExtension: string;
|
|
41
|
+
/** TypeScript support */
|
|
42
|
+
typescript: boolean;
|
|
43
|
+
/** JSX/TSX support */
|
|
44
|
+
jsx: boolean;
|
|
45
|
+
/** Component file extension */
|
|
46
|
+
componentExtension: string;
|
|
47
|
+
/** Additional framework-specific options */
|
|
48
|
+
options?: Record<string, unknown>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Generated prompt structure (framework-agnostic)
|
|
52
|
+
*/
|
|
53
|
+
export interface FrameworkPrompt {
|
|
54
|
+
/** System prompt with framework-specific instructions */
|
|
55
|
+
systemPrompt: string;
|
|
56
|
+
/** Component reference documentation */
|
|
57
|
+
componentReference: string;
|
|
58
|
+
/** Layout instructions */
|
|
59
|
+
layoutInstructions: string;
|
|
60
|
+
/** Example stories */
|
|
61
|
+
examples: string;
|
|
62
|
+
/** Sample story template */
|
|
63
|
+
sampleStory: string;
|
|
64
|
+
/** Framework metadata */
|
|
65
|
+
framework: DetectedFramework;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Story generation options
|
|
69
|
+
*/
|
|
70
|
+
export interface StoryGenerationOptions {
|
|
71
|
+
/** Target framework (auto-detect if not specified) */
|
|
72
|
+
framework?: FrameworkType;
|
|
73
|
+
/** Target story framework */
|
|
74
|
+
storyFramework?: StoryFramework;
|
|
75
|
+
/** Use TypeScript */
|
|
76
|
+
typescript?: boolean;
|
|
77
|
+
/** Include story documentation */
|
|
78
|
+
includeDocumentation?: boolean;
|
|
79
|
+
/** Include accessibility tests */
|
|
80
|
+
includeA11yTests?: boolean;
|
|
81
|
+
/** Include interaction tests */
|
|
82
|
+
includeInteractionTests?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Framework Adapter Interface
|
|
86
|
+
*
|
|
87
|
+
* Each framework adapter must implement this interface to provide
|
|
88
|
+
* framework-specific story generation capabilities.
|
|
89
|
+
*/
|
|
90
|
+
export interface FrameworkAdapter {
|
|
91
|
+
/** Framework identifier */
|
|
92
|
+
readonly type: FrameworkType;
|
|
93
|
+
/** Display name */
|
|
94
|
+
readonly name: string;
|
|
95
|
+
/** Supported story frameworks */
|
|
96
|
+
readonly supportedStoryFrameworks: StoryFramework[];
|
|
97
|
+
/** Default file extension */
|
|
98
|
+
readonly defaultExtension: string;
|
|
99
|
+
/**
|
|
100
|
+
* Generate the system prompt for this framework
|
|
101
|
+
*/
|
|
102
|
+
generateSystemPrompt(config: StoryUIConfig, options?: StoryGenerationOptions): string;
|
|
103
|
+
/**
|
|
104
|
+
* Generate component reference documentation
|
|
105
|
+
*/
|
|
106
|
+
generateComponentReference(components: DiscoveredComponent[], config: StoryUIConfig): string;
|
|
107
|
+
/**
|
|
108
|
+
* Generate example stories
|
|
109
|
+
*/
|
|
110
|
+
generateExamples(config: StoryUIConfig): string;
|
|
111
|
+
/**
|
|
112
|
+
* Generate a sample story template
|
|
113
|
+
*/
|
|
114
|
+
generateSampleStory(config: StoryUIConfig, components: DiscoveredComponent[]): string;
|
|
115
|
+
/**
|
|
116
|
+
* Generate import statements for components
|
|
117
|
+
*/
|
|
118
|
+
generateImports(components: DiscoveredComponent[], config: StoryUIConfig): string;
|
|
119
|
+
/**
|
|
120
|
+
* Post-process generated story content
|
|
121
|
+
*/
|
|
122
|
+
postProcess(storyContent: string): string;
|
|
123
|
+
/**
|
|
124
|
+
* Validate generated story syntax
|
|
125
|
+
*/
|
|
126
|
+
validate(storyContent: string): {
|
|
127
|
+
valid: boolean;
|
|
128
|
+
errors: string[];
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Get the story file template
|
|
132
|
+
*/
|
|
133
|
+
getStoryTemplate(options?: StoryGenerationOptions): string;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Framework Detection Result
|
|
137
|
+
*/
|
|
138
|
+
export interface FrameworkDetectionResult {
|
|
139
|
+
/** Detected frameworks sorted by confidence */
|
|
140
|
+
frameworks: DetectedFramework[];
|
|
141
|
+
/** Best match */
|
|
142
|
+
primary: DetectedFramework;
|
|
143
|
+
/** Package.json dependencies found */
|
|
144
|
+
dependencies: Record<string, string>;
|
|
145
|
+
/** Configuration files found */
|
|
146
|
+
configFiles: string[];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Component metadata for story generation
|
|
150
|
+
*/
|
|
151
|
+
export interface ComponentMetadata {
|
|
152
|
+
/** Component name */
|
|
153
|
+
name: string;
|
|
154
|
+
/** Import path */
|
|
155
|
+
importPath: string;
|
|
156
|
+
/** Props definition */
|
|
157
|
+
props: PropDefinition[];
|
|
158
|
+
/** Component description */
|
|
159
|
+
description?: string;
|
|
160
|
+
/** Example usage */
|
|
161
|
+
examples?: string[];
|
|
162
|
+
/** Tags/categories */
|
|
163
|
+
tags?: string[];
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Property definition
|
|
167
|
+
*/
|
|
168
|
+
export interface PropDefinition {
|
|
169
|
+
/** Property name */
|
|
170
|
+
name: string;
|
|
171
|
+
/** Property type */
|
|
172
|
+
type: string;
|
|
173
|
+
/** Required flag */
|
|
174
|
+
required: boolean;
|
|
175
|
+
/** Default value */
|
|
176
|
+
defaultValue?: unknown;
|
|
177
|
+
/** Description */
|
|
178
|
+
description?: string;
|
|
179
|
+
/** Enum values if applicable */
|
|
180
|
+
enumValues?: string[];
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../story-generator/framework-adapters/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue Framework Adapter
|
|
3
|
+
*
|
|
4
|
+
* Generates Storybook stories for Vue 3 components.
|
|
5
|
+
* Supports Composition API and Options API.
|
|
6
|
+
*/
|
|
7
|
+
import { FrameworkType, StoryFramework, StoryGenerationOptions } from './types.js';
|
|
8
|
+
import { BaseFrameworkAdapter } from './base-adapter.js';
|
|
9
|
+
import { StoryUIConfig } from '../../story-ui.config.js';
|
|
10
|
+
import { DiscoveredComponent } from '../componentDiscovery.js';
|
|
11
|
+
export declare class VueAdapter extends BaseFrameworkAdapter {
|
|
12
|
+
readonly type: FrameworkType;
|
|
13
|
+
readonly name = "Vue";
|
|
14
|
+
readonly supportedStoryFrameworks: StoryFramework[];
|
|
15
|
+
readonly defaultExtension = ".stories.ts";
|
|
16
|
+
generateSystemPrompt(config: StoryUIConfig, options?: StoryGenerationOptions): string;
|
|
17
|
+
generateExamples(config: StoryUIConfig): string;
|
|
18
|
+
generateSampleStory(config: StoryUIConfig, components: DiscoveredComponent[]): string;
|
|
19
|
+
getStoryTemplate(options?: StoryGenerationOptions): string;
|
|
20
|
+
/**
|
|
21
|
+
* Post-process Vue stories
|
|
22
|
+
*/
|
|
23
|
+
postProcess(storyContent: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Validate Vue story
|
|
26
|
+
*/
|
|
27
|
+
validate(storyContent: string): {
|
|
28
|
+
valid: boolean;
|
|
29
|
+
errors: string[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Factory function
|
|
34
|
+
*/
|
|
35
|
+
export declare function createVueAdapter(): VueAdapter;
|
|
36
|
+
//# sourceMappingURL=vue-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-adapter.d.ts","sourceRoot":"","sources":["../../../story-generator/framework-adapters/vue-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,cAAc,EACd,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,UAAW,SAAQ,oBAAoB;IAClD,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAS;IACrC,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,wBAAwB,EAAE,cAAc,EAAE,CAIjD;IACF,QAAQ,CAAC,gBAAgB,iBAAiB;IAE1C,oBAAoB,CAClB,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,MAAM;IA+FT,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM;IAuH/C,mBAAmB,CACjB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,mBAAmB,EAAE,GAChC,MAAM;IA4CT,gBAAgB,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM;IAsB1D;;OAEG;IACH,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAkBzC;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE;CAuBrE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAE7C"}
|