@storybook/angular 7.5.0-alpha.0 → 7.5.0-alpha.2

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/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  - [moduleMetadata decorator](#modulemetadata-decorator)
11
11
  - [applicationConfig decorator](#applicationconfig-decorator)
12
12
  - [FAQ](#faq)
13
- - [How do I migrate to a Angular Storybook builder?](#how-do-i-migrate-to-a-angular-storybook-builder)
13
+ - [How do I migrate to an Angular Storybook builder?](#how-do-i-migrate-to-an-angular-storybook-builder)
14
14
  - [Do you have only one Angular project in your workspace?](#do-you-have-only-one-angular-project-in-your-workspace)
15
15
  - [Adjust your `package.json`](#adjust-your-packagejson)
16
16
  - [I have multiple projects in my Angular workspace](#i-have-multiple-projects-in-my-angular-workspace)
@@ -252,10 +252,12 @@ export const WithCustomApplicationProvider: Story = {
252
252
 
253
253
  ## FAQ
254
254
 
255
- ### How do I migrate to a Angular Storybook builder?
255
+ ### How do I migrate to an Angular Storybook builder?
256
256
 
257
257
  The Storybook [Angular builder](https://angular.io/guide/glossary#builder) is a new way to run Storybook in an Angular workspace. It is a drop-in replacement for running `storybook dev` and `storybook build` directly.
258
258
 
259
+ You can run `npx storybook@next automigrate` to try let Storybook detect and automatically fix your configuration. Otherwise, you can follow the next steps to manually adjust your configuration.
260
+
259
261
  #### Do you have only one Angular project in your workspace?
260
262
 
261
263
  In this case go to your `angular.json` and add `storybook` and `build-storybook` entries in `architect` section of your project like shown above.
@@ -1,4 +1,3 @@
1
1
  import webpack from 'webpack';
2
2
  import { PresetOptions } from './preset-options';
3
3
  export declare function webpackFinal(baseConfig: webpack.Configuration, options: PresetOptions): Promise<any>;
4
- export declare const migrationToBuilderReferrenceMessage: string;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.migrationToBuilderReferrenceMessage = exports.webpackFinal = void 0;
3
+ exports.webpackFinal = void 0;
4
4
  const node_logger_1 = require("@storybook/node-logger");
5
+ const server_errors_1 = require("@storybook/core-events/server-errors");
5
6
  const architect_1 = require("@angular-devkit/architect");
6
7
  const find_up_1 = require("find-up");
7
- const ts_dedent_1 = require("ts-dedent");
8
8
  const core_1 = require("@angular-devkit/core");
9
9
  const angular_cli_webpack_1 = require("./angular-cli-webpack");
10
10
  const module_is_available_1 = require("./utils/module-is-available");
@@ -66,12 +66,6 @@ async function getBuilderOptions(options, builderContext) {
66
66
  node_logger_1.logger.info(`=> Using angular project with "tsConfig:${builderOptions.tsConfig}"`);
67
67
  return builderOptions;
68
68
  }
69
- exports.migrationToBuilderReferrenceMessage = (0, ts_dedent_1.dedent) `Your Storybook startup uses a solution that is not supported.
70
- You must use angular builder to have an explicit configuration on the project used in angular.json
71
- Read more at:
72
- - https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#sb-angular-builder)
73
- - https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#angular13)
74
- `;
75
69
  /**
76
70
  * Checks if using legacy configuration that doesn't use builder and logs message referring to migration docs.
77
71
  */
@@ -80,6 +74,5 @@ function checkForLegacyBuildOptions(options) {
80
74
  // Not use legacy way with builder (`angularBrowserTarget` is defined or null with builder and undefined without)
81
75
  return;
82
76
  }
83
- node_logger_1.logger.error(exports.migrationToBuilderReferrenceMessage);
84
- throw Error('angularBrowserTarget is undefined.');
77
+ throw new server_errors_1.AngularLegacyBuildOptionsError();
85
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/angular",
3
- "version": "7.5.0-alpha.0",
3
+ "version": "7.5.0-alpha.2",
4
4
  "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
5
5
  "keywords": [
6
6
  "storybook",
@@ -37,20 +37,20 @@
37
37
  "prep": "../../../scripts/prepare/tsc.ts"
38
38
  },
39
39
  "dependencies": {
40
- "@storybook/builder-webpack5": "7.5.0-alpha.0",
41
- "@storybook/cli": "7.5.0-alpha.0",
42
- "@storybook/client-logger": "7.5.0-alpha.0",
43
- "@storybook/core-common": "7.5.0-alpha.0",
44
- "@storybook/core-events": "7.5.0-alpha.0",
45
- "@storybook/core-server": "7.5.0-alpha.0",
46
- "@storybook/core-webpack": "7.5.0-alpha.0",
47
- "@storybook/docs-tools": "7.5.0-alpha.0",
40
+ "@storybook/builder-webpack5": "7.5.0-alpha.2",
41
+ "@storybook/cli": "7.5.0-alpha.2",
42
+ "@storybook/client-logger": "7.5.0-alpha.2",
43
+ "@storybook/core-common": "7.5.0-alpha.2",
44
+ "@storybook/core-events": "7.5.0-alpha.2",
45
+ "@storybook/core-server": "7.5.0-alpha.2",
46
+ "@storybook/core-webpack": "7.5.0-alpha.2",
47
+ "@storybook/docs-tools": "7.5.0-alpha.2",
48
48
  "@storybook/global": "^5.0.0",
49
- "@storybook/manager-api": "7.5.0-alpha.0",
50
- "@storybook/node-logger": "7.5.0-alpha.0",
51
- "@storybook/preview-api": "7.5.0-alpha.0",
52
- "@storybook/telemetry": "7.5.0-alpha.0",
53
- "@storybook/types": "7.5.0-alpha.0",
49
+ "@storybook/manager-api": "7.5.0-alpha.2",
50
+ "@storybook/node-logger": "7.5.0-alpha.2",
51
+ "@storybook/preview-api": "7.5.0-alpha.2",
52
+ "@storybook/telemetry": "7.5.0-alpha.2",
53
+ "@storybook/types": "7.5.0-alpha.2",
54
54
  "@types/node": "^16.0.0",
55
55
  "@types/react": "^16.14.34",
56
56
  "@types/react-dom": "^16.9.14",