@storybook/server-webpack5 7.6.0-beta.2 → 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.
- package/dist/preset.d.ts +27 -92
- package/package.json +6 -6
package/dist/preset.d.ts
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
import { FileSystemCache } from 'file-system-cache';
|
2
2
|
import { TransformOptions } from '@babel/core';
|
3
3
|
import { Server } from 'http';
|
4
|
-
import { StorybookConfig as StorybookConfig$1 } from './index.js';
|
5
|
-
import '@storybook/preset-server-webpack';
|
6
|
-
import '@storybook/builder-webpack5';
|
7
4
|
|
8
5
|
/**
|
9
6
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
@@ -2787,9 +2784,13 @@ interface Presets {
|
|
2787
2784
|
apply(extension: 'entries', config?: [], args?: any): Promise<unknown>;
|
2788
2785
|
apply(extension: 'stories', config?: [], args?: any): Promise<StoriesEntry[]>;
|
2789
2786
|
apply(extension: 'managerEntries', config: [], args?: any): Promise<string[]>;
|
2790
|
-
apply(extension: 'refs', config?: [], args?: any): Promise<
|
2791
|
-
apply(extension: 'core', config?:
|
2792
|
-
apply(extension: '
|
2787
|
+
apply(extension: 'refs', config?: [], args?: any): Promise<StorybookConfigRaw['refs']>;
|
2788
|
+
apply(extension: 'core', config?: StorybookConfigRaw['core'], args?: any): Promise<NonNullable<StorybookConfigRaw['core']>>;
|
2789
|
+
apply(extension: 'docs', config?: StorybookConfigRaw['docs'], args?: any): Promise<NonNullable<StorybookConfigRaw['docs']>>;
|
2790
|
+
apply(extension: 'features', config?: StorybookConfigRaw['features'], args?: any): Promise<NonNullable<StorybookConfigRaw['features']>>;
|
2791
|
+
apply(extension: 'typescript', config?: StorybookConfigRaw['typescript'], args?: any): Promise<NonNullable<StorybookConfigRaw['typescript']>>;
|
2792
|
+
apply(extension: 'build', config?: StorybookConfigRaw['build'], args?: any): Promise<NonNullable<StorybookConfigRaw['build']>>;
|
2793
|
+
apply(extension: 'staticDirs', config?: StorybookConfigRaw['staticDirs'], args?: any): Promise<StorybookConfigRaw['staticDirs']>;
|
2793
2794
|
apply<T>(extension: string, config?: T, args?: unknown): Promise<T>;
|
2794
2795
|
}
|
2795
2796
|
interface LoadedPreset {
|
@@ -2849,7 +2850,7 @@ interface BuilderOptions {
|
|
2849
2850
|
cache?: FileSystemCache;
|
2850
2851
|
configDir: string;
|
2851
2852
|
docsMode?: boolean;
|
2852
|
-
features?:
|
2853
|
+
features?: StorybookConfigRaw['features'];
|
2853
2854
|
versionCheck?: VersionCheck;
|
2854
2855
|
disableWebpackDefaults?: boolean;
|
2855
2856
|
serverChannelUrl?: string;
|
@@ -2955,9 +2956,10 @@ interface TestBuildConfig {
|
|
2955
2956
|
test?: TestBuildFlags;
|
2956
2957
|
}
|
2957
2958
|
/**
|
2958
|
-
* The interface for Storybook configuration in
|
2959
|
+
* The interface for Storybook configuration used internally in presets
|
2960
|
+
* The difference is that these values are the raw values, AKA, not wrapped with `PresetValue<>`
|
2959
2961
|
*/
|
2960
|
-
interface
|
2962
|
+
interface StorybookConfigRaw {
|
2961
2963
|
/**
|
2962
2964
|
* Sets the addons you want to use with Storybook.
|
2963
2965
|
*
|
@@ -2965,11 +2967,6 @@ interface StorybookConfig {
|
|
2965
2967
|
*/
|
2966
2968
|
addons?: Preset[];
|
2967
2969
|
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
2970
|
staticDirs?: (DirectoryMapping | string)[];
|
2974
2971
|
logLevel?: string;
|
2975
2972
|
features?: {
|
@@ -3011,91 +3008,29 @@ interface StorybookConfig {
|
|
3011
3008
|
disallowImplicitActionsInRenderV8?: boolean;
|
3012
3009
|
};
|
3013
3010
|
build?: TestBuildConfig;
|
3014
|
-
/**
|
3015
|
-
* Tells Storybook where to find stories.
|
3016
|
-
*
|
3017
|
-
* @example `['./src/*.stories.@(j|t)sx?']`
|
3018
|
-
*/
|
3019
3011
|
stories: StoriesEntry[];
|
3020
|
-
/**
|
3021
|
-
* Framework, e.g. '@storybook/react-vite', required in v7
|
3022
|
-
*/
|
3023
3012
|
framework?: Preset;
|
3024
|
-
/**
|
3025
|
-
* Controls how Storybook handles TypeScript files.
|
3026
|
-
*/
|
3027
3013
|
typescript?: Partial<TypescriptOptions>;
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3033
|
-
|
3034
|
-
|
3035
|
-
|
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
|
-
*/
|
3014
|
+
refs?: CoreCommon_StorybookRefs;
|
3015
|
+
babel?: TransformOptions;
|
3016
|
+
swc?: Options$2;
|
3017
|
+
env?: Record<string, string>;
|
3018
|
+
babelDefault?: TransformOptions;
|
3019
|
+
config?: Entry[];
|
3020
|
+
previewAnnotations?: Entry[];
|
3021
|
+
storyIndexers?: StoryIndexer[];
|
3022
|
+
experimental_indexers?: Indexer[];
|
3070
3023
|
docs?: DocsOptions;
|
3071
|
-
|
3072
|
-
|
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
|
-
*/
|
3024
|
+
previewHead?: string;
|
3025
|
+
previewBody?: string;
|
3085
3026
|
previewMainTemplate?: string;
|
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>;
|
3027
|
+
managerHead?: string;
|
3092
3028
|
}
|
3093
|
-
type
|
3094
|
-
type
|
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]>;
|
3029
|
+
type PresetProperty<K, TStorybookConfig = StorybookConfigRaw> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
|
3030
|
+
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]>;
|
3096
3031
|
type Path = string;
|
3097
3032
|
|
3098
|
-
declare const addons: PresetProperty<'addons'
|
3099
|
-
declare const core: PresetProperty<'core'
|
3033
|
+
declare const addons: PresetProperty<'addons'>;
|
3034
|
+
declare const core: PresetProperty<'core'>;
|
3100
3035
|
|
3101
3036
|
export { addons, core };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/server-webpack5",
|
3
|
-
"version": "
|
3
|
+
"version": "8.0.0-alpha.0",
|
4
4
|
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -47,14 +47,14 @@
|
|
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": "
|
51
|
-
"@storybook/core-common": "
|
52
|
-
"@storybook/preset-server-webpack": "
|
53
|
-
"@storybook/server": "
|
50
|
+
"@storybook/builder-webpack5": "8.0.0-alpha.0",
|
51
|
+
"@storybook/core-common": "8.0.0-alpha.0",
|
52
|
+
"@storybook/preset-server-webpack": "8.0.0-alpha.0",
|
53
|
+
"@storybook/server": "8.0.0-alpha.0",
|
54
54
|
"@types/node": "^18.0.0"
|
55
55
|
},
|
56
56
|
"devDependencies": {
|
57
|
-
"typescript": "
|
57
|
+
"typescript": "^5.3.2"
|
58
58
|
},
|
59
59
|
"engines": {
|
60
60
|
"node": ">=16.0.0"
|