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