From 14620cd82b9c759e3449a676bc63e94088b842ce Mon Sep 17 00:00:00 2001 From: Valery Bugakov Date: Wed, 28 Apr 2021 17:43:54 +0300 Subject: [PATCH 1/3] Core: Add features to the StorybookConfig type --- lib/core-common/src/types.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/core-common/src/types.ts b/lib/core-common/src/types.ts index 50d18720484b..3bb7dc7a24b4 100644 --- a/lib/core-common/src/types.ts +++ b/lib/core-common/src/types.ts @@ -229,6 +229,12 @@ export interface StorybookConfig { options?: any; } >; + /** + * Allows to disable deprecated implicit PostCSS loader. + */ + features?: { + postcss?: boolean + } /** * Tells Storybook where to find stories. * From b38464c65358d176473675900bde4c70323c564a Mon Sep 17 00:00:00 2001 From: Valery Bugakov Date: Wed, 28 Apr 2021 18:09:36 +0300 Subject: [PATCH 2/3] Core: Add core.builder and loglevel to StorybookConfig type --- examples/official-storybook/main.ts | 6 ++++-- examples/react-ts-webpack4/main.ts | 6 ++++-- examples/react-ts/main.ts | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/examples/official-storybook/main.ts b/examples/official-storybook/main.ts index e72009a04f20..3522ffe7dae3 100644 --- a/examples/official-storybook/main.ts +++ b/examples/official-storybook/main.ts @@ -2,7 +2,7 @@ import type { StorybookConfig } from '@storybook/react/types'; -module.exports = { +const config: StorybookConfig = { stories: [ // FIXME: Breaks e2e tests './intro.stories.mdx', '../../lib/ui/src/**/*.stories.@(js|tsx|mdx)', @@ -35,4 +35,6 @@ module.exports = { builder: 'webpack4', }, logLevel: 'debug', -} as StorybookConfig; +}; + +module.exports = config; diff --git a/examples/react-ts-webpack4/main.ts b/examples/react-ts-webpack4/main.ts index 14131c236a8e..9f01df4c63e7 100644 --- a/examples/react-ts-webpack4/main.ts +++ b/examples/react-ts-webpack4/main.ts @@ -1,6 +1,6 @@ import type { StorybookConfig } from '@storybook/react/types'; -module.exports = { +const config: StorybookConfig = { stories: ['./src/*.stories.*'], logLevel: 'debug', addons: [ @@ -27,4 +27,6 @@ module.exports = { propFilter: (prop) => ['label', 'disabled'].includes(prop.name), }, }, -} as StorybookConfig; +}; + +module.exports = config; diff --git a/examples/react-ts/main.ts b/examples/react-ts/main.ts index 3427cbbc2528..e702ca4c15ba 100644 --- a/examples/react-ts/main.ts +++ b/examples/react-ts/main.ts @@ -1,6 +1,6 @@ import type { StorybookConfig } from '@storybook/react/types'; -module.exports = { +const config: StorybookConfig = { stories: ['./src/*.stories.*'], logLevel: 'debug', addons: [ @@ -31,4 +31,6 @@ module.exports = { features: { postcss: false, }, -} as StorybookConfig; +}; + +module.exports = config; From 6b8c8b5345c8fe3c340d64d961a4eb1a66262738 Mon Sep 17 00:00:00 2001 From: Valery Bugakov Date: Wed, 28 Apr 2021 18:36:38 +0300 Subject: [PATCH 3/3] web: add core and loglevel types --- lib/core-common/src/types.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core-common/src/types.ts b/lib/core-common/src/types.ts index 3bb7dc7a24b4..c5b420b673be 100644 --- a/lib/core-common/src/types.ts +++ b/lib/core-common/src/types.ts @@ -229,12 +229,14 @@ export interface StorybookConfig { options?: any; } >; + core?: CoreConfig; + logLevel?: string; /** * Allows to disable deprecated implicit PostCSS loader. */ features?: { - postcss?: boolean - } + postcss?: boolean; + }; /** * Tells Storybook where to find stories. *