@storybook/react-vite 7.6.0 → 8.0.0-alpha.0
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?: {
|
|
@@ -3010,70 +3010,110 @@ interface StorybookConfig$1 {
|
|
|
3010
3010
|
disallowImplicitActionsInRenderV8?: boolean;
|
|
3011
3011
|
};
|
|
3012
3012
|
build?: TestBuildConfig;
|
|
3013
|
+
stories: StoriesEntry[];
|
|
3014
|
+
framework?: Preset;
|
|
3015
|
+
typescript?: Partial<TypescriptOptions$1>;
|
|
3016
|
+
refs?: CoreCommon_StorybookRefs;
|
|
3017
|
+
babel?: TransformOptions;
|
|
3018
|
+
swc?: Options$2;
|
|
3019
|
+
env?: Record<string, string>;
|
|
3020
|
+
babelDefault?: TransformOptions;
|
|
3021
|
+
config?: Entry[];
|
|
3022
|
+
previewAnnotations?: Entry[];
|
|
3023
|
+
storyIndexers?: StoryIndexer[];
|
|
3024
|
+
experimental_indexers?: Indexer[];
|
|
3025
|
+
docs?: DocsOptions;
|
|
3026
|
+
previewHead?: string;
|
|
3027
|
+
previewBody?: string;
|
|
3028
|
+
previewMainTemplate?: string;
|
|
3029
|
+
managerHead?: string;
|
|
3030
|
+
}
|
|
3031
|
+
/**
|
|
3032
|
+
* The interface for Storybook configuration in `main.ts` files.
|
|
3033
|
+
* This interface is public
|
|
3034
|
+
* All values should be wrapped with `PresetValue<>`, though there are a few exceptions: `addons`, `framework`
|
|
3035
|
+
*/
|
|
3036
|
+
interface StorybookConfig$1 {
|
|
3037
|
+
/**
|
|
3038
|
+
* Sets the addons you want to use with Storybook.
|
|
3039
|
+
*
|
|
3040
|
+
* @example `['@storybook/addon-essentials']` or `[{ name: '@storybook/addon-essentials', options: { backgrounds: false } }]`
|
|
3041
|
+
*/
|
|
3042
|
+
addons?: StorybookConfigRaw['addons'];
|
|
3043
|
+
core?: PresetValue<StorybookConfigRaw['core']>;
|
|
3044
|
+
/**
|
|
3045
|
+
* Sets a list of directories of static files to be loaded by Storybook server
|
|
3046
|
+
*
|
|
3047
|
+
* @example `['./public']` or `[{from: './public', 'to': '/assets'}]`
|
|
3048
|
+
*/
|
|
3049
|
+
staticDirs?: PresetValue<StorybookConfigRaw['staticDirs']>;
|
|
3050
|
+
logLevel?: PresetValue<StorybookConfigRaw['logLevel']>;
|
|
3051
|
+
features?: PresetValue<StorybookConfigRaw['features']>;
|
|
3052
|
+
build?: PresetValue<StorybookConfigRaw['build']>;
|
|
3013
3053
|
/**
|
|
3014
3054
|
* Tells Storybook where to find stories.
|
|
3015
3055
|
*
|
|
3016
|
-
* @example `['./src/*.stories.@(j|t)sx?']`
|
|
3056
|
+
* @example `['./src/*.stories.@(j|t)sx?']` or `async () => [...(await myCustomStoriesEntryBuilderFunc())]`
|
|
3017
3057
|
*/
|
|
3018
|
-
stories:
|
|
3058
|
+
stories: PresetValue<StorybookConfigRaw['stories']>;
|
|
3019
3059
|
/**
|
|
3020
3060
|
* Framework, e.g. '@storybook/react-vite', required in v7
|
|
3021
3061
|
*/
|
|
3022
|
-
framework?:
|
|
3062
|
+
framework?: StorybookConfigRaw['framework'];
|
|
3023
3063
|
/**
|
|
3024
3064
|
* Controls how Storybook handles TypeScript files.
|
|
3025
3065
|
*/
|
|
3026
|
-
typescript?:
|
|
3066
|
+
typescript?: PresetValue<StorybookConfigRaw['typescript']>;
|
|
3027
3067
|
/**
|
|
3028
3068
|
* References external Storybooks
|
|
3029
3069
|
*/
|
|
3030
|
-
refs?: PresetValue<
|
|
3070
|
+
refs?: PresetValue<StorybookConfigRaw['refs']>;
|
|
3031
3071
|
/**
|
|
3032
3072
|
* Modify or return babel config.
|
|
3033
3073
|
*/
|
|
3034
|
-
babel?:
|
|
3074
|
+
babel?: PresetValue<StorybookConfigRaw['babel']>;
|
|
3035
3075
|
/**
|
|
3036
3076
|
* Modify or return swc config.
|
|
3037
3077
|
*/
|
|
3038
|
-
swc?:
|
|
3078
|
+
swc?: PresetValue<StorybookConfigRaw['swc']>;
|
|
3039
3079
|
/**
|
|
3040
3080
|
* Modify or return env config.
|
|
3041
3081
|
*/
|
|
3042
|
-
env?: PresetValue<
|
|
3082
|
+
env?: PresetValue<StorybookConfigRaw['env']>;
|
|
3043
3083
|
/**
|
|
3044
3084
|
* Modify or return babel config.
|
|
3045
3085
|
*/
|
|
3046
|
-
babelDefault?:
|
|
3086
|
+
babelDefault?: PresetValue<StorybookConfigRaw['babelDefault']>;
|
|
3047
3087
|
/**
|
|
3048
3088
|
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
|
3049
3089
|
*
|
|
3050
3090
|
* @deprecated use `previewAnnotations` or `/preview.js` file instead
|
|
3051
3091
|
*/
|
|
3052
|
-
config?: PresetValue<
|
|
3092
|
+
config?: PresetValue<StorybookConfigRaw['config']>;
|
|
3053
3093
|
/**
|
|
3054
3094
|
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
|
3055
3095
|
*/
|
|
3056
|
-
previewAnnotations?: PresetValue<
|
|
3096
|
+
previewAnnotations?: PresetValue<StorybookConfigRaw['previewAnnotations']>;
|
|
3057
3097
|
/**
|
|
3058
3098
|
* Process CSF files for the story index.
|
|
3059
3099
|
* @deprecated use {@link experimental_indexers} instead
|
|
3060
3100
|
*/
|
|
3061
|
-
storyIndexers?: PresetValue<
|
|
3101
|
+
storyIndexers?: PresetValue<StorybookConfigRaw['storyIndexers']>;
|
|
3062
3102
|
/**
|
|
3063
3103
|
* Process CSF files for the story index.
|
|
3064
3104
|
*/
|
|
3065
|
-
experimental_indexers?: PresetValue<
|
|
3105
|
+
experimental_indexers?: PresetValue<StorybookConfigRaw['experimental_indexers']>;
|
|
3066
3106
|
/**
|
|
3067
3107
|
* Docs related features in index generation
|
|
3068
3108
|
*/
|
|
3069
|
-
docs?:
|
|
3109
|
+
docs?: PresetValue<StorybookConfigRaw['docs']>;
|
|
3070
3110
|
/**
|
|
3071
3111
|
* Programmatically modify the preview head/body HTML.
|
|
3072
3112
|
* The previewHead and previewBody functions accept a string,
|
|
3073
3113
|
* which is the existing head/body, and return a modified string.
|
|
3074
3114
|
*/
|
|
3075
|
-
previewHead?: PresetValue<
|
|
3076
|
-
previewBody?: PresetValue<
|
|
3115
|
+
previewHead?: PresetValue<StorybookConfigRaw['previewHead']>;
|
|
3116
|
+
previewBody?: PresetValue<StorybookConfigRaw['previewBody']>;
|
|
3077
3117
|
/**
|
|
3078
3118
|
* Programmatically override the preview's main page template.
|
|
3079
3119
|
* This should return a reference to a file containing an `.ejs` template
|
|
@@ -3081,17 +3121,17 @@ interface StorybookConfig$1 {
|
|
|
3081
3121
|
*
|
|
3082
3122
|
* @example '.storybook/index.ejs'
|
|
3083
3123
|
*/
|
|
3084
|
-
previewMainTemplate?:
|
|
3124
|
+
previewMainTemplate?: PresetValue<StorybookConfigRaw['previewMainTemplate']>;
|
|
3085
3125
|
/**
|
|
3086
3126
|
* Programmatically modify the preview head/body HTML.
|
|
3087
3127
|
* The managerHead function accept a string,
|
|
3088
3128
|
* which is the existing head content, and return a modified string.
|
|
3089
3129
|
*/
|
|
3090
|
-
managerHead?: PresetValue<
|
|
3130
|
+
managerHead?: PresetValue<StorybookConfigRaw['managerHead']>;
|
|
3091
3131
|
}
|
|
3092
3132
|
type PresetValue<T> = T | ((config: T, options: Options) => T | Promise<T>);
|
|
3093
|
-
type PresetProperty<K, TStorybookConfig =
|
|
3094
|
-
type PresetPropertyFn<K, TStorybookConfig =
|
|
3133
|
+
type PresetProperty<K, TStorybookConfig = StorybookConfigRaw> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
|
|
3134
|
+
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
3135
|
type Path = string;
|
|
3096
3136
|
|
|
3097
3137
|
type FrameworkName = '@storybook/react-vite';
|
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.0",
|
|
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.0",
|
|
53
|
+
"@storybook/react": "8.0.0-alpha.0",
|
|
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": {
|