@storybook/angular 7.0.0-beta.26 → 7.0.0-beta.27
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.
|
@@ -76,7 +76,8 @@ const isStandaloneComponent = (component) => {
|
|
|
76
76
|
const decorators = reflectionCapabilities.annotations(component);
|
|
77
77
|
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
|
|
78
78
|
// Angular deps are updated to v14.x.x.
|
|
79
|
-
return (decorators || []).some((d) => d instanceof core_1.Component
|
|
79
|
+
return (decorators || []).some((d) => (d instanceof core_1.Component || d instanceof core_1.Directive || d instanceof core_1.Pipe) &&
|
|
80
|
+
d.standalone);
|
|
80
81
|
};
|
|
81
82
|
exports.isStandaloneComponent = isStandaloneComponent;
|
|
82
83
|
/**
|
|
@@ -284,7 +284,27 @@ describe('isStandaloneComponent', () => {
|
|
|
284
284
|
}
|
|
285
285
|
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooPipe)).toEqual(false);
|
|
286
286
|
});
|
|
287
|
-
it('should return
|
|
287
|
+
it('should return true with a Directive with "standalone: true"', () => {
|
|
288
|
+
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
|
|
289
|
+
// Angular deps are updated to v14.x.x.
|
|
290
|
+
let FooDirective = class FooDirective {
|
|
291
|
+
};
|
|
292
|
+
FooDirective = __decorate([
|
|
293
|
+
(0, core_1.Directive)({ standalone: true })
|
|
294
|
+
], FooDirective);
|
|
295
|
+
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooDirective)).toEqual(true);
|
|
296
|
+
});
|
|
297
|
+
it('should return false with a Directive with "standalone: false"', () => {
|
|
298
|
+
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
|
|
299
|
+
// Angular deps are updated to v14.x.x.
|
|
300
|
+
let FooDirective = class FooDirective {
|
|
301
|
+
};
|
|
302
|
+
FooDirective = __decorate([
|
|
303
|
+
(0, core_1.Directive)({ standalone: false })
|
|
304
|
+
], FooDirective);
|
|
305
|
+
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooDirective)).toEqual(false);
|
|
306
|
+
});
|
|
307
|
+
it('should return false with Directive without the "standalone" property', () => {
|
|
288
308
|
let FooDirective = class FooDirective {
|
|
289
309
|
};
|
|
290
310
|
FooDirective = __decorate([
|
|
@@ -292,6 +312,36 @@ describe('isStandaloneComponent', () => {
|
|
|
292
312
|
], FooDirective);
|
|
293
313
|
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooDirective)).toEqual(false);
|
|
294
314
|
});
|
|
315
|
+
it('should return true with a Pipe with "standalone: true"', () => {
|
|
316
|
+
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
|
|
317
|
+
// Angular deps are updated to v14.x.x.
|
|
318
|
+
let FooPipe = class FooPipe {
|
|
319
|
+
};
|
|
320
|
+
FooPipe = __decorate([
|
|
321
|
+
(0, core_1.Pipe)({ standalone: true })
|
|
322
|
+
], FooPipe);
|
|
323
|
+
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooPipe)).toEqual(true);
|
|
324
|
+
});
|
|
325
|
+
it('should return false with a Pipe with "standalone: false"', () => {
|
|
326
|
+
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
|
|
327
|
+
// Angular deps are updated to v14.x.x.
|
|
328
|
+
let FooPipe = class FooPipe {
|
|
329
|
+
};
|
|
330
|
+
FooPipe = __decorate([
|
|
331
|
+
(0, core_1.Pipe)({ standalone: false })
|
|
332
|
+
], FooPipe);
|
|
333
|
+
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooPipe)).toEqual(false);
|
|
334
|
+
});
|
|
335
|
+
it('should return false with Pipe without the "standalone" property', () => {
|
|
336
|
+
let FooPipe = class FooPipe {
|
|
337
|
+
};
|
|
338
|
+
FooPipe = __decorate([
|
|
339
|
+
(0, core_1.Pipe)({
|
|
340
|
+
name: 'fooPipe',
|
|
341
|
+
})
|
|
342
|
+
], FooPipe);
|
|
343
|
+
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooPipe)).toEqual(false);
|
|
344
|
+
});
|
|
295
345
|
});
|
|
296
346
|
describe('getComponentDecoratorMetadata', () => {
|
|
297
347
|
it('should return Component with a Component', () => {
|
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.27",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
"prep": "../../../scripts/prepare/tsc.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@storybook/builder-webpack5": "7.0.0-beta.
|
|
40
|
-
"@storybook/client-logger": "7.0.0-beta.
|
|
41
|
-
"@storybook/core-client": "7.0.0-beta.
|
|
42
|
-
"@storybook/core-common": "7.0.0-beta.
|
|
43
|
-
"@storybook/core-events": "7.0.0-beta.
|
|
44
|
-
"@storybook/core-server": "7.0.0-beta.
|
|
45
|
-
"@storybook/core-webpack": "7.0.0-beta.
|
|
46
|
-
"@storybook/docs-tools": "7.0.0-beta.
|
|
39
|
+
"@storybook/builder-webpack5": "7.0.0-beta.27",
|
|
40
|
+
"@storybook/client-logger": "7.0.0-beta.27",
|
|
41
|
+
"@storybook/core-client": "7.0.0-beta.27",
|
|
42
|
+
"@storybook/core-common": "7.0.0-beta.27",
|
|
43
|
+
"@storybook/core-events": "7.0.0-beta.27",
|
|
44
|
+
"@storybook/core-server": "7.0.0-beta.27",
|
|
45
|
+
"@storybook/core-webpack": "7.0.0-beta.27",
|
|
46
|
+
"@storybook/docs-tools": "7.0.0-beta.27",
|
|
47
47
|
"@storybook/global": "^5.0.0",
|
|
48
|
-
"@storybook/manager-api": "7.0.0-beta.
|
|
49
|
-
"@storybook/node-logger": "7.0.0-beta.
|
|
50
|
-
"@storybook/preview-api": "7.0.0-beta.
|
|
51
|
-
"@storybook/types": "7.0.0-beta.
|
|
48
|
+
"@storybook/manager-api": "7.0.0-beta.27",
|
|
49
|
+
"@storybook/node-logger": "7.0.0-beta.27",
|
|
50
|
+
"@storybook/preview-api": "7.0.0-beta.27",
|
|
51
|
+
"@storybook/types": "7.0.0-beta.27",
|
|
52
52
|
"@types/node": "^16.0.0",
|
|
53
53
|
"@types/react": "^16.14.34",
|
|
54
54
|
"@types/react-dom": "^16.9.14",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"bundler": {
|
|
128
128
|
"tsConfig": "tsconfig.build.json"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "1abdc0888cba8f23b12a8b9a777f4af6ed15ffe2"
|
|
131
131
|
}
|