Skip to content

Commit

Permalink
Merge pull request #24976 from storybookjs/norbert/fix-globalization-…
Browse files Browse the repository at this point in the history
…core-events-errors

Core: Prebundling globalize the core-event sub paths
  • Loading branch information
ndelangen authored Nov 24, 2023
2 parents f8a2b33 + 89daec6 commit 8e97d70
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/lib/preview/src/globals/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const globalsNameReferenceMap = {
'@storybook/channels': '__STORYBOOK_MODULE_CHANNELS__',
'@storybook/client-logger': '__STORYBOOK_MODULE_CLIENT_LOGGER__',
'@storybook/core-events': '__STORYBOOK_MODULE_CORE_EVENTS__',
'@storybook/core-events/preview-errors': '__STORYBOOK_MODULE_CORE_EVENTS_PREVIEW_ERRORS__',
'@storybook/preview-api': '__STORYBOOK_MODULE_PREVIEW_API__',
'@storybook/types': '__STORYBOOK_MODULE_TYPES__',
} as const;
Expand Down
2 changes: 2 additions & 0 deletions code/lib/preview/src/globals/runtime.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as CHANNELS from '@storybook/channels';
import * as CLIENT_LOGGER from '@storybook/client-logger';
import * as CORE_EVENTS from '@storybook/core-events';
import * as CORE_EVENTS_PREVIEW_ERRORS from '@storybook/core-events/preview-errors';
import * as PREVIEW_API from '@storybook/preview-api';
import * as TYPES from '@storybook/types';
import * as GLOBAL from '@storybook/global';
Expand All @@ -12,6 +13,7 @@ export const globalsNameValueMap: Required<Record<keyof typeof globalsNameRefere
'@storybook/channels': CHANNELS,
'@storybook/client-logger': CLIENT_LOGGER,
'@storybook/core-events': CORE_EVENTS,
'@storybook/core-events/preview-errors': CORE_EVENTS_PREVIEW_ERRORS,
'@storybook/preview-api': PREVIEW_API,
'@storybook/global': GLOBAL,
'@storybook/types': TYPES,
Expand Down
3 changes: 2 additions & 1 deletion code/lib/preview/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable no-underscore-dangle, @typescript-eslint/naming-convention */
declare var LOGLEVEL: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent' | undefined;

declare var __STORYBOOK_ADDONS_CHANNEL__: any;
declare var __STORYBOOK_MODULE_CORE_EVENTS_PREVIEW_ERRORS__: any;
declare var sendTelemetryError: (error: any) => void;
5 changes: 5 additions & 0 deletions code/ui/manager/src/globals/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ export default {
'UPDATE_QUERY_PARAMS',
'UPDATE_STORY_ARGS',
],
'@storybook/core-events/manager-errors': [
'Category',
'ProviderDoesNotExtendBaseProviderError',
'UncaughtManagerError',
],
'@storybook/router': [
'BaseLocationProvider',
'DEEPLY_EQUAL',
Expand Down
1 change: 1 addition & 0 deletions code/ui/manager/src/globals/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const globalsNameReferenceMap = {
'@storybook/components': '__STORYBOOK_COMPONENTS__',
'@storybook/channels': '__STORYBOOK_CHANNELS__',
'@storybook/core-events': '__STORYBOOK_CORE_EVENTS__',
'@storybook/core-events/manager-errors': '__STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__',
'@storybook/router': '__STORYBOOK_ROUTER__',
'@storybook/theming': '__STORYBOOK_THEMING__',
'@storybook/icons': '__STORYBOOK_ICONS__',
Expand Down
2 changes: 2 additions & 0 deletions code/ui/manager/src/globals/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as REACT_DOM from 'react-dom';
import * as COMPONENTS from '@storybook/components';
import * as CHANNELS from '@storybook/channels';
import * as EVENTS from '@storybook/core-events';
import * as EVENTS_MANAGER_ERRORS from '@storybook/core-events/manager-errors';
import * as ROUTER from '@storybook/router';
import * as ICONS from '@storybook/icons';
import * as THEMING from '@storybook/theming';
Expand All @@ -20,6 +21,7 @@ export const globalsNameValueMap: Required<Record<keyof typeof globalsNameRefere
'@storybook/components': COMPONENTS,
'@storybook/channels': CHANNELS,
'@storybook/core-events': EVENTS,
'@storybook/core-events/manager-errors': EVENTS_MANAGER_ERRORS,
'@storybook/router': ROUTER,
'@storybook/theming': THEMING,
'@storybook/icons': ICONS,
Expand Down
1 change: 1 addition & 0 deletions code/ui/manager/src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ declare var __REACT_DOM__: any;
declare var __STORYBOOK_COMPONENTS__: any;
declare var __STORYBOOK_CHANNELS__: any;
declare var __STORYBOOK_CORE_EVENTS__: any;
declare var __STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__: any;
declare var __STORYBOOK_ROUTER__: any;
declare var __STORYBOOK_THEMING__: any;
declare var __STORYBOOK_API__: any;
Expand Down

0 comments on commit 8e97d70

Please sign in to comment.