@storybook/preact-vite 7.1.0-alpha.9 → 7.1.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,40 @@ type Primitive =
17
17
  | symbol
18
18
  | bigint;
19
19
 
20
+ /**
21
+ Matches a JSON object.
22
+
23
+ This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
24
+
25
+ @category JSON
26
+ */
27
+ type JsonObject = {[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined};
28
+
29
+ /**
30
+ Matches a JSON array.
31
+
32
+ @category JSON
33
+ */
34
+ type JsonArray = JsonValue[] | readonly JsonValue[];
35
+
36
+ /**
37
+ Matches any valid JSON primitive value.
38
+
39
+ @category JSON
40
+ */
41
+ type JsonPrimitive = string | number | boolean | null;
42
+
43
+ /**
44
+ Matches any valid JSON value.
45
+
46
+ @see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.
47
+
48
+ @category JSON
49
+ */
50
+ type JsonValue = JsonPrimitive | JsonObject | JsonArray;
51
+
20
52
  declare global {
53
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
21
54
  interface SymbolConstructor {
22
55
  readonly observable: symbol;
23
56
  }
@@ -83,8 +116,8 @@ declare namespace PackageJson$1 {
83
116
  email?: string;
84
117
  };
85
118
 
86
- export interface DirectoryLocations {
87
- [directoryType: string]: unknown;
119
+ export type DirectoryLocations = {
120
+ [directoryType: string]: JsonValue | undefined;
88
121
 
89
122
  /**
90
123
  Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder.
@@ -115,7 +148,7 @@ declare namespace PackageJson$1 {
115
148
  Location for test files.
116
149
  */
117
150
  test?: string;
118
- }
151
+ };
119
152
 
120
153
  export type Scripts = {
121
154
  /**
@@ -265,22 +298,11 @@ declare namespace PackageJson$1 {
265
298
  export type Dependency = Partial<Record<string, string>>;
266
299
 
267
300
  /**
268
- Conditions which provide a way to resolve a package entry point based on the environment.
301
+ A mapping of conditions and the paths to which they resolve.
269
302
  */
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};
303
+ type ExportConditions = { // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
304
+ [condition: string]: Exports;
305
+ };
284
306
 
285
307
  /**
286
308
  Entry points of a module, optionally with conditions and subpath exports.
@@ -289,16 +311,16 @@ declare namespace PackageJson$1 {
289
311
  | null
290
312
  | string
291
313
  | Array<string | ExportConditions>
292
- | ExportConditions
293
- | {[path: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
314
+ | ExportConditions;
294
315
 
295
316
  /**
296
- Import map entries of a module, optionally with conditions.
317
+ Import map entries of a module, optionally with conditions and subpath imports.
297
318
  */
298
319
  export type Imports = { // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
299
- [key: string]: string | {[key in ExportCondition]: Exports};
320
+ [key: `#${string}`]: Exports;
300
321
  };
301
322
 
323
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
302
324
  export interface NonStandardEntryPoints {
303
325
  /**
304
326
  An ECMAScript module ID that is the primary entry point to the program.
@@ -331,7 +353,7 @@ declare namespace PackageJson$1 {
331
353
  sideEffects?: boolean | string[];
332
354
  }
333
355
 
334
- export interface TypeScriptConfiguration {
356
+ export type TypeScriptConfiguration = {
335
357
  /**
336
358
  Location of the bundled TypeScript declaration file.
337
359
  */
@@ -346,12 +368,12 @@ declare namespace PackageJson$1 {
346
368
  Location of the bundled TypeScript declaration file. Alias of `types`.
347
369
  */
348
370
  typings?: string;
349
- }
371
+ };
350
372
 
351
373
  /**
352
- An alternative configuration for Yarn workspaces.
374
+ An alternative configuration for workspaces.
353
375
  */
354
- export interface WorkspaceConfig {
376
+ export type WorkspaceConfig = {
355
377
  /**
356
378
  An array of workspace pattern strings which contain the workspace packages.
357
379
  */
@@ -360,10 +382,11 @@ declare namespace PackageJson$1 {
360
382
  /**
361
383
  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
384
 
363
- [Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/)
385
+ [Supported](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) by Yarn.
386
+ [Not supported](https://github.com/npm/rfcs/issues/287) by npm.
364
387
  */
365
388
  nohoist?: WorkspacePattern[];
366
- }
389
+ };
367
390
 
368
391
  /**
369
392
  A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process.
@@ -376,16 +399,7 @@ declare namespace PackageJson$1 {
376
399
  */
377
400
  type WorkspacePattern = string;
378
401
 
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
-
402
+ export type YarnConfiguration = {
389
403
  /**
390
404
  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
405
 
@@ -397,18 +411,19 @@ declare namespace PackageJson$1 {
397
411
  Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file.
398
412
  */
399
413
  resolutions?: Dependency;
400
- }
414
+ };
401
415
 
402
- export interface JSPMConfiguration {
416
+ export type JSPMConfiguration = {
403
417
  /**
404
418
  JSPM configuration.
405
419
  */
406
420
  jspm?: PackageJson$1;
407
- }
421
+ };
408
422
 
409
423
  /**
410
424
  Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties.
411
425
  */
426
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
412
427
  export interface PackageJsonStandard {
413
428
  /**
414
429
  The name of the package.
@@ -538,7 +553,7 @@ declare namespace PackageJson$1 {
538
553
  /**
539
554
  Is used to set configuration parameters used in package scripts that persist across upgrades.
540
555
  */
541
- config?: Record<string, unknown>;
556
+ config?: JsonObject;
542
557
 
543
558
  /**
544
559
  The dependencies of the package.
@@ -579,7 +594,7 @@ declare namespace PackageJson$1 {
579
594
  Engines that this package runs on.
580
595
  */
581
596
  engines?: {
582
- [EngineName in 'npm' | 'node' | string]?: string;
597
+ [EngineName in 'npm' | 'node' | string]?: string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents
583
598
  };
584
599
 
585
600
  /**
@@ -678,13 +693,41 @@ declare namespace PackageJson$1 {
678
693
  */
679
694
  url: string;
680
695
  };
696
+
697
+ /**
698
+ Used to configure [npm workspaces](https://docs.npmjs.com/cli/using-npm/workspaces) / [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/).
699
+
700
+ Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run your install command once in order to install all of them in a single pass.
701
+
702
+ Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces.
703
+ */
704
+ workspaces?: WorkspacePattern[] | WorkspaceConfig;
681
705
  }
682
706
 
683
- export interface PublishConfig {
707
+ /**
708
+ Type for [`package.json` file used by the Node.js runtime](https://nodejs.org/api/packages.html#nodejs-packagejson-field-definitions).
709
+ */
710
+ export type NodeJsStandard = {
711
+ /**
712
+ Defines which package manager is expected to be used when working on the current project. It can set to any of the [supported package managers](https://nodejs.org/api/corepack.html#supported-package-managers), and will ensure that your teams use the exact same package manager versions without having to install anything else than Node.js.
713
+
714
+ __This field is currently experimental and needs to be opted-in; check the [Corepack](https://nodejs.org/api/corepack.html) page for details about the procedure.__
715
+
716
+ @example
717
+ ```json
718
+ {
719
+ "packageManager": "<package manager name>@<version>"
720
+ }
721
+ ```
722
+ */
723
+ packageManager?: string;
724
+ };
725
+
726
+ export type PublishConfig = {
684
727
  /**
685
728
  Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig).
686
729
  */
687
- [additionalProperties: string]: unknown;
730
+ [additionalProperties: string]: JsonValue | undefined;
688
731
 
689
732
  /**
690
733
  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.
@@ -704,7 +747,7 @@ declare namespace PackageJson$1 {
704
747
  Default: `'latest'`
705
748
  */
706
749
  tag?: string;
707
- }
750
+ };
708
751
  }
