@storybook/angular 7.0.7 → 7.0.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.
@@ -13,6 +13,17 @@ export type StorybookBuilderOptions = JsonObject & {
13
13
  stylePreprocessorOptions?: StylePreprocessorOptions;
14
14
  assets?: AssetPattern[];
15
15
  } & Pick<CLIOptions, 'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'webpackStatsJson' | 'disableTelemetry'>;
16
- export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
17
- declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
16
+ export type StorybookBuilderOutput = JsonObject & BuilderOutput & {
17
+ [key: string]: any;
18
+ };
19
+ declare const _default: import("@angular-devkit/architect/src/internal").Builder<JsonObject & {
20
+ browserTarget?: string;
21
+ tsConfig?: string;
22
+ docs: boolean;
23
+ compodoc: boolean;
24
+ compodocArgs: string[];
25
+ styles?: StyleElement[];
26
+ stylePreprocessorOptions?: StylePreprocessorOptions;
27
+ assets?: AssetPattern[];
28
+ } & Pick<CLIOptions, "disableTelemetry" | "webpackStatsJson" | "outputDir" | "configDir" | "loglevel" | "quiet">>;
18
29
  export default _default;
@@ -11,9 +11,8 @@ const core_server_1 = require("@storybook/core-server");
11
11
  const run_compodoc_1 = require("../utils/run-compodoc");
12
12
  const error_handler_1 = require("../utils/error-handler");
13
13
  (0, telemetry_1.addToGlobalContext)('cliVersion', cli_1.versions.storybook);
