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