709
752
 
710
753
  /**
@@ -713,6 +756,8 @@ Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-j
713
756
  @category File
714
757
  */
715
758
  type PackageJson$1 =
759
+ JsonObject &
760
+ PackageJson$1.NodeJsStandard &
716
761
  PackageJson$1.PackageJsonStandard &
717
762
  PackageJson$1.NonStandardEntryPoints &
718
763
  PackageJson$1.TypeScriptConfiguration &
@@ -735,7 +780,7 @@ interface StoriesSpecifier {
735
780
  /**
736
781
  * What does the filename of a story file look like?
737
782
  * (a glob, relative to directory, no leading `./`)
738
- * If unset, we use `** / *.@(mdx|stories.@(mdx|tsx|ts|jsx|js))` (no spaces)
783
+ * If unset, we use `** / *.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))` (no spaces)
739
784
  */
740
785
  files?: string;
741
786
  }
@@ -836,11 +881,6 @@ interface VersionCheck {
836
881
  error?: any;
837
882
  time: number;
838
883
  }
839
- interface ReleaseNotesData {
840
- success: boolean;
841
- currentVersion: string;
842
- showOnFirstLaunch: boolean;
843
- }
844
884
  type PackageJson = PackageJson$1 & Record<string, any>;
845
885
  interface LoadOptions {
846
886
  packageJson: PackageJson;
@@ -857,6 +897,7 @@ interface CLIOptions {
857
897
  disableTelemetry?: boolean;
858
898
  enableCrashReports?: boolean;
859
899
  host?: string;
900
+ initialPath?: string;
860
901
  /**
861
902
  * @deprecated Use 'staticDirs' Storybook Configuration option instead
862
903
  */
@@ -873,7 +914,6 @@ interface CLIOptions {
873
914
  loglevel?: string;
874
915
  quiet?: boolean;
875
916
  versionUpdates?: boolean;
876
- releaseNotes?: boolean;
877
917
  docs?: boolean;
878
918
  debugWebpack?: boolean;
879
919
  webpackStatsJson?: string | boolean;
@@ -887,7 +927,6 @@ interface BuilderOptions {
887
927
  docsMode?: boolean;
888
928
  features?: StorybookConfig$1['features'];
889
929
  versionCheck?: VersionCheck;
890
- releaseNotesData?: ReleaseNotesData;
891
930
  disableWebpackDefaults?: boolean;
892
931
  serverChannelUrl?: string;
893
932
  }
@@ -993,6 +1032,10 @@ interface StorybookConfig$1 {
993
1032
  * Apply decorators from preview.js before decorators from addons or frameworks
994
1033
  */
995
1034
  legacyDecoratorFileOrder?: boolean;
1035
+ /**
1036
+ * Show a notification anytime a What's new? post is published in the Storybook blog.
1037
+ */
1038
+ whatsNewNotifications?: boolean;
996
1039
  };
997
1040
  /**
998
1041
  * Tells Storybook where to find stories.
@@ -1050,13 +1093,19 @@ interface StorybookConfig$1 {
1050
1093
  previewHead?: PresetValue<string>;
1051
1094
  previewBody?: PresetValue<string>;
1052
1095
  /**
1053
- * Programatically override the preview's main page template.
1096
+ * Programmatically override the preview's main page template.
1054
1097
  * This should return a reference to a file containing an `.ejs` template
1055
1098
  * that will be interpolated with environment variables.
1056
1099
  *
1057
1100
  * @example '.storybook/index.ejs'
1058
1101
  */
1059
1102
  previewMainTemplate?: string;
1103
+ /**
1104
+ * Programmatically modify the preview head/body HTML.
1105
+ * The managerHead function accept a string,
1106
+ * which is the existing head content, and return a modified string.
1107
+ */
1108
+ managerHead?: PresetValue<string>;
1060
1109
  }
1061
1110
  type PresetValue<T> = T | ((config: T, options: Options) => T | Promise<T>);
1062
1111
  type PresetProperty<K, TStorybookConfig = StorybookConfig$1> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { F as FrameworkOptions, S as StorybookConfig } from './types-5df36224.js';
1
+ export { F as FrameworkOptions, S as StorybookConfig } from './index-a4393ac2.js';
2
2
  import 'file-system-cache';
3
3
  import '@babel/core';
4
4
  import 'http';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};module.exports=__toCommonJS(src_exports);
1
+ "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};module.exports=__toCommonJS(src_exports);
package/dist/index.mjs CHANGED
@@ -0,0 +1 @@
1
+
package/dist/preset.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as PresetProperty, S as StorybookConfig } from './types-5df36224.js';
1
+ import { P as PresetProperty, S as StorybookConfig } from './index-a4393ac2.js';
2
2
  import 'file-system-cache';
