@storybook/core-webpack 7.0.0-alpha.0 → 7.0.0-alpha.3
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.
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.array.slice.js");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.object.freeze.js");
|
|
6
|
-
|
|
7
3
|
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
@@ -13,13 +9,9 @@ var _nodeLogger = require("@storybook/node-logger");
|
|
|
13
9
|
|
|
14
10
|
var _tsDedent = _interopRequireDefault(require("ts-dedent"));
|
|
15
11
|
|
|
16
|
-
var _templateObject;
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var checkWebpackVersion = function checkWebpackVersion(webpack, specifier, caption) {
|
|
14
|
+
const checkWebpackVersion = (webpack, specifier, caption) => {
|
|
23
15
|
if (!webpack.version) {
|
|
24
16
|
_nodeLogger.logger.info('Skipping webpack version check, no version available');
|
|
25
17
|
|
|
@@ -27,7 +19,15 @@ var checkWebpackVersion = function checkWebpackVersion(webpack, specifier, capti
|
|
|
27
19
|
}
|
|
28
20
|
|
|
29
21
|
if (webpack.version !== specifier) {
|
|
30
|
-
_nodeLogger.logger.warn((0, _tsDedent.default)
|
|
22
|
+
_nodeLogger.logger.warn((0, _tsDedent.default)`
|
|
23
|
+
Unexpected webpack version in ${caption}:
|
|
24
|
+
- Received '${webpack.version}'
|
|
25
|
+
- Expected '${specifier}'
|
|
26
|
+
|
|
27
|
+
If you're using Webpack 5 in SB6.2 and upgrading, consider: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#webpack-5-manager-build
|
|
28
|
+
|
|
29
|
+
For more info about Webpack 5 support: https://gist.github.com/shilman/8856ea1786dcd247139b47b270912324#troubleshooting
|
|
30
|
+
`);
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.to-string.js");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.object.keys.js");
|
|
8
|
-
|
|
9
3
|
Object.defineProperty(exports, "__esModule", {
|
|
10
4
|
value: true
|
|
11
5
|
});
|
|
@@ -17,7 +11,7 @@ Object.keys(_types).forEach(function (key) {
|
|
|
17
11
|
if (key in exports && exports[key] === _types[key]) return;
|
|
18
12
|
Object.defineProperty(exports, key, {
|
|
19
13
|
enumerable: true,
|
|
20
|
-
get: function
|
|
14
|
+
get: function () {
|
|
21
15
|
return _types[key];
|
|
22
16
|
}
|
|
23
17
|
});
|
|
@@ -30,7 +24,7 @@ Object.keys(_loadCustomWebpackConfig).forEach(function (key) {
|
|
|
30
24
|
if (key in exports && exports[key] === _loadCustomWebpackConfig[key]) return;
|
|
31
25
|
Object.defineProperty(exports, key, {
|
|
32
26
|
enumerable: true,
|
|
33
|
-
get: function
|
|
27
|
+
get: function () {
|
|
34
28
|
return _loadCustomWebpackConfig[key];
|
|
35
29
|
}
|
|
36
30
|
});
|
|
@@ -43,7 +37,7 @@ Object.keys(_checkWebpackVersion).forEach(function (key) {
|
|
|
43
37
|
if (key in exports && exports[key] === _checkWebpackVersion[key]) return;
|
|
44
38
|
Object.defineProperty(exports, key, {
|
|
45
39
|
enumerable: true,
|
|
46
|
-
get: function
|
|
40
|
+
get: function () {
|
|
47
41
|
return _checkWebpackVersion[key];
|
|
48
42
|
}
|
|
49
43
|
});
|
|
@@ -56,7 +50,7 @@ Object.keys(_mergeWebpackConfig).forEach(function (key) {
|
|
|
56
50
|
if (key in exports && exports[key] === _mergeWebpackConfig[key]) return;
|
|
57
51
|
Object.defineProperty(exports, key, {
|
|
58
52
|
enumerable: true,
|
|
59
|
-
get: function
|
|
53
|
+
get: function () {
|
|
60
54
|
return _mergeWebpackConfig[key];
|
|
61
55
|
}
|
|
62
56
|
});
|
|
@@ -5,20 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.loadCustomWebpackConfig = void 0;
|
|
7
7
|
|
|
8
|
-
require("core-js/modules/es.array.map.js");
|
|
9
|
-
|
|
10
8
|
var _path = _interopRequireDefault(require("path"));
|
|
11
9
|
|
|
12
10
|
var _coreCommon = require("@storybook/core-common");
|
|
13
11
|
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
const webpackConfigs = ['webpack.config', 'webpackfile'];
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
return (0, _coreCommon.serverRequire)(webpackConfigs.map(function (configName) {
|
|
20
|
-
return _path.default.resolve(configDir, configName);
|
|
21
|
-
}));
|
|
22
|
-
};
|
|
16
|
+
const loadCustomWebpackConfig = configDir => (0, _coreCommon.serverRequire)(webpackConfigs.map(configName => _path.default.resolve(configDir, configName)));
|
|
23
17
|
|
|
24
18
|
exports.loadCustomWebpackConfig = loadCustomWebpackConfig;
|
|
@@ -1,110 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.js");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.symbol.description.js");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.object.to-string.js");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.symbol.iterator.js");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.iterator.js");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.string.iterator.js");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.array.from.js");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.array.slice.js");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.function.name.js");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
24
|
-
|
|
25
3
|
Object.defineProperty(exports, "__esModule", {
|
|
26
4
|
value: true
|
|
27
5
|
});
|
|
28
6
|
exports.mergeConfigs = mergeConfigs;
|
|
29
7
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
37
|
-
|
|
38
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
39
|
-
|
|
40
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
41
|
-
|
|
42
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
43
|
-
|
|
44
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
45
|
-
|
|
46
|
-
function plugins(_ref, _ref2) {
|
|
47
|
-
var _ref$plugins = _ref.plugins,
|
|
48
|
-
defaultPlugins = _ref$plugins === void 0 ? [] : _ref$plugins;
|
|
49
|
-
var _ref2$plugins = _ref2.plugins,
|
|
50
|
-
customPlugins = _ref2$plugins === void 0 ? [] : _ref2$plugins;
|
|
51
|
-
return [].concat(_toConsumableArray(defaultPlugins), _toConsumableArray(customPlugins));
|
|
8
|
+
function plugins({
|
|
9
|
+
plugins: defaultPlugins = []
|
|
10
|
+
}, {
|
|
11
|
+
plugins: customPlugins = []
|
|
12
|
+
}) {
|
|
13
|
+
return [...defaultPlugins, ...customPlugins];
|
|
52
14
|
}
|
|
53
15
|
|
|
54
|
-
function rules(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return [
|
|
16
|
+
function rules({
|
|
17
|
+
rules: defaultRules = []
|
|
18
|
+
}, {
|
|
19
|
+
rules: customRules = []
|
|
20
|
+
}) {
|
|
21
|
+
return [...defaultRules, ...customRules];
|
|
60
22
|
}
|
|
61
23
|
|
|
62
|
-
function extensions(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return [
|
|
24
|
+
function extensions({
|
|
25
|
+
extensions: defaultExtensions = []
|
|
26
|
+
}, {
|
|
27
|
+
extensions: customExtensions = []
|
|
28
|
+
}) {
|
|
29
|
+
return [...defaultExtensions, ...customExtensions];
|
|
68
30
|
}
|
|
69
31
|
|
|
70
|
-
function alias(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
32
|
+
function alias({
|
|
33
|
+
alias: defaultAlias = {}
|
|
34
|
+
}, {
|
|
35
|
+
alias: customAlias = {}
|
|
36
|
+
}) {
|
|
75
37
|
return Object.assign({}, defaultAlias, customAlias);
|
|
76
38
|
}
|
|
77
39
|
|
|
78
|
-
function _module(
|
|
79
|
-
|
|
80
|
-
defaultModule = _ref9$module === void 0 ? {
|
|
40
|
+
function _module({
|
|
41
|
+
module: defaultModule = {
|
|
81
42
|
rules: []
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
module: customModule = {
|
|
85
46
|
rules: []
|
|
86
|
-
}
|
|
47
|
+
}
|
|
48
|
+
}) {
|
|
87
49
|
return Object.assign({}, defaultModule, customModule, {
|
|
88
50
|
rules: rules(defaultModule, customModule)
|
|
89
51
|
});
|
|
90
52
|
}
|
|
91
53
|
|
|
92
|
-
function resolve(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
54
|
+
function resolve({
|
|
55
|
+
resolve: defaultResolve = {}
|
|
56
|
+
}, {
|
|
57
|
+
resolve: customResolve = {}
|
|
58
|
+
}) {
|
|
97
59
|
return Object.assign({}, defaultResolve, customResolve, {
|
|
98
60
|
alias: alias(defaultResolve, customResolve),
|
|
99
61
|
extensions: extensions(defaultResolve, customResolve)
|
|
100
62
|
});
|
|
101
63
|
}
|
|
102
64
|
|
|
103
|
-
function optimization(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
65
|
+
function optimization({
|
|
66
|
+
optimization: defaultOptimization = {}
|
|
67
|
+
}, {
|
|
68
|
+
optimization: customOptimization = {}
|
|
69
|
+
}) {
|
|
108
70
|
return Object.assign({}, defaultOptimization, customOptimization);
|
|
109
71
|
}
|
|
110
72
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/core-webpack",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.3",
|
|
4
4
|
"description": "Storybook framework-agnostic API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"prepare": "node ../../scripts/prepare.js"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@storybook/core-common": "7.0.0-alpha.
|
|
37
|
-
"@storybook/node-logger": "7.0.0-alpha.
|
|
36
|
+
"@storybook/core-common": "7.0.0-alpha.3",
|
|
37
|
+
"@storybook/node-logger": "7.0.0-alpha.3",
|
|
38
38
|
"@types/node": "^14.0.10 || ^16.0.0",
|
|
39
39
|
"core-js": "^3.8.2",
|
|
40
40
|
"ts-dedent": "^2.0.0"
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "629b056190993bcee6445471b8cb27208eb401a9"
|
|
46
46
|
}
|