@storybook/builder-webpack5 6.5.0-alpha.24 → 6.5.0-alpha.25
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.
- package/dist/cjs/preview/iframe-webpack.config.js +1 -1
- package/dist/esm/preview/iframe-webpack.config.js +1 -1
- package/dist/modern/preview/iframe-webpack.config.js +1 -1
- package/package.json +17 -18
- package/{dist/cjs/preview → templates}/virtualModuleModernEntry.js.handlebars +0 -0
- package/dist/esm/preview/virtualModuleModernEntry.js.handlebars +0 -44
- package/dist/modern/preview/virtualModuleModernEntry.js.handlebars +0 -44
|
@@ -85,7 +85,7 @@ var _default = async function _default(options) {
|
|
|
85
85
|
|
|
86
86
|
var configEntryPath = _path.default.resolve(_path.default.join(workingDir, 'storybook-config-entry.js'));
|
|
87
87
|
|
|
88
|
-
virtualModuleMapping[configEntryPath] = (0, _coreCommon.handlebars)(await (0, _coreCommon.readTemplate)(
|
|
88
|
+
virtualModuleMapping[configEntryPath] = (0, _coreCommon.handlebars)(await (0, _coreCommon.readTemplate)(require.resolve('@storybook/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars')), {
|
|
89
89
|
storiesFilename: storiesFilename,
|
|
90
90
|
configs: configs
|
|
91
91
|
} // We need to double escape `\` for webpack. We may have some in windows paths
|
|
@@ -60,7 +60,7 @@ export default (async function (options) {
|
|
|
60
60
|
var storiesPath = path.resolve(path.join(workingDir, storiesFilename));
|
|
61
61
|
virtualModuleMapping[storiesPath] = toImportFn(stories);
|
|
62
62
|
var configEntryPath = path.resolve(path.join(workingDir, 'storybook-config-entry.js'));
|
|
63
|
-
virtualModuleMapping[configEntryPath] = handlebars(await readTemplate(
|
|
63
|
+
virtualModuleMapping[configEntryPath] = handlebars(await readTemplate(require.resolve('@storybook/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars')), {
|
|
64
64
|
storiesFilename: storiesFilename,
|
|
65
65
|
configs: configs
|
|
66
66
|
} // We need to double escape `\` for webpack. We may have some in windows paths
|
|
@@ -60,7 +60,7 @@ export default (async function (options) {
|
|
|
60
60
|
var storiesPath = path.resolve(path.join(workingDir, storiesFilename));
|
|
61
61
|
virtualModuleMapping[storiesPath] = toImportFn(stories);
|
|
62
62
|
var configEntryPath = path.resolve(path.join(workingDir, 'storybook-config-entry.js'));
|
|
63
|
-
virtualModuleMapping[configEntryPath] = handlebars(await readTemplate(
|
|
63
|
+
virtualModuleMapping[configEntryPath] = handlebars(await readTemplate(require.resolve('@storybook/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars')), {
|
|
64
64
|
storiesFilename: storiesFilename,
|
|
65
65
|
configs: configs
|
|
66
66
|
} // We need to double escape `\` for webpack. We may have some in windows paths
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/builder-webpack5",
|
|
3
|
-
"version": "6.5.0-alpha.
|
|
3
|
+
"version": "6.5.0-alpha.25",
|
|
4
4
|
"description": "Storybook framework-agnostic API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist/**/*",
|
|
34
|
-
"
|
|
35
|
-
"types/**/*",
|
|
34
|
+
"templates/**/*",
|
|
36
35
|
"*.js",
|
|
37
36
|
"*.d.ts"
|
|
38
37
|
],
|
|
@@ -60,21 +59,21 @@
|
|
|
60
59
|
"@babel/preset-env": "^7.12.11",
|
|
61
60
|
"@babel/preset-react": "^7.12.10",
|
|
62
61
|
"@babel/preset-typescript": "^7.12.7",
|
|
63
|
-
"@storybook/addons": "6.5.0-alpha.
|
|
64
|
-
"@storybook/api": "6.5.0-alpha.
|
|
65
|
-
"@storybook/channel-postmessage": "6.5.0-alpha.
|
|
66
|
-
"@storybook/channels": "6.5.0-alpha.
|
|
67
|
-
"@storybook/client-api": "6.5.0-alpha.
|
|
68
|
-
"@storybook/client-logger": "6.5.0-alpha.
|
|
69
|
-
"@storybook/components": "6.5.0-alpha.
|
|
70
|
-
"@storybook/core-common": "6.5.0-alpha.
|
|
71
|
-
"@storybook/core-events": "6.5.0-alpha.
|
|
72
|
-
"@storybook/node-logger": "6.5.0-alpha.
|
|
73
|
-
"@storybook/preview-web": "6.5.0-alpha.
|
|
74
|
-
"@storybook/router": "6.5.0-alpha.
|
|
62
|
+
"@storybook/addons": "6.5.0-alpha.25",
|
|
63
|
+
"@storybook/api": "6.5.0-alpha.25",
|
|
64
|
+
"@storybook/channel-postmessage": "6.5.0-alpha.25",
|
|
65
|
+
"@storybook/channels": "6.5.0-alpha.25",
|
|
66
|
+
"@storybook/client-api": "6.5.0-alpha.25",
|
|
67
|
+
"@storybook/client-logger": "6.5.0-alpha.25",
|
|
68
|
+
"@storybook/components": "6.5.0-alpha.25",
|
|
69
|
+
"@storybook/core-common": "6.5.0-alpha.25",
|
|
70
|
+
"@storybook/core-events": "6.5.0-alpha.25",
|
|
71
|
+
"@storybook/node-logger": "6.5.0-alpha.25",
|
|
72
|
+
"@storybook/preview-web": "6.5.0-alpha.25",
|
|
73
|
+
"@storybook/router": "6.5.0-alpha.25",
|
|
75
74
|
"@storybook/semver": "^7.3.2",
|
|
76
|
-
"@storybook/store": "6.5.0-alpha.
|
|
77
|
-
"@storybook/theming": "6.5.0-alpha.
|
|
75
|
+
"@storybook/store": "6.5.0-alpha.25",
|
|
76
|
+
"@storybook/theming": "6.5.0-alpha.25",
|
|
78
77
|
"@types/node": "^14.0.10 || ^16.0.0",
|
|
79
78
|
"babel-loader": "^8.0.0",
|
|
80
79
|
"babel-plugin-named-exports-order": "^0.0.2",
|
|
@@ -116,6 +115,6 @@
|
|
|
116
115
|
"publishConfig": {
|
|
117
116
|
"access": "public"
|
|
118
117
|
},
|
|
119
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "25ed23c17e07452af0dbd34665eb9a6dfdac526c",
|
|
120
119
|
"sbmodern": "dist/modern/index.js"
|
|
121
120
|
}
|
|
File without changes
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import global from 'global';
|
|
2
|
-
|
|
3
|
-
import { composeConfigs, PreviewWeb } from '@storybook/preview-web';
|
|
4
|
-
import { ClientApi } from '@storybook/client-api';
|
|
5
|
-
import { addons } from '@storybook/addons';
|
|
6
|
-
import createPostMessageChannel from '@storybook/channel-postmessage';
|
|
7
|
-
import createWebSocketChannel from '@storybook/channel-websocket';
|
|
8
|
-
|
|
9
|
-
import { importFn } from './{{storiesFilename}}';
|
|
10
|
-
|
|
11
|
-
const { SERVER_CHANNEL_URL } = global;
|
|
12
|
-
|
|
13
|
-
const getProjectAnnotations = () =>
|
|
14
|
-
composeConfigs([{{#each configs}}require('{{this}}'),{{/each}}]);
|
|
15
|
-
|
|
16
|
-
const channel = createPostMessageChannel({ page: 'preview' });
|
|
17
|
-
addons.setChannel(channel);
|
|
18
|
-
|
|
19
|
-
if (SERVER_CHANNEL_URL) {
|
|
20
|
-
const serverChannel = createWebSocketChannel({ url: SERVER_CHANNEL_URL, });
|
|
21
|
-
addons.setServerChannel(serverChannel);
|
|
22
|
-
window.__STORYBOOK_SERVER_CHANNEL__ = serverChannel;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const preview = new PreviewWeb();
|
|
26
|
-
|
|
27
|
-
window.__STORYBOOK_PREVIEW__ = preview;
|
|
28
|
-
window.__STORYBOOK_STORY_STORE__ = preview.storyStore;
|
|
29
|
-
window.__STORYBOOK_ADDONS_CHANNEL__ = channel;
|
|
30
|
-
window.__STORYBOOK_CLIENT_API__ = new ClientApi({ storyStore: preview.storyStore });
|
|
31
|
-
|
|
32
|
-
preview.initialize({ importFn, getProjectAnnotations });
|
|
33
|
-
|
|
34
|
-
if (module.hot) {
|
|
35
|
-
import.meta.webpackHot.accept('./{{storiesFilename}}', () => {
|
|
36
|
-
// importFn has changed so we need to patch the new one in
|
|
37
|
-
preview.onStoriesChanged({ importFn });
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
import.meta.webpackHot.accept([{{#each configs}}'{{this}}',{{/each}}], () => {
|
|
41
|
-
// getProjectAnnotations has changed so we need to patch the new one in
|
|
42
|
-
preview.onGetProjectAnnotationsChanged({ getProjectAnnotations });
|
|
43
|
-
});
|
|
44
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import global from 'global';
|
|
2
|
-
|
|
3
|
-
import { composeConfigs, PreviewWeb } from '@storybook/preview-web';
|
|
4
|
-
import { ClientApi } from '@storybook/client-api';
|
|
5
|
-
import { addons } from '@storybook/addons';
|
|
6
|
-
import createPostMessageChannel from '@storybook/channel-postmessage';
|
|
7
|
-
import createWebSocketChannel from '@storybook/channel-websocket';
|
|
8
|
-
|
|
9
|
-
import { importFn } from './{{storiesFilename}}';
|
|
10
|
-
|
|
11
|
-
const { SERVER_CHANNEL_URL } = global;
|
|
12
|
-
|
|
13
|
-
const getProjectAnnotations = () =>
|
|
14
|
-
composeConfigs([{{#each configs}}require('{{this}}'),{{/each}}]);
|
|
15
|
-
|
|
16
|
-
const channel = createPostMessageChannel({ page: 'preview' });
|
|
17
|
-
addons.setChannel(channel);
|
|
18
|
-
|
|
19
|
-
if (SERVER_CHANNEL_URL) {
|
|
20
|
-
const serverChannel = createWebSocketChannel({ url: SERVER_CHANNEL_URL, });
|
|
21
|
-
addons.setServerChannel(serverChannel);
|
|
22
|
-
window.__STORYBOOK_SERVER_CHANNEL__ = serverChannel;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const preview = new PreviewWeb();
|
|
26
|
-
|
|
27
|
-
window.__STORYBOOK_PREVIEW__ = preview;
|
|
28
|
-
window.__STORYBOOK_STORY_STORE__ = preview.storyStore;
|
|
29
|
-
window.__STORYBOOK_ADDONS_CHANNEL__ = channel;
|
|
30
|
-
window.__STORYBOOK_CLIENT_API__ = new ClientApi({ storyStore: preview.storyStore });
|
|
31
|
-
|
|
32
|
-
preview.initialize({ importFn, getProjectAnnotations });
|
|
33
|
-
|
|
34
|
-
if (module.hot) {
|
|
35
|
-
import.meta.webpackHot.accept('./{{storiesFilename}}', () => {
|
|
36
|
-
// importFn has changed so we need to patch the new one in
|
|
37
|
-
preview.onStoriesChanged({ importFn });
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
import.meta.webpackHot.accept([{{#each configs}}'{{this}}',{{/each}}], () => {
|
|
41
|
-
// getProjectAnnotations has changed so we need to patch the new one in
|
|
42
|
-
preview.onGetProjectAnnotationsChanged({ getProjectAnnotations });
|
|
43
|
-
});
|
|
44
|
-
}
|