3
3
  import '@babel/core';
4
4
  import 'http';
package/dist/preset.js CHANGED
@@ -1 +1 @@
1
- var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{core:()=>core,viteFinal:()=>viteFinal});module.exports=__toCommonJS(preset_exports);var import_builder_vite=require("@storybook/builder-vite"),import_preset_vite=__toESM(require("@preact/preset-vite")),core={builder:"@storybook/builder-vite",renderer:"@storybook/preact"},viteFinal=async config=>{let{plugins=[]}=config;return await(0,import_builder_vite.hasVitePlugins)(plugins,["vite:preact-jsx"])||plugins.push((0,import_preset_vite.default)()),config};0&&(module.exports={core,viteFinal});
1
+ "use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{core:()=>core,viteFinal:()=>viteFinal});module.exports=__toCommonJS(preset_exports);var import_builder_vite=require("@storybook/builder-vite"),import_preset_vite=__toESM(require("@preact/preset-vite")),core={builder:"@storybook/builder-vite",renderer:"@storybook/preact"},viteFinal=async config=>{let{plugins=[]}=config;return await(0,import_builder_vite.hasVitePlugins)(plugins,["vite:preact-jsx"])||plugins.push((0,import_preset_vite.default)()),config};0&&(module.exports={core,viteFinal});
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@storybook/preact-vite",
3
- "version": "7.1.0-alpha.9",
3
+ "version": "7.1.0-beta.1",
4
4
  "description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.",
