@storybook/react-webpack5 7.0.0-alpha.0 → 7.0.0-alpha.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/preset.d.ts +337 -0
- package/dist/preset.js +1 -0
- package/dist/preset.mjs +1 -0
- package/dist/types-e3f39788.d.ts +27 -0
- package/package.json +38 -13
- package/preset.js +1 -1
- package/dist/cjs/index.js +0 -37
- package/dist/cjs/preset.js +0 -76
- package/dist/cjs/types.js +0 -5
- package/dist/esm/index.js +0 -2
- package/dist/esm/preset.js +0 -6
- package/dist/esm/types.js +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/preset.d.ts +0 -11
- package/dist/types/types.d.ts +0 -38
- package/standalone.js +0 -7
- package/types-6-0.d.ts +0 -1
- package/types-7-0.d.ts +0 -1
- package/types.d.ts +0 -1
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=(r,o,t,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==t&&a(r,e,{get:()=>o[e],enumerable:!(m=b(o,e))||m.enumerable});return r},x=(r,o,t)=>(f(r,o,"default"),t&&f(t,o,"default"));var g=r=>f(a({},"__esModule",{value:!0}),r);var p={};module.exports=g(p);x(p,require("@storybook/react"),module.exports);
|
package/dist/index.mjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";export*from"@storybook/react";
|
package/dist/preset.d.ts
ADDED
@@ -0,0 +1,337 @@
|
|
1
|
+
import { TransformOptions } from '@babel/core';
|
2
|
+
import { Server } from 'http';
|
3
|
+
import Cache__default from 'file-system-cache';
|
4
|
+
import { S as StorybookConfig$1 } from './types-e3f39788.js';
|
5
|
+
import '@storybook/preset-react-webpack';
|
6
|
+
import '@storybook/builder-webpack5';
|
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 type Parameters = {
|
21
|
+
[name: string]: any;
|
22
|
+
};
|
23
|
+
|
24
|
+
declare type FileSystemCache = ReturnType<typeof Cache__default>;
|
25
|
+
|
26
|
+
/**
|
27
|
+
* ⚠️ This file contains internal WIP types they MUST NOT be exported outside this package for now!
|
28
|
+
*/
|
29
|
+
declare type BuilderName = 'webpack5' | '@storybook/builder-webpack5' | string;
|
30
|
+
interface CoreConfig {
|
31
|
+
builder?: BuilderName | {
|
32
|
+
name: BuilderName;
|
33
|
+
options?: Record<string, any>;
|
34
|
+
};
|
35
|
+
disableWebpackDefaults?: boolean;
|
36
|
+
channelOptions?: Partial<Options>;
|
37
|
+
/**
|
38
|
+
* Disables the generation of project.json, a file containing Storybook metadata
|
39
|
+
*/
|
40
|
+
disableProjectJson?: boolean;
|
41
|
+
/**
|
42
|
+
* Disables Storybook telemetry
|
43
|
+
* @see https://storybook.js.org/telemetry
|
44
|
+
*/
|
45
|
+
disableTelemetry?: boolean;
|
46
|
+
/**
|
47
|
+
* Enable crash reports to be sent to Storybook telemetry
|
48
|
+
* @see https://storybook.js.org/telemetry
|
49
|
+
*/
|
50
|
+
enableCrashReports?: boolean;
|
51
|
+
/**
|
52
|
+
* enable CORS headings to run document in a "secure context"
|
53
|
+
* see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements
|
54
|
+
* This enables these headers in development-mode:
|
55
|
+
* Cross-Origin-Opener-Policy: same-origin
|
56
|
+
* Cross-Origin-Embedder-Policy: require-corp
|
57
|
+
*/
|
58
|
+
crossOriginIsolated?: boolean;
|
59
|
+
}
|
60
|
+
interface DirectoryMapping {
|
61
|
+
from: string;
|
62
|
+
to: string;
|
63
|
+
}
|
64
|
+
interface Presets {
|
65
|
+
apply(extension: 'typescript', config: TypescriptOptions, args?: Options$1): Promise<TypescriptOptions>;
|
66
|
+
apply(extension: 'framework', config?: {}, args?: any): Promise<Preset>;
|
67
|
+
apply(extension: 'babel', config?: {}, args?: any): Promise<TransformOptions>;
|
68
|
+
apply(extension: 'entries', config?: [], args?: any): Promise<unknown>;
|
69
|
+
apply(extension: 'stories', config?: [], args?: any): Promise<StoriesEntry[]>;
|
70
|
+
apply(extension: 'managerEntries', config: [], args?: any): Promise<string[]>;
|
71
|
+
apply(extension: 'refs', config?: [], args?: any): Promise<unknown>;
|
72
|
+
apply(extension: 'core', config?: {}, args?: any): Promise<CoreConfig>;
|
73
|
+
apply<T>(extension: string, config?: T, args?: unknown): Promise<T>;
|
74
|
+
}
|
75
|
+
interface LoadedPreset {
|
76
|
+
name: string;
|
77
|
+
preset: any;
|
78
|
+
options: any;
|
79
|
+
}
|
80
|
+
interface VersionCheck {
|
81
|
+
success: boolean;
|
82
|
+
data?: any;
|
83
|
+
error?: any;
|
84
|
+
time: number;
|
85
|
+
}
|
86
|
+
interface ReleaseNotesData {
|
87
|
+
success: boolean;
|
88
|
+
currentVersion: string;
|
89
|
+
showOnFirstLaunch: boolean;
|
90
|
+
}
|
91
|
+
interface PackageJson {
|
92
|
+
name: string;
|
93
|
+
version: string;
|
94
|
+
dependencies?: Record<string, string>;
|
95
|
+
devDependencies?: Record<string, string>;
|
96
|
+
peerDependencies?: Record<string, string>;
|
97
|
+
scripts?: Record<string, string>;
|
98
|
+
eslintConfig?: Record<string, any>;
|
99
|
+
type?: 'module';
|
100
|
+
[key: string]: any;
|
101
|
+
}
|
102
|
+
interface LoadOptions {
|
103
|
+
packageJson: PackageJson;
|
104
|
+
outputDir?: string;
|
105
|
+
configDir?: string;
|
106
|
+
ignorePreview?: boolean;
|
107
|
+
extendServer?: (server: Server) => void;
|
108
|
+
}
|
109
|
+
interface CLIOptions {
|
110
|
+
port?: number;
|
111
|
+
ignorePreview?: boolean;
|
112
|
+
previewUrl?: string;
|
113
|
+
forceBuildPreview?: boolean;
|
114
|
+
disableTelemetry?: boolean;
|
115
|
+
enableCrashReports?: boolean;
|
116
|
+
host?: string;
|
117
|
+
/**
|
118
|
+
* @deprecated Use 'staticDirs' Storybook Configuration option instead
|
119
|
+
*/
|
120
|
+
staticDir?: string[];
|
121
|
+
configDir?: string;
|
122
|
+
https?: boolean;
|
123
|
+
sslCa?: string[];
|
124
|
+
sslCert?: string;
|
125
|
+
sslKey?: string;
|
126
|
+
smokeTest?: boolean;
|
127
|
+
managerCache?: boolean;
|
128
|
+
open?: boolean;
|
129
|
+
ci?: boolean;
|
130
|
+
loglevel?: string;
|
131
|
+
quiet?: boolean;
|
132
|
+
versionUpdates?: boolean;
|
133
|
+
releaseNotes?: boolean;
|
134
|
+
dll?: boolean;
|
135
|
+
docs?: boolean;
|
136
|
+
docsDll?: boolean;
|
137
|
+
uiDll?: boolean;
|
138
|
+
debugWebpack?: boolean;
|
139
|
+
webpackStatsJson?: string | boolean;
|
140
|
+
outputDir?: string;
|
141
|
+
}
|
142
|
+
interface BuilderOptions {
|
143
|
+
configType?: 'DEVELOPMENT' | 'PRODUCTION';
|
144
|
+
ignorePreview: boolean;
|
145
|
+
cache: FileSystemCache;
|
146
|
+
configDir: string;
|
147
|
+
docsMode: boolean;
|
148
|
+
features?: StorybookConfig['features'];
|
149
|
+
versionCheck?: VersionCheck;
|
150
|
+
releaseNotesData?: ReleaseNotesData;
|
151
|
+
disableWebpackDefaults?: boolean;
|
152
|
+
serverChannelUrl?: string;
|
153
|
+
}
|
154
|
+
interface StorybookConfigOptions {
|
155
|
+
presets: Presets;
|
156
|
+
presetsList?: LoadedPreset[];
|
157
|
+
}
|
158
|
+
declare type Options$1 = LoadOptions & StorybookConfigOptions & CLIOptions & BuilderOptions;
|
159
|
+
interface IndexerOptions {
|
160
|
+
makeTitle: (userTitle?: string) => string;
|
161
|
+
}
|
162
|
+
interface IndexedStory {
|
163
|
+
id: string;
|
164
|
+
name: string;
|
165
|
+
parameters?: Parameters;
|
166
|
+
}
|
167
|
+
interface StoryIndex {
|
168
|
+
meta: {
|
169
|
+
title?: string;
|
170
|
+
};
|
171
|
+
stories: IndexedStory[];
|
172
|
+
}
|
173
|
+
interface StoryIndexer {
|
174
|
+
test: RegExp;
|
175
|
+
indexer: (fileName: string, options: IndexerOptions) => Promise<StoryIndex>;
|
176
|
+
}
|
177
|
+
/**
|
178
|
+
* Options for TypeScript usage within Storybook.
|
179
|
+
*/
|
180
|
+
interface TypescriptOptions {
|
181
|
+
/**
|
182
|
+
* Enables type checking within Storybook.
|
183
|
+
*
|
184
|
+
* @default `false`
|
185
|
+
*/
|
186
|
+
check: boolean;
|
187
|
+
/**
|
188
|
+
* Disable parsing typescript files through babel.
|
189
|
+
*
|
190
|
+
* @default `false`
|
191
|
+
*/
|
192
|
+
skipBabel: boolean;
|
193
|
+
}
|
194
|
+
interface StoriesSpecifier {
|
195
|
+
/**
|
196
|
+
* When auto-titling, what to prefix all generated titles with (default: '')
|
197
|
+
*/
|
198
|
+
titlePrefix?: string;
|
199
|
+
/**
|
200
|
+
* Where to start looking for story files
|
201
|
+
*/
|
202
|
+
directory: string;
|
203
|
+
/**
|
204
|
+
* What does the filename of a story file look like?
|
205
|
+
* (a glob, relative to directory, no leading `./`)
|
206
|
+
* If unset, we use `** / *.stories.@(mdx|tsx|ts|jsx|js)` (no spaces)
|
207
|
+
*/
|
208
|
+
files?: string;
|
209
|
+
}
|
210
|
+
declare type StoriesEntry = string | StoriesSpecifier;
|
211
|
+
declare type Preset = string | {
|
212
|
+
name: string;
|
213
|
+
options?: any;
|
214
|
+
};
|
215
|
+
/**
|
216
|
+
* An additional script that gets injected into the
|
217
|
+
* preview or the manager,
|
218
|
+
*/
|
219
|
+
declare type Entry = string;
|
220
|
+
declare type StorybookRefs = Record<string, {
|
221
|
+
title: string;
|
222
|
+
url: string;
|
223
|
+
} | {
|
224
|
+
disable: boolean;
|
225
|
+
}>;
|
226
|
+
/**
|
227
|
+
* The interface for Storybook configuration in `main.ts` files.
|
228
|
+
*/
|
229
|
+
interface StorybookConfig {
|
230
|
+
/**
|
231
|
+
* Sets the addons you want to use with Storybook.
|
232
|
+
*
|
233
|
+
* @example `['@storybook/addon-essentials']` or `[{ name: '@storybook/addon-essentials', options: { backgrounds: false } }]`
|
234
|
+
*/
|
235
|
+
addons?: Preset[];
|
236
|
+
core?: CoreConfig;
|
237
|
+
/**
|
238
|
+
* Sets a list of directories of static files to be loaded by Storybook server
|
239
|
+
*
|
240
|
+
* @example `['./public']` or `[{from: './public', 'to': '/assets'}]`
|
241
|
+
*/
|
242
|
+
staticDirs?: (DirectoryMapping | string)[];
|
243
|
+
logLevel?: string;
|
244
|
+
features?: {
|
245
|
+
/**
|
246
|
+
* Allows to disable deprecated implicit PostCSS loader. (will be removed in 7.0)
|
247
|
+
*/
|
248
|
+
postcss?: boolean;
|
249
|
+
/**
|
250
|
+
* Build stories.json automatically on start/build
|
251
|
+
*/
|
252
|
+
buildStoriesJson?: boolean;
|
253
|
+
/**
|
254
|
+
* Activate preview of CSF v3.0
|
255
|
+
*
|
256
|
+
* @deprecated This is always on now from 6.4 regardless of the setting
|
257
|
+
*/
|
258
|
+
previewCsfV3?: boolean;
|
259
|
+
/**
|
260
|
+
* Activate on demand story store
|
261
|
+
*/
|
262
|
+
storyStoreV7?: boolean;
|
263
|
+
/**
|
264
|
+
* Enable a set of planned breaking changes for SB7.0
|
265
|
+
*/
|
266
|
+
breakingChangesV7?: boolean;
|
267
|
+
/**
|
268
|
+
* Enable the step debugger functionality in Addon-interactions.
|
269
|
+
*/
|
270
|
+
interactionsDebugger?: boolean;
|
271
|
+
/**
|
272
|
+
* Use Storybook 7.0 babel config scheme
|
273
|
+
*/
|
274
|
+
babelModeV7?: boolean;
|
275
|
+
/**
|
276
|
+
* Filter args with a "target" on the type from the render function (EXPERIMENTAL)
|
277
|
+
*/
|
278
|
+
argTypeTargetsV7?: boolean;
|
279
|
+
/**
|
280
|
+
* Warn when there is a pre-6.0 hierarchy separator ('.' / '|') in the story title.
|
281
|
+
* Will be removed in 7.0.
|
282
|
+
*/
|
283
|
+
warnOnLegacyHierarchySeparator?: boolean;
|
284
|
+
/**
|
285
|
+
* Preview MDX2 support, will become default in 7.0
|
286
|
+
*/
|
287
|
+
previewMdx2?: boolean;
|
288
|
+
};
|
289
|
+
/**
|
290
|
+
* Tells Storybook where to find stories.
|
291
|
+
*
|
292
|
+
* @example `['./src/*.stories.@(j|t)sx?']`
|
293
|
+
*/
|
294
|
+
stories: StoriesEntry[];
|
295
|
+
/**
|
296
|
+
* Framework, e.g. '@storybook/react', required in v7
|
297
|
+
*/
|
298
|
+
framework?: Preset;
|
299
|
+
/**
|
300
|
+
* Controls how Storybook handles TypeScript files.
|
301
|
+
*/
|
302
|
+
typescript?: Partial<TypescriptOptions>;
|
303
|
+
/**
|
304
|
+
* References external Storybooks
|
305
|
+
*/
|
306
|
+
refs?: StorybookRefs | ((config: any, options: Options$1) => StorybookRefs);
|
307
|
+
/**
|
308
|
+
* Modify or return babel config.
|
309
|
+
*/
|
310
|
+
babel?: (config: TransformOptions, options: Options$1) => TransformOptions | Promise<TransformOptions>;
|
311
|
+
/**
|
312
|
+
* Modify or return babel config.
|
313
|
+
*/
|
314
|
+
babelDefault?: (config: TransformOptions, options: Options$1) => TransformOptions | Promise<TransformOptions>;
|
315
|
+
/**
|
316
|
+
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
317
|
+
*
|
318
|
+
* @deprecated use `previewAnnotations` or `/preview.js` file instead
|
319
|
+
*/
|
320
|
+
config?: (entries: Entry[], options: Options$1) => Entry[];
|
321
|
+
/**
|
322
|
+
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
323
|
+
*/
|
324
|
+
previewAnnotations?: (entries: Entry[], options: Options$1) => Entry[];
|
325
|
+
/**
|
326
|
+
* Process CSF files for the story index.
|
327
|
+
*/
|
328
|
+
storyIndexers?: (indexers: StoryIndexer[], options: Options$1) => StoryIndexer[];
|
329
|
+
}
|
330
|
+
declare type PresetProperty<K, TStorybookConfig = StorybookConfig> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
|
331
|
+
declare type PresetPropertyFn<K, TStorybookConfig = StorybookConfig, TOptions = {}> = (config: TStorybookConfig[K extends keyof TStorybookConfig ? K : never], options: Options$1 & TOptions) => TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | Promise<TStorybookConfig[K extends keyof TStorybookConfig ? K : never]>;
|
332
|
+
|
333
|
+
declare const addons: PresetProperty<'addons', StorybookConfig$1>;
|
334
|
+
declare const core: PresetProperty<'core', StorybookConfig$1>;
|
335
|
+
declare const webpack: StorybookConfig$1['webpack'];
|
336
|
+
|
337
|
+
export { addons, core, webpack };
|
package/dist/preset.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var c=Object.create;var t=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var n=(e,r)=>t(e,"name",{value:r,configurable:!0});var m=(e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})},i=(e,r,o,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of l(r))!d.call(e,s)&&s!==o&&t(e,s,{get:()=>r[s],enumerable:!(p=k(r,s))||p.enumerable});return e};var u=(e,r,o)=>(o=e!=null?c(b(e)):{},i(r||!e||!e.__esModule?t(o,"default",{value:e,enumerable:!0}):o,e)),y=e=>i(t({},"__esModule",{value:!0}),e);var q={};m(q,{addons:()=>j,core:()=>v,webpack:()=>w});module.exports=y(q);var a=u(require("path")),j=[a.default.dirname(require.resolve(a.default.join("@storybook/preset-react-webpack","package.json"))),a.default.dirname(require.resolve(a.default.join("@storybook/react","package.json")))],v=n(async(e,r)=>{let o=await r.presets.apply("framework");return{...e,builder:{name:a.default.dirname(require.resolve(a.default.join("@storybook/builder-webpack5","package.json"))),options:typeof o=="string"?{}:o.options.builder||{}}}},"core"),w=n(async e=>{var r;return e.resolve=e.resolve||{},e.resolve.alias={...(r=e.resolve)==null?void 0:r.alias,"@storybook/react":a.default.dirname(require.resolve(a.default.join("@storybook/react","package.json")))},e},"webpack");0&&(module.exports={addons,core,webpack});
|
package/dist/preset.mjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var n=Object.defineProperty;var t=(e,o)=>n(e,"name",{value:o,configurable:!0}),a=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,s)=>(typeof require!="undefined"?require:o)[s]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});import r from"path";var k=[r.dirname(a.resolve(r.join("@storybook/preset-react-webpack","package.json"))),r.dirname(a.resolve(r.join("@storybook/react","package.json")))],l=t(async(e,o)=>{let s=await o.presets.apply("framework");return{...e,builder:{name:r.dirname(a.resolve(r.join("@storybook/builder-webpack5","package.json"))),options:typeof s=="string"?{}:s.options.builder||{}}}},"core"),b=t(async e=>(e.resolve=e.resolve||{},e.resolve.alias={...e.resolve?.alias,"@storybook/react":r.dirname(a.resolve(r.join("@storybook/react","package.json")))},e),"webpack");export{k as addons,l as core,b as webpack};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { ReactOptions, StorybookConfig as StorybookConfig$1, TypescriptOptions as TypescriptOptions$1 } from '@storybook/preset-react-webpack';
|
2
|
+
import { BuilderOptions, StorybookConfigWebpack, TypescriptOptions } from '@storybook/builder-webpack5';
|
3
|
+
|
4
|
+
declare type FrameworkName = '@storybook/react-webpack5';
|
5
|
+
declare type BuilderName = '@storybook/builder-webpack5';
|
6
|
+
declare type FrameworkOptions = ReactOptions & {
|
7
|
+
builder?: BuilderOptions;
|
8
|
+
};
|
9
|
+
declare type StorybookConfigFramework = {
|
10
|
+
framework: FrameworkName | {
|
11
|
+
name: FrameworkName;
|
12
|
+
options: FrameworkOptions;
|
13
|
+
};
|
14
|
+
core?: StorybookConfig$1['core'] & {
|
15
|
+
builder?: BuilderName | {
|
16
|
+
name: BuilderName;
|
17
|
+
options: BuilderOptions;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
typescript?: Partial<TypescriptOptions & TypescriptOptions$1> & StorybookConfig$1['typescript'];
|
21
|
+
};
|
22
|
+
/**
|
23
|
+
* The interface for Storybook configuration in `main.ts` files.
|
24
|
+
*/
|
25
|
+
declare type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
|
26
|
+
|
27
|
+
export { FrameworkOptions as F, StorybookConfig as S };
|
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.11",
|
4
4
|
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -19,9 +19,26 @@
|
|
19
19
|
"url": "https://opencollective.com/storybook"
|
20
20
|
},
|
21
21
|
"license": "MIT",
|
22
|
-
"
|
23
|
-
|
24
|
-
|
22
|
+
"exports": {
|
23
|
+
".": {
|
24
|
+
"require": "./dist/index.js",
|
25
|
+
"import": "./dist/index.mjs",
|
26
|
+
"types": "./dist/index.d.ts"
|
27
|
+
},
|
28
|
+
"./preset": {
|
29
|
+
"require": "./dist/preset.js",
|
30
|
+
"import": "./dist/preset.mjs",
|
31
|
+
"types": "./dist/preset.d.ts"
|
32
|
+
},
|
33
|
+
"./package.json": {
|
34
|
+
"require": "./package.json",
|
35
|
+
"import": "./package.json",
|
36
|
+
"types": "./package.json"
|
37
|
+
}
|
38
|
+
},
|
39
|
+
"main": "dist/index.js",
|
40
|
+
"module": "dist/index.mjs",
|
41
|
+
"types": "dist/index.d.ts",
|
25
42
|
"files": [
|
26
43
|
"dist/**/*",
|
27
44
|
"types/**/*",
|
@@ -30,19 +47,20 @@
|
|
30
47
|
"*.d.ts"
|
31
48
|
],
|
32
49
|
"scripts": {
|
33
|
-
"
|
50
|
+
"check": "tsc --noEmit",
|
51
|
+
"prepare": "esrun ../../scripts/prepare/bundle.ts"
|
34
52
|
},
|
35
53
|
"dependencies": {
|
36
|
-
"@storybook/builder-webpack5": "7.0.0-alpha.
|
37
|
-
"@storybook/
|
38
|
-
"@storybook/
|
39
|
-
"@storybook/react": "7.0.0-alpha.0",
|
54
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.11",
|
55
|
+
"@storybook/preset-react-webpack": "7.0.0-alpha.11",
|
56
|
+
"@storybook/react": "7.0.0-alpha.11",
|
40
57
|
"@types/node": "^14.14.20 || ^16.0.0",
|
41
|
-
"core-js": "^3.8.2"
|
42
|
-
"regenerator-runtime": "^0.13.7"
|
58
|
+
"core-js": "^3.8.2"
|
43
59
|
},
|
44
60
|
"devDependencies": {
|
45
|
-
"
|
61
|
+
"@digitak/esrun": "^3.2.2",
|
62
|
+
"jest-specific-snapshot": "^4.0.0",
|
63
|
+
"typescript": "~4.6.3"
|
46
64
|
},
|
47
65
|
"peerDependencies": {
|
48
66
|
"@babel/core": "^7.11.5",
|
@@ -63,5 +81,12 @@
|
|
63
81
|
"publishConfig": {
|
64
82
|
"access": "public"
|
65
83
|
},
|
66
|
-
"
|
84
|
+
"bundler": {
|
85
|
+
"entries": [
|
86
|
+
"./src/index.ts",
|
87
|
+
"./src/preset.ts"
|
88
|
+
],
|
89
|
+
"platform": "node"
|
90
|
+
},
|
91
|
+
"gitHead": "688d338903e84a7e83cb104472e868e734399f65"
|
67
92
|
}
|
package/preset.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
module.exports = require('./dist/
|
1
|
+
module.exports = require('./dist/preset');
|
package/dist/cjs/index.js
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
require("core-js/modules/es.object.to-string.js");
|
4
|
-
|
5
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
6
|
-
|
7
|
-
require("core-js/modules/es.object.keys.js");
|
8
|
-
|
9
|
-
Object.defineProperty(exports, "__esModule", {
|
10
|
-
value: true
|
11
|
-
});
|
12
|
-
|
13
|
-
var _react = require("@storybook/react");
|
14
|
-
|
15
|
-
Object.keys(_react).forEach(function (key) {
|
16
|
-
if (key === "default" || key === "__esModule") return;
|
17
|
-
if (key in exports && exports[key] === _react[key]) return;
|
18
|
-
Object.defineProperty(exports, key, {
|
19
|
-
enumerable: true,
|
20
|
-
get: function get() {
|
21
|
-
return _react[key];
|
22
|
-
}
|
23
|
-
});
|
24
|
-
});
|
25
|
-
|
26
|
-
var _types = require("./types");
|
27
|
-
|
28
|
-
Object.keys(_types).forEach(function (key) {
|
29
|
-
if (key === "default" || key === "__esModule") return;
|
30
|
-
if (key in exports && exports[key] === _types[key]) return;
|
31
|
-
Object.defineProperty(exports, key, {
|
32
|
-
enumerable: true,
|
33
|
-
get: function get() {
|
34
|
-
return _types[key];
|
35
|
-
}
|
36
|
-
});
|
37
|
-
});
|
package/dist/cjs/preset.js
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4
|
-
|
5
|
-
require("core-js/modules/es.symbol.js");
|
6
|
-
|
7
|
-
require("core-js/modules/es.symbol.description.js");
|
8
|
-
|
9
|
-
require("core-js/modules/es.symbol.iterator.js");
|
10
|
-
|
11
|
-
require("core-js/modules/es.array.iterator.js");
|
12
|
-
|
13
|
-
require("core-js/modules/es.string.iterator.js");
|
14
|
-
|
15
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
16
|
-
|
17
|
-
require("core-js/modules/es.symbol.async-iterator.js");
|
18
|
-
|
19
|
-
require("core-js/modules/es.symbol.to-string-tag.js");
|
20
|
-
|
21
|
-
require("core-js/modules/es.json.to-string-tag.js");
|
22
|
-
|
23
|
-
require("core-js/modules/es.math.to-string-tag.js");
|
24
|
-
|
25
|
-
require("core-js/modules/es.object.get-prototype-of.js");
|
26
|
-
|
27
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
28
|
-
|
29
|
-
require("core-js/modules/es.function.name.js");
|
30
|
-
|
31
|
-
require("core-js/modules/es.array.slice.js");
|
32
|
-
|
33
|
-
Object.defineProperty(exports, "__esModule", {
|
34
|
-
value: true
|
35
|
-
});
|
36
|
-
exports.core = exports.addons = void 0;
|
37
|
-
|
38
|
-
require("core-js/modules/es.object.assign.js");
|
39
|
-
|
40
|
-
require("core-js/modules/es.object.to-string.js");
|
41
|
-
|
42
|
-
require("core-js/modules/es.promise.js");
|
43
|
-
|
44
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
45
|
-
|
46
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
47
|
-
|
48
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
49
|
-
|
50
|
-
var addons = ['@storybook/preset-react-webpack', '@storybook/react'];
|
51
|
-
exports.addons = addons;
|
52
|
-
|
53
|
-
var core = /*#__PURE__*/function () {
|
54
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config) {
|
55
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
56
|
-
while (1) {
|
57
|
-
switch (_context.prev = _context.next) {
|
58
|
-
case 0:
|
59
|
-
return _context.abrupt("return", Object.assign({}, config, {
|
60
|
-
builder: require.resolve('@storybook/builder-webpack5')
|
61
|
-
}));
|
62
|
-
|
63
|
-
case 1:
|
64
|
-
case "end":
|
65
|
-
return _context.stop();
|
66
|
-
}
|
67
|
-
}
|
68
|
-
}, _callee);
|
69
|
-
}));
|
70
|
-
|
71
|
-
return function core(_x) {
|
72
|
-
return _ref.apply(this, arguments);
|
73
|
-
};
|
74
|
-
}();
|
75
|
-
|
76
|
-
exports.core = core;
|
package/dist/cjs/types.js
DELETED
package/dist/esm/index.js
DELETED
package/dist/esm/preset.js
DELETED
package/dist/esm/types.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/types/index.d.ts
DELETED
package/dist/types/preset.d.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import type { StorybookConfig } from '@storybook/preset-react-webpack';
|
2
|
-
export declare const addons: StorybookConfig['addons'];
|
3
|
-
export declare const core: (config: StorybookConfig['core']) => Promise<{
|
4
|
-
builder: string;
|
5
|
-
disableWebpackDefaults?: boolean;
|
6
|
-
channelOptions?: Partial<import("telejson").Options>;
|
7
|
-
disableProjectJson?: boolean;
|
8
|
-
disableTelemetry?: boolean;
|
9
|
-
enableCrashReports?: boolean;
|
10
|
-
crossOriginIsolated?: boolean;
|
11
|
-
}>;
|
package/dist/types/types.d.ts
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
import type ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
2
|
-
import type { Configuration } from 'webpack';
|
3
|
-
import type { StorybookConfig as BaseStorybookConfig } from '@storybook/preset-react-webpack';
|
4
|
-
export type { BuilderResult } from '@storybook/preset-react-webpack';
|
5
|
-
/**
|
6
|
-
* Options for TypeScript usage within Storybook.
|
7
|
-
*/
|
8
|
-
export declare type TypescriptOptions = BaseStorybookConfig['typescript'] & {
|
9
|
-
/**
|
10
|
-
* Configures `fork-ts-checker-webpack-plugin`
|
11
|
-
*/
|
12
|
-
checkOptions: ForkTsCheckerWebpackPlugin['options'];
|
13
|
-
};
|
14
|
-
export interface StorybookTypescriptConfig {
|
15
|
-
typescript?: Partial<TypescriptOptions>;
|
16
|
-
}
|
17
|
-
export interface ReactOptions {
|
18
|
-
fastRefresh?: boolean;
|
19
|
-
strictMode?: boolean;
|
20
|
-
/**
|
21
|
-
* Use React's legacy root API to mount components
|
22
|
-
* @description
|
23
|
-
* React has introduced a new root API with React 18.x to enable a whole set of new features (e.g. concurrent features)
|
24
|
-
* If this flag is true, the legacy Root API is used to mount components to make it easier to migrate step by step to React 18.
|
25
|
-
* @default false
|
26
|
-
*/
|
27
|
-
legacyRootApi?: boolean;
|
28
|
-
}
|
29
|
-
export interface StorybookReactConfig {
|
30
|
-
framework: string | {
|
31
|
-
name: '@storybook/react-webpack5';
|
32
|
-
options: ReactOptions;
|
33
|
-
};
|
34
|
-
}
|
35
|
-
/**
|
36
|
-
* The interface for Storybook configuration in `main.ts` files.
|
37
|
-
*/
|
38
|
-
export declare type StorybookConfig = BaseStorybookConfig<Configuration> & StorybookReactConfig & StorybookTypescriptConfig;
|
package/standalone.js
DELETED
package/types-6-0.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './dist/types/client/preview/types-6-0.d';
|
package/types-7-0.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './dist/types/client/preview/types-7-0.d';
|
package/types.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './dist/types/index.d';
|