Skip to content

Commit 03876c9

Browse files
committed
improved stability when not only Components get exported
1 parent 60a0976 commit 03876c9

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tsharp/ng-component-hierarchy-visualizer",
3-
"version": "1.7.0",
3+
"version": "1.7.1",
44
"description": "generate mermaid representations of your angular component hierarchy",
55
"keywords": [
66
"angular",

scripts/template.helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const loadDependencies = (c, withNestedTemplateElements, recursionDepth) => {
3333
}
3434

3535
const importNodes = parse(fileContent, { range: true }).body
36-
.filter(n => n.type === 'ExportDefaultDeclaration' || n.type === 'ExportNamedDeclaration')?.flatMap(n => n
36+
.filter(n => (n.type === 'ExportDefaultDeclaration' || n.type === 'ExportNamedDeclaration') && n.declaration?.decorators)?.flatMap(n => n
3737
.declaration.decorators.filter(d => d.expression.callee?.name === 'Component')?.[0]
3838
.expression.arguments[0].properties.filter(n => n.key.name === 'imports')?.[0]
3939
?.value.elements);

test-data/route-definitions/ngx-admin/pages/pages.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Component } from '@angular/core';
22

33
import { MENU_ITEMS } from './pages-menu';
44

5+
export const x = 42;
6+
57
@Component({
68
selector: 'ngx-pages',
79
styleUrls: ['pages.component.scss'],

0 commit comments

Comments
 (0)