@storybook/builder-webpack5 6.5.0-alpha.27 → 6.5.0-alpha.28

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.
@@ -0,0 +1,45 @@
1
+ import fetch from 'unfetch';
2
+ import global from 'global';
3
+
4
+ import { composeConfigs, PreviewWeb } from '@storybook/preview-web';
5
+ import { ClientApi } from '@storybook/client-api';
6
+ import { addons } from '@storybook/addons';
7
+ import createPostMessageChannel from '@storybook/channel-postmessage';
8
+ import createWebSocketChannel from '@storybook/channel-websocket';
9
+
10
+ import { importFn } from './{{storiesFilename}}';
11
+
12
+ const { SERVER_CHANNEL_URL } = global;
13
+
14
+ const getProjectAnnotations = () =>
15
+ composeConfigs([{{#each configs}}require('{{this}}'),{{/each}}]);
16
+
17
+ const channel = createPostMessageChannel({ page: 'preview' });
18
+ addons.setChannel(channel);
19
+
20
+ if (SERVER_CHANNEL_URL) {
21
+ const serverChannel = createWebSocketChannel({ url: SERVER_CHANNEL_URL, });
22
+ addons.setServerChannel(serverChannel);
23
+ window.__STORYBOOK_SERVER_CHANNEL__ = serverChannel;
24
+ }
25
+
26
+ const preview = new PreviewWeb();
27
+
28
+ window.__STORYBOOK_PREVIEW__ = preview;
29
+ window.__STORYBOOK_STORY_STORE__ = preview.storyStore;
30
+ window.__STORYBOOK_ADDONS_CHANNEL__ = channel;
31
+ window.__STORYBOOK_CLIENT_API__ = new ClientApi({ storyStore: preview.storyStore });
32
+
33
+ preview.initialize({ importFn, getProjectAnnotations });
34
+
35
+ if (module.hot) {
36
+ module.hot.accept('./{{storiesFilename}}', () => {
37
+ // importFn has changed so we need to patch the new one in
38
+ preview.onStoriesChanged({ importFn });
39
+ });
40
+
41
+ module.hot.accept([{{#each configs}}'{{this}}',{{/each}}], () => {
42
+ // getProjectAnnotations has changed so we need to patch the new one in
43
+ preview.onGetProjectAnnotationsChanged({ getProjectAnnotations });
44
+ });
45
+ }
@@ -0,0 +1,45 @@
1
+ import fetch from 'unfetch';
2
+ import global from 'global';
3
+
4
+ import { composeConfigs, PreviewWeb } from '@storybook/preview-web';
5
+ import { ClientApi } from '@storybook/client-api';
6
+ import { addons } from '@storybook/addons';
7
+ import createPostMessageChannel from '@storybook/channel-postmessage';
8
+ import createWebSocketChannel from '@storybook/channel-websocket';
9
+
10
+ import { importFn } from './{{storiesFilename}}';
11
+
12
+ const { SERVER_CHANNEL_URL } = global;
13
+
14
+ const getProjectAnnotations = () =>
15
+ composeConfigs([{{#each configs}}require('{{this}}'),{{/each}}]);
16
+
17
+ const channel = createPostMessageChannel({ page: 'preview' });
18
+ addons.setChannel(channel);
19
+
20
+ if (SERVER_CHANNEL_URL) {
21
+ const serverChannel = createWebSocketChannel({ url: SERVER_CHANNEL_URL, });
22
+ addons.setServerChannel(serverChannel);
23
+ window.__STORYBOOK_SERVER_CHANNEL__ = serverChannel;
24
+ }
25
+
26
+ const preview = new PreviewWeb();
27
+
28
+ window.__STORYBOOK_PREVIEW__ = preview;
29
+ window.__STORYBOOK_STORY_STORE__ = preview.storyStore;
30
+ window.__STORYBOOK_ADDONS_CHANNEL__ = channel;
31
+ window.__STORYBOOK_CLIENT_API__ = new ClientApi({ storyStore: preview.storyStore });
32
+
33
+ preview.initialize({ importFn, getProjectAnnotations });
34
+
35
+ if (module.hot) {
36
+ module.hot.accept('./{{storiesFilename}}', () => {
37
+ // importFn has changed so we need to patch the new one in
38
+ preview.onStoriesChanged({ importFn });
39
+ });
40
+
41
+ module.hot.accept([{{#each configs}}'{{this}}',{{/each}}], () => {
42
+ // getProjectAnnotations has changed so we need to patch the new one in
43
+ preview.onGetProjectAnnotationsChanged({ getProjectAnnotations });
44
+ });
45
+ }
@@ -0,0 +1,45 @@
1
+ import fetch from 'unfetch';
2
+ import global from 'global';
3
+
4
+ import { composeConfigs, PreviewWeb } from '@storybook/preview-web';
5
+ import { ClientApi } from '@storybook/client-api';
6
+ import { addons } from '@storybook/addons';
7
+ import createPostMessageChannel from '@storybook/channel-postmessage';
8
+ import createWebSocketChannel from '@storybook/channel-websocket';
9
+
10
+ import { importFn } from './{{storiesFilename}}';
11
+
12
+ const { SERVER_CHANNEL_URL } = global;
13
+
14
+ const getProjectAnnotations = () =>
15
+ composeConfigs([{{#each configs}}require('{{this}}'),{{/each}}]);
16
+
17
+ const channel = createPostMessageChannel({ page: 'preview' });
18
+ addons.setChannel(channel);
19
+
20
+ if (SERVER_CHANNEL_URL) {
21
+ const serverChannel = createWebSocketChannel({ url: SERVER_CHANNEL_URL, });
22
+ addons.setServerChannel(serverChannel);
23
+ window.__STORYBOOK_SERVER_CHANNEL__ = serverChannel;
24
+ }
25
+
26
+ const preview = new PreviewWeb();
27
+
28
+ window.__STORYBOOK_PREVIEW__ = preview;
29
+ window.__STORYBOOK_STORY_STORE__ = preview.storyStore;
30
+ window.__STORYBOOK_ADDONS_CHANNEL__ = channel;
31
+ window.__STORYBOOK_CLIENT_API__ = new ClientApi({ storyStore: preview.storyStore });
32
+
33
+ preview.initialize({ importFn, getProjectAnnotations });
34
+
35
+ if (module.hot) {
36
+ module.hot.accept('./{{storiesFilename}}', () => {
37
+ // importFn has changed so we need to patch the new one in
38
+ preview.onStoriesChanged({ importFn });
39
+ });
40
+
41
+ module.hot.accept([{{#each configs}}'{{this}}',{{/each}}], () => {
42
+ // getProjectAnnotations has changed so we need to patch the new one in
43
+ preview.onGetProjectAnnotationsChanged({ getProjectAnnotations });
44
+ });
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/builder-webpack5",
3
- "version": "6.5.0-alpha.27",
3
+ "version": "6.5.0-alpha.28",
4
4
  "description": "Storybook framework-agnostic API",
5
5
  "keywords": [
6
6
  "storybook"
@@ -59,21 +59,21 @@
59
59
  "@babel/preset-env": "^7.12.11",
60
60
  "@babel/preset-react": "^7.12.10",
61
61
  "@babel/preset-typescript": "^7.12.7",
62
- "@storybook/addons": "6.5.0-alpha.27",
63
- "@storybook/api": "6.5.0-alpha.27",
64
- "@storybook/channel-postmessage": "6.5.0-alpha.27",
65
- "@storybook/channels": "6.5.0-alpha.27",
66
- "@storybook/client-api": "6.5.0-alpha.27",
67
- "@storybook/client-logger": "6.5.0-alpha.27",
68
- "@storybook/components": "6.5.0-alpha.27",
69
- "@storybook/core-common": "6.5.0-alpha.27",
70
- "@storybook/core-events": "6.5.0-alpha.27",
71
- "@storybook/node-logger": "6.5.0-alpha.27",
72
- "@storybook/preview-web": "6.5.0-alpha.27",
73
- "@storybook/router": "6.5.0-alpha.27",
62
+ "@storybook/addons": "6.5.0-alpha.28",
63
+ "@storybook/api": "6.5.0-alpha.28",
64
+ "@storybook/channel-postmessage": "6.5.0-alpha.28",
65
+ "@storybook/channels": "6.5.0-alpha.28",
66
+ "@storybook/client-api": "6.5.0-alpha.28",
67
+ "@storybook/client-logger": "6.5.0-alpha.28",
68
+ "@storybook/components": "6.5.0-alpha.28",
69
+ "@storybook/core-common": "6.5.0-alpha.28",
70
+ "@storybook/core-events": "6.5.0-alpha.28",
71
+ "@storybook/node-logger": "6.5.0-alpha.28",
72
+ "@storybook/preview-web": "6.5.0-alpha.28",
73
+ "@storybook/router": "6.5.0-alpha.28",
74
74
  "@storybook/semver": "^7.3.2",
75
- "@storybook/store": "6.5.0-alpha.27",
76
- "@storybook/theming": "6.5.0-alpha.27",
75
+ "@storybook/store": "6.5.0-alpha.28",
76
+ "@storybook/theming": "6.5.0-alpha.28",
77
77
  "@types/node": "^14.0.10 || ^16.0.0",
78
78
  "babel-loader": "^8.0.0",
79
79
  "babel-plugin-named-exports-order": "^0.0.2",
@@ -115,6 +115,6 @@
115
115
  "publishConfig": {
116
116
  "access": "public"
117
117
  },
118
- "gitHead": "2532ee915bc340aa4e1ca0f13afe5bc190f9903e",
118
+ "gitHead": "a95a47b6cb372d38518aa220129169d889b23d64",
119
119
  "sbmodern": "dist/modern/index.js"
120
120
  }