chore(storybook): consolidate storybook and enhance plugin stories (#37771)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2026-02-11 19:06:23 -05:00
committed by GitHub
parent b012b63e5b
commit 981b370fe9
173 changed files with 5307 additions and 18230 deletions

View File

@@ -218,16 +218,18 @@ if (!isDevMode) {
}
// TypeScript type checking configuration
// SWC handles transpilation, but we still need ForkTsCheckerWebpackPlugin
// to generate .d.ts files for the plugin packages
if (!isDevMode) {
// SWC handles transpilation. In production, type checking is done by:
// 1. `npm run plugins:build` which generates .d.ts files
// 2. `npm run type` which runs full TypeScript checking
// We skip ForkTsCheckerWebpackPlugin in production because:
// - Story files import from @storybook-shared which causes rootDir errors
// - The above commands already provide comprehensive type checking
if (isDevMode) {
plugins.push(
new ForkTsCheckerWebpackPlugin({
async: false,
async: true,
typescript: {
memoryLimit: TYPESCRIPT_MEMORY_LIMIT,
build: true, // CRITICAL: Generate .d.ts files for plugins
mode: 'write-references', // Handle project references
configOverwrite: {
compilerOptions: {
skipLibCheck: true,
@@ -442,6 +444,7 @@ const config = {
path.resolve(APP_DIR, 'plugins'),
],
alias: {
'@storybook-shared': path.resolve(APP_DIR, '.storybook/shared'),
react: path.resolve(path.join(APP_DIR, './node_modules/react')),
// TODO: remove Handlebars alias once Handlebars NPM package has been updated to
// correctly support webpack import (https://github.com/handlebars-lang/handlebars.js/issues/953)