@storybook/angular 7.0.0-beta.43 → 7.0.0-beta.44
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/dist/client/angular-beta/StorybookWrapperComponent.js +2 -1
- package/dist/client/angular-beta/utils/PropertyExtractor.d.ts +1 -1
- package/dist/client/angular-beta/utils/PropertyExtractor.js +4 -1
- package/dist/client/angular-beta/utils/PropertyExtractor.test.js +2 -2
- package/package.json +15 -15
|
@@ -40,7 +40,7 @@ const createStorybookWrapperComponent = (selector, template, storyComponent, sty
|
|
|
40
40
|
// In ivy, a '' selector is not allowed, therefore we need to just set it to anything if
|
|
41
41
|
// storyComponent was not provided.
|
|
42
42
|
const viewChildSelector = storyComponent ?? '__storybook-noop';
|
|
43
|
-
const imports = (0, PropertyExtractor_1.extractImports)(moduleMetadata);
|
|
43
|
+
const imports = (0, PropertyExtractor_1.extractImports)(moduleMetadata, storyComponent);
|
|
44
44
|
const declarations = (0, PropertyExtractor_1.extractDeclarations)(moduleMetadata, storyComponent);
|
|
45
45
|
const providers = (0, PropertyExtractor_1.extractProviders)(moduleMetadata);
|
|
46
46
|
// Only create a new module if it doesn't already exist
|
|
@@ -135,6 +135,7 @@ const createStorybookWrapperComponent = (selector, template, storyComponent, sty
|
|
|
135
135
|
schemas: moduleMetadata.schemas,
|
|
136
136
|
}),
|
|
137
137
|
__param(0, (0, core_1.Inject)(StorybookProvider_1.STORY_PROPS)),
|
|
138
|
+
__param(1, (0, core_1.Inject)(core_1.ChangeDetectorRef)),
|
|
138
139
|
__metadata("design:paramtypes", [rxjs_1.Subject,
|
|
139
140
|
core_1.ChangeDetectorRef])
|
|
140
141
|
], StorybookWrapperComponent);
|
|
@@ -26,7 +26,7 @@ export declare const analyzeMetadata: (metadata: NgModuleMetadata) => {
|
|
|
26
26
|
* Only standalone components are imported
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
|
-
export declare const extractImports: (metadata: NgModuleMetadata) => any[];
|
|
29
|
+
export declare const extractImports: (metadata: NgModuleMetadata, storyComponent?: any) => any[];
|
|
30
30
|
/**
|
|
31
31
|
* Extract providers from NgModule
|
|
32
32
|
*
|
|
@@ -101,8 +101,11 @@ exports.analyzeMetadata = analyzeMetadata;
|
|
|
101
101
|
* Only standalone components are imported
|
|
102
102
|
*
|
|
103
103
|
*/
|
|
104
|
-
const extractImports = (metadata) => {
|
|
104
|
+
const extractImports = (metadata, storyComponent) => {
|
|
105
105
|
const { imports } = (0, exports.analyzeMetadata)(metadata);
|
|
106
|
+
if ((0, NgComponentAnalyzer_1.isStandaloneComponent)(storyComponent)) {
|
|
107
|
+
imports.push(storyComponent);
|
|
108
|
+
}
|
|
106
109
|
return uniqueArray([common_1.CommonModule, imports]);
|
|
107
110
|
};
|
|
108
111
|
exports.extractImports = extractImports;
|
|
@@ -85,8 +85,8 @@ describe('PropertyExtractor', () => {
|
|
|
85
85
|
});
|
|
86
86
|
it('should return standalone components', () => {
|
|
87
87
|
const imports = (0, PropertyExtractor_1.extractImports)({
|
|
88
|
-
imports: [TestModuleWithImportsAndProviders
|
|
89
|
-
});
|
|
88
|
+
imports: [TestModuleWithImportsAndProviders],
|
|
89
|
+
}, StandaloneTestComponent);
|
|
90
90
|
expect(imports).toEqual([common_1.CommonModule, StandaloneTestComponent]);
|
|
91
91
|
});
|
|
92
92
|
it('should not return any regular modules (they get destructured)', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.44",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"prep": "../../../scripts/prepare/tsc.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@storybook/builder-webpack5": "7.0.0-beta.
|
|
40
|
-
"@storybook/cli": "7.0.0-beta.
|
|
41
|
-
"@storybook/client-logger": "7.0.0-beta.
|
|
42
|
-
"@storybook/core-client": "7.0.0-beta.
|
|
43
|
-
"@storybook/core-common": "7.0.0-beta.
|
|
44
|
-
"@storybook/core-events": "7.0.0-beta.
|
|
45
|
-
"@storybook/core-server": "7.0.0-beta.
|
|
46
|
-
"@storybook/core-webpack": "7.0.0-beta.
|
|
47
|
-
"@storybook/docs-tools": "7.0.0-beta.
|
|
39
|
+
"@storybook/builder-webpack5": "7.0.0-beta.44",
|
|
40
|
+
"@storybook/cli": "7.0.0-beta.44",
|
|
41
|
+
"@storybook/client-logger": "7.0.0-beta.44",
|
|
42
|
+
"@storybook/core-client": "7.0.0-beta.44",
|
|
43
|
+
"@storybook/core-common": "7.0.0-beta.44",
|
|
44
|
+
"@storybook/core-events": "7.0.0-beta.44",
|
|
45
|
+
"@storybook/core-server": "7.0.0-beta.44",
|
|
46
|
+
"@storybook/core-webpack": "7.0.0-beta.44",
|
|
47
|
+
"@storybook/docs-tools": "7.0.0-beta.44",
|
|
48
48
|
"@storybook/global": "^5.0.0",
|
|
49
|
-
"@storybook/manager-api": "7.0.0-beta.
|
|
50
|
-
"@storybook/node-logger": "7.0.0-beta.
|
|
51
|
-
"@storybook/preview-api": "7.0.0-beta.
|
|
52
|
-
"@storybook/types": "7.0.0-beta.
|
|
49
|
+
"@storybook/manager-api": "7.0.0-beta.44",
|
|
50
|
+
"@storybook/node-logger": "7.0.0-beta.44",
|
|
51
|
+
"@storybook/preview-api": "7.0.0-beta.44",
|
|
52
|
+
"@storybook/types": "7.0.0-beta.44",
|
|
53
53
|
"@types/node": "^16.0.0",
|
|
54
54
|
"@types/react": "^16.14.34",
|
|
55
55
|
"@types/react-dom": "^16.9.14",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"bundler": {
|
|
124
124
|
"tsConfig": "tsconfig.build.json"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "cb3de6c33a80b366011c8081867b59985c27a666"
|
|
127
127
|
}
|