Skip to content

Conversation

JReinhold and others added 27 commits October 30, 2025 14:39
* extract human-readable /mcp to maintainable html file

* upgrade tsdown, remove json treeshaking workaround

* add changeset
Co-authored-by: storybook-app-bot[bot] <175111413+storybook-app-bot[bot]@users.noreply.github.com>
* upgrade to storybook 10.1.0-alpha.2

* changesets
Co-authored-by: storybook-app-bot[bot] <175111413+storybook-app-bot[bot]@users.noreply.github.com>
* Initial plan

* Rename "examples" to "stories" in component manifest format

- Updated type definitions in types.ts files to rename Example to Story
- Updated format-manifest.ts to use story terminology (story, story_name, story_description, story_code)
- Updated all fixture JSON files to use "stories" instead of "examples"
- Updated test files and descriptions to use "stories" terminology
- Updated test snapshots to reflect the new XML output format
- All tests passing, build and typecheck successful

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Jeppe Reinhold <[email protected]>
* add name to manifest errors

* add fixtures with errors

* add changeset

* improve test reports in ci

* update fixtures to use stories instead of examples

* more example -> story renaming
* replace prettier with oxfmt

* add oxlint for linting

* update actions using npx actions-up

* add publint

* fix types

* add check-everything script

* add build-storybook to check all

* split GH Workflows

* explain lint disables
Co-authored-by: storybook-app-bot[bot] <175111413+storybook-app-bot[bot]@users.noreply.github.com>
* replace oxfmt with prettier

* typo
* add initial eval setup

* well, a lot happened here...

* add clack

