@storybook/react-webpack5 7.0.0-alpha.43 → 7.0.0-alpha.45
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 +73 -48
- package/dist/preset.js +1 -1
- package/dist/preset.mjs +1 -1
- package/package.json +5 -5
package/dist/preset.d.ts
CHANGED
@@ -1,32 +1,10 @@
|
|
1
|
+
import { FileSystemCache } from 'file-system-cache';
|
1
2
|
import { TransformOptions } from '@babel/core';
|
2
3
|
import { Server } from 'http';
|
3
|
-
import Cache__default from 'file-system-cache';
|
4
4
|
import { S as StorybookConfig$1 } from './types-e3f39788.js';
|
5
5
|
import '@storybook/preset-react-webpack';
|
6
6
|
import '@storybook/builder-webpack5';
|
7
7
|
|
8
|
-
interface Options {
|
9
|
-
allowRegExp: boolean;
|
10
|
-
allowFunction: boolean;
|
11
|
-
allowSymbol: boolean;
|
12
|
-
allowDate: boolean;
|
13
|
-
allowUndefined: boolean;
|
14
|
-
allowClass: boolean;
|
15
|
-
maxDepth: number;
|
16
|
-
space: number | undefined;
|
17
|
-
lazyEval: boolean;
|
18
|
-
}
|
19
|
-
|
20
|
-
declare global {
|
21
|
-
interface SymbolConstructor {
|
22
|
-
readonly observable: symbol;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
declare type Parameters = {
|
27
|
-
[name: string]: any;
|
28
|
-
};
|
29
|
-
|
30
8
|
/**
|
31
9
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
32
10
|
|
@@ -742,7 +720,52 @@ PackageJson$1.NonStandardEntryPoints &
|
|
742
720
|
PackageJson$1.TypeScriptConfiguration &
|
743
721
|
PackageJson$1.YarnConfiguration &
|
744
722
|
PackageJson$1.JSPMConfiguration;
|
745
|
-
|
723
|
+
|
724
|
+
declare type StoryId = string;
|
725
|
+
declare type Tag = string;
|
726
|
+
declare type Parameters$1 = {
|
727
|
+
[name: string]: any;
|
728
|
+
};
|
729
|
+
declare type Addon_Comparator<T> = ((a: T, b: T) => boolean) | ((a: T, b: T) => number);
|
730
|
+
declare type Addon_StorySortMethod = 'configure' | 'alphabetical';
|
731
|
+
interface Addon_StorySortObjectParameter {
|
732
|
+
method?: Addon_StorySortMethod;
|
733
|
+
order?: any[];
|
734
|
+
locales?: string;
|
735
|
+
includeNames?: boolean;
|
736
|
+
}
|
737
|
+
declare type Addon_IndexEntryLegacy = [StoryId, any, Parameters, Parameters];
|
738
|
+
declare type Addon_StorySortComparator = Addon_Comparator<Addon_IndexEntryLegacy>;
|
739
|
+
declare type Addon_StorySortParameter = Addon_StorySortComparator | Addon_StorySortObjectParameter;
|
740
|
+
interface Addon_OptionsParameter extends Object {
|
741
|
+
storySort?: Addon_StorySortParameter;
|
742
|
+
theme?: {
|
743
|
+
base: string;
|
744
|
+
brandTitle?: string;
|
745
|
+
};
|
746
|
+
[key: string]: any;
|
747
|
+
}
|
748
|
+
declare type Layout = 'centered' | 'fullscreen' | 'padded' | 'none';
|
749
|
+
interface Parameters extends Parameters$1 {
|
750
|
+
fileName?: string;
|
751
|
+
options?: Addon_OptionsParameter;
|
752
|
+
/** The layout property defines basic styles added to the preview body where the story is rendered. If you pass 'none', no styles are applied. */
|
753
|
+
layout?: Layout;
|
754
|
+
docsOnly?: boolean;
|
755
|
+
[key: string]: any;
|
756
|
+
}
|
757
|
+
|
758
|
+
interface Options$1 {
|
759
|
+
allowRegExp: boolean;
|
760
|
+
allowFunction: boolean;
|
761
|
+
allowSymbol: boolean;
|
762
|
+
allowDate: boolean;
|
763
|
+
allowUndefined: boolean;
|
764
|
+
allowClass: boolean;
|
765
|
+
maxDepth: number;
|
766
|
+
space: number | undefined;
|
767
|
+
lazyEval: boolean;
|
768
|
+
}
|
746
769
|
|
747
770
|
/**
|
748
771
|
* ⚠️ This file contains internal WIP types they MUST NOT be exported outside this package for now!
|
@@ -756,7 +779,7 @@ interface CoreConfig {
|
|
756
779
|
};
|
757
780
|
renderer?: RendererName;
|
758
781
|
disableWebpackDefaults?: boolean;
|
759
|
-
channelOptions?: Partial<Options>;
|
782
|
+
channelOptions?: Partial<Options$1>;
|
760
783
|
/**
|
761
784
|
* Disables the generation of project.json, a file containing Storybook metadata
|
762
785
|
*/
|
@@ -785,11 +808,11 @@ interface DirectoryMapping {
|
|
785
808
|
to: string;
|
786
809
|
}
|
787
810
|
interface Presets {
|
788
|
-
apply(extension: 'typescript', config: TypescriptOptions, args?: Options
|
811
|
+
apply(extension: 'typescript', config: TypescriptOptions, args?: Options): Promise<TypescriptOptions>;
|
789
812
|
apply(extension: 'framework', config?: {}, args?: any): Promise<Preset>;
|
790
813
|
apply(extension: 'babel', config?: {}, args?: any): Promise<TransformOptions>;
|
791
814
|
apply(extension: 'entries', config?: [], args?: any): Promise<unknown>;
|
792
|
-
apply(extension: 'stories', config?: [], args?: any): Promise<
|
815
|
+
apply(extension: 'stories', config?: [], args?: any): Promise<CoreCommon_StoriesEntry[]>;
|
793
816
|
apply(extension: 'managerEntries', config: [], args?: any): Promise<string[]>;
|
794
817
|
apply(extension: 'refs', config?: [], args?: any): Promise<unknown>;
|
795
818
|
apply(extension: 'core', config?: {}, args?: any): Promise<CoreConfig>;
|
@@ -868,24 +891,26 @@ interface StorybookConfigOptions {
|
|
868
891
|
presets: Presets;
|
869
892
|
presetsList?: LoadedPreset[];
|
870
893
|
}
|
871
|
-
declare type Options
|
872
|
-
interface
|
894
|
+
declare type Options = LoadOptions & StorybookConfigOptions & CLIOptions & BuilderOptions;
|
895
|
+
interface CoreCommon_IndexerOptions {
|
873
896
|
makeTitle: (userTitle?: string) => string;
|
874
897
|
}
|
875
|
-
interface
|
898
|
+
interface CoreCommon_IndexedStory {
|
876
899
|
id: string;
|
877
900
|
name: string;
|
901
|
+
tags?: Tag[];
|
878
902
|
parameters?: Parameters;
|
879
903
|
}
|
880
|
-
interface
|
904
|
+
interface CoreCommon_StoryIndex {
|
881
905
|
meta: {
|
882
906
|
title?: string;
|
907
|
+
tags?: Tag[];
|
883
908
|
};
|
884
|
-
stories:
|
909
|
+
stories: CoreCommon_IndexedStory[];
|
885
910
|
}
|
886
|
-
interface
|
911
|
+
interface CoreCommon_StoryIndexer {
|
887
912
|
test: RegExp;
|
888
|
-
indexer: (fileName: string, options:
|
913
|
+
indexer: (fileName: string, options: CoreCommon_IndexerOptions) => Promise<CoreCommon_StoryIndex>;
|
889
914
|
addDocsTemplate?: boolean;
|
890
915
|
}
|
891
916
|
/**
|
@@ -905,7 +930,7 @@ interface TypescriptOptions {
|
|
905
930
|
*/
|
906
931
|
skipBabel: boolean;
|
907
932
|
}
|
908
|
-
interface
|
933
|
+
interface CoreCommon_StoriesSpecifier {
|
909
934
|
/**
|
910
935
|
* When auto-titling, what to prefix all generated titles with (default: '')
|
911
936
|
*/
|
@@ -921,7 +946,7 @@ interface StoriesSpecifier {
|
|
921
946
|
*/
|
922
947
|
files?: string;
|
923
948
|
}
|
924
|
-
declare type
|
949
|
+
declare type CoreCommon_StoriesEntry = string | CoreCommon_StoriesSpecifier;
|
925
950
|
declare type Preset = string | {
|
926
951
|
name: string;
|
927
952
|
options?: any;
|
@@ -931,7 +956,7 @@ declare type Preset = string | {
|
|
931
956
|
* preview or the manager,
|
932
957
|
*/
|
933
958
|
declare type Entry = string;
|
934
|
-
declare type
|
959
|
+
declare type CoreCommon_StorybookRefs = Record<string, {
|
935
960
|
title: string;
|
936
961
|
url: string;
|
937
962
|
} | {
|
@@ -1019,7 +1044,7 @@ interface StorybookConfig {
|
|
1019
1044
|
*
|
1020
1045
|
* @example `['./src/*.stories.@(j|t)sx?']`
|
1021
1046
|
*/
|
1022
|
-
stories:
|
1047
|
+
stories: CoreCommon_StoriesEntry[];
|
1023
1048
|
/**
|
1024
1049
|
* Framework, e.g. '@storybook/react', required in v7
|
1025
1050
|
*/
|
@@ -1031,29 +1056,29 @@ interface StorybookConfig {
|
|
1031
1056
|
/**
|
1032
1057
|
* References external Storybooks
|
1033
1058
|
*/
|
1034
|
-
refs?:
|
1059
|
+
refs?: CoreCommon_StorybookRefs | ((config: any, options: Options) => CoreCommon_StorybookRefs);
|
1035
1060
|
/**
|
1036
1061
|
* Modify or return babel config.
|
1037
1062
|
*/
|
1038
|
-
babel?: (config: TransformOptions, options: Options
|
1063
|
+
babel?: (config: TransformOptions, options: Options) => TransformOptions | Promise<TransformOptions>;
|
1039
1064
|
/**
|
1040
1065
|
* Modify or return babel config.
|
1041
1066
|
*/
|
1042
|
-
babelDefault?: (config: TransformOptions, options: Options
|
1067
|
+
babelDefault?: (config: TransformOptions, options: Options) => TransformOptions | Promise<TransformOptions>;
|
1043
1068
|
/**
|
1044
1069
|
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
1045
1070
|
*
|
1046
1071
|
* @deprecated use `previewAnnotations` or `/preview.js` file instead
|
1047
1072
|
*/
|
1048
|
-
config?: (entries: Entry[], options: Options
|
1073
|
+
config?: (entries: Entry[], options: Options) => Entry[];
|
1049
1074
|
/**
|
1050
1075
|
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
1051
1076
|
*/
|
1052
|
-
previewAnnotations?: (entries: Entry[], options: Options
|
1077
|
+
previewAnnotations?: (entries: Entry[], options: Options) => Entry[];
|
1053
1078
|
/**
|
1054
1079
|
* Process CSF files for the story index.
|
1055
1080
|
*/
|
1056
|
-
storyIndexers?: (indexers:
|
1081
|
+
storyIndexers?: (indexers: CoreCommon_StoryIndexer[], options: Options) => CoreCommon_StoryIndexer[];
|
1057
1082
|
/**
|
1058
1083
|
* Docs related features in index generation
|
1059
1084
|
*/
|
@@ -1063,14 +1088,14 @@ interface StorybookConfig {
|
|
1063
1088
|
* The previewHead and previewBody functions accept a string,
|
1064
1089
|
* which is the existing head/body, and return a modified string.
|
1065
1090
|
*/
|
1066
|
-
previewHead?: (head: string, options: Options
|
1067
|
-
previewBody?: (body: string, options: Options
|
1091
|
+
previewHead?: (head: string, options: Options) => string;
|
1092
|
+
previewBody?: (body: string, options: Options) => string;
|
1068
1093
|
}
|
1069
1094
|
declare type PresetProperty<K, TStorybookConfig = StorybookConfig> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
|
1070
|
-
declare type PresetPropertyFn<K, TStorybookConfig = StorybookConfig, TOptions = {}> = (config: TStorybookConfig[K extends keyof TStorybookConfig ? K : never], options: Options
|
1095
|
+
declare 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]>;
|
1071
1096
|
|
1072
1097
|
declare const addons: PresetProperty<'addons', StorybookConfig$1>;
|
1073
|
-
declare const frameworkOptions: (_: never, options: Options
|
1098
|
+
declare const frameworkOptions: (_: never, options: Options) => Promise<StorybookConfig$1['framework']>;
|
1074
1099
|
declare const core: PresetProperty<'core', StorybookConfig$1>;
|
1075
1100
|
declare const webpack: StorybookConfig$1['webpack'];
|
1076
1101
|
|
package/dist/preset.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var y=Object.create;var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var
|
1
|
+
"use strict";var y=Object.create;var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var l=(o,e)=>{for(var r in e)a(o,r,{get:e[r],enumerable:!0})},i=(o,e,r,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of b(e))!f.call(o,s)&&s!==r&&a(o,s,{get:()=>e[s],enumerable:!(p=m(e,s))||p.enumerable});return o};var k=(o,e,r)=>(r=o!=null?y(c(o)):{},i(e||!o||!o.__esModule?a(r,"default",{value:o,enumerable:!0}):r,o)),w=o=>i(a({},"__esModule",{value:!0}),o);var j={};l(j,{addons:()=>u,core:()=>g,frameworkOptions:()=>d,webpack:()=>v});module.exports=w(j);var t=k(require("path")),u=[t.default.dirname(require.resolve(t.default.join("@storybook/preset-react-webpack","package.json")))],n={legacyRootApi:!0},d=async(o,e)=>{let r=await e.presets.apply("framework");return typeof r=="string"?{name:r,options:n}:typeof r>"u"?{name:require.resolve("@storybook/react-webpack5"),options:n}:{name:r.name,options:{...n,...r.options}}},g=async(o,e)=>{let r=await e.presets.apply("framework");return{...o,builder:{name:t.default.dirname(require.resolve(t.default.join("@storybook/builder-webpack5","package.json"))),options:typeof r=="string"?{}:r.options.builder||{}},renderer:t.default.dirname(require.resolve(t.default.join("@storybook/react","package.json")))}},v=async o=>{var e;return o.resolve=o.resolve||{},o.resolve.alias={...(e=o.resolve)==null?void 0:e.alias,"@storybook/react":t.default.dirname(require.resolve(t.default.join("@storybook/react","package.json")))},o};0&&(module.exports={addons,core,frameworkOptions,webpack});
|
package/dist/preset.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var t=(o=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(o,{get:(s,e)=>(typeof require!="undefined"?require:s)[e]}):o)(function(o){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+o+'" is not supported')});import r from"path";var k=[r.dirname(t.resolve(r.join("@storybook/preset-react-webpack","package.json")))],a={legacyRootApi:!0},y=async(o,s)=>{let e=await s.presets.apply("framework");return typeof e=="string"?{name:e,options:a}:typeof e>"u"?{name:t.resolve("@storybook/react-webpack5"),options:a}:{name:e.name,options:{...a,...e.options}}},
|
1
|
+
var t=(o=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(o,{get:(s,e)=>(typeof require!="undefined"?require:s)[e]}):o)(function(o){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+o+'" is not supported')});import r from"path";var k=[r.dirname(t.resolve(r.join("@storybook/preset-react-webpack","package.json")))],a={legacyRootApi:!0},y=async(o,s)=>{let e=await s.presets.apply("framework");return typeof e=="string"?{name:e,options:a}:typeof e>"u"?{name:t.resolve("@storybook/react-webpack5"),options:a}:{name:e.name,options:{...a,...e.options}}},b=async(o,s)=>{let e=await s.presets.apply("framework");return{...o,builder:{name:r.dirname(t.resolve(r.join("@storybook/builder-webpack5","package.json"))),options:typeof e=="string"?{}:e.options.builder||{}},renderer:r.dirname(t.resolve(r.join("@storybook/react","package.json")))}},c=async o=>(o.resolve=o.resolve||{},o.resolve.alias={...o.resolve?.alias,"@storybook/react":r.dirname(t.resolve(r.join("@storybook/react","package.json")))},o);export{k as addons,b as core,y as frameworkOptions,c as webpack};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/react-webpack5",
|
3
|
-
"version": "7.0.0-alpha.
|
3
|
+
"version": "7.0.0-alpha.45",
|
4
4
|
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -51,9 +51,9 @@
|
|
51
51
|
"prep": "../../../scripts/prepare/bundle.ts"
|
52
52
|
},
|
53
53
|
"dependencies": {
|
54
|
-
"@storybook/builder-webpack5": "7.0.0-alpha.
|
55
|
-
"@storybook/preset-react-webpack": "7.0.0-alpha.
|
56
|
-
"@storybook/react": "7.0.0-alpha.
|
54
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.45",
|
55
|
+
"@storybook/preset-react-webpack": "7.0.0-alpha.45",
|
56
|
+
"@storybook/react": "7.0.0-alpha.45",
|
57
57
|
"@types/node": "^16.0.0"
|
58
58
|
},
|
59
59
|
"devDependencies": {
|
@@ -86,5 +86,5 @@
|
|
86
86
|
],
|
87
87
|
"platform": "node"
|
88
88
|
},
|
89
|
-
"gitHead": "
|
89
|
+
"gitHead": "3ef14366115c56c1d45c0359ff681cc47ed50532"
|
90
90
|
}
|