Skip to content

Commit

Permalink
Fix loading of experimental channel for essential addons
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Apr 9, 2024
1 parent e36a1c0 commit 9264728
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/addons/controls/src/preset.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type { Options } from '@storybook/types';
import type { Channel } from '@storybook/channels';
import { initFileSearchChannel } from './server-channel/file-search-channel';
import { initCreateNewStoryChannel } from './server-channel/create-new-story-channel';

// eslint-disable-next-line @typescript-eslint/naming-convention
export const experimental_serverChannel = async (channel: Channel, options: Options) => {
initCreateNewStoryChannel(channel, options);
initFileSearchChannel(channel, options);
};
3 changes: 3 additions & 0 deletions code/addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@
"@storybook/addon-outline": "workspace:*",
"@storybook/addon-toolbars": "workspace:*",
"@storybook/addon-viewport": "workspace:*",
"@storybook/channels": "workspace:*",
"@storybook/core-common": "workspace:*",
"@storybook/manager-api": "workspace:*",
"@storybook/node-logger": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/types": "workspace:*",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
Expand All @@ -113,6 +115,7 @@
"bundler": {
"nodeEntries": [
"./src/index.ts",
"./src/preset.ts",
"./src/docs/preset.ts",
"./src/docs/mdx-react-shim.ts"
],
Expand Down
1 change: 1 addition & 0 deletions code/addons/essentials/preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./dist/preset');
10 changes: 10 additions & 0 deletions code/addons/essentials/src/preset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @ts-expect-error no types
import { experimental_serverChannel as experimentalServerChannelControls } from '@storybook/addon-controls/dist/preset';

import type { Channel } from '@storybook/channels';
import type { Options } from '@storybook/types';

// eslint-disable-next-line @typescript-eslint/naming-convention
export const experimental_serverChannel = async (channel: Channel, options: Options) => {
experimentalServerChannelControls(channel, options);
};
2 changes: 2 additions & 0 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4874,10 +4874,12 @@ __metadata:
"@storybook/addon-outline": "workspace:*"
"@storybook/addon-toolbars": "workspace:*"
"@storybook/addon-viewport": "workspace:*"
"@storybook/channels": "workspace:*"
"@storybook/core-common": "workspace:*"
"@storybook/manager-api": "workspace:*"
"@storybook/node-logger": "workspace:*"
"@storybook/preview-api": "workspace:*"
"@storybook/types": "workspace:*"
ts-dedent: "npm:^2.0.0"
typescript: "npm:^5.3.2"
languageName: unknown
Expand Down

0 comments on commit 9264728

Please sign in to comment.