* Add interactive prompts and styled output to eval CLI (#65)

* Initial plan

* Add interactive prompts and prettier output to eval CLI

Co-authored-by: JReinhold <[email protected]>

* Use tasks API for parallel evaluation steps

Co-authored-by: JReinhold <[email protected]>

* Apply oxfmt formatting to eval.ts

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JReinhold <[email protected]>

* improve terminal experience

* save environment

* improve terminal experience

* only allow one eval at a time

* add support for custom context

* format

* add support for eval hooks, add log about how to rerun experiments

* prompt to start storybook at the end of the evaluation

* add message about getting into the experiment

* improve experiment dir name

* take screenshots of failed stories too

* cleanup

* improve reshaped stories, improve test+a11y summary, improve mcp server config arg

* support --[no-]storybook flag

* collect experiment description and branch name

* save result summary to google sheets

* improve plain prompt

* prompt for google sheets upload

* fix google sheets upload

* support "Storybook MCP" context, which starts up the docs-only @storybook/mcp server with a given component manifest

* Add basic Radix eval (#66)

* Add Radix eval

* Add Rsuite eval (#67)

---------

Co-authored-by: Jeppe Reinhold <[email protected]>

* format

* fix typechecking

* add reshaped component manifest

* add conversation-viewer.html with approximate token count

* cleanup

* add documentation, fixups

* format

* fix stories not having imports anymore

* fix plain and radix experiments

* experiments will have unique package names

* more eval test fixing

* more story fixes

* fix typecheck and lint summary

* improve conversation viewer

* simplify viewer content

* simplify viewer content

* result visualisations is via storybook

* upload to chromatic

* update google sheet row order

* add Chromatic link to CLI log

* add note about public results

* remove description arg from evals

* Evals: Add Radix UI website prompt (#74)

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: JReinhold <[email protected]>
Co-authored-by: Michael Shilman <[email protected]>
* Start review

* Fix

* More comments

* Fix config files and restructure

* Resolve conflicts

* Fix github actions

* Fix coverage

* Fix type error

* Fix

* Fix

* Dedupe

* Update packages/mcp/src/index.ts

Co-authored-by: Jeppe Reinhold <[email protected]>

* Update .github/workflows/check.yml

Co-authored-by: Jeppe Reinhold <[email protected]>

* Update .github/workflows/check.yml

Co-authored-by: Jeppe Reinhold <[email protected]>

* Improve get/post handling

* Dedupe vite

* lock file

* test perf of check-everything in CI

* rename

* rename

* Add turbo caching

* check cache invalidation

* refactor

* refactor

* refactor

* refactor

* Use node version file

* description

* refactor

* rollback

* use turbo for artifacts

* install node

* optimize

* install offline for faster symlinking

* optimize

* Check ci

* Only upload test results on failure

* Check github reporter

* Fix command

* Fix test

* Remove check everything

* test corepack enable

* test corepack enable

* test corepack enable

* fix

* Check if this is faster

* Check if this is faster

* no cache

* rollback

* Change nothing

* Fix prettier

* Modify changeset for MCP server GET responses

Updated the changeset to handle GET responses in the MCP server.

* Prettier

* use docker

* debug

* use node 24

* Try own caching

* Prune it

* Don't format pnpm lock

* Fix

* again

* use composite

* change

* Revert "change"

This reverts commit 8031a63.

* Revert "use composite"

This reverts commit 7f26a54.

* Revert "again"

This reverts commit 7fdccdf.

* Revert "Fix"

This reverts commit f4dd004.

* Revert "Don't format pnpm lock"

This reverts commit c11c4ec.

* Revert "Prune it"

This reverts commit 1009ad5.

* Revert "Try own caching"

This reverts commit 82eb804.

* Revert "use node 24"

This reverts commit c63f9ee.

* Revert "debug"

This reverts commit d647a91.

* Revert "use docker"

This reverts commit 766462e.

* Address feedback

* Initial plan

* Update README and Copilot instructions for script changes

Co-authored-by: JReinhold <[email protected]>

* Address feedback

* Make it loose

* Watch storybook by default

* Fix command

* Fix

* Add pnpm to ignore

* Fix dev command

* Cleanup

* get CI green

---------

Co-authored-by: Jeppe Reinhold <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JReinhold <[email protected]>
…t ID instead of multiple (#79)

* cleanup

* get-component-documentation only accepts a single component id
* cleanup

* get-component-documentation only accepts a single component id

* fix versions

* use vitest cli instead of node for evals

* prefix experiment scripts so they are not picked up by turborepo
* Initial plan

* Add toolset property to all telemetry payloads in addon-mcp

Co-authored-by: JReinhold <[email protected]>

* add changeset

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JReinhold <[email protected]>
Co-authored-by: Jeppe Reinhold <[email protected]>
Co-authored-by: Jeppe Reinhold <[email protected]>
* remove source API and use the request instead

* cleanup

* add changesets

* add path argument to manifestProvider

* cleanup

* update changeset

* fix serve.ts

* cleanup
* allow undefined requests when using custom manifestProvider

* changeset

* add tests for internal stdio transport

* cleanup
* add e2e tests

* improve e2e scripting

* add tests for mcp index

* add preset tests

* add telemetry tests

* simplify tool test mocks

* simplify mcp-handler tests, improve disableTelemetry handling

* add tests for manifest availability

* exclude evals from coverage

* cleanup

* changeset

* fix preset registering handlers instead of middlewares

* update tests to match changes in base branch

* cleanup

* await sb process kill

* globally mock storybook deps

* clean lock file
* add e2e tests

* improve e2e scripting

* add tests for mcp index

* add preset tests

* add telemetry tests

* simplify tool test mocks

* simplify mcp-handler tests, improve disableTelemetry handling

* add tests for manifest availability

* exclude evals from coverage

* cleanup

* changeset

* fix preset registering handlers instead of middlewares

* update tests to match changes in base branch

* cleanup

* await sb process kill

* refactor formatter, splitting into markdown and xml, configurable, defaulting to markdown

* globally mock storybook deps

* clean lock file

* fix context arg

* fix tests

* fix types

* "Examples" -> "Stories", simplify tests

* simplify tests and types

* simplify

* use ts-like prop type docs format

* add script to clean experiments

* add changeset
* Update reshaped flight booking eval

* format

---------

Co-authored-by: Jeppe Reinhold <[email protected]>
Co-authored-by: Jeppe Reinhold <[email protected]>
Co-authored-by: storybook-app-bot[bot] <175111413+storybook-app-bot[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 20, 2025 20:42
@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2025

⚠️ No Changeset found

Latest commit: d8ce62a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "@storybook/mcp-eval*" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 92.17391% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.13%. Comparing base (90a4952) to head (d8ce62a).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/addon-mcp/src/preset.ts 60.00% 1 Missing and 3 partials ⚠️
...kages/mcp/src/utils/manifest-formatter/markdown.ts 95.71% 1 Missing and 2 partials ⚠️
packages/mcp/src/utils/get-manifest.ts 83.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
+ Coverage   81.91%   89.13%   +7.21%     
==========================================
  Files          15       19       +4     
  Lines         846      414     -432     
  Branches      159      116      -43     
==========================================
- Hits          693      369     -324     
+ Misses        145        6     -139     
- Partials        8       39      +31     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR merges stable releases of @storybook/[email protected] and @storybook/[email protected], introducing significant architectural improvements and new features.

Key changes:

  • Replaced XML output format with markdown as the default for component documentation, with configurable format support
  • Changed manifest loading from URL-based to Request-based architecture with improved context handling
  • Modified get-component-documentation tool to handle single components instead of arrays
  • Enhanced telemetry collection with toolset tracking

Reviewed Changes

Copilot reviewed 155 out of 177 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/mcp/src/utils/manifest-formatter/xml.ts New XML formatter implementation extracted from format-manifest.ts
packages/mcp/src/utils/manifest-formatter/markdown.ts New markdown formatter for token-efficient output
packages/mcp/src/utils/manifest-formatter/types.ts Common interface for manifest formatters
packages/mcp/src/utils/get-manifest.ts Changed from URL-based to Request-based manifest loading
packages/mcp/src/utils/format-manifest.ts Refactored to use formatter abstraction with format parameter
packages/mcp/src/types.ts Added OutputFormat type, replaced 'source' with 'request' in StorybookContext
packages/mcp/src/tools/*.ts Updated tools to use request-based context and format parameter
packages/addon-mcp/src/mcp-handler.ts Updated to pass request instead of source URL, improved telemetry handling
packages/addon-mcp/src/preset.ts Improved HTML template handling and error handling
packages/addon-mcp/src/types.ts Added experimentalFormat option
package.json Updated dependencies and added new scripts for linting, testing

/\r?\n([\t ]*)$/,
'',
);
strings[strings.length - 1] = strings.at(-1)!.replace(/\r?\n([\t ]*)$/, '');
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of .at(-1)! with a non-null assertion is potentially unsafe. Consider adding a guard check or using strings[strings.length - 1] directly as was done before, since the original code was already safe.

Suggested change
strings[strings.length - 1] = strings.at(-1)!.replace(/\r?\n([\t ]*)$/, '');
strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, '');

Copilot uses AI. Check for mistakes.

// 4. Remove leading whitespace.
strings[0] = strings[0].replace(/^\r?\n/, '');
strings[0] = strings[0]!.replace(/^\r?\n/, '');
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non-null assertion operator ! assumes strings[0] exists. Since strings is constructed from templ which could theoretically be empty, consider adding a guard check before accessing strings[0].

Copilot uses AI. Check for mistakes.
export const experimental_devServer: PresetProperty<
'experimental_devServer'
> = async (app, options) => {
// There is error handling here. The can make the whole storybook app crash with.
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected grammar in comment from 'The can make' to 'This can make'.

Suggested change
// There is error handling here. The can make the whole storybook app crash with.
// There is error handling here. This can make the whole storybook app crash.

Copilot uses AI. Check for mistakes.
return new Request(url, {
method: req.method,
headers: req.headers as HeadersInit,
// oxlint-disable-next-line no-invalid-fetch-options -- We now req.method is always 'POST', linter doesn't
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'now' to 'know' in the oxlint-disable comment.

Suggested change
// oxlint-disable-next-line no-invalid-fetch-options -- We now req.method is always 'POST', linter doesn't
// oxlint-disable-next-line no-invalid-fetch-options -- We know req.method is always 'POST', linter doesn't

Copilot uses AI. Check for mistakes.
const format = args.values.format as OutputFormat;

transport.listen({
source: args.values.manifestPath,
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'source' property is being set in the context object, but according to the updated types in src/types.ts, StorybookContext no longer has a 'source' property - it was replaced with 'request'. This property should be removed as it's not part of the type definition and is unused.

Suggested change
source: args.values.manifestPath,

Copilot uses AI. Check for mistakes.
@JReinhold JReinhold merged commit 6ccdb73 into main Nov 20, 2025
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants