@storybook/angular 6.4.0-alpha.36 → 6.4.0-alpha.37

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 @@
1
+ export declare const buildStandaloneErrorHandler: (error: any) => any;
@@ -67,6 +67,7 @@ var operators_1 = require("rxjs/operators");
67
67
  // eslint-disable-next-line import/no-extraneous-dependencies
68
68
  var standalone_1 = __importDefault(require("@storybook/angular/standalone"));
69
69
  var run_compodoc_1 = require("../utils/run-compodoc");
70
+ var build_standalone_errors_handler_1 = require("../utils/build-standalone-errors-handler");
70
71
  exports.default = architect_1.createBuilder(commandBuilder);
71
72
  function commandBuilder(options, context) {
72
73
  return rxjs_1.from(setup(options, context)).pipe(operators_1.switchMap(function (_a) {
@@ -109,5 +110,5 @@ function setup(options, context) {
109
110
  });
110
111
  }
111
112
  function runInstance(options) {
112
- return rxjs_1.from(standalone_1.default(options));
113
+ return rxjs_1.from(standalone_1.default(options)).pipe(operators_1.catchError(function (error) { return rxjs_1.throwError(build_standalone_errors_handler_1.buildStandaloneErrorHandler(error)); }));
113
114
  }
@@ -67,6 +67,7 @@ var operators_1 = require("rxjs/operators");
67
67
  // eslint-disable-next-line import/no-extraneous-dependencies
68
68
  var standalone_1 = __importDefault(require("@storybook/angular/standalone"));
69
69
  var run_compodoc_1 = require("../utils/run-compodoc");
70
+ var build_standalone_errors_handler_1 = require("../utils/build-standalone-errors-handler");
70
71
  exports.default = architect_1.createBuilder(commandBuilder);
71
72
  function commandBuilder(options, context) {
72
73
  return rxjs_1.from(setup(options, context)).pipe(operators_1.switchMap(function (_a) {
@@ -111,6 +112,6 @@ function setup(options, context) {
111
112
  function runInstance(options) {
112
113
  return new rxjs_1.Observable(function (observer) {
113
114
  // This Observable intentionally never complete, leaving the process running ;)
114
- standalone_1.default(options).then(function () { return observer.next(); }, function (error) { return observer.error(error); });
115
+ standalone_1.default(options).then(function () { return observer.next(); }, function (error) { return observer.error(build_standalone_errors_handler_1.buildStandaloneErrorHandler(error)); });
115
116
  });
116
117
  }
@@ -0,0 +1 @@
1
+ export declare const buildStandaloneErrorHandler: (error: any) => any;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.buildStandaloneErrorHandler = void 0;
11
+ var node_logger_1 = require("@storybook/node-logger");
12
+ var ts_dedent_1 = __importDefault(require("ts-dedent"));
13
+ exports.buildStandaloneErrorHandler = function (error) {
14
+ var _a;
15
+ // Duplicate code for Standalone error handling
16
+ // Source: https://github.com/storybookjs/storybook/blob/39c7ba09ad84fbd466f9c25d5b92791a5450b9f6/lib/core-server/src/build-dev.ts#L136
17
+ node_logger_1.instance.heading = '';
18
+ if (error instanceof Error) {
19
+ if (error.error) {
20
+ node_logger_1.logger.error(error.error);
21
+ }
22
+ else if (error.stats && error.stats.compilation.errors) {
23
+ error.stats.compilation.errors.forEach(function (e) { return node_logger_1.logger.plain(e); });
24
+ }
25
+ else {
26
+ node_logger_1.logger.error(error);
27
+ }
28
+ }
29
+ else if ((_a = error.compilation) === null || _a === void 0 ? void 0 : _a.errors) {
30
+ error.compilation.errors.forEach(function (e) { return node_logger_1.logger.plain(e); });
31
+ }
32
+ node_logger_1.logger.line();
33
+ return error.close
34
+ ? ts_dedent_1.default(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n FATAL broken build!, will close the process,\n Fix the error below and restart storybook.\n "], ["\n FATAL broken build!, will close the process,\n Fix the error below and restart storybook.\n "]))) : ts_dedent_1.default(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n Broken build, fix the error above.\n You may need to refresh the browser.\n "], ["\n Broken build, fix the error above.\n You may need to refresh the browser.\n "])));
35
+ };
36
+ var templateObject_1, templateObject_2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/angular",
3
- "version": "6.4.0-alpha.36",
3
+ "version": "6.4.0-alpha.37",
4
4
  "description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
5
5
  "keywords": [
6
6
  "storybook"
@@ -45,14 +45,14 @@
45
45
  "prepare": "node ../../scripts/prepare.js"
46
46
  },
47
47
  "dependencies": {
48
- "@storybook/addons": "6.4.0-alpha.36",
49
- "@storybook/api": "6.4.0-alpha.36",
50
- "@storybook/core": "6.4.0-alpha.36",
51
- "@storybook/core-common": "6.4.0-alpha.36",
52
- "@storybook/core-events": "6.4.0-alpha.36",
48
+ "@storybook/addons": "6.4.0-alpha.37",
49
+ "@storybook/api": "6.4.0-alpha.37",
50
+ "@storybook/core": "6.4.0-alpha.37",
51
+ "@storybook/core-common": "6.4.0-alpha.37",
52
+ "@storybook/core-events": "6.4.0-alpha.37",
53
53
  "@storybook/csf": "0.0.2--canary.68887a1.0",
54
- "@storybook/node-logger": "6.4.0-alpha.36",
55
- "@storybook/store": "6.4.0-alpha.36",
54
+ "@storybook/node-logger": "6.4.0-alpha.37",
55
+ "@storybook/store": "6.4.0-alpha.37",
56
56
  "@types/webpack-env": "^1.16.0",
57
57
  "autoprefixer": "^9.8.6",
58
58
  "core-js": "^3.8.2",
@@ -131,5 +131,5 @@
131
131
  "access": "public"
132
132
  },
133
133
  "builders": "dist/ts3.9/builders/builders.json",
134
- "gitHead": "cc13af28a7ea2042d63075ff94e542c99fdc4aad"
134
+ "gitHead": "c0c82361c8829e4b983146252435557ef6243c5c"
135
135
  }