storybook 9.1.14 → 9.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4128,7 +4128,7 @@ async function qn(t) {
4128
4128
  o(qn, "findPackage");
4129
4129
 
4130
4130
  // package.json
4131
- var wt = "9.1.14";
4131
+ var wt = "9.1.16";
4132
4132
 
4133
4133
  // src/cli/globalSettings.ts
4134
4134
  var At = T(require("node:fs/promises"), 1), xs = require("node:os"), Zt = require("node:path"), vs = T(Gn(), 1), Ne = T(gs(), 1);
@@ -6433,9 +6433,10 @@ async function wa(t, e = { retryDelay: 1e3, immediate: !1 }) {
6433
6433
  anonymousId: fa()
6434
6434
  }, c;
6435
6435
  try {
6436
- c = Tl(t, a, e), ur.push(c), e.immediate ? await Promise.all(ur) : await c;
6437
- let p = await Cn(), l = ft(), f = { ...i, eventType: r, eventId: l, sessionId: p, metadata: s, payload: n, context: a };
6438
- await ha(r, f);
6436
+ c = Tl(t, a, e), ur.push(c);
6437
+ let p = await Cn(), l = ft(), f = { ...i, eventType: r, eventId: l, sessionId: p, metadata: s, payload: n, context: a }, x = e.immediate ?
6438
+ ur : [c];
6439
+ await Promise.all([...x, ha(r, f)]);
6439
6440
  } catch {
6440
6441
  } finally {
6441
6442
  ur = ur.filter((p) => p !== c);
@@ -6454,11 +6455,10 @@ sExampleStoryId"), Sl = /* @__PURE__ */ o(async (t, e = {}, r = {}) => {
6454
6455
  try {
6455
6456
  r?.stripMetadata || (n.metadata = await kn(r?.configDir));
6456
6457
  } catch (s) {
6457
- n.payload.metadataErrorMessage = Ge(s).message, r?.enableCrashReports && (n.payload.metadataError = Ge(s));
6458
+ e.metadataErrorMessage = Ge(s).message, r?.enableCrashReports && (e.metadataError = Ge(s));
6458
6459
  } finally {
6459
- let { error: s } = n.payload;
6460
- s && (n.payload.error = Ge(s)), (!n.payload.error || r?.enableCrashReports) && (process.env?.STORYBOOK_TELEMETRY_DEBUG && (En.logger.info(
6461
- `
6460
+ let { error: s } = e;
6461
+ s && (e.error = Ge(s)), (!e.error || r?.enableCrashReports) && (process.env?.STORYBOOK_TELEMETRY_DEBUG && (En.logger.info(`
6462
6462
  [telemetry]`), En.logger.info(JSON.stringify(n, null, 2))), await wa(n, r));
6463
6463
  }
6464
6464
  }, "telemetry");
@@ -32,7 +32,7 @@ declare const monorepoConfigs: {
32
32
  };
33
33
  type MonorepoType = keyof typeof monorepoConfigs | 'Workspaces' | undefined;
34
34
 
35
- type EventType = 'boot' | 'dev' | 'build' | 'index' | 'upgrade' | 'multi-upgrade' | 'init' | 'init-step' | 'scaffolded-empty' | 'browser' | 'canceled' | 'error' | 'error-metadata' | 'version-update' | 'core-config' | 'remove' | 'save-story' | 'create-new-story-file' | 'create-new-story-file-search' | 'testing-module-watch-mode' | 'testing-module-completed-report' | 'testing-module-crash-report' | 'addon-test' | 'test-run' | 'addon-onboarding' | 'onboarding-survey' | 'mocking';
35
+ type EventType = 'boot' | 'dev' | 'build' | 'index' | 'upgrade' | 'multi-upgrade' | 'init' | 'init-step' | 'scaffolded-empty' | 'browser' | 'canceled' | 'error' | 'error-metadata' | 'version-update' | 'core-config' | 'remove' | 'save-story' | 'create-new-story-file' | 'create-new-story-file-search' | 'testing-module-watch-mode' | 'testing-module-completed-report' | 'testing-module-crash-report' | 'addon-test' | 'test-run' | 'addon-onboarding' | 'onboarding-survey' | 'mocking' | 'preview-first-load';
36
36
  interface Dependency {
37
37
  version: string | undefined;
38
38
  versionSpecifier?: string;
@@ -84,6 +84,9 @@ type StorybookMetadata = {
84
84
  interface Payload {
85
85
  [key: string]: any;
86
86
  }
87
+ interface Context {
88
+ [key: string]: any;
89
+ }
87
90
  interface Options {
88
91
  retryDelay: number;
89
92
  immediate: boolean;
@@ -97,6 +100,23 @@ interface TelemetryData {
97
100
  payload: Payload;
98
101
  metadata?: StorybookMetadata;
99
102
  }
103
+ interface TelemetryEvent extends TelemetryData {
104
+ eventId: string;
105
+ sessionId: string;
106
+ context: Context;
107
+ }
108
+ interface InitPayload {
109
+ projectType: string;
110
+ features: {
111
+ dev: boolean;
112
+ docs: boolean;
113
+ test: boolean;
114
+ onboarding: boolean;
115
+ };
116
+ newUser: boolean;
117
+ versionSpecifier: string | undefined;
118
+ cliIntegration: string | undefined;
119
+ }
100
120
 
101
121
  declare const oneWayHash: (payload: BinaryLike) => string;
102
122
 
@@ -133,4 +153,4 @@ declare const addToGlobalContext: (key: string, value: any) => void;
133
153
  declare const isExampleStoryId: (storyId: string) => boolean;
134
154
  declare const telemetry: (eventType: EventType, payload?: Payload, options?: Partial<Options>) => Promise<void>;
135
155
 
136
- export { type Dependency, type EventType, type IErrorWithStdErrAndStdOut, type Options, type Payload, type StorybookAddon, type StorybookMetadata, type TelemetryData, addToGlobalContext, cleanPaths, computeStorybookMetadata, getPrecedingUpgrade, getStorybookMetadata, isExampleStoryId, metaFrameworks, oneWayHash, removeAnsiEscapeCodes, sanitizeAddonName, sanitizeError, telemetry };
156
+ export { type Context, type Dependency, type EventType, type IErrorWithStdErrAndStdOut, type InitPayload, type Options, type Payload, type StorybookAddon, type StorybookMetadata, type TelemetryData, type TelemetryEvent, addToGlobalContext, cleanPaths, computeStorybookMetadata, getPrecedingUpgrade, getStorybookMetadata, isExampleStoryId, metaFrameworks, oneWayHash, removeAnsiEscapeCodes, sanitizeAddonName, sanitizeError, telemetry };
@@ -4134,7 +4134,7 @@ async function kn(t) {
4134
4134
  o(kn, "findPackage");
4135
4135
 
4136
4136
  // package.json
4137
- var ut = "9.1.14";
4137
+ var ut = "9.1.16";
4138
4138
 
4139
4139
  // src/cli/globalSettings.ts
4140
4140
  var Yn = H(In(), 1), Ee = H(Kn(), 1);
@@ -6466,9 +6466,10 @@ async function Ro(t, e = { retryDelay: 1e3, immediate: !1 }) {
6466
6466
  anonymousId: Po()
6467
6467
  }, c;
6468
6468
  try {
6469
- c = $l(t, a, e), Ht.push(c), e.immediate ? await Promise.all(Ht) : await c;
6470
- let p = await an(), l = et(), f = { ...i, eventType: r, eventId: l, sessionId: p, metadata: s, payload: n, context: a };
6471
- await jo(r, f);
6469
+ c = $l(t, a, e), Ht.push(c);
6470
+ let p = await an(), l = et(), f = { ...i, eventType: r, eventId: l, sessionId: p, metadata: s, payload: n, context: a }, x = e.immediate ?
6471
+ Ht : [c];
6472
+ await Promise.all([...x, jo(r, f)]);
6472
6473
  } catch {
6473
6474
  } finally {
6474
6475
  Ht = Ht.filter((p) => p !== c);
@@ -6487,10 +6488,10 @@ sExampleStoryId"), Ev = /* @__PURE__ */ o(async (t, e = {}, r = {}) => {
6487
6488
  try {
6488
6489
  r?.stripMetadata || (n.metadata = await ko(r?.configDir));
6489
6490
  } catch (s) {
6490
- n.payload.metadataErrorMessage = ct(s).message, r?.enableCrashReports && (n.payload.metadataError = ct(s));
6491
+ e.metadataErrorMessage = ct(s).message, r?.enableCrashReports && (e.metadataError = ct(s));
6491
6492
  } finally {
6492
- let { error: s } = n.payload;
6493
- s && (n.payload.error = ct(s)), (!n.payload.error || r?.enableCrashReports) && (process.env?.STORYBOOK_TELEMETRY_DEBUG && (Do.info(`
6493
+ let { error: s } = e;
6494
+ s && (e.error = ct(s)), (!e.error || r?.enableCrashReports) && (process.env?.STORYBOOK_TELEMETRY_DEBUG && (Do.info(`
6494
6495
  [telemetry]`), Do.info(JSON.stringify(n, null, 2))), await Ro(n, r));
6495
6496
  }
6496
6497
  }, "telemetry");
@@ -2509,6 +2509,7 @@ interface StorybookConfigRaw {
2509
2509
  babelDefault?: any;
2510
2510
  previewAnnotations?: Entry[];
2511
2511
  experimental_indexers?: Indexer[];
2512
+ experimental_devServer?: ServerApp;
2512
2513
  docs?: DocsOptions;
2513
2514
  previewHead?: string;
2514
2515
  previewBody?: string;
@@ -3589,4 +3590,4 @@ type SupportedFrameworks = 'angular' | 'ember' | 'html-vite' | 'nextjs' | 'nextj
3589
3590
 
3590
3591
  type SupportedRenderers = 'react' | 'react-native' | 'vue3' | 'angular' | 'ember' | 'preact' | 'svelte' | 'qwik' | 'html' | 'web-components' | 'server' | 'solid' | 'nuxt';
3591
3592
 
3592
- export { type API_ActiveTabsType, type API_BaseEntry, type API_ComponentEntry, type API_ComposedRef, type API_ComposedRefUpdate, type API_DocsEntry, type API_FilterFunction, type API_GroupEntry, type API_HashEntry, type API_IframeRenderer, type API_IndexHash, type API_Layout, type API_LayoutCustomisations, type API_LeafEntry, type API_LoadedRefData, type API_MatchOptions, type API_Notification, type API_OptionsData, type API_PanelPositions, type API_PreparedIndexEntry, type API_PreparedStoryIndex, type API_Provider, type API_ProviderData, type API_RefId, type API_RefUrl, type API_Refs, type API_ReleaseNotes, type API_RenderOptions, type API_RootEntry, type API_RouteOptions, type API_SetRefData, type API_Settings, type API_SidebarOptions, type API_StateMerger, type API_StoryEntry, type API_StoryMapper, type API_UI, type API_UIOptions, type API_UnknownEntries, type API_Version, type API_Versions$1 as API_Versions, type API_ViewMode, type Actor, type Addon_AddStoryArgs, type Addon_Annotations, type Addon_ArgType, type Addon_ArgsStoryFn, type Addon_BaseAnnotations, type Addon_BaseDecorators, type Addon_BaseMeta, type Addon_BaseStoryFn, type Addon_BaseStoryObject, type Addon_BaseType, type Addon_ClientApiAddon, type Addon_ClientApiAddons, type Addon_ClientApiReturnFn, type Addon_ClientStoryApi, type Addon_Collection, type Addon_Comparator, type Addon_Config, type Addon_DecoratorFunction, type Addon_Elements, type Addon_LegacyStoryFn, type Addon_LoadFn, type Addon_Loadable, type Addon_Loader, type Addon_LoaderFunction, type Addon_Loaders, type Addon_MakeDecoratorResult, type Addon_OptionsParameter, type Addon_OptionsParameterV7, type Addon_PageType, type Addon_PartialStoryFn, type Addon_RenderOptions, type Addon_RequireContext, type Addon_StoryApi, type Addon_StoryContext, type Addon_StoryContextUpdate, type Addon_StoryFn, type Addon_StorySortComparator, type Addon_StorySortComparatorV7, type Addon_StorySortMethod, type Addon_StorySortObjectParameter, type Addon_StorySortParameter, type Addon_StorySortParameterV7, type Addon_StoryWrapper, type Addon_TestProviderType, type Addon_ToolbarConfig, type Addon_Type, type Addon_Types, Addon_TypesEnum, type Addon_TypesMapping, type Addon_WrapperSettings, type Addon_WrapperType, type Addons_ArgTypes, type BaseIndexEntry, type BaseIndexInput, type BaseStory, type BoundStory, type Builder, type BuilderName, type BuilderOptions, type BuilderResult, type BuilderStats, type Builder_EnvsRaw, type Builder_Unpromise, type Builder_WithRequiredProperty, type CLIBaseOptions, type CLIOptions, type CSFFile, type CompatibleString, type ComposeStoryFn, type ComposedStoryFn, type CoreCommon_AddonEntry, type CoreCommon_AddonInfo, type CoreCommon_OptionsEntry, type CoreCommon_ResolvedAddonPreset, type CoreCommon_ResolvedAddonVirtual, type CoreCommon_StorybookInfo, type CoreConfig, type DocsContextProps, type DocsIndexEntry, type DocsIndexInput, type DocsOptions, type DocsPreparedPayload, type DocsRenderFunction, type Entry, type Event, type EventInfo, type GlobalsUpdatedPayload, type IndexEntry, type IndexEntryLegacy, type IndexInput, type IndexInputStats, type IndexedCSFFile, type IndexedStory, type Indexer, type IndexerOptions, type LoadOptions, type LoadedPreset, type Middleware, MockUniversalStore, type ModuleExport, type ModuleExports, type ModuleImportFn, type NamedOrDefaultProjectAnnotations, type NormalizedComponentAnnotations, type NormalizedProjectAnnotations, type NormalizedStoriesSpecifier, type NormalizedStoryAnnotations, type Options, type PackageJson, type PartialArgsStoryFn, type Path, type PreparedMeta, type PreparedStory, type Preset, type PresetConfig, type PresetProperty, type PresetPropertyFn, type PresetValue, type Presets, type PreviewAnnotation, type ProjectAnnotations, type Ref, type RenderContext, type RenderContextCallbacks, type RenderToCanvas, type RendererName, type ResolvedModuleExport, type ResolvedModuleExportFromType, type ResolvedModuleExportType, type SetGlobalsPayload, type SetStoriesPayload, type SetStoriesStory, type SetStoriesStoryData, type Stats, type Status, type StatusByTypeId, type StatusStore, type StatusStoreByTypeId, type StatusTypeId, type StatusValue, type StatusesByStoryIdAndTypeId, type StoreOptions, type Store_CSFExports, type StoriesEntry, type StoriesSpecifier, type StoriesWithPartialProps, type StoryIndex, type StoryIndexEntry, type StoryIndexInput, type StoryIndexV2, type StoryIndexV3, type StoryPreparedPayload, type StoryRenderOptions, type StorybookConfig, type StorybookConfigOptions, type StorybookConfigRaw, type StorybookInternalParameters, type StorybookParameters, type StorybookTypes, type SupportedFrameworks, type SupportedRenderers, type TagOptions, type TagsOptions, type TeardownRenderToCanvas, type TestBuildConfig, type TestBuildFlags, type TestProviderId, type TestProviderState, type TestProviderStateByProviderId, type TestProviderStoreById, type TypescriptOptions, UniversalStore, type UseStatusStore, type UseTestProviderStore, type V3CompatIndexEntry, type VersionCheck, type ViewMode, type WebRenderer };
3593
+ export { type API_ActiveTabsType, type API_BaseEntry, type API_ComponentEntry, type API_ComposedRef, type API_ComposedRefUpdate, type API_DocsEntry, type API_FilterFunction, type API_GroupEntry, type API_HashEntry, type API_IframeRenderer, type API_IndexHash, type API_Layout, type API_LayoutCustomisations, type API_LeafEntry, type API_LoadedRefData, type API_MatchOptions, type API_Notification, type API_OptionsData, type API_PanelPositions, type API_PreparedIndexEntry, type API_PreparedStoryIndex, type API_Provider, type API_ProviderData, type API_RefId, type API_RefUrl, type API_Refs, type API_ReleaseNotes, type API_RenderOptions, type API_RootEntry, type API_RouteOptions, type API_SetRefData, type API_Settings, type API_SidebarOptions, type API_StateMerger, type API_StoryEntry, type API_StoryMapper, type API_UI, type API_UIOptions, type API_UnknownEntries, type API_Version, type API_Versions$1 as API_Versions, type API_ViewMode, type Actor, type Addon_AddStoryArgs, type Addon_Annotations, type Addon_ArgType, type Addon_ArgsStoryFn, type Addon_BaseAnnotations, type Addon_BaseDecorators, type Addon_BaseMeta, type Addon_BaseStoryFn, type Addon_BaseStoryObject, type Addon_BaseType, type Addon_ClientApiAddon, type Addon_ClientApiAddons, type Addon_ClientApiReturnFn, type Addon_ClientStoryApi, type Addon_Collection, type Addon_Comparator, type Addon_Config, type Addon_DecoratorFunction, type Addon_Elements, type Addon_LegacyStoryFn, type Addon_LoadFn, type Addon_Loadable, type Addon_Loader, type Addon_LoaderFunction, type Addon_Loaders, type Addon_MakeDecoratorResult, type Addon_OptionsParameter, type Addon_OptionsParameterV7, type Addon_PageType, type Addon_PartialStoryFn, type Addon_RenderOptions, type Addon_RequireContext, type Addon_StoryApi, type Addon_StoryContext, type Addon_StoryContextUpdate, type Addon_StoryFn, type Addon_StorySortComparator, type Addon_StorySortComparatorV7, type Addon_StorySortMethod, type Addon_StorySortObjectParameter, type Addon_StorySortParameter, type Addon_StorySortParameterV7, type Addon_StoryWrapper, type Addon_TestProviderType, type Addon_ToolbarConfig, type Addon_Type, type Addon_Types, Addon_TypesEnum, type Addon_TypesMapping, type Addon_WrapperSettings, type Addon_WrapperType, type Addons_ArgTypes, type BaseIndexEntry, type BaseIndexInput, type BaseStory, type BoundStory, type Builder, type BuilderName, type BuilderOptions, type BuilderResult, type BuilderStats, type Builder_EnvsRaw, type Builder_Unpromise, type Builder_WithRequiredProperty, type CLIBaseOptions, type CLIOptions, type CSFFile, type CompatibleString, type ComposeStoryFn, type ComposedStoryFn, type CoreCommon_AddonEntry, type CoreCommon_AddonInfo, type CoreCommon_OptionsEntry, type CoreCommon_ResolvedAddonPreset, type CoreCommon_ResolvedAddonVirtual, type CoreCommon_StorybookInfo, type CoreConfig, type DocsContextProps, type DocsIndexEntry, type DocsIndexInput, type DocsOptions, type DocsPreparedPayload, type DocsRenderFunction, type Entry, type Event, type EventInfo, type GlobalsUpdatedPayload, type IndexEntry, type IndexEntryLegacy, type IndexInput, type IndexInputStats, type IndexedCSFFile, type IndexedStory, type Indexer, type IndexerOptions, type LoadOptions, type LoadedPreset, type Middleware, MockUniversalStore, type ModuleExport, type ModuleExports, type ModuleImportFn, type NamedOrDefaultProjectAnnotations, type NormalizedComponentAnnotations, type NormalizedProjectAnnotations, type NormalizedStoriesSpecifier, type NormalizedStoryAnnotations, type Options, type PackageJson, type PartialArgsStoryFn, type Path, type PreparedMeta, type PreparedStory, type Preset, type PresetConfig, type PresetProperty, type PresetPropertyFn, type PresetValue, type Presets, type PreviewAnnotation, type ProjectAnnotations, type Ref, type RenderContext, type RenderContextCallbacks, type RenderToCanvas, type RendererName, type ResolvedModuleExport, type ResolvedModuleExportFromType, type ResolvedModuleExportType, type ServerApp, type SetGlobalsPayload, type SetStoriesPayload, type SetStoriesStory, type SetStoriesStoryData, type Stats, type Status, type StatusByTypeId, type StatusStore, type StatusStoreByTypeId, type StatusTypeId, type StatusValue, type StatusesByStoryIdAndTypeId, type StoreOptions, type Store_CSFExports, type StoriesEntry, type StoriesSpecifier, type StoriesWithPartialProps, type StoryIndex, type StoryIndexEntry, type StoryIndexInput, type StoryIndexV2, type StoryIndexV3, type StoryPreparedPayload, type StoryRenderOptions, type StorybookConfig, type StorybookConfigOptions, type StorybookConfigRaw, type StorybookInternalParameters, type StorybookParameters, type StorybookTypes, type SupportedFrameworks, type SupportedRenderers, type TagOptions, type TagsOptions, type TeardownRenderToCanvas, type TestBuildConfig, type TestBuildFlags, type TestProviderId, type TestProviderState, type TestProviderStateByProviderId, type TestProviderStoreById, type TypescriptOptions, UniversalStore, type UseStatusStore, type UseTestProviderStore, type V3CompatIndexEntry, type VersionCheck, type ViewMode, type WebRenderer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook",
3
- "version": "9.1.14",
3
+ "version": "9.1.16",
4
4
  "description": "Storybook: Develop, document, and test UI components in isolation",
5
5
  "keywords": [
6
6
  "storybook",