@storybook/preact-vite 7.6.3 → 8.0.0-alpha.1

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<unknown>;
2789
- apply(extension: 'core', config?: {}, args?: any): Promise<CoreConfig>;
2790
- apply(extension: 'build', config?: {}, args?: any): Promise<StorybookConfig$1['build']>;
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?: StorybookConfig$1['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 `main.ts` files.
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 StorybookConfig$1 {
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?: {
@@ -3007,72 +3007,116 @@ interface StorybookConfig$1 {
3007
3007
  * This will make sure that your story renders the same no matter if docgen is enabled or not.
3008
3008
  */
3009
3009
  disallowImplicitActionsInRenderV8?: boolean;
3010
+ /**
3011
+ * Enable asynchronous component rendering in NextJS framework
3012
+ */
3013
+ experimentalNextRSC?: boolean;
3010
3014
  };
3011
3015
  build?: TestBuildConfig;
3016
+ stories: StoriesEntry[];
3017
+ framework?: Preset;
3018
+ typescript?: Partial<TypescriptOptions>;
3019
+ refs?: CoreCommon_StorybookRefs;
3020
+ babel?: TransformOptions;
3021
+ swc?: Options$2;
3022
+ env?: Record<string, string>;
3023
+ babelDefault?: TransformOptions;
3024
+ config?: Entry[];
3025
+ previewAnnotations?: Entry[];
3026
+ storyIndexers?: StoryIndexer[];
3027
+ experimental_indexers?: Indexer[];
3028
+ docs?: DocsOptions;
3029
+ previewHead?: string;
3030
+ previewBody?: string;
3031
+ previewMainTemplate?: string;
3032
+ managerHead?: string;
3033
+ }
3034
+ /**
3035
+ * The interface for Storybook configuration in `main.ts` files.
3036
+ * This interface is public
3037
+ * All values should be wrapped with `PresetValue<>`, though there are a few exceptions: `addons`, `framework`
3038
+ */
3039
+ interface StorybookConfig$1 {
3040
+ /**
3041
+ * Sets the addons you want to use with Storybook.
3042
+ *
3043
+ * @example `['@storybook/addon-essentials']` or `[{ name: '@storybook/addon-essentials', options: { backgrounds: false } }]`
3044
+ */
3045
+ addons?: StorybookConfigRaw['addons'];
3046
+ core?: PresetValue<StorybookConfigRaw['core']>;
3047
+ /**
3048
+ * Sets a list of directories of static files to be loaded by Storybook server
3049
+ *
3050
+ * @example `['./public']` or `[{from: './public', 'to': '/assets'}]`
3051
+ */
3052
+ staticDirs?: PresetValue<StorybookConfigRaw['staticDirs']>;
3053
+ logLevel?: PresetValue<StorybookConfigRaw['logLevel']>;
3054
+ features?: PresetValue<StorybookConfigRaw['features']>;
3055
+ build?: PresetValue<StorybookConfigRaw['build']>;
3012
3056
  /**
3013
3057
  * Tells Storybook where to find stories.
3014
3058
  *
3015
- * @example `['./src/*.stories.@(j|t)sx?']`
3059
+ * @example `['./src/*.stories.@(j|t)sx?']` or `async () => [...(await myCustomStoriesEntryBuilderFunc())]`
3016
3060
  */
3017
- stories: StoriesEntry[];
3061
+ stories: PresetValue<StorybookConfigRaw['stories']>;
3018
3062
  /**
3019
3063
  * Framework, e.g. '@storybook/react-vite', required in v7
3020
3064
  */
3021
- framework?: Preset;
3065
+ framework?: StorybookConfigRaw['framework'];
3022
3066
  /**
3023
3067
  * Controls how Storybook handles TypeScript files.
3024
3068
  */
3025
- typescript?: Partial<TypescriptOptions>;
3069
+ typescript?: PresetValue<StorybookConfigRaw['typescript']>;
3026
3070
  /**
3027
3071
  * References external Storybooks
3028
3072
  */
3029
- refs?: PresetValue<CoreCommon_StorybookRefs>;
3073
+ refs?: PresetValue<StorybookConfigRaw['refs']>;
3030
3074
  /**
3031
3075
  * Modify or return babel config.
3032
3076
  */
3033
- babel?: (config: TransformOptions, options: Options) => TransformOptions | Promise<TransformOptions>;
3077
+ babel?: PresetValue<StorybookConfigRaw['babel']>;
3034
3078
  /**
3035
3079
  * Modify or return swc config.
3036
3080
  */
3037
- swc?: (config: Options$2, options: Options) => Options$2 | Promise<Options$2>;
3081
+ swc?: PresetValue<StorybookConfigRaw['swc']>;
3038
3082
  /**
3039
3083
  * Modify or return env config.
3040
3084
  */
3041
- env?: PresetValue<Record<string, string>>;
3085
+ env?: PresetValue<StorybookConfigRaw['env']>;
3042
3086
  /**
3043
3087
  * Modify or return babel config.
3044
3088
  */
3045
- babelDefault?: (config: TransformOptions, options: Options) => TransformOptions | Promise<TransformOptions>;
3089
+ babelDefault?: PresetValue<StorybookConfigRaw['babelDefault']>;
3046
3090
  /**
3047
3091
  * Add additional scripts to run in the preview a la `.storybook/preview.js`
3048
3092
  *
3049
3093
  * @deprecated use `previewAnnotations` or `/preview.js` file instead
3050
3094
  */
3051
- config?: PresetValue<Entry[]>;
3095
+ config?: PresetValue<StorybookConfigRaw['config']>;
3052
3096
  /**
3053
3097
  * Add additional scripts to run in the preview a la `.storybook/preview.js`
3054
3098
  */
3055
- previewAnnotations?: PresetValue<Entry[]>;
3099
+ previewAnnotations?: PresetValue<StorybookConfigRaw['previewAnnotations']>;
3056
3100
  /**
3057
3101
  * Process CSF files for the story index.
3058
3102
  * @deprecated use {@link experimental_indexers} instead
3059
3103
  */
3060
- storyIndexers?: PresetValue<StoryIndexer[]>;
3104
+ storyIndexers?: PresetValue<StorybookConfigRaw['storyIndexers']>;
3061
3105
  /**
3062
3106
  * Process CSF files for the story index.
3063
3107
  */
3064
- experimental_indexers?: PresetValue<Indexer[]>;
3108
+ experimental_indexers?: PresetValue<StorybookConfigRaw['experimental_indexers']>;
3065
3109
  /**
3066
3110
  * Docs related features in index generation
3067
3111
  */
3068
- docs?: DocsOptions;
3112
+ docs?: PresetValue<StorybookConfigRaw['docs']>;
3069
3113
  /**
3070
3114
  * Programmatically modify the preview head/body HTML.
3071
3115
  * The previewHead and previewBody functions accept a string,
3072
3116
  * which is the existing head/body, and return a modified string.
3073
3117
  */
3074
- previewHead?: PresetValue<string>;
3075
- previewBody?: PresetValue<string>;
3118
+ previewHead?: PresetValue<StorybookConfigRaw['previewHead']>;
3119
+ previewBody?: PresetValue<StorybookConfigRaw['previewBody']>;
3076
3120
  /**
3077
3121
  * Programmatically override the preview's main page template.
3078
3122
  * This should return a reference to a file containing an `.ejs` template
@@ -3080,17 +3124,17 @@ interface StorybookConfig$1 {
3080
3124
  *
3081
3125
  * @example '.storybook/index.ejs'
3082
3126
  */
3083
- previewMainTemplate?: string;
3127
+ previewMainTemplate?: PresetValue<StorybookConfigRaw['previewMainTemplate']>;
3084
3128
  /**
3085
3129
  * Programmatically modify the preview head/body HTML.
3086
3130
  * The managerHead function accept a string,
3087
3131
  * which is the existing head content, and return a modified string.
3088
3132
  */
3089
- managerHead?: PresetValue<string>;
3133
+ managerHead?: PresetValue<StorybookConfigRaw['managerHead']>;
3090
3134
  }
3091
3135
  type PresetValue<T> = T | ((config: T, options: Options) => T | Promise<T>);
3092
- type PresetProperty<K, TStorybookConfig = StorybookConfig$1> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
3093
- type PresetPropertyFn<K, TStorybookConfig = StorybookConfig$1, 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]>;
3136
+ type PresetProperty<K, TStorybookConfig = StorybookConfigRaw> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
3137
+ 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
3138
  type Path = string;
3095
3139
 
3096
3140
  type FrameworkName = '@storybook/preact-vite';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { F as FrameworkOptions, S as StorybookConfig } from './index-cd9b6938.js';
1
+ export { F as FrameworkOptions, S as StorybookConfig } from './index-b0246dd8.js';
2
2
  import 'file-system-cache';
3
3
  import '@babel/core';
4
4
  import 'http';
package/dist/preset.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as PresetProperty, S as StorybookConfig } from './index-cd9b6938.js';
1
+ import { P as PresetProperty, S as StorybookConfig } from './index-b0246dd8.js';
2
2
  import 'file-system-cache';
3
3
  import '@babel/core';
4
4
  import 'http';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/preact-vite",
3
- "version": "7.6.3",
3
+ "version": "8.0.0-alpha.1",
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": "7.6.3",
52
- "@storybook/preact": "7.6.3"
51
+ "@storybook/builder-vite": "8.0.0-alpha.1",
52
+ "@storybook/preact": "8.0.0-alpha.1"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/node": "^18.0.0",
56
- "typescript": "~4.9.3",
56
+ "typescript": "^5.3.2",
57
57
  "vite": "^4.0.0"
58
58
  },
59
59
  "peerDependencies": {