@storybook/react-webpack5 0.0.0-pr-24997-sha-c414978b → 0.0.0-pr-25079-sha-65111396
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preset.d.ts +92 -30
- package/package.json +4 -4
package/dist/preset.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { FileSystemCache } from 'file-system-cache';
|
2
2
|
import { TransformOptions } from '@babel/core';
|
3
3
|
import { Server } from 'http';
|
4
|
-
import { StorybookConfig } from './index.js';
|
4
|
+
import { StorybookConfig as StorybookConfig$1 } from './index.js';
|
5
5
|
import '@storybook/preset-react-webpack';
|
6
6
|
import '@storybook/builder-webpack5';
|
7
7
|
|
@@ -2787,13 +2787,9 @@ interface Presets {
|
|
2787
2787
|
apply(extension: 'entries', config?: [], args?: any): Promise<unknown>;
|
2788
2788
|
apply(extension: 'stories', config?: [], args?: any): Promise<StoriesEntry[]>;
|
2789
2789
|
apply(extension: 'managerEntries', config: [], args?: any): Promise<string[]>;
|
2790
|
-
apply(extension: 'refs', config?: [], args?: any): Promise<
|
2791
|
-
apply(extension: 'core', config?:
|
2792
|
-
apply(extension: '
|
2793
|
-
apply(extension: 'features', config?: StorybookConfigRaw['features'], args?: any): Promise<NonNullable<StorybookConfigRaw['features']>>;
|
2794
|
-
apply(extension: 'typescript', config?: StorybookConfigRaw['typescript'], args?: any): Promise<NonNullable<StorybookConfigRaw['typescript']>>;
|
2795
|
-
apply(extension: 'build', config?: StorybookConfigRaw['build'], args?: any): Promise<NonNullable<StorybookConfigRaw['build']>>;
|
2796
|
-
apply(extension: 'staticDirs', config?: StorybookConfigRaw['staticDirs'], args?: any): Promise<StorybookConfigRaw['staticDirs']>;
|
2790
|
+
apply(extension: 'refs', config?: [], args?: any): Promise<unknown>;
|
2791
|
+
apply(extension: 'core', config?: {}, args?: any): Promise<CoreConfig>;
|
2792
|
+
apply(extension: 'build', config?: {}, args?: any): Promise<StorybookConfig['build']>;
|
2797
2793
|
apply<T>(extension: string, config?: T, args?: unknown): Promise<T>;
|
2798
2794
|
}
|
2799
2795
|
interface LoadedPreset {
|
@@ -2853,7 +2849,7 @@ interface BuilderOptions {
|
|
2853
2849
|
cache?: FileSystemCache;
|
2854
2850
|
configDir: string;
|
2855
2851
|
docsMode?: boolean;
|
2856
|
-
features?:
|
2852
|
+
features?: StorybookConfig['features'];
|
2857
2853
|
versionCheck?: VersionCheck;
|
2858
2854
|
disableWebpackDefaults?: boolean;
|
2859
2855
|
serverChannelUrl?: string;
|
@@ -2959,10 +2955,9 @@ interface TestBuildConfig {
|
|
2959
2955
|
test?: TestBuildFlags;
|
2960
2956
|
}
|
2961
2957
|
/**
|
2962
|
-
* The interface for Storybook configuration
|
2963
|
-
* The difference is that these values are the raw values, AKA, not wrapped with `PresetValue<>`
|
2958
|
+
* The interface for Storybook configuration in `main.ts` files.
|
2964
2959
|
*/
|
2965
|
-
interface
|
2960
|
+
interface StorybookConfig {
|
2966
2961
|
/**
|
2967
2962
|
* Sets the addons you want to use with Storybook.
|
2968
2963
|
*
|
@@ -2970,6 +2965,11 @@ interface StorybookConfigRaw {
|
|
2970
2965
|
*/
|
2971
2966
|
addons?: Preset[];
|
2972
2967
|
core?: CoreConfig;
|
2968
|
+
/**
|
2969
|
+
* Sets a list of directories of static files to be loaded by Storybook server
|
2970
|
+
*
|
2971
|
+
* @example `['./public']` or `[{from: './public', 'to': '/assets'}]`
|
2972
|
+
*/
|
2973
2973
|
staticDirs?: (DirectoryMapping | string)[];
|
2974
2974
|
logLevel?: string;
|
2975
2975
|
features?: {
|
@@ -3011,31 +3011,93 @@ interface StorybookConfigRaw {
|
|
3011
3011
|
disallowImplicitActionsInRenderV8?: boolean;
|
3012
3012
|
};
|
3013
3013
|
build?: TestBuildConfig;
|
3014
|
+
/**
|
3015
|
+
* Tells Storybook where to find stories.
|
3016
|
+
*
|
3017
|
+
* @example `['./src/*.stories.@(j|t)sx?']`
|
3018
|
+
*/
|
3014
3019
|
stories: StoriesEntry[];
|
3020
|
+
/**
|
3021
|
+
* Framework, e.g. '@storybook/react-vite', required in v7
|
3022
|
+
*/
|
3015
3023
|
framework?: Preset;
|
3024
|
+
/**
|
3025
|
+
* Controls how Storybook handles TypeScript files.
|
3026
|
+
*/
|
3016
3027
|
typescript?: Partial<TypescriptOptions>;
|
3017
|
-
|
3018
|
-
|
3019
|
-
|
3020
|
-
|
3021
|
-
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3028
|
+
/**
|
3029
|
+
* References external Storybooks
|
3030
|
+
*/
|
3031
|
+
refs?: PresetValue<CoreCommon_StorybookRefs>;
|
3032
|
+
/**
|
3033
|
+
* Modify or return babel config.
|
3034
|
+
*/
|
3035
|
+
babel?: (config: TransformOptions, options: Options) => TransformOptions | Promise<TransformOptions>;
|
3036
|
+
/**
|
3037
|
+
* Modify or return swc config.
|
3038
|
+
*/
|
3039
|
+
swc?: (config: Options$2, options: Options) => Options$2 | Promise<Options$2>;
|
3040
|
+
/**
|
3041
|
+
* Modify or return env config.
|
3042
|
+
*/
|
3043
|
+
env?: PresetValue<Record<string, string>>;
|
3044
|
+
/**
|
3045
|
+
* Modify or return babel config.
|
3046
|
+
*/
|
3047
|
+
babelDefault?: (config: TransformOptions, options: Options) => TransformOptions | Promise<TransformOptions>;
|
3048
|
+
/**
|
3049
|
+
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
3050
|
+
*
|
3051
|
+
* @deprecated use `previewAnnotations` or `/preview.js` file instead
|
3052
|
+
*/
|
3053
|
+
config?: PresetValue<Entry[]>;
|
3054
|
+
/**
|
3055
|
+
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
3056
|
+
*/
|
3057
|
+
previewAnnotations?: PresetValue<Entry[]>;
|
3058
|
+
/**
|
3059
|
+
* Process CSF files for the story index.
|
3060
|
+
* @deprecated use {@link experimental_indexers} instead
|
3061
|
+
*/
|
3062
|
+
storyIndexers?: PresetValue<StoryIndexer[]>;
|
3063
|
+
/**
|
3064
|
+
* Process CSF files for the story index.
|
3065
|
+
*/
|
3066
|
+
experimental_indexers?: PresetValue<Indexer[]>;
|
3067
|
+
/**
|
3068
|
+
* Docs related features in index generation
|
3069
|
+
*/
|
3026
3070
|
docs?: DocsOptions;
|
3027
|
-
|
3028
|
-
|
3071
|
+
/**
|
3072
|
+
* Programmatically modify the preview head/body HTML.
|
3073
|
+
* The previewHead and previewBody functions accept a string,
|
3074
|
+
* which is the existing head/body, and return a modified string.
|
3075
|
+
*/
|
3076
|
+
previewHead?: PresetValue<string>;
|
3077
|
+
previewBody?: PresetValue<string>;
|
3078
|
+
/**
|
3079
|
+
* Programmatically override the preview's main page template.
|
3080
|
+
* This should return a reference to a file containing an `.ejs` template
|
3081
|
+
* that will be interpolated with environment variables.
|
3082
|
+
*
|
3083
|
+
* @example '.storybook/index.ejs'
|
3084
|
+
*/
|
3029
3085
|
previewMainTemplate?: string;
|
3030
|
-
|
3086
|
+
/**
|
3087
|
+
* Programmatically modify the preview head/body HTML.
|
3088
|
+
* The managerHead function accept a string,
|
3089
|
+
* which is the existing head content, and return a modified string.
|
3090
|
+
*/
|
3091
|
+
managerHead?: PresetValue<string>;
|
3031
3092
|
}
|
3032
|
-
type
|
3033
|
-
type
|
3093
|
+
type PresetValue<T> = T | ((config: T, options: Options) => T | Promise<T>);
|
3094
|
+
type PresetProperty<K, TStorybookConfig = StorybookConfig> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
|
3095
|
+
type PresetPropertyFn<K, TStorybookConfig = StorybookConfig, TOptions = {}> = (config: TStorybookConfig[K extends keyof TStorybookConfig ? K : never], options: Options & TOptions) => TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | Promise<TStorybookConfig[K extends keyof TStorybookConfig ? K : never]>;
|
3034
3096
|
type Path = string;
|
3035
3097
|
|
3036
|
-
declare const addons: PresetProperty<'addons'>;
|
3037
|
-
declare const frameworkOptions: (_: never, options: Options) => Promise<StorybookConfig['framework']>;
|
3038
|
-
declare const core: PresetProperty<'core'>;
|
3039
|
-
declare const webpack: StorybookConfig['webpack'];
|
3098
|
+
declare const addons: PresetProperty<'addons', StorybookConfig$1>;
|
3099
|
+
declare const frameworkOptions: (_: never, options: Options) => Promise<StorybookConfig$1['framework']>;
|
3100
|
+
declare const core: PresetProperty<'core', StorybookConfig$1>;
|
3101
|
+
declare const webpack: StorybookConfig$1['webpack'];
|
3040
3102
|
|
3041
3103
|
export { addons, core, frameworkOptions, webpack };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/react-webpack5",
|
3
|
-
"version": "0.0.0-pr-
|
3
|
+
"version": "0.0.0-pr-25079-sha-65111396",
|
4
4
|
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -47,9 +47,9 @@
|
|
47
47
|
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
48
48
|
},
|
49
49
|
"dependencies": {
|
50
|
-
"@storybook/builder-webpack5": "0.0.0-pr-
|
51
|
-
"@storybook/preset-react-webpack": "0.0.0-pr-
|
52
|
-
"@storybook/react": "0.0.0-pr-
|
50
|
+
"@storybook/builder-webpack5": "0.0.0-pr-25079-sha-65111396",
|
51
|
+
"@storybook/preset-react-webpack": "0.0.0-pr-25079-sha-65111396",
|
52
|
+
"@storybook/react": "0.0.0-pr-25079-sha-65111396",
|
53
53
|
"@types/node": "^18.0.0"
|
54
54
|
},
|
55
55
|
"devDependencies": {
|