@storybook/core-server 6.3.4 → 6.3.8
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/build-static.js +5 -0
- package/dist/cjs/cli/utils.js +5 -1
- package/dist/cjs/utils/output-stats.js +17 -4
- package/dist/esm/build-static.js +6 -1
- package/dist/esm/cli/utils.js +5 -1
- package/dist/esm/utils/output-stats.js +16 -3
- package/dist/modern/build-static.js +6 -1
- package/dist/modern/cli/utils.js +5 -1
- package/dist/modern/utils/output-stats.js +16 -3
- package/package.json +12 -11
- package/typings.d.ts +1 -0
package/dist/cjs/build-static.js
CHANGED
|
@@ -109,6 +109,11 @@ async function buildStaticStandalone(options) {
|
|
|
109
109
|
features: features
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
+
if (options.debugWebpack) {
|
|
113
|
+
(0, _coreCommon.logConfig)('Preview webpack config', await previewBuilder.getConfig(fullOptions));
|
|
114
|
+
(0, _coreCommon.logConfig)('Manager webpack config', await managerBuilder.getConfig(fullOptions));
|
|
115
|
+
}
|
|
116
|
+
|
|
112
117
|
var core = await presets.apply('core');
|
|
113
118
|
|
|
114
119
|
var _ref = (core === null || core === void 0 ? void 0 : core.builder) === 'webpack5' ? await Promise.resolve().then(function () {
|
package/dist/cjs/cli/utils.js
CHANGED
|
@@ -14,7 +14,11 @@ var _tsDedent = _interopRequireDefault(require("ts-dedent"));
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
16
|
function parseList(str) {
|
|
17
|
-
return str.split(',')
|
|
17
|
+
return str.split(',').map(function (item) {
|
|
18
|
+
return item.trim();
|
|
19
|
+
}).filter(function (item) {
|
|
20
|
+
return item.length > 0;
|
|
21
|
+
});
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
function getEnvConfig(program, configEnv) {
|
|
@@ -8,16 +8,22 @@ exports.writeStats = void 0;
|
|
|
8
8
|
|
|
9
9
|
require("core-js/modules/es.promise.js");
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var _path = _interopRequireDefault(require("path"));
|
|
11
|
+
var _jsonExt = require("@discoveryjs/json-ext");
|
|
14
12
|
|
|
15
13
|
var _nodeLogger = require("@storybook/node-logger");
|
|
16
14
|
|
|
15
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
16
|
+
|
|
17
17
|
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
18
18
|
|
|
19
|
+
var _path = _interopRequireDefault(require("path"));
|
|
20
|
+
|
|
19
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
22
|
|
|
23
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
24
|
+
|
|
25
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
|
+
|
|
21
27
|
async function outputStats(directory, previewStats, managerStats) {
|
|
22
28
|
if (previewStats) {
|
|
23
29
|
var filePath = await writeStats(directory, 'preview', previewStats);
|
|
@@ -35,7 +41,14 @@ async function outputStats(directory, previewStats, managerStats) {
|
|
|
35
41
|
var writeStats = async function (directory, name, stats) {
|
|
36
42
|
var filePath = _path.default.join(directory, `${name}-stats.json`);
|
|
37
43
|
|
|
38
|
-
|
|
44
|
+
var _stats$toJson = stats.toJson(),
|
|
45
|
+
chunks = _stats$toJson.chunks,
|
|
46
|
+
data = _objectWithoutProperties(_stats$toJson, ["chunks"]); // omit chunks, which is about half of the total data
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
await new Promise(function (resolve, reject) {
|
|
50
|
+
(0, _jsonExt.stringifyStream)(data, null, 2).on('error', reject).pipe(_fsExtra.default.createWriteStream(filePath)).on('error', reject).on('finish', resolve);
|
|
51
|
+
});
|
|
39
52
|
return filePath;
|
|
40
53
|
};
|
|
41
54
|
|
package/dist/esm/build-static.js
CHANGED
|
@@ -27,7 +27,7 @@ import cpy from 'cpy';
|
|
|
27
27
|
import fs from 'fs-extra';
|
|
28
28
|
import path from 'path';
|
|
29
29
|
import { logger } from '@storybook/node-logger';
|
|
30
|
-
import { loadAllPresets, cache } from '@storybook/core-common';
|
|
30
|
+
import { loadAllPresets, cache, logConfig } from '@storybook/core-common';
|
|
31
31
|
import { getProdCli } from './cli';
|
|
32
32
|
import { outputStats } from './utils/output-stats';
|
|
33
33
|
import { copyAllStaticFiles } from './utils/copy-all-static-files';
|
|
@@ -81,6 +81,11 @@ export async function buildStaticStandalone(options) {
|
|
|
81
81
|
features: features
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
+
if (options.debugWebpack) {
|
|
85
|
+
logConfig('Preview webpack config', await previewBuilder.getConfig(fullOptions));
|
|
86
|
+
logConfig('Manager webpack config', await managerBuilder.getConfig(fullOptions));
|
|
87
|
+
}
|
|
88
|
+
|
|
84
89
|
var core = await presets.apply('core');
|
|
85
90
|
|
|
86
91
|
var _ref = (core === null || core === void 0 ? void 0 : core.builder) === 'webpack5' ? await import('@storybook/manager-webpack5/prebuilt-manager') : await import('@storybook/manager-webpack4/prebuilt-manager'),
|
package/dist/esm/cli/utils.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import deprecate from 'util-deprecate';
|
|
2
2
|
import dedent from 'ts-dedent';
|
|
3
3
|
export function parseList(str) {
|
|
4
|
-
return str.split(',')
|
|
4
|
+
return str.split(',').map(function (item) {
|
|
5
|
+
return item.trim();
|
|
6
|
+
}).filter(function (item) {
|
|
7
|
+
return item.length > 0;
|
|
8
|
+
});
|
|
5
9
|
}
|
|
6
10
|
export function getEnvConfig(program, configEnv) {
|
|
7
11
|
Object.keys(configEnv).forEach(function (fieldName) {
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
2
|
+
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
+
|
|
1
5
|
import "core-js/modules/es.promise.js";
|
|
2
|
-
import
|
|
3
|
-
import path from 'path';
|
|
6
|
+
import { stringifyStream } from '@discoveryjs/json-ext';
|
|
4
7
|
import { logger } from '@storybook/node-logger';
|
|
8
|
+
import chalk from 'chalk';
|
|
5
9
|
import fs from 'fs-extra';
|
|
10
|
+
import path from 'path';
|
|
6
11
|
export async function outputStats(directory, previewStats, managerStats) {
|
|
7
12
|
if (previewStats) {
|
|
8
13
|
var filePath = await writeStats(directory, 'preview', previewStats);
|
|
@@ -17,6 +22,14 @@ export async function outputStats(directory, previewStats, managerStats) {
|
|
|
17
22
|
}
|
|
18
23
|
export var writeStats = async function (directory, name, stats) {
|
|
19
24
|
var filePath = path.join(directory, `${name}-stats.json`);
|
|
20
|
-
|
|
25
|
+
|
|
26
|
+
var _stats$toJson = stats.toJson(),
|
|
27
|
+
chunks = _stats$toJson.chunks,
|
|
28
|
+
data = _objectWithoutProperties(_stats$toJson, ["chunks"]); // omit chunks, which is about half of the total data
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
await new Promise(function (resolve, reject) {
|
|
32
|
+
stringifyStream(data, null, 2).on('error', reject).pipe(fs.createWriteStream(filePath)).on('error', reject).on('finish', resolve);
|
|
33
|
+
});
|
|
21
34
|
return filePath;
|
|
22
35
|
};
|
|
@@ -27,7 +27,7 @@ import cpy from 'cpy';
|
|
|
27
27
|
import fs from 'fs-extra';
|
|
28
28
|
import path from 'path';
|
|
29
29
|
import { logger } from '@storybook/node-logger';
|
|
30
|
-
import { loadAllPresets, cache } from '@storybook/core-common';
|
|
30
|
+
import { loadAllPresets, cache, logConfig } from '@storybook/core-common';
|
|
31
31
|
import { getProdCli } from './cli';
|
|
32
32
|
import { outputStats } from './utils/output-stats';
|
|
33
33
|
import { copyAllStaticFiles } from './utils/copy-all-static-files';
|
|
@@ -81,6 +81,11 @@ export async function buildStaticStandalone(options) {
|
|
|
81
81
|
features: features
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
+
if (options.debugWebpack) {
|
|
85
|
+
logConfig('Preview webpack config', await previewBuilder.getConfig(fullOptions));
|
|
86
|
+
logConfig('Manager webpack config', await managerBuilder.getConfig(fullOptions));
|
|
87
|
+
}
|
|
88
|
+
|
|
84
89
|
var core = await presets.apply('core');
|
|
85
90
|
|
|
86
91
|
var _ref = (core === null || core === void 0 ? void 0 : core.builder) === 'webpack5' ? await import('@storybook/manager-webpack5/prebuilt-manager') : await import('@storybook/manager-webpack4/prebuilt-manager'),
|
package/dist/modern/cli/utils.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import deprecate from 'util-deprecate';
|
|
2
2
|
import dedent from 'ts-dedent';
|
|
3
3
|
export function parseList(str) {
|
|
4
|
-
return str.split(',')
|
|
4
|
+
return str.split(',').map(function (item) {
|
|
5
|
+
return item.trim();
|
|
6
|
+
}).filter(function (item) {
|
|
7
|
+
return item.length > 0;
|
|
8
|
+
});
|
|
5
9
|
}
|
|
6
10
|
export function getEnvConfig(program, configEnv) {
|
|
7
11
|
Object.keys(configEnv).forEach(function (fieldName) {
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
2
|
+
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
+
|
|
1
5
|
import "core-js/modules/es.promise.js";
|
|
2
|
-
import
|
|
3
|
-
import path from 'path';
|
|
6
|
+
import { stringifyStream } from '@discoveryjs/json-ext';
|
|
4
7
|
import { logger } from '@storybook/node-logger';
|
|
8
|
+
import chalk from 'chalk';
|
|
5
9
|
import fs from 'fs-extra';
|
|
10
|
+
import path from 'path';
|
|
6
11
|
export async function outputStats(directory, previewStats, managerStats) {
|
|
7
12
|
if (previewStats) {
|
|
8
13
|
var filePath = await writeStats(directory, 'preview', previewStats);
|
|
@@ -17,6 +22,14 @@ export async function outputStats(directory, previewStats, managerStats) {
|
|
|
17
22
|
}
|
|
18
23
|
export var writeStats = async function (directory, name, stats) {
|
|
19
24
|
var filePath = path.join(directory, `${name}-stats.json`);
|
|
20
|
-
|
|
25
|
+
|
|
26
|
+
var _stats$toJson = stats.toJson(),
|
|
27
|
+
chunks = _stats$toJson.chunks,
|
|
28
|
+
data = _objectWithoutProperties(_stats$toJson, ["chunks"]); // omit chunks, which is about half of the total data
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
await new Promise(function (resolve, reject) {
|
|
32
|
+
stringifyStream(data, null, 2).on('error', reject).pipe(fs.createWriteStream(filePath)).on('error', reject).on('finish', resolve);
|
|
33
|
+
});
|
|
21
34
|
return filePath;
|
|
22
35
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/core-server",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.8",
|
|
4
4
|
"description": "Storybook framework-agnostic API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -40,12 +40,13 @@
|
|
|
40
40
|
"prepare": "node ../../scripts/prepare.js"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"@storybook/
|
|
45
|
-
"@storybook/core-
|
|
46
|
-
"@storybook/
|
|
47
|
-
"@storybook/
|
|
48
|
-
"@storybook/
|
|
43
|
+
"@discoveryjs/json-ext": "^0.5.3",
|
|
44
|
+
"@storybook/builder-webpack4": "6.3.8",
|
|
45
|
+
"@storybook/core-client": "6.3.8",
|
|
46
|
+
"@storybook/core-common": "6.3.8",
|
|
47
|
+
"@storybook/csf-tools": "6.3.8",
|
|
48
|
+
"@storybook/manager-webpack4": "6.3.8",
|
|
49
|
+
"@storybook/node-logger": "6.3.8",
|
|
49
50
|
"@storybook/semver": "^7.3.2",
|
|
50
51
|
"@types/node": "^14.0.10",
|
|
51
52
|
"@types/node-fetch": "^2.5.7",
|
|
@@ -75,15 +76,15 @@
|
|
|
75
76
|
"webpack": "4"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
|
78
|
-
"@storybook/builder-webpack5": "6.3.
|
|
79
|
+
"@storybook/builder-webpack5": "6.3.8",
|
|
79
80
|
"@types/compression": "^1.7.0",
|
|
80
81
|
"@types/ip": "^1.1.0",
|
|
81
82
|
"@types/serve-favicon": "^2.5.2",
|
|
82
83
|
"jest-specific-snapshot": "^4.0.0"
|
|
83
84
|
},
|
|
84
85
|
"peerDependencies": {
|
|
85
|
-
"@storybook/builder-webpack5": "6.3.
|
|
86
|
-
"@storybook/manager-webpack5": "6.3.
|
|
86
|
+
"@storybook/builder-webpack5": "6.3.8",
|
|
87
|
+
"@storybook/manager-webpack5": "6.3.8",
|
|
87
88
|
"react": "^16.8.0 || ^17.0.0",
|
|
88
89
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
89
90
|
},
|
|
@@ -101,6 +102,6 @@
|
|
|
101
102
|
"publishConfig": {
|
|
102
103
|
"access": "public"
|
|
103
104
|
},
|
|
104
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "7982432207f6c28bf597b053e49e36fbbcd19b88",
|
|
105
106
|
"sbmodern": "dist/modern/index.js"
|
|
106
107
|
}
|
package/typings.d.ts
CHANGED