@storybook/core-server 6.3.6 → 6.3.10

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.
@@ -8,16 +8,22 @@ exports.writeStats = void 0;
8
8
 
9
9
  require("core-js/modules/es.promise.js");
10
10
 
11
- var _chalk = _interopRequireDefault(require("chalk"));
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
- await _fsExtra.default.outputFile(filePath, JSON.stringify(stats.toJson(), null, 2), 'utf8');
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
 
@@ -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 chalk from 'chalk';
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
- await fs.outputFile(filePath, JSON.stringify(stats.toJson(), null, 2), 'utf8');
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
  };
@@ -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 chalk from 'chalk';
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
- await fs.outputFile(filePath, JSON.stringify(stats.toJson(), null, 2), 'utf8');
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.6",
3
+ "version": "6.3.10",
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
- "@storybook/builder-webpack4": "6.3.6",
44
- "@storybook/core-client": "6.3.6",
45
- "@storybook/core-common": "6.3.6",
46
- "@storybook/csf-tools": "6.3.6",
47
- "@storybook/manager-webpack4": "6.3.6",
48
- "@storybook/node-logger": "6.3.6",
43
+ "@discoveryjs/json-ext": "^0.5.3",
44
+ "@storybook/builder-webpack4": "6.3.10",
45
+ "@storybook/core-client": "6.3.10",
46
+ "@storybook/core-common": "6.3.10",
47
+ "@storybook/csf-tools": "6.3.10",
48
+ "@storybook/manager-webpack4": "6.3.10",
49
+ "@storybook/node-logger": "6.3.10",
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.6",
79
+ "@storybook/builder-webpack5": "6.3.10",
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.6",
86
- "@storybook/manager-webpack5": "6.3.6",
86
+ "@storybook/builder-webpack5": "6.3.10",
87
+ "@storybook/manager-webpack5": "6.3.10",
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": "8c14e96e8ab21e6008e7c8458d7515539d448e06",
105
+ "gitHead": "591d742fd3b9986d5aef4ed66b9f50084eee02e4",
105
106
  "sbmodern": "dist/modern/index.js"
106
107
  }
package/typings.d.ts CHANGED
@@ -7,6 +7,7 @@ declare module '@storybook/theming/paths';
7
7
  declare module '@storybook/ui/paths';
8
8
  declare module 'better-opn';
9
9
  declare module '@storybook/ui';
10
+ declare module '@discoveryjs/json-ext';
10
11
 
11
12
  declare module 'file-system-cache' {
12
13
  export interface Options {