@storybook/angular 6.4.14 → 6.4.18

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.
@@ -1,4 +1,4 @@
1
- import { Component, Input, Output, Type } from '@angular/core';
1
+ import { Component, Type } from '@angular/core';
2
2
  export declare type ComponentInputsOutputs = {
3
3
  inputs: {
4
4
  propName: string;
@@ -19,7 +19,9 @@ export declare const isComponent: (component: any) => component is Type<unknown>
19
19
  * Returns all component decorator properties
20
20
  * is used to get all `@Input` and `@Output` Decorator
21
21
  */
22
- export declare const getComponentPropsDecoratorMetadata: (component: any) => Record<string, (Input | Output)[]>;
22
+ export declare const getComponentPropsDecoratorMetadata: (component: any) => {
23
+ [key: string]: any[];
24
+ };
23
25
  /**
24
26
  * Returns component decorator `@Component`
25
27
  */
@@ -1,4 +1,23 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
2
21
  var __spreadArrays = (this && this.__spreadArrays) || function () {
3
22
  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4
23
  for (var r = Array(s), k = 0, i = 0; i < il; i++)
@@ -10,18 +29,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.runCompodoc = void 0;
11
30
  var child_process_1 = require("child_process");
12
31
  var rxjs_1 = require("rxjs");
32
+ var path = __importStar(require("path"));
33
+ var hasTsConfigArg = function (args) { return args.indexOf('-p') !== -1; };
34
+ // path.relative is necessary to workaround a compodoc issue with
35
+ // absolute paths on windows machines
36
+ var toRelativePath = function (pathToTsConfig) {
37
+ return path.isAbsolute(pathToTsConfig) ? path.relative('.', pathToTsConfig) : pathToTsConfig;
38
+ };
13
39
  exports.runCompodoc = function (_a, context) {
14
40
  var compodocArgs = _a.compodocArgs, tsconfig = _a.tsconfig;
15
41
  return new rxjs_1.Observable(function (observer) {
42
+ var tsConfigPath = toRelativePath(tsconfig);
16
43
  var finalCompodocArgs = __spreadArrays([
17
- // Default options
18
- '-p',
19
- tsconfig,
44
+ 'compodoc'
45
+ ], (hasTsConfigArg(compodocArgs) ? [] : ['-p', tsConfigPath]), [
20
46
  '-d',
21
47
  "" + context.workspaceRoot
22
48
  ], compodocArgs);
23
49
  try {
24
- var child = child_process_1.spawn('compodoc', finalCompodocArgs);
50
+ context.logger.info(finalCompodocArgs.join(' '));
51
+ var child = child_process_1.spawn('npx', finalCompodocArgs, {
52
+ cwd: context.workspaceRoot,
53
+ env: process.env,
54
+ shell: true,
55
+ });
25
56
  child.stdout.on('data', function (data) {
26
57
  context.logger.info(data.toString());
27
58
  });
@@ -1,4 +1,4 @@
1
- import { Component, Input, Output, Type } from '@angular/core';
1
+ import { Component, Type } from '@angular/core';
2
2
  export declare type ComponentInputsOutputs = {
3
3
  inputs: {
4
4
  propName: string;
@@ -19,7 +19,9 @@ export declare const isComponent: (component: any) => component is Type<unknown>
19
19
  * Returns all component decorator properties
20
20
  * is used to get all `@Input` and `@Output` Decorator
21
21
  */
22
- export declare const getComponentPropsDecoratorMetadata: (component: any) => Record<string, (Input | Output)[]>;
22
+ export declare const getComponentPropsDecoratorMetadata: (component: any) => {
23
+ [key: string]: any[];
24
+ };
23
25
  /**
24
26
  * Returns component decorator `@Component`
25
27
  */
@@ -20,6 +20,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.getComponentDecoratorMetadata = exports.getComponentPropsDecoratorMetadata = exports.isComponent = exports.isDeclarable = exports.getComponentInputsOutputs = void 0;
22
22
  var core_1 = require("@angular/core");
23
+ var reflectionCapabilities = new core_1.ɵReflectionCapabilities();
23
24
  /**
24
25
  * Returns component Inputs / Outputs by browsing these properties and decorator
25
26
  */
@@ -70,20 +71,14 @@ exports.isDeclarable = function (component) {
70
71
  if (!component) {
71
72
  return false;
72
73
  }
73
- var decoratorKey = '__annotations__';
74
- var decorators = Reflect.getOwnPropertyDescriptor(component, decoratorKey)
75
- ? Reflect.getOwnPropertyDescriptor(component, decoratorKey).value
76
- : component[decoratorKey];
74
+ var decorators = reflectionCapabilities.annotations(component);
77
75
  return !!(decorators || []).find(function (d) { return d instanceof core_1.Directive || d instanceof core_1.Pipe || d instanceof core_1.Component; });
78
76
  };
79
77
  exports.isComponent = function (component) {
80
78
  if (!component) {
81
79
  return false;
82
80
  }
83
- var decoratorKey = '__annotations__';
84
- var decorators = Reflect.getOwnPropertyDescriptor(component, decoratorKey)
85
- ? Reflect.getOwnPropertyDescriptor(component, decoratorKey).value
86
- : component[decoratorKey];
81
+ var decorators = reflectionCapabilities.annotations(component);
87
82
  return (decorators || []).some(function (d) { return d instanceof core_1.Component; });
88
83
  };
89
84
  /**
@@ -91,34 +86,12 @@ exports.isComponent = function (component) {
91
86
  * is used to get all `@Input` and `@Output` Decorator
92
87
  */
93
88
  exports.getComponentPropsDecoratorMetadata = function (component) {
94
- var decoratorKey = '__prop__metadata__';
95
- var propsDecorators = Reflect &&
96
- Reflect.getOwnPropertyDescriptor &&
97
- Reflect.getOwnPropertyDescriptor(component, decoratorKey)
98
- ? Reflect.getOwnPropertyDescriptor(component, decoratorKey).value
99
- : component[decoratorKey];
100
- var parent = Reflect && Reflect.getPrototypeOf && Reflect.getPrototypeOf(component);
101
- if (parent) {
102
- var parentPropsDecorators = exports.getComponentPropsDecoratorMetadata(parent);
103
- propsDecorators = __assign(__assign({}, parentPropsDecorators), propsDecorators);
104
- }
105
- return propsDecorators;
89
+ return reflectionCapabilities.propMetadata(component);
106
90
  };
107
91
  /**
108
92
  * Returns component decorator `@Component`
109
93
  */
110
94
  exports.getComponentDecoratorMetadata = function (component) {
111
- var decoratorKey = '__annotations__';
112
- var decorators = Reflect &&
113
- Reflect.getOwnPropertyDescriptor &&
114
- Reflect.getOwnPropertyDescriptor(component, decoratorKey)
115
- ? Reflect.getOwnPropertyDescriptor(component, decoratorKey).value
116
- : component[decoratorKey];
117
- if (!decorators) {
118
- return (component.decorators &&
119
- component.decorators[0] &&
120
- component.decorators[0].args &&
121
- component.decorators[0].args[0]);
122
- }
123
- return decorators.find(function (d) { return d instanceof core_1.Component; });
95
+ var decorators = reflectionCapabilities.annotations(component);
96
+ return decorators.reverse().find(function (d) { return d instanceof core_1.Component; });
124
97
  };
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isComponentAlreadyDeclaredInModules = void 0;
4
4
  var core_1 = require("@angular/core");
5
+ var reflectionCapabilities = new core_1.ɵReflectionCapabilities();
5
6
  /**
6
7
  * Avoid component redeclaration
7
8
  *
@@ -27,12 +28,7 @@ exports.isComponentAlreadyDeclaredInModules = function (componentToFind, moduleD
27
28
  };
28
29
  var extractNgModuleMetadata = function (importItem) {
29
30
  var target = importItem && importItem.ngModule ? importItem.ngModule : importItem;
30
- var decoratorKey = '__annotations__';
31
- var decorators = Reflect &&
32
- Reflect.getOwnPropertyDescriptor &&
33
- Reflect.getOwnPropertyDescriptor(target, decoratorKey)
34
- ? Reflect.getOwnPropertyDescriptor(target, decoratorKey).value
35
- : target[decoratorKey];
31
+ var decorators = reflectionCapabilities.annotations(target);
36
32
  if (!decorators || decorators.length === 0) {
37
33
  return null;
38
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/angular",
3
- "version": "6.4.14",
3
+ "version": "6.4.18",
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.14",
49
- "@storybook/api": "6.4.14",
50
- "@storybook/core": "6.4.14",
51
- "@storybook/core-common": "6.4.14",
52
- "@storybook/core-events": "6.4.14",
48
+ "@storybook/addons": "6.4.18",
49
+ "@storybook/api": "6.4.18",
50
+ "@storybook/core": "6.4.18",
51
+ "@storybook/core-common": "6.4.18",
52
+ "@storybook/core-events": "6.4.18",
53
53
  "@storybook/csf": "0.0.2--canary.87bc651.0",
54
- "@storybook/node-logger": "6.4.14",
54
+ "@storybook/node-logger": "6.4.18",
55
55
  "@storybook/semver": "^7.3.2",
56
- "@storybook/store": "6.4.14",
56
+ "@storybook/store": "6.4.18",
57
57
  "@types/webpack-env": "^1.16.0",
58
58
  "autoprefixer": "^9.8.6",
59
59
  "core-js": "^3.8.2",
@@ -85,14 +85,12 @@
85
85
  "@angular/compiler": "^11.2.14",
86
86
  "@angular/compiler-cli": "^11.2.14",
87
87
  "@angular/core": "^11.2.14",
88
- "@angular/elements": "^11.2.14",
89
88
  "@angular/forms": "^11.2.14",
90
89
  "@angular/platform-browser": "^11.2.14",
91
90
  "@angular/platform-browser-dynamic": "^11.2.14",
92
91
  "@nrwl/workspace": "^11.6.3",
93
92
  "@types/autoprefixer": "^9.7.2",
94
93
  "@types/jest": "^26.0.16",
95
- "@webcomponents/custom-elements": "^1.4.3",
96
94
  "jest": "^26.6.3",
97
95
  "jest-preset-angular": "^8.3.2",
98
96
  "ts-jest": "^26.4.4"
@@ -106,13 +104,11 @@
106
104
  "@angular/compiler": ">=6.0.0",
107
105
  "@angular/compiler-cli": ">=6.0.0",
108
106
  "@angular/core": ">=6.0.0",
109
- "@angular/elements": ">=6.0.0",
110
107
  "@angular/forms": ">=6.0.0",
111
108
  "@angular/platform-browser": ">=6.0.0",
112
109
  "@angular/platform-browser-dynamic": ">=6.0.0",
113
110
  "@babel/core": "*",
114
111
  "@nrwl/workspace": ">=11.1.0",
115
- "@webcomponents/custom-elements": ">=1.4.3",
116
112
  "rxjs": "^6.0.0 || ^7.4.0",
117
113
  "typescript": "^3.4.0 || >=4.0.0",
118
114
  "zone.js": "^0.8.29 || ^0.9.0 || ^0.10.0 || ^0.11.0"
@@ -121,14 +117,8 @@
121
117
  "@angular/cli": {
122
118
  "optional": true
123
119
  },
124
- "@angular/elements": {
125
- "optional": true
126
- },
127
120
  "@nrwl/workspace": {
128
121
  "optional": true
129
- },
130
- "@webcomponents/custom-elements": {
131
- "optional": true
132
122
  }
133
123
  },
134
124
  "engines": {
@@ -138,5 +128,5 @@
138
128
  "access": "public"
139
129
  },
140
130
  "builders": "dist/ts3.9/builders/builders.json",
141
- "gitHead": "cf71c9f2b86e71f39c0d452174d84f34f86879b0"
131
+ "gitHead": "2c57c56209263201a5d3dcef473e2f6b337b931b"
142
132
  }