@storybook/react-webpack5 7.0.0-alpha.13 → 7.0.0-alpha.18

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1 +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);
1
+ "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(r,o,m,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==m&&a(r,e,{get:()=>o[e],enumerable:!(x=b(o,e))||x.enumerable});return r},p=(r,o,m)=>(t(r,o,"default"),m&&t(m,o,"default"));var g=r=>t(a({},"__esModule",{value:!0}),r);var f={};module.exports=g(f);p(f,require("@storybook/react"),module.exports);
package/dist/preset.d.ts CHANGED
@@ -21,6 +21,719 @@ declare type Parameters = {
21
21
  [name: string]: any;
22
22
  };
23
23
 
24
+ /**
25
+ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
26
+
27
+ @category Type
28
+ */
29
+ type Primitive =
30
+ | null
31
+ | undefined
32
+ | string
33
+ | number
34
+ | boolean
35
+ | symbol
36
+ | bigint;
37
+
38
+ declare global {
39
+ interface SymbolConstructor {
40
+ readonly observable: symbol;
41
+ }
42
+ }
43
+
44
+ /**
45
+ Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
46
+
47
+ Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
48
+
49
+ This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
50
+
51
+ @example
52
+ ```
53
+ import type {LiteralUnion} from 'type-fest';
54
+
55
+ // Before
56
+
57
+ type Pet = 'dog' | 'cat' | string;
58
+
59
+ const pet: Pet = '';
60
+ // Start typing in your TypeScript-enabled IDE.
61
+ // You **will not** get auto-completion for `dog` and `cat` literals.
62
+
63
+ // After
64
+
65
+ type Pet2 = LiteralUnion<'dog' | 'cat', string>;
66
+
67
+ const pet: Pet2 = '';
68
+ // You **will** get auto-completion for `dog` and `cat` literals.
69
+ ```
70
+
71
+ @category Type
72
+ */
73
+ type LiteralUnion<
74
+ LiteralType,
75
+ BaseType extends Primitive,
76
+ > = LiteralType | (BaseType & Record<never, never>);
77
+
78
+ declare namespace PackageJson$1 {
79
+ /**
80
+ A person who has been involved in creating or maintaining the package.
81
+ */
82
+ export type Person =
83
+ | string
84
+ | {
85
+ name: string;
86
+ url?: string;
87
+ email?: string;
88
+ };
89
+
90
+ export type BugsLocation =
91
+ | string
92
+ | {
93
+ /**
94
+ The URL to the package's issue tracker.
95
+ */
96
+ url?: string;
97
+
98
+ /**
99
+ The email address to which issues should be reported.
100
+ */
101
+ email?: string;
102
+ };
103
+
104
+ export interface DirectoryLocations {
105
+ [directoryType: string]: unknown;
106
+
107
+ /**
108
+ Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder.
109
+ */
110
+ bin?: string;
111
+
112
+ /**
113
+ Location for Markdown files.
114
+ */
115
+ doc?: string;
116
+
117
+ /**
118
+ Location for example scripts.
119
+ */
120
+ example?: string;
121
+
122
+ /**
123
+ Location for the bulk of the library.
124
+ */
125
+ lib?: string;
126
+
127
+ /**
128
+ Location for man pages. Sugar to generate a `man` array by walking the folder.
129
+ */
130
+ man?: string;
131
+
132
+ /**
133
+ Location for test files.
134
+ */
135
+ test?: string;
136
+ }
137
+
138
+ export type Scripts = {
139
+ /**
140
+ Run **before** the package is published (Also run on local `npm install` without any arguments).
141
+ */
142
+ prepublish?: string;
143
+
144
+ /**
145
+ Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`.
146
+ */
147
+ prepare?: string;
148
+
149
+ /**
150
+ Run **before** the package is prepared and packed, **only** on `npm publish`.
151
+ */
152
+ prepublishOnly?: string;
153
+
154
+ /**
155
+ Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies).
156
+ */
157
+ prepack?: string;
158
+
159
+ /**
160
+ Run **after** the tarball has been generated and moved to its final destination.
161
+ */
162
+ postpack?: string;
163
+
164
+ /**
165
+ Run **after** the package is published.
166
+ */
167
+ publish?: string;
168
+
169
+ /**
170
+ Run **after** the package is published.
171
+ */
172
+ postpublish?: string;
173
+
174
+ /**
175
+ Run **before** the package is installed.
176
+ */
177
+ preinstall?: string;
178
+
179
+ /**
180
+ Run **after** the package is installed.
181
+ */
182
+ install?: string;
183
+
184
+ /**
185
+ Run **after** the package is installed and after `install`.
186
+ */
187
+ postinstall?: string;
188
+
189
+ /**
190
+ Run **before** the package is uninstalled and before `uninstall`.
191
+ */
192
+ preuninstall?: string;
193
+
194
+ /**
195
+ Run **before** the package is uninstalled.
196
+ */
197
+ uninstall?: string;
198
+
199
+ /**
200
+ Run **after** the package is uninstalled.
201
+ */
202
+ postuninstall?: string;
203
+
204
+ /**
205
+ Run **before** bump the package version and before `version`.
206
+ */
207
+ preversion?: string;
208
+
209
+ /**
210
+ Run **before** bump the package version.
211
+ */
212
+ version?: string;
213
+
214
+ /**
215
+ Run **after** bump the package version.
216
+ */
217
+ postversion?: string;
218
+
219
+ /**
220
+ Run with the `npm test` command, before `test`.
221
+ */
222
+ pretest?: string;
223
+
224
+ /**
225
+ Run with the `npm test` command.
226
+ */
227
+ test?: string;
228
+
229
+ /**
230
+ Run with the `npm test` command, after `test`.
231
+ */
232
+ posttest?: string;
233
+
234
+ /**
235
+ Run with the `npm stop` command, before `stop`.
236
+ */
237
+ prestop?: string;
238
+
239
+ /**
240
+ Run with the `npm stop` command.
241
+ */
242
+ stop?: string;
243
+
244
+ /**
245
+ Run with the `npm stop` command, after `stop`.
246
+ */
247
+ poststop?: string;
248
+
249
+ /**
250
+ Run with the `npm start` command, before `start`.
251
+ */
252
+ prestart?: string;
253
+
254
+ /**
255
+ Run with the `npm start` command.
256
+ */
257
+ start?: string;
258
+
259
+ /**
260
+ Run with the `npm start` command, after `start`.
261
+ */
262
+ poststart?: string;
263
+
264
+ /**
265
+ Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
266
+ */
267
+ prerestart?: string;
268
+
269
+ /**
270
+ Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
271
+ */
272
+ restart?: string;
273
+
274
+ /**
275
+ Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
276
+ */
277
+ postrestart?: string;
278
+ } & Partial<Record<string, string>>;
279
+
280
+ /**
281
+ Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL.
282
+ */
283
+ export type Dependency = Partial<Record<string, string>>;
284
+
285
+ /**
286
+ Conditions which provide a way to resolve a package entry point based on the environment.
287
+ */
288
+ export type ExportCondition = LiteralUnion<
289
+ | 'import'
290
+ | 'require'
291
+ | 'node'
292
+ | 'node-addons'
293
+ | 'deno'
294
+ | 'browser'
295
+ | 'electron'
296
+ | 'react-native'
297
+ | 'default',
298
+ string
299
+ >;
300
+
301
+ /**
302
+ Entry points of a module, optionally with conditions and subpath exports.
303
+ */
304
+ export type Exports =
305
+ | null
306
+ | string
307
+ | string[]
308
+ | {[key in ExportCondition]: Exports}
309
+ | {[key: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
310
+
311
+ /**
312
+ Import map entries of a module, optionally with conditions.
313
+ */
314
+ export type Imports = { // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
315
+ [key: string]: string | {[key in ExportCondition]: Exports};
316
+ };
317
+
318
+ export interface NonStandardEntryPoints {
319
+ /**
320
+ An ECMAScript module ID that is the primary entry point to the program.
321
+ */
322
+ module?: string;
323
+
324
+ /**
325
+ A module ID with untranspiled code that is the primary entry point to the program.
326
+ */
327
+ esnext?:
328
+ | string
329
+ | {
330
+ [moduleName: string]: string | undefined;
331
+ main?: string;
332
+ browser?: string;
333
+ };
334
+
335
+ /**
336
+ A hint to JavaScript bundlers or component tools when packaging modules for client side use.
337
+ */
338
+ browser?:
339
+ | string
340
+ | Partial<Record<string, string | false>>;
341
+
342
+ /**
343
+ Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused.
344
+
345
+ [Read more.](https://webpack.js.org/guides/tree-shaking/)
346
+ */
347
+ sideEffects?: boolean | string[];
348
+ }
349
+
350
+ export interface TypeScriptConfiguration {
351
+ /**
352
+ Location of the bundled TypeScript declaration file.
353
+ */
354
+ types?: string;
355
+
356
+ /**
357
+ Version selection map of TypeScript.
358
+ */
359
+ typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>>;
360
+
361
+ /**
362
+ Location of the bundled TypeScript declaration file. Alias of `types`.
363
+ */
364
+ typings?: string;
365
+ }
366
+
367
+ /**
368
+ An alternative configuration for Yarn workspaces.
369
+ */
370
+ export interface WorkspaceConfig {
371
+ /**
372
+ An array of workspace pattern strings which contain the workspace packages.
373
+ */
374
+ packages?: WorkspacePattern[];
375
+
376
+ /**
377
+ Designed to solve the problem of packages which break when their `node_modules` are moved to the root workspace directory - a process known as hoisting. For these packages, both within your workspace, and also some that have been installed via `node_modules`, it is important to have a mechanism for preventing the default Yarn workspace behavior. By adding workspace pattern strings here, Yarn will resume non-workspace behavior for any package which matches the defined patterns.
378
+
379
+ [Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/)
380
+ */
381
+ nohoist?: WorkspacePattern[];
382
+ }
383
+
384
+ /**
385
+ A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process.
386
+
387
+ The patterns are handled with [minimatch](https://github.com/isaacs/minimatch).
388
+
389
+ @example
390
+ `docs` → Include the docs directory and install its dependencies.
391
+ `packages/*` → Include all nested directories within the packages directory, like `packages/cli` and `packages/core`.
392
+ */
393
+ type WorkspacePattern = string;
394
+
395
+ export interface YarnConfiguration {
396
+ /**
397
+ Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/).
398
+
399
+ Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass.
400
+
401
+ Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces.
402
+ */
403
+ workspaces?: WorkspacePattern[] | WorkspaceConfig;
404
+
405
+ /**
406
+ If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`.
407
+
408
+ Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line.
409
+ */
410
+ flat?: boolean;
411
+
412
+ /**
413
+ Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file.
414
+ */
415
+ resolutions?: Dependency;
416
+ }
417
+
418
+ export interface JSPMConfiguration {
419
+ /**
420
+ JSPM configuration.
421
+ */
422
+ jspm?: PackageJson$1;
423
+ }
424
+
425
+ /**
426
+ Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties.
427
+ */
428
+ export interface PackageJsonStandard {
429
+ /**
430
+ The name of the package.
431
+ */
432
+ name?: string;
433
+
434
+ /**
435
+ Package version, parseable by [`node-semver`](https://github.com/npm/node-semver).
436
+ */
437
+ version?: string;
438
+
439
+ /**
440
+ Package description, listed in `npm search`.
441
+ */
442
+ description?: string;
443
+
444
+ /**
445
+ Keywords associated with package, listed in `npm search`.
446
+ */
447
+ keywords?: string[];
448
+
449
+ /**
450
+ The URL to the package's homepage.
451
+ */
452
+ homepage?: LiteralUnion<'.', string>;
453
+
454
+ /**
455
+ The URL to the package's issue tracker and/or the email address to which issues should be reported.
456
+ */
457
+ bugs?: BugsLocation;
458
+
459
+ /**
460
+ The license for the package.
461
+ */
462
+ license?: string;
463
+
464
+ /**
465
+ The licenses for the package.
466
+ */
467
+ licenses?: Array<{
468
+ type?: string;
469
+ url?: string;
470
+ }>;
471
+
472
+ author?: Person;
473
+
474
+ /**
475
+ A list of people who contributed to the package.
476
+ */
477
+ contributors?: Person[];
478
+
479
+ /**
480
+ A list of people who maintain the package.
481
+ */
482
+ maintainers?: Person[];
483
+
484
+ /**
485
+ The files included in the package.
486
+ */
487
+ files?: string[];
488
+
489
+ /**
490
+ Resolution algorithm for importing ".js" files from the package's scope.
491
+
492
+ [Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field)
493
+ */
494
+ type?: 'module' | 'commonjs';
495
+
496
+ /**
497
+ The module ID that is the primary entry point to the program.
498
+ */
499
+ main?: string;
500
+
501
+ /**
502
+ Subpath exports to define entry points of the package.
503
+
504
+ [Read more.](https://nodejs.org/api/packages.html#subpath-exports)
505
+ */
506
+ exports?: Exports;
507
+
508
+ /**
509
+ Subpath imports to define internal package import maps that only apply to import specifiers from within the package itself.
510
+
511
+ [Read more.](https://nodejs.org/api/packages.html#subpath-imports)
512
+ */
513
+ imports?: Imports;
514
+
515
+ /**
516
+ The executable files that should be installed into the `PATH`.
517
+ */
518
+ bin?:
519
+ | string
520
+ | Partial<Record<string, string>>;
521
+
522
+ /**
523
+ Filenames to put in place for the `man` program to find.
524
+ */
525
+ man?: string | string[];
526
+
527
+ /**
528
+ Indicates the structure of the package.
529
+ */
530
+ directories?: DirectoryLocations;
531
+
532
+ /**
533
+ Location for the code repository.
534
+ */
535
+ repository?:
536
+ | string
537
+ | {
538
+ type: string;
539
+ url: string;
540
+
541
+ /**
542
+ Relative path to package.json if it is placed in non-root directory (for example if it is part of a monorepo).
543
+
544
+ [Read more.](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md)
545
+ */
546
+ directory?: string;
547
+ };
548
+
549
+ /**
550
+ Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point.
551
+ */
552
+ scripts?: Scripts;
553
+
554
+ /**
555
+ Is used to set configuration parameters used in package scripts that persist across upgrades.
556
+ */
557
+ config?: Record<string, unknown>;
558
+
559
+ /**
560
+ The dependencies of the package.
561
+ */
562
+ dependencies?: Dependency;
563
+
564
+ /**
565
+ Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling.
566
+ */
567
+ devDependencies?: Dependency;
568
+
569
+ /**
570
+ Dependencies that are skipped if they fail to install.
571
+ */
572
+ optionalDependencies?: Dependency;
573
+
574
+ /**
575
+ Dependencies that will usually be required by the package user directly or via another dependency.
576
+ */
577
+ peerDependencies?: Dependency;
578
+
579
+ /**
580
+ Indicate peer dependencies that are optional.
581
+ */
582
+ peerDependenciesMeta?: Partial<Record<string, {optional: true}>>;
583
+
584
+ /**
585
+ Package names that are bundled when the package is published.
586
+ */
587
+ bundledDependencies?: string[];
588
+
589
+ /**
590
+ Alias of `bundledDependencies`.
591
+ */
592
+ bundleDependencies?: string[];
593
+
594
+ /**
595
+ Engines that this package runs on.
596
+ */
597
+ engines?: {
598
+ [EngineName in 'npm' | 'node' | string]?: string;
599
+ };
600
+
601
+ /**
602
+ @deprecated
603
+ */
604
+ engineStrict?: boolean;
605
+
606
+ /**
607
+ Operating systems the module runs on.
608
+ */
609
+ os?: Array<LiteralUnion<
610
+ | 'aix'
611
+ | 'darwin'
612
+ | 'freebsd'
613
+ | 'linux'
614
+ | 'openbsd'
615
+ | 'sunos'
616
+ | 'win32'
617
+ | '!aix'
618
+ | '!darwin'
619
+ | '!freebsd'
620
+ | '!linux'
621
+ | '!openbsd'
622
+ | '!sunos'
623
+ | '!win32',
624
+ string
625
+ >>;
626
+
627
+ /**
628
+ CPU architectures the module runs on.
629
+ */
630
+ cpu?: Array<LiteralUnion<
631
+ | 'arm'
632
+ | 'arm64'
633
+ | 'ia32'
634
+ | 'mips'
635
+ | 'mipsel'
636
+ | 'ppc'
637
+ | 'ppc64'
638
+ | 's390'
639
+ | 's390x'
640
+ | 'x32'
641
+ | 'x64'
642
+ | '!arm'
643
+ | '!arm64'
644
+ | '!ia32'
645
+ | '!mips'
646
+ | '!mipsel'
647
+ | '!ppc'
648
+ | '!ppc64'
649
+ | '!s390'
650
+ | '!s390x'
651
+ | '!x32'
652
+ | '!x64',
653
+ string
654
+ >>;
655
+
656
+ /**
657
+ If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally.
658
+
659
+ @deprecated
660
+ */
661
+ preferGlobal?: boolean;
662
+
663
+ /**
664
+ If set to `true`, then npm will refuse to publish it.
665
+ */
666
+ private?: boolean;
667
+
668
+ /**
669
+ A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default.
670
+ */
671
+ publishConfig?: PublishConfig;
672
+
673
+ /**
674
+ Describes and notifies consumers of a package's monetary support information.
675
+
676
+ [Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md)
677
+ */
678
+ funding?: string | {
679
+ /**
680
+ The type of funding.
681
+ */
682
+ type?: LiteralUnion<
683
+ | 'github'
684
+ | 'opencollective'
685
+ | 'patreon'
686
+ | 'individual'
687
+ | 'foundation'
688
+ | 'corporation',
689
+ string
690
+ >;
691
+
692
+ /**
693
+ The URL to the funding page.
694
+ */
695
+ url: string;
696
+ };
697
+ }
698
+
699
+ export interface PublishConfig {
700
+ /**
701
+ Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig).
702
+ */
703
+ [additionalProperties: string]: unknown;
704
+
705
+ /**
706
+ When publishing scoped packages, the access level defaults to restricted. If you want your scoped package to be publicly viewable (and installable) set `--access=public`. The only valid values for access are public and restricted. Unscoped packages always have an access level of public.
707
+ */
708
+ access?: 'public' | 'restricted';
709
+
710
+ /**
711
+ The base URL of the npm registry.
712
+
713
+ Default: `'https://registry.npmjs.org/'`
714
+ */
715
+ registry?: string;
716
+
717
+ /**
718
+ The tag to publish the package under.
719
+
720
+ Default: `'latest'`
721
+ */
722
+ tag?: string;
723
+ }
724
+ }
725
+
726
+ /**
727
+ Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn.
728
+
729
+ @category File
730
+ */
731
+ type PackageJson$1 =
732
+ PackageJson$1.PackageJsonStandard &
733
+ PackageJson$1.NonStandardEntryPoints &
734
+ PackageJson$1.TypeScriptConfiguration &
735
+ PackageJson$1.YarnConfiguration &
736
+ PackageJson$1.JSPMConfiguration;
24
737
  declare type FileSystemCache = ReturnType<typeof Cache__default>;
25
738
 
26
739
  /**
@@ -88,17 +801,7 @@ interface ReleaseNotesData {
88
801
  currentVersion: string;
89
802
  showOnFirstLaunch: boolean;
90
803
  }
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
- }
804
+ declare type PackageJson = PackageJson$1 & Record<string, any>;
102
805
  interface LoadOptions {
103
806
  packageJson: PackageJson;
104
807
  outputDir?: string;
@@ -237,6 +940,10 @@ declare type DocsOptions = {
237
940
  * Should we generate a docs entry per CSF file?
238
941
  */
239
942
  docsPage?: boolean;
943
+ /**
944
+ * Only show doc entries in the side bar (usually set with the `--docs` CLI flag)
945
+ */
946
+ docsMode?: boolean;
240
947
  };
241
948
  /**
242
949
  * The interface for Storybook configuration in `main.ts` files.
@@ -350,7 +1057,8 @@ declare type PresetProperty<K, TStorybookConfig = StorybookConfig> = TStorybookC
350
1057
  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]>;
351
1058
 
352
1059
  declare const addons: PresetProperty<'addons', StorybookConfig$1>;
1060
+ declare const frameworkOptions: (_: never, options: Options$1) => Promise<StorybookConfig$1['framework']>;
353
1061
  declare const core: PresetProperty<'core', StorybookConfig$1>;
354
1062
  declare const webpack: StorybookConfig$1['webpack'];
355
1063
 
356
- export { addons, core, webpack };
1064
+ export { addons, core, frameworkOptions, webpack };
package/dist/preset.js CHANGED
@@ -1 +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});
1
+ "use strict";var y=Object.create;var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var l=(o,e)=>{for(var r in e)a(o,r,{get:e[r],enumerable:!0})},p=(o,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of c(e))!f.call(o,s)&&s!==r&&a(o,s,{get:()=>e[s],enumerable:!(i=m(e,s))||i.enumerable});return o};var k=(o,e,r)=>(r=o!=null?y(b(o)):{},p(e||!o||!o.__esModule?a(r,"default",{value:o,enumerable:!0}):r,o)),w=o=>p(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"))),t.default.dirname(require.resolve(t.default.join("@storybook/react","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||{}}}},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 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};
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"))),r.dirname(t.resolve(r.join("@storybook/react","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}}},c=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||{}}}},m=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,c as core,y as frameworkOptions,m as webpack};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react-webpack5",
3
- "version": "7.0.0-alpha.13",
3
+ "version": "7.0.0-alpha.18",
4
4
  "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
5
5
  "keywords": [
6
6
  "storybook"
@@ -48,17 +48,16 @@
48
48
  ],
49
49
  "scripts": {
50
50
  "check": "tsc --noEmit",
51
- "prepare": "esrun ../../scripts/prepare/bundle.ts"
51
+ "prepare": "../../../scripts/prepare/bundle.ts"
52
52
  },
53
53
  "dependencies": {
54
- "@storybook/builder-webpack5": "7.0.0-alpha.13",
55
- "@storybook/preset-react-webpack": "7.0.0-alpha.13",
56
- "@storybook/react": "7.0.0-alpha.13",
54
+ "@storybook/builder-webpack5": "7.0.0-alpha.18",
55
+ "@storybook/preset-react-webpack": "7.0.0-alpha.18",
56
+ "@storybook/react": "7.0.0-alpha.18",
57
57
  "@types/node": "^14.14.20 || ^16.0.0",
58
58
  "core-js": "^3.8.2"
59
59
  },
60
60
  "devDependencies": {
61
- "@digitak/esrun": "^3.2.2",
62
61
  "jest-specific-snapshot": "^4.0.0",
63
62
  "typescript": "~4.6.3"
64
63
  },
@@ -88,5 +87,5 @@
88
87
  ],
89
88
  "platform": "node"
90
89
  },
91
- "gitHead": "9ac4d2e0a05eb945713a0e6689abc3b12359e181"
90
+ "gitHead": "bd59f1eef0f644175abdb0d9873ed0553f431f53"
92
91
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2017 Kadira Inc. <hello@kadira.io>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.