14
- exports.default = (0, architect_1.createBuilder)(commandBuilder);
15
- function commandBuilder(options, context) {
16
- return (0, rxjs_1.from)(setup(options, context)).pipe((0, operators_1.switchMap)(({ tsConfig }) => {
14
+ const commandBuilder = (options, context) => {
15
+ const builder = (0, rxjs_1.from)(setup(options, context)).pipe((0, operators_1.switchMap)(({ tsConfig }) => {
17
16
  const runCompodoc$ = options.compodoc
18
17
  ? (0, run_compodoc_1.runCompodoc)({ compodocArgs: options.compodocArgs, tsconfig: tsConfig }, context).pipe((0, operators_1.mapTo)({ tsConfig }))
19
18
  : (0, rxjs_1.of)({});
@@ -47,7 +46,9 @@ function commandBuilder(options, context) {
47
46
  }), (0, operators_1.switchMap)((standaloneOptions) => runInstance({ ...standaloneOptions, mode: 'static' })), (0, operators_1.map)(() => {
48
47
  return { success: true };
49
48
  }));
50
- }
49
+ return builder;
50
+ };
51
+ exports.default = (0, architect_1.createBuilder)(commandBuilder);
51
52
  async function setup(options, context) {
52
53
  let browserOptions;
53
54
  let browserTarget;
@@ -14,5 +14,14 @@ export type StorybookBuilderOptions = JsonObject & {
14
14
  assets?: AssetPattern[];
15
15
  } & Pick<CLIOptions, 'port' | 'host' | 'configDir' | 'https' | 'sslCa' | 'sslCert' | 'sslKey' | 'smokeTest' | 'ci' | 'quiet' | 'disableTelemetry'>;
16
16
  export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
17
- declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
17
+ declare const _default: import("@angular-devkit/architect/src/internal").Builder<JsonObject & {
18
+ browserTarget?: string;
19
+ tsConfig?: string;
20
+ docs: boolean;
21
+ compodoc: boolean;
22
+ compodocArgs: string[];
23
+ styles?: StyleElement[];
24
+ stylePreprocessorOptions?: StylePreprocessorOptions;
25
+ assets?: AssetPattern[];
26
+ } & Pick<CLIOptions, "host" | "disableTelemetry" | "port" | "configDir" | "quiet" | "https" | "sslCa" | "sslCert" | "sslKey" | "smokeTest" | "ci">>;
18
27
  export default _default;
@@ -11,9 +11,8 @@ const core_server_1 = require("@storybook/core-server");
11
11
  const run_compodoc_1 = require("../utils/run-compodoc");
12
12
  const error_handler_1 = require("../utils/error-handler");
13
13
  (0, telemetry_1.addToGlobalContext)('cliVersion', cli_1.versions.storybook);
14
- exports.default = (0, architect_1.createBuilder)(commandBuilder);
15
- function commandBuilder(options, context) {
16
- return (0, rxjs_1.from)(setup(options, context)).pipe((0, operators_1.switchMap)(({ tsConfig }) => {
14
+ const commandBuilder = (options, context) => {
15
+ const builder = (0, rxjs_1.from)(setup(options, context)).pipe((0, operators_1.switchMap)(({ tsConfig }) => {
17
16
  const runCompodoc$ = options.compodoc
18
17
  ? (0, run_compodoc_1.runCompodoc)({ compodocArgs: options.compodocArgs, tsconfig: tsConfig }, context).pipe((0, operators_1.mapTo)({ tsConfig }))
19
18
  : (0, rxjs_1.of)({});
@@ -56,7 +55,9 @@ function commandBuilder(options, context) {
56
55
  }), (0, operators_1.switchMap)((standaloneOptions) => runInstance(standaloneOptions)), (0, operators_1.map)((port) => {
57
56
  return { success: true, info: { port } };
58
57
  }));
59
- }
58
+ return builder;
59
+ };
60
+ exports.default = (0, architect_1.createBuilder)(commandBuilder);
60
61
  async function setup(options, context) {
61
62
  let browserOptions;
62
63
  let browserTarget;
@@ -15,7 +15,10 @@ const getComponentInputsOutputs = (component) => {
15
15
  };
16
16
  // Adds the I/O present in @Component metadata
17
17
  if (componentMetadata && componentMetadata.inputs) {
18
- initialValue.inputs.push(...componentMetadata.inputs.map((i) => ({ propName: i, templateName: i })));
18
+ initialValue.inputs.push(...componentMetadata.inputs.map((i) => ({
19
+ propName: typeof i === 'string' ? i : i.name,
20
+ templateName: typeof i === 'string' ? i : i.alias,
21
+ })));
19
22
  }
20
23
  if (componentMetadata && componentMetadata.outputs) {
21
24
  initialValue.outputs.push(...componentMetadata.outputs.map((i) => ({ propName: i, templateName: i })));
@@ -30,7 +33,7 @@ const getComponentInputsOutputs = (component) => {
30
33
  if (value instanceof core_1.Input) {
31
34
  const inputToAdd = {
32
35
  propName: propertyName,
33
- templateName: value.bindingPropertyName ?? propertyName,
36
+ templateName: value.bindingPropertyName ?? value.alias ?? propertyName,
34
37
  };
35
38
  const previousInputsFiltered = previousValue.inputs.filter((i) => i.templateName !== propertyName);
36
39
  return {
@@ -41,7 +44,7 @@ const getComponentInputsOutputs = (component) => {
41
44
  if (value instanceof core_1.Output) {
42
45
  const outputToAdd = {
43
46
  propName: propertyName,
44
- templateName: value.bindingPropertyName ?? propertyName,
47
+ templateName: value.bindingPropertyName ?? value.alias ?? propertyName,
45
48
  };
46
49
  const previousOutputsFiltered = previousValue.outputs.filter((i) => i.templateName !== propertyName);
47
50
  return {
@@ -368,11 +368,7 @@ function sortByPropName(array) {
368
368
  function resolveComponentFactory(component) {
369
369
  testing_1.TestBed.configureTestingModule({
370
370
  declarations: [component],
371
- }).overrideModule(testing_2.BrowserDynamicTestingModule, {
372
- set: {
373
- entryComponents: [component],
374
- },
375
- });
371
+ }).overrideModule(testing_2.BrowserDynamicTestingModule, {});
376
372
  const componentFactoryResolver = testing_1.TestBed.inject(core_1.ComponentFactoryResolver);
377
373
  return componentFactoryResolver.resolveComponentFactory(component);
378
374
  }
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.webpack = exports.runNgcc = void 0;
27
+ const core_1 = require("@angular/core");
27
28
  const path = __importStar(require("path"));
28
29
  /**
29
30
  * Source : https://github.com/angular/angular-cli/blob/ebccb5de4a455af813c5e82483db6af20666bdbd/packages/angular_devkit/build_angular/src/utils/load-esm.ts#L23
@@ -51,7 +52,8 @@ function loadEsmModule(modulePath) {
51
52
  const runNgcc = async () => {
52
53
  let ngcc;
53
54
  try {
54
- ngcc = await Promise.resolve().then(() => __importStar(require('@angular/compiler-cli/ngcc')));
55
+ // eslint-disable-next-line global-require
56
+ ngcc = require('@angular/compiler-cli/ngcc');
55
57
  }
56
58
  catch (error) {
57
59
  ngcc = await loadEsmModule('@angular/compiler-cli/ngcc');
@@ -69,26 +71,25 @@ exports.runNgcc = runNgcc;
69
71
  const webpack = async (webpackConfig, options) => {
70
72
  const framework = await options.presets.apply('framework');
71
73
  const angularOptions = (typeof framework === 'object' ? framework.options : {});
74
+ const isAngular16OrNewer = parseInt(core_1.VERSION.major, 10) >= 16;
72
75
  // Default to true, if undefined
73
76
  if (angularOptions.enableIvy === false) {
74
77
  return webpackConfig;
75
78
  }
76
- if (angularOptions.enableNgcc !== false) {
79
+ let extraMainFields = [];
80
+ if (angularOptions.enableNgcc !== false && !isAngular16OrNewer) {
81
+ // TODO: Drop if Angular 14 and 15 are not supported anymore
77
82
  (0, exports.runNgcc)();
83
+ extraMainFields = ['es2015_ivy_ngcc', 'module_ivy_ngcc', 'main_ivy_ngcc'];
84
+ }
85
+ if (!isAngular16OrNewer) {
86
+ extraMainFields.push('es2015');
78
87
  }
79
88
  return {
80
89
  ...webpackConfig,
81
90
  resolve: {
82
91
  ...webpackConfig.resolve,
83
- mainFields: [
84
- 'es2015_ivy_ngcc',
85
- 'module_ivy_ngcc',
86
- 'main_ivy_ngcc',
87
- 'es2015',
88
- 'browser',
89
- 'module',
90
- 'main',
91
- ],
92
+ mainFields: [...extraMainFields, 'browser', 'module', 'main'],
92
93
  },
93
94
  };
94
95
  };
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@storybook/angular",
3
- "version": "7.0.7",
3
+ "version": "7.0.8",
4
4
  "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
5
5
  "keywords": [
6
6
  "storybook",
7
7
  "angular"
8
8
  ],
9
- "homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/angular",
9
+ "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/angular",
10
10
  "bugs": {
11
11
  "url": "https://github.com/storybookjs/storybook/issues"
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "https://github.com/storybookjs/storybook.git",
16
- "directory": "frameworks/angular"
16
+ "directory": "code/frameworks/angular"
17
17
  },
18
18
  "funding": {
19
19
  "type": "opencollective",
@@ -36,21 +36,21 @@
36
36
  "prep": "../../../scripts/prepare/tsc.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@storybook/builder-webpack5": "7.0.7",
40
- "@storybook/cli": "7.0.7",
41
- "@storybook/client-logger": "7.0.7",
42
- "@storybook/core-client": "7.0.7",
43
- "@storybook/core-common": "7.0.7",
44
- "@storybook/core-events": "7.0.7",
45
- "@storybook/core-server": "7.0.7",
46
- "@storybook/core-webpack": "7.0.7",
47
- "@storybook/docs-tools": "7.0.7",
39
+ "@storybook/builder-webpack5": "7.0.8",
40
+ "@storybook/cli": "7.0.8",
41
+ "@storybook/client-logger": "7.0.8",
42
+ "@storybook/core-client": "7.0.8",
43
+ "@storybook/core-common": "7.0.8",
44
+ "@storybook/core-events": "7.0.8",
45
+ "@storybook/core-server": "7.0.8",
46
+ "@storybook/core-webpack": "7.0.8",
47
+ "@storybook/docs-tools": "7.0.8",
48
48
  "@storybook/global": "^5.0.0",
49
- "@storybook/manager-api": "7.0.7",
50
- "@storybook/node-logger": "7.0.7",
51
- "@storybook/preview-api": "7.0.7",
52
- "@storybook/telemetry": "7.0.7",
53
- "@storybook/types": "7.0.7",
49
+ "@storybook/manager-api": "7.0.8",
50
+ "@storybook/node-logger": "7.0.8",
51
+ "@storybook/preview-api": "7.0.8",
52
+ "@storybook/telemetry": "7.0.8",
53
+ "@storybook/types": "7.0.8",
54
54
  "@types/node": "^16.0.0",
55
55
  "@types/react": "^16.14.34",
56
56
  "@types/react-dom": "^16.9.14",
@@ -66,18 +66,18 @@
66
66
  "webpack": "5"
67
67
  },
68
68
  "devDependencies": {
69
- "@angular-devkit/architect": "^0.1500.4",
70
- "@angular-devkit/build-angular": "^15.1.1",
71
- "@angular-devkit/core": "^15.1.1",
72
- "@angular/animations": "^15.1.1",
73
- "@angular/cli": "^15.1.1",
74
- "@angular/common": "^15.1.1",
75
- "@angular/compiler": "^15.1.1",
76
- "@angular/compiler-cli": "^15.1.1",
77
- "@angular/core": "^15.1.1",
78
- "@angular/forms": "^15.1.1",
79
- "@angular/platform-browser": "^15.1.1",
80
- "@angular/platform-browser-dynamic": "^15.1.1",
69
+ "@angular-devkit/architect": "^0.1600.0-rc.3",
70
+ "@angular-devkit/build-angular": "^16.0.0-rc.3",
71
+ "@angular-devkit/core": "^16.0.0-rc.3",
72
+ "@angular/animations": "^16.0.0-rc.3",
73
+ "@angular/cli": "^16.0.0-rc.3",
74
+ "@angular/common": "^16.0.0-rc.3",
75
+ "@angular/compiler": "^16.0.0-rc.3",
76
+ "@angular/compiler-cli": "^16.0.0-rc.3",
77
+ "@angular/core": "^16.0.0-rc.3",
78
+ "@angular/forms": "^16.0.0-rc.3",
79
+ "@angular/platform-browser": "^16.0.0-rc.3",
80
+ "@angular/platform-browser-dynamic": "^16.0.0-rc.3",
81
81
  "@types/rimraf": "^3.0.2",
82
82
  "@types/tmp": "^0.2.3",
83
83
  "cross-spawn": "^7.0.3",
@@ -88,20 +88,20 @@
88
88
  "tmp": "^0.2.1",
89
89
  "typescript": "~4.9.3",
90
90
  "webpack": "5",
91
- "zone.js": "^0.12.0"
91
+ "zone.js": "^0.13.0"
92
92
  },
93
93
  "peerDependencies": {
94
- "@angular-devkit/architect": ">=0.1400.0 < 0.1600.0",
95
- "@angular-devkit/build-angular": ">=14.1.0 < 16.0.0",
96
- "@angular-devkit/core": ">=14.1.0 < 16.0.0",
97
- "@angular/cli": ">=14.1.0 < 16.0.0",
98
- "@angular/common": ">=14.1.0 < 16.0.0",
99
- "@angular/compiler": ">=14.1.0 < 16.0.0",
100
- "@angular/compiler-cli": ">=14.1.0 < 16.0.0",
101
- "@angular/core": ">=14.1.0 < 16.0.0",
102
- "@angular/forms": ">=14.1.0 < 16.0.0",
103
- "@angular/platform-browser": ">=14.1.0 < 16.0.0",
104
- "@angular/platform-browser-dynamic": ">=14.1.0 < 16.0.0",
94
+ "@angular-devkit/architect": ">=0.1400.0 < 0.1700.0",
95
+ "@angular-devkit/build-angular": ">=14.1.0 < 17.0.0",
96
+ "@angular-devkit/core": ">=14.1.0 < 17.0.0",
97
+ "@angular/cli": ">=14.1.0 < 17.0.0",
98
+ "@angular/common": ">=14.1.0 < 17.0.0",
99
+ "@angular/compiler": ">=14.1.0 < 17.0.0",
100
+ "@angular/compiler-cli": ">=14.1.0 < 17.0.0",
101
+ "@angular/core": ">=14.1.0 < 17.0.0",
102
+ "@angular/forms": ">=14.1.0 < 17.0.0",
103
+ "@angular/platform-browser": ">=14.1.0 < 17.0.0",
104
+ "@angular/platform-browser-dynamic": ">=14.1.0 < 17.0.0",
105
105
  "@babel/core": "*",
106
106
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
107
107
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
@@ -124,5 +124,5 @@
124
124
  "bundler": {
125
125
  "tsConfig": "tsconfig.build.json"
126
126
  },
127
- "gitHead": "9e352853ca5ce94d81fcdb06c303b4fbf43f8971"
127
+ "gitHead": "9991b68c7d0cd1543c974f358cae9e0d02b29e7e"
128
128
  }