Add Storybook MCP

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
Charles de Dreuille
2025-12-18 12:40:19 +00:00
parent 1381a2ff7d
commit 2b361f5198
5 changed files with 236 additions and 86 deletions
+6
View File
@@ -1,3 +1,4 @@
// This file has been automatically migrated to valid ESM format by Storybook.
import { defineMain } from '@storybook/react-vite/node';
import { fileURLToPath } from 'node:url';
import { createRequire } from 'node:module';
@@ -49,11 +50,16 @@ export default defineMain({
getAbsolutePath('@storybook/addon-docs'),
getAbsolutePath('@storybook/addon-a11y'),
getAbsolutePath('@storybook/addon-vitest'),
getAbsolutePath('@storybook/addon-mcp'),
],
framework: {
name: getAbsolutePath('@storybook/react-vite'),
options: {},
},
features: {
experimentalComponentsManifest: true,
experimentalCodeExamples: true, // optional
},
viteFinal: async (config, { configType }) => {
// Add Node.js polyfills for browser compatibility
//
+7
View File
@@ -107,6 +107,13 @@ export default definePreview({
// 'dark spotify': allModes['dark spotify'],
},
},
a11y: {
// 'todo' - show a11y violations in the test UI only
// 'error' - fail CI on a11y violations
// 'off' - skip a11y checks entirely
test: 'todo',
},
},
decorators: [