mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
chore(storybook): consolidate storybook and enhance plugin stories (#37771)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user