5
5
  "keywords": [
6
6
  "storybook"
7
7
  ],
8
- "homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/preact-vite",
8
+ "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/preact-vite",
9
9
  "bugs": {
10
10
  "url": "https://github.com/storybookjs/storybook/issues"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
14
14
  "url": "https://github.com/storybookjs/storybook.git",
15
- "directory": "frameworks/preact-vite"
15
+ "directory": "code/frameworks/preact-vite"
16
16
  },
17
17
  "funding": {
18
18
  "type": "opencollective",
@@ -21,14 +21,13 @@
21
21
  "license": "MIT",
22
22
  "exports": {
23
23
  ".": {
24
+ "types": "./dist/index.d.ts",
24
25
  "require": "./dist/index.js",
25
- "import": "./dist/index.mjs",
26
- "types": "./dist/index.d.ts"
26
+ "import": "./dist/index.mjs"
27
27
  },
28
28
  "./preset": {
29
- "require": "./dist/preset.js",
30
- "import": "./dist/preset.mjs",
31
- "types": "./dist/preset.d.ts"
29
+ "types": "./dist/preset.d.ts",
30
+ "require": "./dist/preset.js"
32
31
  },
33
32
  "./package.json": "./package.json"
34
33
  },
@@ -48,8 +47,8 @@
48
47
  },
49
48
  "dependencies": {
50
49
  "@preact/preset-vite": "^2.0.0",
51
- "@storybook/builder-vite": "7.1.0-alpha.9",
52
- "@storybook/preact": "7.1.0-alpha.9"
50
+ "@storybook/builder-vite": "7.1.0-beta.1",
51
+ "@storybook/preact": "7.1.0-beta.1"
53
52
  },
54
53
  "devDependencies": {
55
54
  "@types/node": "^16.0.0",
@@ -73,5 +72,5 @@
73
72
  ],
74
73
  "platform": "node"
75
74
  },
76
- "gitHead": "ec112401efaae6d3d4996c790a30301177570da9"
77
- }
75
+ "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17"
76
+ }
package/dist/preset.mjs DELETED
@@ -1 +0,0 @@
1
- import{hasVitePlugins}from"@storybook/builder-vite";import preact from"@preact/preset-vite";var core={builder:"@storybook/builder-vite",renderer:"@storybook/preact"},viteFinal=async config=>{let{plugins=[]}=config;return await hasVitePlugins(plugins,["vite:preact-jsx"])||plugins.push(preact()),config};export{core,viteFinal};