Skip to content

Commit 82c4016

Browse files
authored
Merge branch 'main' into fix/preview-stories-monorepo-import-path-matching
2 parents dd59515 + 1ed83b5 commit 82c4016

51 files changed

Lines changed: 3400 additions & 2808 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/all-pans-rest.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@storybook/addon-mcp': minor
3+
'@storybook/mcp': minor
4+
---
5+
6+
Remove support for XML format.
7+
8+
## Breaking Change
9+
10+
The related option to configure XML vs markdown format now has no impact, the output is always formatted as markdown.

.changeset/legal-facts-refuse.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@storybook/addon-mcp': minor
3+
'@storybook/mcp': minor
4+
---
5+
6+
Add multi-source composition with OAuth for private Storybooks

.github/copilot-instructions.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ The addon supports configuring which toolsets are enabled:
3535
toolsets: {
3636
dev: true,
3737
docs: true,
38-
},
39-
experimentalFormat: 'markdown' // Output format: 'markdown' (default) or 'xml'
38+
}
4039
}
4140
}
4241
```
@@ -74,11 +73,8 @@ The `@storybook/mcp` package (in `packages/mcp`) is framework-agnostic:
7473
- `onSessionInitialize`: Called when an MCP session is initialized
7574
- `onListAllDocumentation`: Called when the list-all-documentation tool is invoked
7675
- `onGetDocumentation`: Called when the get-documentation tool is invoked
77-
- **Output Format**: The `format` property in context controls output format:
78-
- `'markdown'` (default): Token-efficient markdown with adaptive formatting
79-
- `'xml'`: Legacy XML format
80-
- Format is configurable via addon options or directly in `StorybookContext`
81-
- Formatters are implemented in `packages/mcp/src/utils/manifest-formatter/` with separate files for XML and markdown
76+
- **Output Format**: Responses are markdown-only (token-efficient markdown with adaptive formatting).
77+
- Formatter implementations are in `packages/mcp/src/utils/manifest-formatter/`.
8278

8379
## Development Environment
8480

.github/instructions/mcp.instructions.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ src/
2929
list-all-documentation.ts # List all documentation tool
3030
get-documentation.ts # Get component documentation tool
3131
utils/
32-
format-manifest.ts # Format component manifest to XML
32+
manifest-formatter/markdown.ts # Format component/docs manifests to markdown
3333
parse-react-docgen.ts # Parse react-docgen output
3434
get-manifest.ts # Fetch and validate manifest
3535
dedent.ts # Template string dedentation
@@ -107,19 +107,8 @@ Component manifests can include a `reactDocgen` property containing prop informa
107107
- Extracts prop names
108108
- Serializes TypeScript types into readable strings (handles unions, intersections, functions, objects, etc.)
109109
- Includes optional fields: `description`, `type`, `defaultValue`, `required`
110-
3. **Formatting**: The `formatComponentManifest()` function in `src/utils/format-manifest.ts` generates an XML representation of the component including a `<props>` section when `reactDocgen` is present
111-
4. **Output**: Each prop is formatted as:
112-
```xml
113-
<prop>
114-
<prop_name>propName</prop_name>
115-
<prop_type>string | number</prop_type>
116-
<prop_required>false</prop_required>
117-
<prop_default>"default"</prop_default>
118-
<prop_description>
119-
Prop description text
120-
</prop_description>
121-
</prop>
122-
```
110+
3. **Formatting**: The markdown formatter in `src/utils/manifest-formatter/markdown.ts` generates markdown output for components, docs, and props (including a `## Props` section when `reactDocgen` is present)
111+
4. **Output**: Props are rendered in markdown as TypeScript-like declarations inside fenced code blocks, including optional description/default metadata when available.
123112

124113
**Type serialization examples:**
125114

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ test-report.junit.xml
1212
*storybook.log
1313
trials/
1414
orchestration-logs/
15+
CLAUDE.local.md

.vscode/mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"servers": {
3+
"Storybook MCP": {
4+
"url": "http://localhost:6006/mcp",
5+
"type": "http"
6+
}
7+
}
8+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineMain } from '@storybook/react-vite/node';
2+
import baseConfig from '../.storybook/main';
3+
4+
/**
5+
* Multi-source Storybook configuration with a private Chromatic ref.
6+
* Used for manual testing of the OAuth composition auth flow.
7+
*/
8+
const config = defineMain({
9+
...baseConfig,
10+
refs: {
11+
'test-private-sb': {
12+
title: 'Test Private SB',
13+
url: 'https://main--6985a38660050ca8a9e62053.chromatic.com',
14+
},
15+
},
16+
});
17+
18+
export default config;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '../.storybook/preview';
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { defineMain } from '@storybook/react-vite/node';
2+
import baseConfig from '../.storybook/main';
3+
4+
/**
5+
* Multi-source Storybook configuration with composition (refs).
6+
* Used for E2E tests that verify multi-source/composition behavior.
7+
*/
8+
const config = defineMain({
9+
...baseConfig,
10+
// Composition with public Chromatic Storybook (storybook-ui next branch)
11+
refs: {
12+
'storybook-ui': {
13+
title: 'Storybook UI',
14+
url: 'https://next--635781f3500dd2c49e189caf.chromatic.com',
15+
},
16+
'no-manifest': {
17+
title: 'No Manifest',
18+
url: 'https://66b1e47012f95c6f90c8882e-eplpsjesci.chromatic.com',
19+
},
20+
},
21+
});
22+
23+
export default config;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '../.storybook/preview';

0 commit comments

Comments
 (0)