Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/mcp/fixtures/button.fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
}
}
},
"examples": [
"stories": [
{
"id": "button--primary",
"name": "Primary",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp/fixtures/card.fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
}
}
},
"examples": [
"stories": [
{
"id": "card--basic",
"name": "Basic",
Expand Down
6 changes: 3 additions & 3 deletions packages/mcp/fixtures/full-manifest.fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}
}
},
"examples": [
"stories": [
{
"id": "button--primary",
"name": "Primary",
Expand Down Expand Up @@ -244,7 +244,7 @@
}
}
},
"examples": [
"stories": [
{
"id": "card--basic",
"name": "Basic",
Expand Down Expand Up @@ -429,7 +429,7 @@
}
}
},
"examples": [
"stories": [
{
"id": "input--basic",
"name": "Basic",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp/fixtures/input.fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
}
}
},
"examples": [
"stories": [
{
"id": "input--basic",
"name": "Basic",
Expand Down
6 changes: 3 additions & 3 deletions packages/mcp/fixtures/small-manifest.fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"path": "src/components/Button.tsx",
"name": "Button",
"summary": "A simple button component",
"examples": [
"stories": [
{
"name": "Primary",
"description": "The primary button variant.",
Expand All @@ -19,7 +19,7 @@
"path": "src/components/Card.tsx",
"name": "Card",
"description": "A container component for grouping related content.",
"examples": [
"stories": [
{
"name": "Basic",
"description": "A basic card with content.",
Expand All @@ -32,7 +32,7 @@
"path": "src/components/Input.tsx",
"name": "Input",
"description": "A text input component with validation support.",
"examples": [
"stories": [
{
"name": "Basic",
"description": "A basic text input.",
Expand Down
84 changes: 42 additions & 42 deletions packages/mcp/src/tools/get-component-documentation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ describe('getComponentDocumentationTool', () => {
"text": "<component>
<id>button</id>
<name>Button</name>
<example>
<example_name>Primary</example_name>
<example_description>
<story>
<story_name>Primary</story_name>
<story_description>
The primary button variant.
</example_description>
<example_code>
</story_description>
<story_code>
const Primary = () => <Button variant="primary">Click Me</Button>
</example_code>
</example>
</story_code>
</story>
</component>",
"type": "text",
},
Expand Down Expand Up @@ -111,15 +111,15 @@ describe('getComponentDocumentationTool', () => {
"text": "<component>
<id>button</id>
<name>Button</name>
<example>
<example_name>Primary</example_name>
<example_description>
<story>
<story_name>Primary</story_name>
<story_description>
The primary button variant.
</example_description>
<example_code>
</story_description>
<story_code>
const Primary = () => <Button variant="primary">Click Me</Button>
</example_code>
</example>
</story_code>
</story>
</component>",
"type": "text",
},
Expand All @@ -130,20 +130,20 @@ describe('getComponentDocumentationTool', () => {
<description>
A container component for grouping related content.
</description>
<example>
<example_name>Basic</example_name>
<example_description>
<story>
<story_name>Basic</story_name>
<story_description>
A basic card with content.
</example_description>
<example_code>
</story_description>
<story_code>
const Basic = () => (
<Card>
<h3>Title</h3>
<p>Content</p>
</Card>
)
</example_code>
</example>
</story_code>
</story>
</component>",
"type": "text",
},
Expand All @@ -154,15 +154,15 @@ describe('getComponentDocumentationTool', () => {
<description>
A text input component with validation support.
</description>
<example>
<example_name>Basic</example_name>
<example_description>
<story>
<story_name>Basic</story_name>
<story_description>
A basic text input.
</example_description>
<example_code>
</story_description>
<story_code>
const Basic = () => <Input label="Name" placeholder="Enter name" />
</example_code>
</example>
</story_code>
</story>
</component>",
"type": "text",
},
Expand Down Expand Up @@ -220,15 +220,15 @@ describe('getComponentDocumentationTool', () => {
"text": "<component>
<id>button</id>
<name>Button</name>
<example>
<example_name>Primary</example_name>
<example_description>
<story>
<story_name>Primary</story_name>
<story_description>
The primary button variant.
</example_description>
<example_code>
</story_description>
<story_code>
const Primary = () => <Button variant="primary">Click Me</Button>
</example_code>
</example>
</story_code>
</story>
</component>",
"type": "text",
},
Expand All @@ -239,20 +239,20 @@ describe('getComponentDocumentationTool', () => {
<description>
A container component for grouping related content.
</description>
<example>
<example_name>Basic</example_name>
<example_description>
<story>
<story_name>Basic</story_name>
<story_description>
A basic card with content.
</example_description>
<example_code>
</story_description>
<story_code>
const Basic = () => (
<Card>
<h3>Title</h3>
<p>Content</p>
</Card>
)
</example_code>
</example>
</story_code>
</story>
</component>",
"type": "text",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/mcp/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const BaseManifest = v.object({
),
});

const Example = v.object({
const Story = v.object({
...BaseManifest.entries,
snippet: v.optional(v.string()),
});
Expand All @@ -60,7 +60,7 @@ export const ComponentManifest = v.object({
id: v.string(),
path: v.string(),
summary: v.optional(v.string()),
examples: v.optional(v.array(Example)),
stories: v.optional(v.array(Story)),
// loose schema for react-docgen types, as they are pretty complex
reactDocgen: v.optional(v.custom<Documentation>(() => true)),
});
Expand Down
Loading