Skip to content

Rename experimentalComponentsManifestcomponentsManifest with backwards compat#181

Merged
JReinhold merged 7 commits intomainfrom
copilot/update-storybook-feature-flag
Mar 5, 2026
Merged

Rename experimentalComponentsManifestcomponentsManifest with backwards compat#181
JReinhold merged 7 commits intomainfrom
copilot/update-storybook-feature-flag

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

Needs storybookjs/storybook#33974 to be released first.

  • Explore codebase and understand all references to experimentalComponentsManifest
  • Update packages/addon-mcp/src/tools/is-manifest-available.ts — backwards-compat feature flag check
  • Update packages/addon-mcp/src/tools/is-manifest-available.test.ts — use new flag name in mock, add backwards-compat test cases
  • Update packages/mcp/src/utils/get-manifest.ts — 404 hint mentions both componentsManifest and experimentalComponentsManifest for older Storybook versions
  • Update packages/mcp/src/utils/get-manifest.test.ts — asserts hint contains both flag names
  • Update packages/addon-mcp/README.md — reflect that componentsManifest defaults to true; "To enable" section shows both flag names with comments indicating which Storybook version each applies to
  • Update packages/addon-mcp/src/preset.test.ts — test references
  • Update packages/addon-mcp/src/mcp-handler.test.ts — test references
  • Update apps/internal-storybook/.storybook/main.ts — remove explicit componentsManifest: true (defaults to true)
  • Update eval/templates/grading/.storybook/main.ts — remove explicit componentsManifest: true (defaults to true)
  • Update .github/instructions/addon-mcp.instructions.md — remove "Requires feature flag" line (it's the default now)
  • Update .changeset/components-manifest-flag-rename.md — simplified to single sentence per review
  • Run tests — all 151 mcp + 180 addon-mcp tests pass
Original prompt

Task

Update all references to the Storybook feature flag experimentalComponentsManifestcomponentsManifest across the MCP packages. The flag has been renamed and now defaults to true in Storybook core.

The MCP addon needs backwards compatibility with older Storybook versions that still use the old flag name.

Files to change

1. packages/addon-mcp/src/tools/is-manifest-available.ts — Feature flag check

  • Change the feature flag check to support both old and new Storybook versions:
    // Before:
    const hasFeatureFlag = !!features?.experimentalComponentsManifest;
    
    // After (backwards compatible):
    const hasFeatureFlag = features?.componentsManifest !== false && (features?.componentsManifest === true || features?.componentsManifest === undefined || !!features?.experimentalComponentsManifest);
    Actually, simpler approach:
    const hasFeatureFlag = !!(features?.componentsManifest ?? features?.experimentalComponentsManifest);
    This checks the new name first, falls back to the old name for older Storybook versions.

2. packages/addon-mcp/README.md — Documentation

  • Replace all experimentalComponentsManifestcomponentsManifest in code examples
  • Update the configuration example — remove the explicit features.experimentalComponentsManifest: true line and add a comment that it's enabled by default:
    // .storybook/main.js
    export default {
      addons: [
        {
          name: '@storybook/addon-mcp',
          options: {
            toolsets: {
              dev: true,
              docs: true,
            },
          },
        },
      ],
      // componentsManifest is enabled by default, no need to set it
    };
  • Remove "Experimental" labeling from docs toolset section title (change "Docs Tools (Experimental)" → "Docs Tools")
  • Update the requirements section to reflect it's no longer experimental

3. packages/mcp/src/utils/get-manifest.ts — Error hint message

  • Update the 404 error hint from:
    features: { experimentalComponentsManifest: true }
    
    to:
    features: { componentsManifest: true }
    

4. packages/mcp/src/utils/get-manifest.test.ts — Test assertions

  • Update the test that checks for experimentalComponentsManifest in the error message to check for componentsManifest instead

5. .github/instructions/addon-mcp.instructions.md — Copilot instructions

  • Replace all experimentalComponentsManifestcomponentsManifest
  • Update "experimental" labeling where it refers to the feature flag

6. packages/addon-mcp/src/preset.test.ts — Tests

  • Update any references to the old flag name

7. packages/addon-mcp/src/mcp-handler.test.ts — Tests

  • Update any references to the old flag name

8. Full repo search

  • Grep the entire codebase for experimentalComponentsManifest and update ALL remaining occurrences
  • The only place the old name should remain is in is-manifest-available.ts for backwards compatibility

Validation

After making changes:

  1. Run pnpm test run to ensure all tests pass
  2. Run pnpm build to ensure build succeeds
  3. Run grep -r "experimentalComponentsManifest" packages/ to confirm the only remaining reference is the backwards-compat fallback in is-manifest-available.ts

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 2, 2026

🦋 Changeset detected

Latest commit: 2f6c893

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@storybook/addon-mcp Patch
@storybook/mcp Patch

Not sure what this means? Click here to learn what changesets are.

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

… backwards compat

Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Storybook feature flag references in MCP packages Rename experimentalComponentsManifestcomponentsManifest with backwards compat Mar 2, 2026
Copy link
Copy Markdown
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

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

@copilot added a bunch of suggestions, the biggest overall concern is that the documentation doesn't reflect that componentsManifest can largely be omitted because it defaults to true.

…tted

Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 2, 2026

@copilot added a bunch of suggestions, the biggest overall concern is that the documentation doesn't reflect that componentsManifest can largely be omitted because it defaults to true.

Done in a250488. The README now clearly states that componentsManifest defaults to true in recent Storybook versions, so users can omit it from their config. The config examples have been updated to remove the explicit flag, and the "To enable" section now says no configuration is needed with a note for older Storybook versions only.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ds.example.com
    • Triggering command: /opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/mcp/mcp/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/mcp/mcp/node_modules/vitest/dist/workers/forks.js (dns block)
  • my-lib.example.com
    • Triggering command: /opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/mcp/mcp/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/mcp/mcp/node_modules/vitest/dist/workers/forks.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@JReinhold JReinhold marked this pull request as ready for review March 2, 2026 16:00
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 2, 2026

npm i https://pkg.pr.new/storybookjs/mcp/@storybook/addon-mcp@181
npm i https://pkg.pr.new/storybookjs/mcp/@storybook/mcp@181

commit: 2f6c893

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 2, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
438 1 437 0
View the full list of 1 ❄️ flaky test(s)
apps/internal-storybook/tests/check-deps.e2e.test.ts > Storybook Dependencies > should be using latest versions from registry

Flake rate in main: 30.77% (Passed 45 times, Failed 20 times)

Stack Traces | 4.67s run time
Error: Storybook dependencies are outdated. Update the catalog in pnpm-workspace.yaml:

  sed -i '' 's/10\.3\.0-alpha\.12/10.3.0-alpha.14/g' pnpm-workspace.yaml && pnpm install

Outdated packages:
  - @storybook/addon-docs: 10.3.0-alpha.12 → 10.3.0-alpha.14
  - @storybook/react-vite: 10.3.0-alpha.12 → 10.3.0-alpha.14
  - storybook: 10.3.0-alpha.12 → 10.3.0-alpha.14
 ❯ tests/check-deps.e2e.test.ts:42:10

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copy link
Copy Markdown
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 updates the Storybook feature flag naming used across @storybook/addon-mcp and @storybook/mcp to reflect the core rename from experimentalComponentsManifest to componentsManifest, while keeping runtime compatibility for older Storybook versions in the addon.

Changes:

  • Updated addon-side feature-flag detection to prefer componentsManifest and fall back to experimentalComponentsManifest.
  • Updated docs/tests/config templates to reference componentsManifest and removed now-unnecessary explicit enabling in example configs.
  • Updated @storybook/mcp’s 404 error hint and corresponding tests to use the new flag name.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/mcp/src/utils/get-manifest.ts Updates 404 “enable manifest” hint to reference features.componentsManifest.
packages/mcp/src/utils/get-manifest.test.ts Updates assertions and test naming for the new hint string.
packages/addon-mcp/src/utils/is-manifest-available.ts Makes addon feature-flag detection prefer componentsManifest with legacy fallback.
packages/addon-mcp/src/utils/is-manifest-available.test.ts Adds coverage for legacy flag name and updates feature mocks.
packages/addon-mcp/src/preset.test.ts Updates mocked features flag name in preset-related tests.
packages/addon-mcp/src/mcp-handler.test.ts Updates mocked features flag name in handler tests.
packages/addon-mcp/README.md Updates docs to new flag name and removes “Experimental” labeling.
eval/templates/grading/.storybook/main.ts Removes explicit feature flag config now that it defaults to enabled.
apps/internal-storybook/.storybook/main.ts Removes explicit feature flag config now that it defaults to enabled.
.github/instructions/addon-mcp.instructions.md Removes docs toolset “requires experimental flag” note.
.github/copilot-instructions.md Updates internal guidance to reflect renamed flag + legacy fallback.
.changeset/components-manifest-flag-rename.md Adds changeset entry documenting the feature-flag rename.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 2, 2026

Bundle Report

Changes will increase total bundle size by 77 bytes (0.16%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@storybook/mcp-esm 42.92kB 77 bytes (0.18%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: @storybook/mcp-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.js 77 bytes 29.98kB 0.26%

Files in index.js:

  • ./src/utils/get-manifest.ts → Total Size: 6.28kB

… 404 hint

Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Copy link
Copy Markdown
Member

@kasperpeulen kasperpeulen left a comment

Choose a reason for hiding this comment

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

LGTM

@JReinhold JReinhold merged commit 36a25d3 into main Mar 5, 2026
8 of 9 checks passed
@JReinhold JReinhold deleted the copilot/update-storybook-feature-flag branch March 5, 2026 12:36
@storybook-app-bot storybook-app-bot bot mentioned this pull request Mar 5, 2026
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.

4 participants