@storybook/angular 6.4.1 → 6.5.0-alpha.1

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.
@@ -79,6 +79,7 @@ var module_is_available_1 = require("./utils/module-is-available");
79
79
  var angular_cli_webpack_12_2_x_1 = require("./angular-cli-webpack-12.2.x");
80
80
  var angular_cli_webpack_13_x_x_1 = require("./angular-cli-webpack-13.x.x");
81
81
  var angular_cli_webpack_older_1 = require("./angular-cli-webpack-older");
82
+ var angular_read_workspace_1 = require("./angular-read-workspace");
82
83
  function webpackFinal(baseConfig, options) {
83
84
  return __awaiter(this, void 0, void 0, function () {
84
85
  var angularCliVersion, webpackGetterByVersions, webpackGetter;
@@ -98,7 +99,7 @@ function webpackFinal(baseConfig, options) {
98
99
  info: '=> Loading angular-cli config for angular >= 13.0.0',
99
100
  condition: semver_1.default.satisfies(angularCliVersion, '>=13.0.0'),
100
101
  getWebpackConfig: function (_baseConfig, _options) { return __awaiter(_this, void 0, void 0, function () {
101
- var builderContext, builderOptions;
102
+ var builderContext, builderOptions, legacyDefaultOptions;
102
103
  return __generator(this, function (_a) {
103
104
  switch (_a.label) {
104
105
  case 0:
@@ -106,8 +107,11 @@ function webpackFinal(baseConfig, options) {
106
107
  return [4 /*yield*/, getBuilderOptions(_options, builderContext)];
107
108
  case 1:
108
109
  builderOptions = _a.sent();
110
+ return [4 /*yield*/, getLegacyDefaultBuildOptions(_options)];
111
+ case 2:
112
+ legacyDefaultOptions = _a.sent();
109
113
  return [2 /*return*/, angular_cli_webpack_13_x_x_1.getWebpackConfig(_baseConfig, {
110
- builderOptions: builderOptions,
114
+ builderOptions: __assign(__assign({}, builderOptions), legacyDefaultOptions),
111
115
  builderContext: builderContext,
112
116
  })];
113
117
  }
@@ -189,3 +193,53 @@ function getBuilderOptions(options, builderContext) {
189
193
  });
190
194
  });
191
195
  }
196
+ /**
197
+ * Get options from legacy way
198
+ * /!\ This is only for backward compatibility and would be removed on Storybook 7.0
199
+ * only work for angular.json with [defaultProject].build or "storybook.build" config
200
+ */
201
+ function getLegacyDefaultBuildOptions(options) {
202
+ return __awaiter(this, void 0, void 0, function () {
203
+ var dirToSearch, workspaceConfig, error_1, browserTarget, _a, target, project;
204
+ return __generator(this, function (_b) {
205
+ switch (_b.label) {
206
+ case 0:
207
+ if (options.angularBrowserTarget !== undefined) {
208
+ // Not use legacy way with builder (`angularBrowserTarget` is defined or null with builder and undefined without)
209
+ return [2 /*return*/, {}];
210
+ }
211
+ dirToSearch = process.cwd();
212
+ _b.label = 1;
213
+ case 1:
214
+ _b.trys.push([1, 3, , 4]);
215
+ return [4 /*yield*/, angular_read_workspace_1.readAngularWorkspaceConfig(dirToSearch)];
216
+ case 2:
217
+ workspaceConfig = _b.sent();
218
+ return [3 /*break*/, 4];
219
+ case 3:
220
+ error_1 = _b.sent();
221
+ node_logger_1.logger.error("=> Could not find angular workspace config (angular.json) on this path \"" + dirToSearch + "\"");
222
+ node_logger_1.logger.info("=> Fail to load angular-cli config. Using base config");
223
+ return [2 /*return*/, {}];
224
+ case 4:
225
+ // Find angular project target
226
+ try {
227
+ browserTarget = {
228
+ configuration: undefined,
229
+ project: angular_read_workspace_1.getDefaultProjectName(workspaceConfig),
230
+ target: 'build',
231
+ };
232
+ _a = angular_read_workspace_1.findAngularProjectTarget(workspaceConfig, browserTarget.project, browserTarget.target), target = _a.target, project = _a.project;
233
+ node_logger_1.logger.info("=> Using angular project \"" + project + ":" + target + "\" for configuring Storybook");
234
+ return [2 /*return*/, __assign({}, target.options)];
235
+ }
236
+ catch (error) {
237
+ node_logger_1.logger.error("=> Could not find angular project: " + error.message);
238
+ node_logger_1.logger.info("=> Fail to load angular-cli config. Using base config");
239
+ return [2 /*return*/, {}];
240
+ }
241
+ return [2 /*return*/];
242
+ }
243
+ });
244
+ });
245
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/angular",
3
- "version": "6.4.1",
3
+ "version": "6.5.0-alpha.1",
4
4
  "description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
5
5
  "keywords": [
6
6
  "storybook"
@@ -45,15 +45,15 @@
45
45
  "prepare": "node ../../scripts/prepare.js"
46
46
  },
47
47
  "dependencies": {
48
- "@storybook/addons": "6.4.1",
49
- "@storybook/api": "6.4.1",
50
- "@storybook/core": "6.4.1",
51
- "@storybook/core-common": "6.4.1",
52
- "@storybook/core-events": "6.4.1",
48
+ "@storybook/addons": "6.5.0-alpha.1",
49
+ "@storybook/api": "6.5.0-alpha.1",
50
+ "@storybook/core": "6.5.0-alpha.1",
51
+ "@storybook/core-common": "6.5.0-alpha.1",
52
+ "@storybook/core-events": "6.5.0-alpha.1",
53
53
  "@storybook/csf": "0.0.2--canary.87bc651.0",
54
- "@storybook/node-logger": "6.4.1",
54
+ "@storybook/node-logger": "6.5.0-alpha.1",
55
55
  "@storybook/semver": "^7.3.2",
56
- "@storybook/store": "6.4.1",
56
+ "@storybook/store": "6.5.0-alpha.1",
57
57
  "@types/webpack-env": "^1.16.0",
58
58
  "autoprefixer": "^9.8.6",
59
59
  "core-js": "^3.8.2",
@@ -138,5 +138,5 @@
138
138
  "access": "public"
139
139
  },
140
140
  "builders": "dist/ts3.9/builders/builders.json",
141
- "gitHead": "bb20e8fef506e05fb9c67dd55b0405b4b1043698"
141
+ "gitHead": "fbf6e247a099ec45c30f8594f255a088847b7957"
142
142
  }