@storybook/react-vite 7.6.3 → 8.0.0-alpha.1
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.
|
@@ -2786,9 +2786,13 @@ interface Presets {
|
|
|
2786
2786
|
apply(extension: 'entries', config?: [], args?: any): Promise<unknown>;
|
|
2787
2787
|
apply(extension: 'stories', config?: [], args?: any): Promise<StoriesEntry[]>;
|
|
2788
2788
|
apply(extension: 'managerEntries', config: [], args?: any): Promise<string[]>;
|
|
2789
|
-
apply(extension: 'refs', config?: [], args?: any): Promise<
|
|
2790
|
-
apply(extension: 'core', config?:
|
|
2791
|
-
apply(extension: '
|
|
2789
|
+
apply(extension: 'refs', config?: [], args?: any): Promise<StorybookConfigRaw['refs']>;
|
|
2790
|
+
apply(extension: 'core', config?: StorybookConfigRaw['core'], args?: any): Promise<NonNullable<StorybookConfigRaw['core']>>;
|
|
2791
|
+
apply(extension: 'docs', config?: StorybookConfigRaw['docs'], args?: any): Promise<NonNullable<StorybookConfigRaw['docs']>>;
|
|
2792
|
+
apply(extension: 'features', config?: StorybookConfigRaw['features'], args?: any): Promise<NonNullable<StorybookConfigRaw['features']>>;
|
|
2793
|
+
apply(extension: 'typescript', config?: StorybookConfigRaw['typescript'], args?: any): Promise<NonNullable<StorybookConfigRaw['typescript']>>;
|
|
2794
|
+
apply(extension: 'build', config?: StorybookConfigRaw['build'], args?: any): Promise<NonNullable<StorybookConfigRaw['build']>>;
|
|
2795
|
+
apply(extension: 'staticDirs', config?: StorybookConfigRaw['staticDirs'], args?: any): Promise<StorybookConfigRaw['staticDirs']>;
|
|
2792
2796
|
apply<T>(extension: string, config?: T, args?: unknown): Promise<T>;
|
|
2793
2797
|
}
|
|
2794
2798
|
interface LoadedPreset {
|
|
@@ -2848,7 +2852,7 @@ interface BuilderOptions {
|
|
|
2848
2852
|
cache?: FileSystemCache;
|
|
2849
2853
|
configDir: string;
|
|
2850
2854
|
docsMode?: boolean;
|
|
2851
|
-
features?:
|
|
2855
|
+
features?: StorybookConfigRaw['features'];
|
|
2852
2856
|
versionCheck?: VersionCheck;
|
|
2853
2857
|
disableWebpackDefaults?: boolean;
|
|
2854
2858
|
serverChannelUrl?: string;
|
|
@@ -2954,9 +2958,10 @@ interface TestBuildConfig {
|
|
|
2954
2958
|
test?: TestBuildFlags;
|
|
2955
2959
|
}
|
|
2956
2960
|
/**
|
|
2957
|
-
* The interface for Storybook configuration in
|
|
2961
|
+
* The interface for Storybook configuration used internally in presets
|
|
2962
|
+
* The difference is that these values are the raw values, AKA, not wrapped with `PresetValue<>`
|
|
2958
2963
|
*/
|
|
2959
|
-
interface
|
|
2964
|
+
interface StorybookConfigRaw {
|
|
2960
2965
|
/**
|
|
2961
2966
|
* Sets the addons you want to use with Storybook.
|
|
2962
2967
|
*
|
|
@@ -2964,11 +2969,6 @@ interface StorybookConfig$1 {
|
|
|
2964
2969
|
*/
|
|
2965
2970
|
addons?: Preset[];
|
|
2966
2971
|
core?: CoreConfig;
|
|
2967
|
-
/**
|
|
2968
|
-
* Sets a list of directories of static files to be loaded by Storybook server
|
|
2969
|
-
*
|
|
2970
|
-
* @example `['./public']` or `[{from: './public', 'to': '/assets'}]`
|
|
2971
|
-
*/
|
|
2972
2972
|
staticDirs?: (DirectoryMapping | string)[];
|
|
2973
2973
|
logLevel?: string;
|
|
2974
2974
|
features?: {
|
|
@@ -3008,72 +3008,116 @@ interface StorybookConfig$1 {
|
|
|
3008
3008
|
* This will make sure that your story renders the same no matter if docgen is enabled or not.
|
|
3009
3009
|
*/
|
|
3010
3010
|
disallowImplicitActionsInRenderV8?: boolean;
|
|
3011
|
+
/**
|
|
3012
|
+
* Enable asynchronous component rendering in NextJS framework
|
|
3013
|
+
*/
|
|
3014
|
+
experimentalNextRSC?: boolean;
|
|
3011
3015
|
};
|
|
3012
3016
|
build?: TestBuildConfig;
|
|
3017
|
+
stories: StoriesEntry[];
|
|
3018
|
+
framework?: Preset;
|
|
3019
|
+
typescript?: Partial<TypescriptOptions$1>;
|
|
3020
|
+
refs?: CoreCommon_StorybookRefs;
|
|
3021
|
+
babel?: TransformOptions;
|
|
3022
|
+
swc?: Options$2;
|
|
3023
|
+
env?: Record<string, string>;
|
|
3024
|
+
babelDefault?: TransformOptions;
|
|
3025
|
+
config?: Entry[];
|
|
3026
|
+
previewAnnotations?: Entry[];
|
|
3027
|
+
storyIndexers?: StoryIndexer[];
|
|
3028
|
+
experimental_indexers?: Indexer[];
|
|
3029
|
+
docs?: DocsOptions;
|
|
3030
|
+
previewHead?: string;
|
|
3031
|
+
previewBody?: string;
|
|
3032
|
+
previewMainTemplate?: string;
|
|
3033
|
+
managerHead?: string;
|
|
3034
|
+
}
|
|
3035
|
+
/**
|
|
3036
|
+
* The interface for Storybook configuration in `main.ts` files.
|
|
3037
|
+
* This interface is public
|
|
3038
|
+
* All values should be wrapped with `PresetValue<>`, though there are a few exceptions: `addons`, `framework`
|
|
3039
|
+
*/
|
|
3040
|
+
interface StorybookConfig$1 {
|
|
3041
|
+
/**
|
|
3042
|
+
* Sets the addons you want to use with Storybook.
|
|
3043
|
+
*
|
|
3044
|
+
* @example `['@storybook/addon-essentials']` or `[{ name: '@storybook/addon-essentials', options: { backgrounds: false } }]`
|
|
3045
|
+
*/
|
|
3046
|
+
addons?: StorybookConfigRaw['addons'];
|
|
3047
|
+
core?: PresetValue<StorybookConfigRaw['core']>;
|
|
3048
|
+
/**
|
|
3049
|
+
* Sets a list of directories of static files to be loaded by Storybook server
|
|
3050
|
+
*
|
|
3051
|
+
* @example `['./public']` or `[{from: './public', 'to': '/assets'}]`
|
|
3052
|
+
*/
|
|
3053
|
+
staticDirs?: PresetValue<StorybookConfigRaw['staticDirs']>;
|
|
3054
|
+
logLevel?: PresetValue<StorybookConfigRaw['logLevel']>;
|
|
3055
|
+
features?: PresetValue<StorybookConfigRaw['features']>;
|
|
3056
|
+
build?: PresetValue<StorybookConfigRaw['build']>;
|
|
3013
3057
|
/**
|
|
3014
3058
|
* Tells Storybook where to find stories.
|
|
3015
3059
|
*
|
|
3016
|
-
* @example `['./src/*.stories.@(j|t)sx?']`
|
|
3060
|
+
* @example `['./src/*.stories.@(j|t)sx?']` or `async () => [...(await myCustomStoriesEntryBuilderFunc())]`
|
|
3017
3061
|
*/
|
|
3018
|
-
stories:
|
|
3062
|
+
stories: PresetValue<StorybookConfigRaw['stories']>;
|
|
3019
3063
|
/**
|
|
3020
3064
|
* Framework, e.g. '@storybook/react-vite', required in v7
|
|
3021
3065
|
*/
|
|
3022
|
-
framework?:
|
|
3066
|
+
framework?: StorybookConfigRaw['framework'];
|
|
3023
3067
|
/**
|
|
3024
3068
|
* Controls how Storybook handles TypeScript files.
|
|
3025
3069
|
*/
|
|
3026
|
-
typescript?:
|
|
3070
|
+
typescript?: PresetValue<StorybookConfigRaw['typescript']>;
|
|
3027
3071
|
/**
|
|
3028
3072
|
* References external Storybooks
|
|
3029
3073
|
*/
|
|
3030
|
-
refs?: PresetValue<
|
|
3074
|
+
refs?: PresetValue<StorybookConfigRaw['refs']>;
|
|
3031
3075
|
/**
|
|
3032
3076
|
* Modify or return babel config.
|
|
3033
3077
|
*/
|
|
3034
|
-
babel?:
|
|
3078
|
+
babel?: PresetValue<StorybookConfigRaw['babel']>;
|
|
3035
3079
|
/**
|
|
3036
3080
|
* Modify or return swc config.
|
|
3037
3081
|
*/
|
|
3038
|
-
swc?:
|
|
3082
|
+
swc?: PresetValue<StorybookConfigRaw['swc']>;
|
|
3039
3083
|
/**
|
|
3040
3084
|
* Modify or return env config.
|
|
3041
3085
|
*/
|
|
3042
|
-
env?: PresetValue<
|
|
3086
|
+
env?: PresetValue<StorybookConfigRaw['env']>;
|
|
3043
3087
|
/**
|
|
3044
3088
|
* Modify or return babel config.
|
|
3045
3089
|
*/
|
|
3046
|
-
babelDefault?:
|
|
3090
|
+
babelDefault?: PresetValue<StorybookConfigRaw['babelDefault']>;
|
|
3047
3091
|
/**
|
|
3048
3092
|
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
|
3049
3093
|
*
|
|
3050
3094
|
* @deprecated use `previewAnnotations` or `/preview.js` file instead
|
|
3051
3095
|
*/
|
|
3052
|
-
config?: PresetValue<
|
|
3096
|
+
config?: PresetValue<StorybookConfigRaw['config']>;
|
|
3053
3097
|
/**
|
|
3054
3098
|
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
|
3055
3099
|
*/
|
|
3056
|
-
previewAnnotations?: PresetValue<
|
|
3100
|
+
previewAnnotations?: PresetValue<StorybookConfigRaw['previewAnnotations']>;
|
|
3057
3101
|
/**
|
|
3058
3102
|
* Process CSF files for the story index.
|
|
3059
3103
|
* @deprecated use {@link experimental_indexers} instead
|
|
3060
3104
|
*/
|
|
3061
|
-
storyIndexers?: PresetValue<
|
|
3105
|
+
storyIndexers?: PresetValue<StorybookConfigRaw['storyIndexers']>;
|
|
3062
3106
|
/**
|
|
3063
3107
|
* Process CSF files for the story index.
|
|
3064
3108
|
*/
|
|
3065
|
-
experimental_indexers?: PresetValue<
|
|
3109
|
+
experimental_indexers?: PresetValue<StorybookConfigRaw['experimental_indexers']>;
|
|
3066
3110
|
/**
|
|
3067
3111
|
* Docs related features in index generation
|
|
3068
3112
|
*/
|
|
3069
|
-
docs?:
|
|
3113
|
+
docs?: PresetValue<StorybookConfigRaw['docs']>;
|
|
3070
3114
|
/**
|
|
3071
3115
|
* Programmatically modify the preview head/body HTML.
|
|
3072
3116
|
* The previewHead and previewBody functions accept a string,
|
|
3073
3117
|
* which is the existing head/body, and return a modified string.
|
|
3074
3118
|
*/
|
|
3075
|
-
previewHead?: PresetValue<
|
|
3076
|
-
previewBody?: PresetValue<
|
|
3119
|
+
previewHead?: PresetValue<StorybookConfigRaw['previewHead']>;
|
|
3120
|
+
previewBody?: PresetValue<StorybookConfigRaw['previewBody']>;
|
|
3077
3121
|
/**
|
|
3078
3122
|
* Programmatically override the preview's main page template.
|
|
3079
3123
|
* This should return a reference to a file containing an `.ejs` template
|
|
@@ -3081,17 +3125,17 @@ interface StorybookConfig$1 {
|
|
|
3081
3125
|
*
|
|
3082
3126
|
* @example '.storybook/index.ejs'
|
|
3083
3127
|
*/
|
|
3084
|
-
previewMainTemplate?:
|
|
3128
|
+
previewMainTemplate?: PresetValue<StorybookConfigRaw['previewMainTemplate']>;
|
|
3085
3129
|
/**
|
|
3086
3130
|
* Programmatically modify the preview head/body HTML.
|
|
3087
3131
|
* The managerHead function accept a string,
|
|
3088
3132
|
* which is the existing head content, and return a modified string.
|
|
3089
3133
|
*/
|
|
3090
|
-
managerHead?: PresetValue<
|
|
3134
|
+
managerHead?: PresetValue<StorybookConfigRaw['managerHead']>;
|
|
3091
3135
|
}
|
|
3092
3136
|
type PresetValue<T> = T | ((config: T, options: Options) => T | Promise<T>);
|
|
3093
|
-
type PresetProperty<K, TStorybookConfig =
|
|
3094
|
-
type PresetPropertyFn<K, TStorybookConfig =
|
|
3137
|
+
type PresetProperty<K, TStorybookConfig = StorybookConfigRaw> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
|
|
3138
|
+
type PresetPropertyFn<K, TStorybookConfig = StorybookConfigRaw, 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]>;
|
|
3095
3139
|
type Path = string;
|
|
3096
3140
|
|
|
3097
3141
|
type FrameworkName = '@storybook/react-vite';
|
|
@@ -3124,7 +3168,7 @@ type TypescriptOptions = TypescriptOptions$1 & {
|
|
|
3124
3168
|
/**
|
|
3125
3169
|
* Sets the type of Docgen when working with React and TypeScript
|
|
3126
3170
|
*
|
|
3127
|
-
* @default `'react-docgen
|
|
3171
|
+
* @default `'react-docgen'`
|
|
3128
3172
|
*/
|
|
3129
3173
|
reactDocgen: 'react-docgen-typescript' | 'react-docgen' | false;
|
|
3130
3174
|
/**
|
package/dist/index.d.ts
CHANGED
package/dist/preset.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-vite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.1",
|
|
4
4
|
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@joshwooding/vite-plugin-react-docgen-typescript": "0.3.0",
|
|
51
51
|
"@rollup/pluginutils": "^5.0.2",
|
|
52
|
-
"@storybook/builder-vite": "
|
|
53
|
-
"@storybook/react": "
|
|
52
|
+
"@storybook/builder-vite": "8.0.0-alpha.1",
|
|
53
|
+
"@storybook/react": "8.0.0-alpha.1",
|
|
54
54
|
"@vitejs/plugin-react": "^3.0.1",
|
|
55
55
|
"magic-string": "^0.30.0",
|
|
56
56
|
"react-docgen": "^7.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "^18.0.0",
|
|
60
|
-
"typescript": "
|
|
60
|
+
"typescript": "^5.3.2",
|
|
61
61
|
"vite": "^4.0.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|