@storybook/angular 7.5.0-alpha.6 → 7.5.0
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.
|
@@ -130,7 +130,7 @@ PropertyExtractor.analyzeDecorators = (component) => {
|
|
|
130
130
|
const isDirective = decorators.some((d) => _a.isDecoratorInstanceOf(d, 'Directive'));
|
|
131
131
|
const isPipe = decorators.some((d) => _a.isDecoratorInstanceOf(d, 'Pipe'));
|
|
132
132
|
const isDeclarable = isComponent || isDirective || isPipe;
|
|
133
|
-
const isStandalone = isComponent && decorators.some((d) => d.standalone);
|
|
133
|
+
const isStandalone = (isComponent || isDirective) && decorators.some((d) => d.standalone);
|
|
134
134
|
return { isDeclarable, isStandalone };
|
|
135
135
|
};
|
|
136
136
|
PropertyExtractor.isDecoratorInstanceOf = (decorator, name) => {
|
|
@@ -18,6 +18,8 @@ const StandaloneTestComponent = (0, core_1.Component)({ standalone: true })(clas
|
|
|
18
18
|
});
|
|
19
19
|
const TestDirective = (0, core_1.Directive)({})(class {
|
|
20
20
|
});
|
|
21
|
+
const StandaloneTestDirective = (0, core_1.Directive)({ standalone: true })(class {
|
|
22
|
+
});
|
|
21
23
|
const TestModuleWithDeclarations = (0, core_1.NgModule)({ declarations: [TestComponent1] })(class {
|
|
22
24
|
});
|
|
23
25
|
const TestModuleWithImportsAndProviders = (0, core_1.NgModule)({
|
|
@@ -108,6 +110,16 @@ describe('PropertyExtractor', () => {
|
|
|
108
110
|
StandaloneTestComponent,
|
|
109
111
|
]);
|
|
110
112
|
});
|
|
113
|
+
it('should return standalone directives', () => {
|
|
114
|
+
const imports = extractImports({
|
|
115
|
+
imports: [TestModuleWithImportsAndProviders],
|
|
116
|
+
}, StandaloneTestDirective);
|
|
117
|
+
expect(imports).toEqual([
|
|
118
|
+
common_1.CommonModule,
|
|
119
|
+
TestModuleWithImportsAndProviders,
|
|
120
|
+
StandaloneTestDirective,
|
|
121
|
+
]);
|
|
122
|
+
});
|
|
111
123
|
});
|
|
112
124
|
describe('extractDeclarations', () => {
|
|
113
125
|
it('should return an array of declarations that contains `storyComponent`', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "7.5.0
|
|
3
|
+
"version": "7.5.0",
|
|
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
|
|
41
|
-
"@storybook/cli": "7.5.0
|
|
42
|
-
"@storybook/client-logger": "7.5.0
|
|
43
|
-
"@storybook/core-common": "7.5.0
|
|
44
|
-
"@storybook/core-events": "7.5.0
|
|
45
|
-
"@storybook/core-server": "7.5.0
|
|
46
|
-
"@storybook/core-webpack": "7.5.0
|
|
47
|
-
"@storybook/docs-tools": "7.5.0
|
|
40
|
+
"@storybook/builder-webpack5": "7.5.0",
|
|
41
|
+
"@storybook/cli": "7.5.0",
|
|
42
|
+
"@storybook/client-logger": "7.5.0",
|
|
43
|
+
"@storybook/core-common": "7.5.0",
|
|
44
|
+
"@storybook/core-events": "7.5.0",
|
|
45
|
+
"@storybook/core-server": "7.5.0",
|
|
46
|
+
"@storybook/core-webpack": "7.5.0",
|
|
47
|
+
"@storybook/docs-tools": "7.5.0",
|
|
48
48
|
"@storybook/global": "^5.0.0",
|
|
49
|
-
"@storybook/manager-api": "7.5.0
|
|
50
|
-
"@storybook/node-logger": "7.5.0
|
|
51
|
-
"@storybook/preview-api": "7.5.0
|
|
52
|
-
"@storybook/telemetry": "7.5.0
|
|
53
|
-
"@storybook/types": "7.5.0
|
|
49
|
+
"@storybook/manager-api": "7.5.0",
|
|
50
|
+
"@storybook/node-logger": "7.5.0",
|
|
51
|
+
"@storybook/preview-api": "7.5.0",
|
|
52
|
+
"@storybook/telemetry": "7.5.0",
|
|
53
|
+
"@storybook/types": "7.5.0",
|
|
54
54
|
"@types/node": "^18.0.0",
|
|
55
55
|
"@types/react": "^16.14.34",
|
|
56
56
|
"@types/react-dom": "^16.9.14",
|