@storybook/preact-vite 8.1.0 → 8.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +26 -4
- package/dist/preset.d.ts +2 -3
- package/package.json +4 -3
- package/dist/index-63444eb0.d.ts +0 -1222
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,26 @@
|
|
1
|
-
|
2
|
-
import '
|
3
|
-
|
4
|
-
|
1
|
+
import { StorybookConfig as StorybookConfig$1, CompatibleString } from '@storybook/types';
|
2
|
+
import { BuilderOptions, StorybookConfigVite } from '@storybook/builder-vite';
|
3
|
+
|
4
|
+
type FrameworkName = CompatibleString<'@storybook/preact-vite'>;
|
5
|
+
type BuilderName = CompatibleString<'@storybook/builder-vite'>;
|
6
|
+
type FrameworkOptions = {
|
7
|
+
builder?: BuilderOptions;
|
8
|
+
};
|
9
|
+
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
|
+
};
|
21
|
+
/**
|
22
|
+
* The interface for Storybook configuration in `main.ts` files.
|
23
|
+
*/
|
24
|
+
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigVite | keyof StorybookConfigFramework> & StorybookConfigVite & StorybookConfigFramework;
|
25
|
+
|
26
|
+
export { FrameworkOptions, StorybookConfig };
|
package/dist/preset.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import '
|
3
|
-
import 'http';
|
1
|
+
import { PresetProperty } from '@storybook/types';
|
2
|
+
import { StorybookConfig } from './index.js';
|
4
3
|
import '@storybook/builder-vite';
|
5
4
|
|
6
5
|
declare const core: PresetProperty<'core'>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/preact-vite",
|
3
|
-
"version": "8.1.
|
3
|
+
"version": "8.1.1",
|
4
4
|
"description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -47,8 +47,9 @@
|
|
47
47
|
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
48
48
|
},
|
49
49
|
"dependencies": {
|
50
|
-
"@storybook/builder-vite": "8.1.
|
51
|
-
"@storybook/preact": "8.1.
|
50
|
+
"@storybook/builder-vite": "8.1.1",
|
51
|
+
"@storybook/preact": "8.1.1",
|
52
|
+
"@storybook/types": "8.1.1"
|
52
53
|
},
|
53
54
|
"devDependencies": {
|
54
55
|
"@types/node": "^18.0.0",
|
package/dist/index-63444eb0.d.ts
DELETED
@@ -1,1222 +0,0 @@
|
|
1
|
-
import { FileSystemCache } from 'file-system-cache';
|
2
|
-
import { Server } from 'http';
|
3
|
-
import { BuilderOptions as BuilderOptions$1, StorybookConfigVite } from '@storybook/builder-vite';
|
4
|
-
|
5
|
-
/**
|
6
|
-
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
7
|
-
|
8
|
-
@category Type
|
9
|
-
*/
|
10
|
-
type Primitive =
|
11
|
-
| null
|
12
|
-
| undefined
|
13
|
-
| string
|
14
|
-
| number
|
15
|
-
| boolean
|
16
|
-
| symbol
|
17
|
-
| bigint;
|
18
|
-
|
19
|
-
declare global {
|
20
|
-
interface SymbolConstructor {
|
21
|
-
readonly observable: symbol;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
/**
|
26
|
-
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.
|
27
|
-
|
28
|
-
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.
|
29
|
-
|
30
|
-
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.
|
31
|
-
|
32
|
-
@example
|
33
|
-
```
|
34
|
-
import type {LiteralUnion} from 'type-fest';
|
35
|
-
|
36
|
-
// Before
|
37
|
-
|
38
|
-
type Pet = 'dog' | 'cat' | string;
|
39
|
-
|
40
|
-
const pet: Pet = '';
|
41
|
-
// Start typing in your TypeScript-enabled IDE.
|
42
|
-
// You **will not** get auto-completion for `dog` and `cat` literals.
|
43
|
-
|
44
|
-
// After
|
45
|
-
|
46
|
-
type Pet2 = LiteralUnion<'dog' | 'cat', string>;
|
47
|
-
|
48
|
-
const pet: Pet2 = '';
|
49
|
-
// You **will** get auto-completion for `dog` and `cat` literals.
|
50
|
-
```
|
51
|
-
|
52
|
-
@category Type
|
53
|
-
*/
|
54
|
-
type LiteralUnion<
|
55
|
-
LiteralType,
|
56
|
-
BaseType extends Primitive,
|
57
|
-
> = LiteralType | (BaseType & Record<never, never>);
|
58
|
-
|
59
|
-
declare namespace PackageJson$1 {
|
60
|
-
/**
|
61
|
-
A person who has been involved in creating or maintaining the package.
|
62
|
-
*/
|
63
|
-
export type Person =
|
64
|
-
| string
|
65
|
-
| {
|
66
|
-
name: string;
|
67
|
-
url?: string;
|
68
|
-
email?: string;
|
69
|
-
};
|
70
|
-
|
71
|
-
export type BugsLocation =
|
72
|
-
| string
|
73
|
-
| {
|
74
|
-
/**
|
75
|
-
The URL to the package's issue tracker.
|
76
|
-
*/
|
77
|
-
url?: string;
|
78
|
-
|
79
|
-
/**
|
80
|
-
The email address to which issues should be reported.
|
81
|
-
*/
|
82
|
-
email?: string;
|
83
|
-
};
|
84
|
-
|
85
|
-
export interface DirectoryLocations {
|
86
|
-
[directoryType: string]: unknown;
|
87
|
-
|
88
|
-
/**
|
89
|
-
Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder.
|
90
|
-
*/
|
91
|
-
bin?: string;
|
92
|
-
|
93
|
-
/**
|
94
|
-
Location for Markdown files.
|
95
|
-
*/
|
96
|
-
doc?: string;
|
97
|
-
|
98
|
-
/**
|
99
|
-
Location for example scripts.
|
100
|
-
*/
|
101
|
-
example?: string;
|
102
|
-
|
103
|
-
/**
|
104
|
-
Location for the bulk of the library.
|
105
|
-
*/
|
106
|
-
lib?: string;
|
107
|
-
|
108
|
-
/**
|
109
|
-
Location for man pages. Sugar to generate a `man` array by walking the folder.
|
110
|
-
*/
|
111
|
-
man?: string;
|
112
|
-
|
113
|
-
/**
|
114
|
-
Location for test files.
|
115
|
-
*/
|
116
|
-
test?: string;
|
117
|
-
}
|
118
|
-
|
119
|
-
export type Scripts = {
|
120
|
-
/**
|
121
|
-
Run **before** the package is published (Also run on local `npm install` without any arguments).
|
122
|
-
*/
|
123
|
-
prepublish?: string;
|
124
|
-
|
125
|
-
/**
|
126
|
-
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`.
|
127
|
-
*/
|
128
|
-
prepare?: string;
|
129
|
-
|
130
|
-
/**
|
131
|
-
Run **before** the package is prepared and packed, **only** on `npm publish`.
|
132
|
-
*/
|
133
|
-
prepublishOnly?: string;
|
134
|
-
|
135
|
-
/**
|
136
|
-
Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies).
|
137
|
-
*/
|
138
|
-
prepack?: string;
|
139
|
-
|
140
|
-
/**
|
141
|
-
Run **after** the tarball has been generated and moved to its final destination.
|
142
|
-
*/
|
143
|
-
postpack?: string;
|
144
|
-
|
145
|
-
/**
|
146
|
-
Run **after** the package is published.
|
147
|
-
*/
|
148
|
-
publish?: string;
|
149
|
-
|
150
|
-
/**
|
151
|
-
Run **after** the package is published.
|
152
|
-
*/
|
153
|
-
postpublish?: string;
|
154
|
-
|
155
|
-
/**
|
156
|
-
Run **before** the package is installed.
|
157
|
-
*/
|
158
|
-
preinstall?: string;
|
159
|
-
|
160
|
-
/**
|
161
|
-
Run **after** the package is installed.
|
162
|
-
*/
|
163
|
-
install?: string;
|
164
|
-
|
165
|
-
/**
|
166
|
-
Run **after** the package is installed and after `install`.
|
167
|
-
*/
|
168
|
-
postinstall?: string;
|
169
|
-
|
170
|
-
/**
|
171
|
-
Run **before** the package is uninstalled and before `uninstall`.
|
172
|
-
*/
|
173
|
-
preuninstall?: string;
|
174
|
-
|
175
|
-
/**
|
176
|
-
Run **before** the package is uninstalled.
|
177
|
-
*/
|
178
|
-
uninstall?: string;
|
179
|
-
|
180
|
-
/**
|
181
|
-
Run **after** the package is uninstalled.
|
182
|
-
*/
|
183
|
-
postuninstall?: string;
|
184
|
-
|
185
|
-
/**
|
186
|
-
Run **before** bump the package version and before `version`.
|
187
|
-
*/
|
188
|
-
preversion?: string;
|
189
|
-
|
190
|
-
/**
|
191
|
-
Run **before** bump the package version.
|
192
|
-
*/
|
193
|
-
version?: string;
|
194
|
-
|
195
|
-
/**
|
196
|
-
Run **after** bump the package version.
|
197
|
-
*/
|
198
|
-
postversion?: string;
|
199
|
-
|
200
|
-
/**
|
201
|
-
Run with the `npm test` command, before `test`.
|
202
|
-
*/
|
203
|
-
pretest?: string;
|
204
|
-
|
205
|
-
/**
|
206
|
-
Run with the `npm test` command.
|
207
|
-
*/
|
208
|
-
test?: string;
|
209
|
-
|
210
|
-
/**
|
211
|
-
Run with the `npm test` command, after `test`.
|
212
|
-
*/
|
213
|
-
posttest?: string;
|
214
|
-
|
215
|
-
/**
|
216
|
-
Run with the `npm stop` command, before `stop`.
|
217
|
-
*/
|
218
|
-
prestop?: string;
|
219
|
-
|
220
|
-
/**
|
221
|
-
Run with the `npm stop` command.
|
222
|
-
*/
|
223
|
-
stop?: string;
|
224
|
-
|
225
|
-
/**
|
226
|
-
Run with the `npm stop` command, after `stop`.
|
227
|
-
*/
|
228
|
-
poststop?: string;
|
229
|
-
|
230
|
-
/**
|
231
|
-
Run with the `npm start` command, before `start`.
|
232
|
-
*/
|
233
|
-
prestart?: string;
|
234
|
-
|
235
|
-
/**
|
236
|
-
Run with the `npm start` command.
|
237
|
-
*/
|
238
|
-
start?: string;
|
239
|
-
|
240
|
-
/**
|
241
|
-
Run with the `npm start` command, after `start`.
|
242
|
-
*/
|
243
|
-
poststart?: string;
|
244
|
-
|
245
|
-
/**
|
246
|
-
Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
|
247
|
-
*/
|
248
|
-
prerestart?: string;
|
249
|
-
|
250
|
-
/**
|
251
|
-
Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
|
252
|
-
*/
|
253
|
-
restart?: string;
|
254
|
-
|
255
|
-
/**
|
256
|
-
Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
|
257
|
-
*/
|
258
|
-
postrestart?: string;
|
259
|
-
} & Partial<Record<string, string>>;
|
260
|
-
|
261
|
-
/**
|
262
|
-
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.
|
263
|
-
*/
|
264
|
-
export type Dependency = Partial<Record<string, string>>;
|
265
|
-
|
266
|
-
/**
|
267
|
-
Conditions which provide a way to resolve a package entry point based on the environment.
|
268
|
-
*/
|
269
|
-
export type ExportCondition = LiteralUnion<
|
270
|
-
| 'import'
|
271
|
-
| 'require'
|
272
|
-
| 'node'
|
273
|
-
| 'node-addons'
|
274
|
-
| 'deno'
|
275
|
-
| 'browser'
|
276
|
-
| 'electron'
|
277
|
-
| 'react-native'
|
278
|
-
| 'default',
|
279
|
-
string
|
280
|
-
>;
|
281
|
-
|
282
|
-
type ExportConditions = {[condition in ExportCondition]: Exports};
|
283
|
-
|
284
|
-
/**
|
285
|
-
Entry points of a module, optionally with conditions and subpath exports.
|
286
|
-
*/
|
287
|
-
export type Exports =
|
288
|
-
| null
|
289
|
-
| string
|
290
|
-
| Array<string | ExportConditions>
|
291
|
-
| ExportConditions
|
292
|
-
| {[path: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
|
293
|
-
|
294
|
-
/**
|
295
|
-
Import map entries of a module, optionally with conditions.
|
296
|
-
*/
|
297
|
-
export type Imports = { // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
|
298
|
-
[key: string]: string | {[key in ExportCondition]: Exports};
|
299
|
-
};
|
300
|
-
|
301
|
-
export interface NonStandardEntryPoints {
|
302
|
-
/**
|
303
|
-
An ECMAScript module ID that is the primary entry point to the program.
|
304
|
-
*/
|
305
|
-
module?: string;
|
306
|
-
|
307
|
-
/**
|
308
|
-
A module ID with untranspiled code that is the primary entry point to the program.
|
309
|
-
*/
|
310
|
-
esnext?:
|
311
|
-
| string
|
312
|
-
| {
|
313
|
-
[moduleName: string]: string | undefined;
|
314
|
-
main?: string;
|
315
|
-
browser?: string;
|
316
|
-
};
|
317
|
-
|
318
|
-
/**
|
319
|
-
A hint to JavaScript bundlers or component tools when packaging modules for client side use.
|
320
|
-
*/
|
321
|
-
browser?:
|
322
|
-
| string
|
323
|
-
| Partial<Record<string, string | false>>;
|
324
|
-
|
325
|
-
/**
|
326
|
-
Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused.
|
327
|
-
|
328
|
-
[Read more.](https://webpack.js.org/guides/tree-shaking/)
|
329
|
-
*/
|
330
|
-
sideEffects?: boolean | string[];
|
331
|
-
}
|
332
|
-
|
333
|
-
export interface TypeScriptConfiguration {
|
334
|
-
/**
|
335
|
-
Location of the bundled TypeScript declaration file.
|
336
|
-
*/
|
337
|
-
types?: string;
|
338
|
-
|
339
|
-
/**
|
340
|
-
Version selection map of TypeScript.
|
341
|
-
*/
|
342
|
-
typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>>;
|
343
|
-
|
344
|
-
/**
|
345
|
-
Location of the bundled TypeScript declaration file. Alias of `types`.
|
346
|
-
*/
|
347
|
-
typings?: string;
|
348
|
-
}
|
349
|
-
|
350
|
-
/**
|
351
|
-
An alternative configuration for Yarn workspaces.
|
352
|
-
*/
|
353
|
-
export interface WorkspaceConfig {
|
354
|
-
/**
|
355
|
-
An array of workspace pattern strings which contain the workspace packages.
|
356
|
-
*/
|
357
|
-
packages?: WorkspacePattern[];
|
358
|
-
|
359
|
-
/**
|
360
|
-
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.
|
361
|
-
|
362
|
-
[Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/)
|
363
|
-
*/
|
364
|
-
nohoist?: WorkspacePattern[];
|
365
|
-
}
|
366
|
-
|
367
|
-
/**
|
368
|
-
A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process.
|
369
|
-
|
370
|
-
The patterns are handled with [minimatch](https://github.com/isaacs/minimatch).
|
371
|
-
|
372
|
-
@example
|
373
|
-
`docs` → Include the docs directory and install its dependencies.
|
374
|
-
`packages/*` → Include all nested directories within the packages directory, like `packages/cli` and `packages/core`.
|
375
|
-
*/
|
376
|
-
type WorkspacePattern = string;
|
377
|
-
|
378
|
-
export interface YarnConfiguration {
|
379
|
-
/**
|
380
|
-
Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/).
|
381
|
-
|
382
|
-
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.
|
383
|
-
|
384
|
-
Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces.
|
385
|
-
*/
|
386
|
-
workspaces?: WorkspacePattern[] | WorkspaceConfig;
|
387
|
-
|
388
|
-
/**
|
389
|
-
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`.
|
390
|
-
|
391
|
-
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.
|
392
|
-
*/
|
393
|
-
flat?: boolean;
|
394
|
-
|
395
|
-
/**
|
396
|
-
Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file.
|
397
|
-
*/
|
398
|
-
resolutions?: Dependency;
|
399
|
-
}
|
400
|
-
|
401
|
-
export interface JSPMConfiguration {
|
402
|
-
/**
|
403
|
-
JSPM configuration.
|
404
|
-
*/
|
405
|
-
jspm?: PackageJson$1;
|
406
|
-
}
|
407
|
-
|
408
|
-
/**
|
409
|
-
Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties.
|
410
|
-
*/
|
411
|
-
export interface PackageJsonStandard {
|
412
|
-
/**
|
413
|
-
The name of the package.
|
414
|
-
*/
|
415
|
-
name?: string;
|
416
|
-
|
417
|
-
/**
|
418
|
-
Package version, parseable by [`node-semver`](https://github.com/npm/node-semver).
|
419
|
-
*/
|
420
|
-
version?: string;
|
421
|
-
|
422
|
-
/**
|
423
|
-
Package description, listed in `npm search`.
|
424
|
-
*/
|
425
|
-
description?: string;
|
426
|
-
|
427
|
-
/**
|
428
|
-
Keywords associated with package, listed in `npm search`.
|
429
|
-
*/
|
430
|
-
keywords?: string[];
|
431
|
-
|
432
|
-
/**
|
433
|
-
The URL to the package's homepage.
|
434
|
-
*/
|
435
|
-
homepage?: LiteralUnion<'.', string>;
|
436
|
-
|
437
|
-
/**
|
438
|
-
The URL to the package's issue tracker and/or the email address to which issues should be reported.
|
439
|
-
*/
|
440
|
-
bugs?: BugsLocation;
|
441
|
-
|
442
|
-
/**
|
443
|
-
The license for the package.
|
444
|
-
*/
|
445
|
-
license?: string;
|
446
|
-
|
447
|
-
/**
|
448
|
-
The licenses for the package.
|
449
|
-
*/
|
450
|
-
licenses?: Array<{
|
451
|
-
type?: string;
|
452
|
-
url?: string;
|
453
|
-
}>;
|
454
|
-
|
455
|
-
author?: Person;
|
456
|
-
|
457
|
-
/**
|
458
|
-
A list of people who contributed to the package.
|
459
|
-
*/
|
460
|
-
contributors?: Person[];
|
461
|
-
|
462
|
-
/**
|
463
|
-
A list of people who maintain the package.
|
464
|
-
*/
|
465
|
-
maintainers?: Person[];
|
466
|
-
|
467
|
-
/**
|
468
|
-
The files included in the package.
|
469
|
-
*/
|
470
|
-
files?: string[];
|
471
|
-
|
472
|
-
/**
|
473
|
-
Resolution algorithm for importing ".js" files from the package's scope.
|
474
|
-
|
475
|
-
[Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field)
|
476
|
-
*/
|
477
|
-
type?: 'module' | 'commonjs';
|
478
|
-
|
479
|
-
/**
|
480
|
-
The module ID that is the primary entry point to the program.
|
481
|
-
*/
|
482
|
-
main?: string;
|
483
|
-
|
484
|
-
/**
|
485
|
-
Subpath exports to define entry points of the package.
|
486
|
-
|
487
|
-
[Read more.](https://nodejs.org/api/packages.html#subpath-exports)
|
488
|
-
*/
|
489
|
-
exports?: Exports;
|
490
|
-
|
491
|
-
/**
|
492
|
-
Subpath imports to define internal package import maps that only apply to import specifiers from within the package itself.
|
493
|
-
|
494
|
-
[Read more.](https://nodejs.org/api/packages.html#subpath-imports)
|
495
|
-
*/
|
496
|
-
imports?: Imports;
|
497
|
-
|
498
|
-
/**
|
499
|
-
The executable files that should be installed into the `PATH`.
|
500
|
-
*/
|
501
|
-
bin?:
|
502
|
-
| string
|
503
|
-
| Partial<Record<string, string>>;
|
504
|
-
|
505
|
-
/**
|
506
|
-
Filenames to put in place for the `man` program to find.
|
507
|
-
*/
|
508
|
-
man?: string | string[];
|
509
|
-
|
510
|
-
/**
|
511
|
-
Indicates the structure of the package.
|
512
|
-
*/
|
513
|
-
directories?: DirectoryLocations;
|
514
|
-
|
515
|
-
/**
|
516
|
-
Location for the code repository.
|
517
|
-
*/
|
518
|
-
repository?:
|
519
|
-
| string
|
520
|
-
| {
|
521
|
-
type: string;
|
522
|
-
url: string;
|
523
|
-
|
524
|
-
/**
|
525
|
-
Relative path to package.json if it is placed in non-root directory (for example if it is part of a monorepo).
|
526
|
-
|
527
|
-
[Read more.](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md)
|
528
|
-
*/
|
529
|
-
directory?: string;
|
530
|
-
};
|
531
|
-
|
532
|
-
/**
|
533
|
-
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.
|
534
|
-
*/
|
535
|
-
scripts?: Scripts;
|
536
|
-
|
537
|
-
/**
|
538
|
-
Is used to set configuration parameters used in package scripts that persist across upgrades.
|
539
|
-
*/
|
540
|
-
config?: Record<string, unknown>;
|
541
|
-
|
542
|
-
/**
|
543
|
-
The dependencies of the package.
|
544
|
-
*/
|
545
|
-
dependencies?: Dependency;
|
546
|
-
|
547
|
-
/**
|
548
|
-
Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling.
|
549
|
-
*/
|
550
|
-
devDependencies?: Dependency;
|
551
|
-
|
552
|
-
/**
|
553
|
-
Dependencies that are skipped if they fail to install.
|
554
|
-
*/
|
555
|
-
optionalDependencies?: Dependency;
|
556
|
-
|
557
|
-
/**
|
558
|
-
Dependencies that will usually be required by the package user directly or via another dependency.
|
559
|
-
*/
|
560
|
-
peerDependencies?: Dependency;
|
561
|
-
|
562
|
-
/**
|
563
|
-
Indicate peer dependencies that are optional.
|
564
|
-
*/
|
565
|
-
peerDependenciesMeta?: Partial<Record<string, {optional: true}>>;
|
566
|
-
|
567
|
-
/**
|
568
|
-
Package names that are bundled when the package is published.
|
569
|
-
*/
|
570
|
-
bundledDependencies?: string[];
|
571
|
-
|
572
|
-
/**
|
573
|
-
Alias of `bundledDependencies`.
|
574
|
-
*/
|
575
|
-
bundleDependencies?: string[];
|
576
|
-
|
577
|
-
/**
|
578
|
-
Engines that this package runs on.
|
579
|
-
*/
|
580
|
-
engines?: {
|
581
|
-
[EngineName in 'npm' | 'node' | string]?: string;
|
582
|
-
};
|
583
|
-
|
584
|
-
/**
|
585
|
-
@deprecated
|
586
|
-
*/
|
587
|
-
engineStrict?: boolean;
|
588
|
-
|
589
|
-
/**
|
590
|
-
Operating systems the module runs on.
|
591
|
-
*/
|
592
|
-
os?: Array<LiteralUnion<
|
593
|
-
| 'aix'
|
594
|
-
| 'darwin'
|
595
|
-
| 'freebsd'
|
596
|
-
| 'linux'
|
597
|
-
| 'openbsd'
|
598
|
-
| 'sunos'
|
599
|
-
| 'win32'
|
600
|
-
| '!aix'
|
601
|
-
| '!darwin'
|
602
|
-
| '!freebsd'
|
603
|
-
| '!linux'
|
604
|
-
| '!openbsd'
|
605
|
-
| '!sunos'
|
606
|
-
| '!win32',
|
607
|
-
string
|
608
|
-
>>;
|
609
|
-
|
610
|
-
/**
|
611
|
-
CPU architectures the module runs on.
|
612
|
-
*/
|
613
|
-
cpu?: Array<LiteralUnion<
|
614
|
-
| 'arm'
|
615
|
-
| 'arm64'
|
616
|
-
| 'ia32'
|
617
|
-
| 'mips'
|
618
|
-
| 'mipsel'
|
619
|
-
| 'ppc'
|
620
|
-
| 'ppc64'
|
621
|
-
| 's390'
|
622
|
-
| 's390x'
|
623
|
-
| 'x32'
|
624
|
-
| 'x64'
|
625
|
-
| '!arm'
|
626
|
-
| '!arm64'
|
627
|
-
| '!ia32'
|
628
|
-
| '!mips'
|
629
|
-
| '!mipsel'
|
630
|
-
| '!ppc'
|
631
|
-
| '!ppc64'
|
632
|
-
| '!s390'
|
633
|
-
| '!s390x'
|
634
|
-
| '!x32'
|
635
|
-
| '!x64',
|
636
|
-
string
|
637
|
-
>>;
|
638
|
-
|
639
|
-
/**
|
640
|
-
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.
|
641
|
-
|
642
|
-
@deprecated
|
643
|
-
*/
|
644
|
-
preferGlobal?: boolean;
|
645
|
-
|
646
|
-
/**
|
647
|
-
If set to `true`, then npm will refuse to publish it.
|
648
|
-
*/
|
649
|
-
private?: boolean;
|
650
|
-
|
651
|
-
/**
|
652
|
-
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.
|
653
|
-
*/
|
654
|
-
publishConfig?: PublishConfig;
|
655
|
-
|
656
|
-
/**
|
657
|
-
Describes and notifies consumers of a package's monetary support information.
|
658
|
-
|
659
|
-
[Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md)
|
660
|
-
*/
|
661
|
-
funding?: string | {
|
662
|
-
/**
|
663
|
-
The type of funding.
|
664
|
-
*/
|
665
|
-
type?: LiteralUnion<
|
666
|
-
| 'github'
|
667
|
-
| 'opencollective'
|
668
|
-
| 'patreon'
|
669
|
-
| 'individual'
|
670
|
-
| 'foundation'
|
671
|
-
| 'corporation',
|
672
|
-
string
|
673
|
-
>;
|
674
|
-
|
675
|
-
/**
|
676
|
-
The URL to the funding page.
|
677
|
-
*/
|
678
|
-
url: string;
|
679
|
-
};
|
680
|
-
}
|
681
|
-
|
682
|
-
export interface PublishConfig {
|
683
|
-
/**
|
684
|
-
Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig).
|
685
|
-
*/
|
686
|
-
[additionalProperties: string]: unknown;
|
687
|
-
|
688
|
-
/**
|
689
|
-
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.
|
690
|
-
*/
|
691
|
-
access?: 'public' | 'restricted';
|
692
|
-
|
693
|
-
/**
|
694
|
-
The base URL of the npm registry.
|
695
|
-
|
696
|
-
Default: `'https://registry.npmjs.org/'`
|
697
|
-
*/
|
698
|
-
registry?: string;
|
699
|
-
|
700
|
-
/**
|
701
|
-
The tag to publish the package under.
|
702
|
-
|
703
|
-
Default: `'latest'`
|
704
|
-
*/
|
705
|
-
tag?: string;
|
706
|
-
}
|
707
|
-
}
|
708
|
-
|
709
|
-
/**
|
710
|
-
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.
|
711
|
-
|
712
|
-
@category File
|
713
|
-
*/
|
714
|
-
type PackageJson$1 =
|
715
|
-
PackageJson$1.PackageJsonStandard &
|
716
|
-
PackageJson$1.NonStandardEntryPoints &
|
717
|
-
PackageJson$1.TypeScriptConfiguration &
|
718
|
-
PackageJson$1.YarnConfiguration &
|
719
|
-
PackageJson$1.JSPMConfiguration;
|
720
|
-
|
721
|
-
type StoryId = string;
|
722
|
-
type ComponentTitle = string;
|
723
|
-
type StoryName = string;
|
724
|
-
type Tag$1 = string;
|
725
|
-
|
726
|
-
interface Options$1 {
|
727
|
-
allowRegExp: boolean;
|
728
|
-
allowFunction: boolean;
|
729
|
-
allowSymbol: boolean;
|
730
|
-
allowDate: boolean;
|
731
|
-
allowUndefined: boolean;
|
732
|
-
allowClass: boolean;
|
733
|
-
allowError: boolean;
|
734
|
-
maxDepth: number;
|
735
|
-
space: number | undefined;
|
736
|
-
lazyEval: boolean;
|
737
|
-
}
|
738
|
-
|
739
|
-
type ExportName = string;
|
740
|
-
type MetaId = string;
|
741
|
-
interface StoriesSpecifier {
|
742
|
-
/**
|
743
|
-
* When auto-titling, what to prefix all generated titles with (default: '')
|
744
|
-
*/
|
745
|
-
titlePrefix?: string;
|
746
|
-
/**
|
747
|
-
* Where to start looking for story files
|
748
|
-
*/
|
749
|
-
directory: string;
|
750
|
-
/**
|
751
|
-
* What does the filename of a story file look like?
|
752
|
-
* (a glob, relative to directory, no leading `./`)
|
753
|
-
* If unset, we use `** / *.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))` (no spaces)
|
754
|
-
*/
|
755
|
-
files?: string;
|
756
|
-
}
|
757
|
-
type StoriesEntry = string | StoriesSpecifier;
|
758
|
-
interface IndexerOptions {
|
759
|
-
makeTitle: (userTitle?: string) => string;
|
760
|
-
}
|
761
|
-
/**
|
762
|
-
* FIXME: This is a temporary type to allow us to deprecate the old indexer API.
|
763
|
-
* We should remove this type and the deprecated indexer API in 8.0.
|
764
|
-
*/
|
765
|
-
type BaseIndexer = {
|
766
|
-
/**
|
767
|
-
* A regular expression that should match all files to be handled by this indexer
|
768
|
-
*/
|
769
|
-
test: RegExp;
|
770
|
-
};
|
771
|
-
/**
|
772
|
-
* An indexer describes which filenames it handles, and how to index each individual file - turning it into an entry in the index.
|
773
|
-
*/
|
774
|
-
type Indexer = BaseIndexer & {
|
775
|
-
/**
|
776
|
-
* Indexes a file containing stories or docs.
|
777
|
-
* @param fileName The name of the file to index.
|
778
|
-
* @param options {@link IndexerOptions} for indexing the file.
|
779
|
-
* @returns A promise that resolves to an array of {@link IndexInput} objects.
|
780
|
-
*/
|
781
|
-
createIndex: (fileName: string, options: IndexerOptions) => Promise<IndexInput[]>;
|
782
|
-
};
|
783
|
-
/**
|
784
|
-
* The base input for indexing a story or docs entry.
|
785
|
-
*/
|
786
|
-
type BaseIndexInput = {
|
787
|
-
/** The file to import from e.g. the story file. */
|
788
|
-
importPath: Path;
|
789
|
-
/** The name of the export to import. */
|
790
|
-
exportName: ExportName;
|
791
|
-
/** The name of the entry, auto-generated from {@link exportName} if unspecified. */
|
792
|
-
name?: StoryName;
|
793
|
-
/** The location in the sidebar, auto-generated from {@link importPath} if unspecified. */
|
794
|
-
title?: ComponentTitle;
|
795
|
-
/**
|
796
|
-
* The custom id optionally set at `meta.id` if it needs to differ from the id generated via {@link title}.
|
797
|
-
* If unspecified, the meta id will be auto-generated from {@link title}.
|
798
|
-
* If specified, the meta in the CSF file _must_ have a matching id set at `meta.id`, to be correctly matched.
|
799
|
-
*/
|
800
|
-
metaId?: MetaId;
|
801
|
-
/** Tags for filtering entries in Storybook and its tools. */
|
802
|
-
tags?: Tag$1[];
|
803
|
-
/**
|
804
|
-
* The id of the entry, auto-generated from {@link title}/{@link metaId} and {@link exportName} if unspecified.
|
805
|
-
* If specified, the story in the CSF file _must_ have a matching id set at `parameters.__id`, to be correctly matched.
|
806
|
-
* Only use this if you need to override the auto-generated id.
|
807
|
-
*/
|
808
|
-
__id?: StoryId;
|
809
|
-
};
|
810
|
-
/**
|
811
|
-
* The input for indexing a story entry.
|
812
|
-
*/
|
813
|
-
type StoryIndexInput = BaseIndexInput & {
|
814
|
-
type: 'story';
|
815
|
-
};
|
816
|
-
/**
|
817
|
-
* The input for indexing a docs entry.
|
818
|
-
*/
|
819
|
-
type DocsIndexInput = BaseIndexInput & {
|
820
|
-
type: 'docs';
|
821
|
-
/** Paths to story files that must be pre-loaded for this docs entry. */
|
822
|
-
storiesImports?: Path[];
|
823
|
-
};
|
824
|
-
type IndexInput = StoryIndexInput | DocsIndexInput;
|
825
|
-
|
826
|
-
/**
|
827
|
-
* ⚠️ This file contains internal WIP types they MUST NOT be exported outside this package for now!
|
828
|
-
*/
|
829
|
-
type BuilderName$1 = 'webpack5' | '@storybook/builder-webpack5' | string;
|
830
|
-
type RendererName = string;
|
831
|
-
interface CoreConfig {
|
832
|
-
builder?: BuilderName$1 | {
|
833
|
-
name: BuilderName$1;
|
834
|
-
options?: Record<string, any>;
|
835
|
-
};
|
836
|
-
renderer?: RendererName;
|
837
|
-
disableWebpackDefaults?: boolean;
|
838
|
-
channelOptions?: Partial<Options$1>;
|
839
|
-
/**
|
840
|
-
* Disables the generation of project.json, a file containing Storybook metadata
|
841
|
-
*/
|
842
|
-
disableProjectJson?: boolean;
|
843
|
-
/**
|
844
|
-
* Disables Storybook telemetry
|
845
|
-
* @see https://storybook.js.org/telemetry
|
846
|
-
*/
|
847
|
-
disableTelemetry?: boolean;
|
848
|
-
/**
|
849
|
-
* Disables notifications for Storybook updates.
|
850
|
-
*/
|
851
|
-
disableWhatsNewNotifications?: boolean;
|
852
|
-
/**
|
853
|
-
* Enable crash reports to be sent to Storybook telemetry
|
854
|
-
* @see https://storybook.js.org/telemetry
|
855
|
-
*/
|
856
|
-
enableCrashReports?: boolean;
|
857
|
-
/**
|
858
|
-
* enable CORS headings to run document in a "secure context"
|
859
|
-
* see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements
|
860
|
-
* This enables these headers in development-mode:
|
861
|
-
* Cross-Origin-Opener-Policy: same-origin
|
862
|
-
* Cross-Origin-Embedder-Policy: require-corp
|
863
|
-
*/
|
864
|
-
crossOriginIsolated?: boolean;
|
865
|
-
}
|
866
|
-
interface DirectoryMapping {
|
867
|
-
from: string;
|
868
|
-
to: string;
|
869
|
-
}
|
870
|
-
interface Presets {
|
871
|
-
apply(extension: 'typescript', config: TypescriptOptions, args?: Options): Promise<TypescriptOptions>;
|
872
|
-
apply(extension: 'framework', config?: {}, args?: any): Promise<Preset>;
|
873
|
-
apply(extension: 'babel', config?: {}, args?: any): Promise<any>;
|
874
|
-
apply(extension: 'swc', config?: {}, args?: any): Promise<any>;
|
875
|
-
apply(extension: 'entries', config?: [], args?: any): Promise<unknown>;
|
876
|
-
apply(extension: 'stories', config?: [], args?: any): Promise<StoriesEntry[]>;
|
877
|
-
apply(extension: 'managerEntries', config: [], args?: any): Promise<string[]>;
|
878
|
-
apply(extension: 'refs', config?: [], args?: any): Promise<StorybookConfigRaw['refs']>;
|
879
|
-
apply(extension: 'core', config?: StorybookConfigRaw['core'], args?: any): Promise<NonNullable<StorybookConfigRaw['core']>>;
|
880
|
-
apply(extension: 'docs', config?: StorybookConfigRaw['docs'], args?: any): Promise<NonNullable<StorybookConfigRaw['docs']>>;
|
881
|
-
apply(extension: 'features', config?: StorybookConfigRaw['features'], args?: any): Promise<NonNullable<StorybookConfigRaw['features']>>;
|
882
|
-
apply(extension: 'typescript', config?: StorybookConfigRaw['typescript'], args?: any): Promise<NonNullable<StorybookConfigRaw['typescript']>>;
|
883
|
-
apply(extension: 'build', config?: StorybookConfigRaw['build'], args?: any): Promise<NonNullable<StorybookConfigRaw['build']>>;
|
884
|
-
apply(extension: 'staticDirs', config?: StorybookConfigRaw['staticDirs'], args?: any): Promise<StorybookConfigRaw['staticDirs']>;
|
885
|
-
apply<T>(extension: string, config?: T, args?: unknown): Promise<T>;
|
886
|
-
}
|
887
|
-
interface LoadedPreset {
|
888
|
-
name: string;
|
889
|
-
preset: any;
|
890
|
-
options: any;
|
891
|
-
}
|
892
|
-
interface VersionCheck {
|
893
|
-
success: boolean;
|
894
|
-
cached: boolean;
|
895
|
-
data?: any;
|
896
|
-
error?: any;
|
897
|
-
time: number;
|
898
|
-
}
|
899
|
-
type PackageJson = PackageJson$1 & Record<string, any>;
|
900
|
-
interface LoadOptions {
|
901
|
-
packageJson: PackageJson;
|
902
|
-
outputDir?: string;
|
903
|
-
configDir?: string;
|
904
|
-
cacheKey?: string;
|
905
|
-
ignorePreview?: boolean;
|
906
|
-
extendServer?: (server: Server) => void;
|
907
|
-
}
|
908
|
-
interface CLIOptions {
|
909
|
-
port?: number;
|
910
|
-
ignorePreview?: boolean;
|
911
|
-
previewUrl?: string;
|
912
|
-
forceBuildPreview?: boolean;
|
913
|
-
disableTelemetry?: boolean;
|
914
|
-
enableCrashReports?: boolean;
|
915
|
-
host?: string;
|
916
|
-
initialPath?: string;
|
917
|
-
exactPort?: boolean;
|
918
|
-
configDir?: string;
|
919
|
-
https?: boolean;
|
920
|
-
sslCa?: string[];
|
921
|
-
sslCert?: string;
|
922
|
-
sslKey?: string;
|
923
|
-
smokeTest?: boolean;
|
924
|
-
managerCache?: boolean;
|
925
|
-
open?: boolean;
|
926
|
-
ci?: boolean;
|
927
|
-
loglevel?: string;
|
928
|
-
quiet?: boolean;
|
929
|
-
versionUpdates?: boolean;
|
930
|
-
docs?: boolean;
|
931
|
-
test?: boolean;
|
932
|
-
debugWebpack?: boolean;
|
933
|
-
webpackStatsJson?: string | boolean;
|
934
|
-
statsJson?: string | boolean;
|
935
|
-
outputDir?: string;
|
936
|
-
}
|
937
|
-
interface BuilderOptions {
|
938
|
-
configType?: 'DEVELOPMENT' | 'PRODUCTION';
|
939
|
-
ignorePreview?: boolean;
|
940
|
-
cache?: FileSystemCache;
|
941
|
-
configDir: string;
|
942
|
-
docsMode?: boolean;
|
943
|
-
features?: StorybookConfigRaw['features'];
|
944
|
-
versionCheck?: VersionCheck;
|
945
|
-
disableWebpackDefaults?: boolean;
|
946
|
-
serverChannelUrl?: string;
|
947
|
-
}
|
948
|
-
interface StorybookConfigOptions {
|
949
|
-
presets: Presets;
|
950
|
-
presetsList?: LoadedPreset[];
|
951
|
-
}
|
952
|
-
type Options = LoadOptions & StorybookConfigOptions & CLIOptions & BuilderOptions & {
|
953
|
-
build?: TestBuildConfig;
|
954
|
-
};
|
955
|
-
/**
|
956
|
-
* Options for TypeScript usage within Storybook.
|
957
|
-
*/
|
958
|
-
interface TypescriptOptions {
|
959
|
-
/**
|
960
|
-
* Enables type checking within Storybook.
|
961
|
-
*
|
962
|
-
* @default `false`
|
963
|
-
*/
|
964
|
-
check: boolean;
|
965
|
-
/**
|
966
|
-
* Disable parsing TypeScript files through compiler.
|
967
|
-
*
|
968
|
-
* @default `false`
|
969
|
-
*/
|
970
|
-
skipCompiler: boolean;
|
971
|
-
}
|
972
|
-
type Preset = string | {
|
973
|
-
name: string;
|
974
|
-
options?: any;
|
975
|
-
};
|
976
|
-
/**
|
977
|
-
* An additional script that gets injected into the
|
978
|
-
* preview or the manager,
|
979
|
-
*/
|
980
|
-
type Entry = string;
|
981
|
-
type CoreCommon_StorybookRefs = Record<string, {
|
982
|
-
title: string;
|
983
|
-
url: string;
|
984
|
-
} | {
|
985
|
-
disable: boolean;
|
986
|
-
expanded?: boolean;
|
987
|
-
}>;
|
988
|
-
type DocsOptions = {
|
989
|
-
/**
|
990
|
-
* What should we call the generated docs entries?
|
991
|
-
*/
|
992
|
-
defaultName?: string;
|
993
|
-
/**
|
994
|
-
* Should we generate a docs entry per CSF file?
|
995
|
-
* Set to 'tag' (the default) to generate an entry for every CSF file with the
|
996
|
-
* 'autodocs' tag.
|
997
|
-
*
|
998
|
-
* @deprecated Use `tags: ['autodocs']` in `.storybook/preview.js` instead
|
999
|
-
*/
|
1000
|
-
autodocs?: boolean | 'tag';
|
1001
|
-
/**
|
1002
|
-
* Only show doc entries in the side bar (usually set with the `--docs` CLI flag)
|
1003
|
-
*/
|
1004
|
-
docsMode?: boolean;
|
1005
|
-
};
|
1006
|
-
interface TestBuildFlags {
|
1007
|
-
/**
|
1008
|
-
* The package @storybook/blocks will be excluded from the bundle, even when imported in e.g. the preview.
|
1009
|
-
*/
|
1010
|
-
disableBlocks?: boolean;
|
1011
|
-
/**
|
1012
|
-
* Disable specific addons
|
1013
|
-
*/
|
1014
|
-
disabledAddons?: string[];
|
1015
|
-
/**
|
1016
|
-
* Filter out .mdx stories entries
|
1017
|
-
*/
|
1018
|
-
disableMDXEntries?: boolean;
|
1019
|
-
/**
|
1020
|
-
* Override autodocs to be disabled
|
1021
|
-
*/
|
1022
|
-
disableAutoDocs?: boolean;
|
1023
|
-
/**
|
1024
|
-
* Override docgen to be disabled.
|
1025
|
-
*/
|
1026
|
-
disableDocgen?: boolean;
|
1027
|
-
/**
|
1028
|
-
* Override sourcemaps generation to be disabled.
|
1029
|
-
*/
|
1030
|
-
disableSourcemaps?: boolean;
|
1031
|
-
/**
|
1032
|
-
* Override tree-shaking (dead code elimination) to be disabled.
|
1033
|
-
*/
|
1034
|
-
disableTreeShaking?: boolean;
|
1035
|
-
/**
|
1036
|
-
* Minify with ESBuild when using webpack.
|
1037
|
-
*/
|
1038
|
-
esbuildMinify?: boolean;
|
1039
|
-
}
|
1040
|
-
interface TestBuildConfig {
|
1041
|
-
test?: TestBuildFlags;
|
1042
|
-
}
|
1043
|
-
type Tag = string;
|
1044
|
-
interface TagOptions {
|
1045
|
-
excludeFromSidebar: boolean;
|
1046
|
-
excludeFromDocsStories: boolean;
|
1047
|
-
}
|
1048
|
-
type TagsOptions = Record<Tag, Partial<TagOptions>>;
|
1049
|
-
/**
|
1050
|
-
* The interface for Storybook configuration used internally in presets
|
1051
|
-
* The difference is that these values are the raw values, AKA, not wrapped with `PresetValue<>`
|
1052
|
-
*/
|
1053
|
-
interface StorybookConfigRaw {
|
1054
|
-
/**
|
1055
|
-
* Sets the addons you want to use with Storybook.
|
1056
|
-
*
|
1057
|
-
* @example `['@storybook/addon-essentials']` or `[{ name: '@storybook/addon-essentials', options: { backgrounds: false } }]`
|
1058
|
-
*/
|
1059
|
-
addons?: Preset[];
|
1060
|
-
core?: CoreConfig;
|
1061
|
-
staticDirs?: (DirectoryMapping | string)[];
|
1062
|
-
logLevel?: string;
|
1063
|
-
features?: {
|
1064
|
-
/**
|
1065
|
-
* Filter args with a "target" on the type from the render function (EXPERIMENTAL)
|
1066
|
-
*/
|
1067
|
-
argTypeTargetsV7?: boolean;
|
1068
|
-
/**
|
1069
|
-
* Apply decorators from preview.js before decorators from addons or frameworks
|
1070
|
-
*/
|
1071
|
-
legacyDecoratorFileOrder?: boolean;
|
1072
|
-
/**
|
1073
|
-
* Disallow implicit actions during rendering. This will be the default in Storybook 8.
|
1074
|
-
*
|
1075
|
-
* This will make sure that your story renders the same no matter if docgen is enabled or not.
|
1076
|
-
*/
|
1077
|
-
disallowImplicitActionsInRenderV8?: boolean;
|
1078
|
-
/**
|
1079
|
-
* Enable asynchronous component rendering in React renderer
|
1080
|
-
*/
|
1081
|
-
experimentalRSC?: boolean;
|
1082
|
-
};
|
1083
|
-
build?: TestBuildConfig;
|
1084
|
-
stories: StoriesEntry[];
|
1085
|
-
framework?: Preset;
|
1086
|
-
typescript?: Partial<TypescriptOptions>;
|
1087
|
-
refs?: CoreCommon_StorybookRefs;
|
1088
|
-
babel?: any;
|
1089
|
-
swc?: any;
|
1090
|
-
env?: Record<string, string>;
|
1091
|
-
babelDefault?: any;
|
1092
|
-
previewAnnotations?: Entry[];
|
1093
|
-
experimental_indexers?: Indexer[];
|
1094
|
-
docs?: DocsOptions;
|
1095
|
-
previewHead?: string;
|
1096
|
-
previewBody?: string;
|
1097
|
-
previewMainTemplate?: string;
|
1098
|
-
managerHead?: string;
|
1099
|
-
tags?: TagsOptions;
|
1100
|
-
}
|
1101
|
-
/**
|
1102
|
-
* The interface for Storybook configuration in `main.ts` files.
|
1103
|
-
* This interface is public
|
1104
|
-
* All values should be wrapped with `PresetValue<>`, though there are a few exceptions: `addons`, `framework`
|
1105
|
-
*/
|
1106
|
-
interface StorybookConfig$1 {
|
1107
|
-
/**
|
1108
|
-
* Sets the addons you want to use with Storybook.
|
1109
|
-
*
|
1110
|
-
* @example `['@storybook/addon-essentials']` or `[{ name: '@storybook/addon-essentials', options: { backgrounds: false } }]`
|
1111
|
-
*/
|
1112
|
-
addons?: StorybookConfigRaw['addons'];
|
1113
|
-
core?: PresetValue<StorybookConfigRaw['core']>;
|
1114
|
-
/**
|
1115
|
-
* Sets a list of directories of static files to be loaded by Storybook server
|
1116
|
-
*
|
1117
|
-
* @example `['./public']` or `[{from: './public', 'to': '/assets'}]`
|
1118
|
-
*/
|
1119
|
-
staticDirs?: PresetValue<StorybookConfigRaw['staticDirs']>;
|
1120
|
-
logLevel?: PresetValue<StorybookConfigRaw['logLevel']>;
|
1121
|
-
features?: PresetValue<StorybookConfigRaw['features']>;
|
1122
|
-
build?: PresetValue<StorybookConfigRaw['build']>;
|
1123
|
-
/**
|
1124
|
-
* Tells Storybook where to find stories.
|
1125
|
-
*
|
1126
|
-
* @example `['./src/*.stories.@(j|t)sx?']` or `async () => [...(await myCustomStoriesEntryBuilderFunc())]`
|
1127
|
-
*/
|
1128
|
-
stories: PresetValue<StorybookConfigRaw['stories']>;
|
1129
|
-
/**
|
1130
|
-
* Framework, e.g. '@storybook/react-vite', required in v7
|
1131
|
-
*/
|
1132
|
-
framework?: StorybookConfigRaw['framework'];
|
1133
|
-
/**
|
1134
|
-
* Controls how Storybook handles TypeScript files.
|
1135
|
-
*/
|
1136
|
-
typescript?: PresetValue<StorybookConfigRaw['typescript']>;
|
1137
|
-
/**
|
1138
|
-
* References external Storybooks
|
1139
|
-
*/
|
1140
|
-
refs?: PresetValue<StorybookConfigRaw['refs']>;
|
1141
|
-
/**
|
1142
|
-
* Modify or return babel config.
|
1143
|
-
*/
|
1144
|
-
babel?: PresetValue<StorybookConfigRaw['babel']>;
|
1145
|
-
/**
|
1146
|
-
* Modify or return swc config.
|
1147
|
-
*/
|
1148
|
-
swc?: PresetValue<StorybookConfigRaw['swc']>;
|
1149
|
-
/**
|
1150
|
-
* Modify or return env config.
|
1151
|
-
*/
|
1152
|
-
env?: PresetValue<StorybookConfigRaw['env']>;
|
1153
|
-
/**
|
1154
|
-
* Modify or return babel config.
|
1155
|
-
*/
|
1156
|
-
babelDefault?: PresetValue<StorybookConfigRaw['babelDefault']>;
|
1157
|
-
/**
|
1158
|
-
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
1159
|
-
*/
|
1160
|
-
previewAnnotations?: PresetValue<StorybookConfigRaw['previewAnnotations']>;
|
1161
|
-
/**
|
1162
|
-
* Process CSF files for the story index.
|
1163
|
-
*/
|
1164
|
-
experimental_indexers?: PresetValue<StorybookConfigRaw['experimental_indexers']>;
|
1165
|
-
/**
|
1166
|
-
* Docs related features in index generation
|
1167
|
-
*/
|
1168
|
-
docs?: PresetValue<StorybookConfigRaw['docs']>;
|
1169
|
-
/**
|
1170
|
-
* Programmatically modify the preview head/body HTML.
|
1171
|
-
* The previewHead and previewBody functions accept a string,
|
1172
|
-
* which is the existing head/body, and return a modified string.
|
1173
|
-
*/
|
1174
|
-
previewHead?: PresetValue<StorybookConfigRaw['previewHead']>;
|
1175
|
-
previewBody?: PresetValue<StorybookConfigRaw['previewBody']>;
|
1176
|
-
/**
|
1177
|
-
* Programmatically override the preview's main page template.
|
1178
|
-
* This should return a reference to a file containing an `.ejs` template
|
1179
|
-
* that will be interpolated with environment variables.
|
1180
|
-
*
|
1181
|
-
* @example '.storybook/index.ejs'
|
1182
|
-
*/
|
1183
|
-
previewMainTemplate?: PresetValue<StorybookConfigRaw['previewMainTemplate']>;
|
1184
|
-
/**
|
1185
|
-
* Programmatically modify the preview head/body HTML.
|
1186
|
-
* The managerHead function accept a string,
|
1187
|
-
* which is the existing head content, and return a modified string.
|
1188
|
-
*/
|
1189
|
-
managerHead?: PresetValue<StorybookConfigRaw['managerHead']>;
|
1190
|
-
/**
|
1191
|
-
* Configure non-standard tag behaviors
|
1192
|
-
*/
|
1193
|
-
tags?: PresetValue<StorybookConfigRaw['tags']>;
|
1194
|
-
}
|
1195
|
-
type PresetValue<T> = T | ((config: T, options: Options) => T | Promise<T>);
|
1196
|
-
type PresetProperty<K, TStorybookConfig = StorybookConfigRaw> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
|
1197
|
-
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]>;
|
1198
|
-
type Path = string;
|
1199
|
-
|
1200
|
-
type FrameworkName = '@storybook/preact-vite';
|
1201
|
-
type BuilderName = '@storybook/builder-vite';
|
1202
|
-
type FrameworkOptions = {
|
1203
|
-
builder?: BuilderOptions$1;
|
1204
|
-
};
|
1205
|
-
type StorybookConfigFramework = {
|
1206
|
-
framework: FrameworkName | {
|
1207
|
-
name: FrameworkName;
|
1208
|
-
options: FrameworkOptions;
|
1209
|
-
};
|
1210
|
-
core?: StorybookConfig$1['core'] & {
|
1211
|
-
builder?: BuilderName | {
|
1212
|
-
name: BuilderName;
|
1213
|
-
options: BuilderOptions$1;
|
1214
|
-
};
|
1215
|
-
};
|
1216
|
-
};
|
1217
|
-
/**
|
1218
|
-
* The interface for Storybook configuration in `main.ts` files.
|
1219
|
-
*/
|
1220
|
-
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigVite | keyof StorybookConfigFramework> & StorybookConfigVite & StorybookConfigFramework;
|
1221
|
-
|
1222
|
-
export { FrameworkOptions as F, PresetProperty as P, StorybookConfig as S };
|