Skip to content

Commit 9fdac1c

Browse files
committed
feat: extends
1 parent 0de8d22 commit 9fdac1c

14 files changed

Lines changed: 103 additions & 1 deletion

src/converters/component/component.converter.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ describe('Component converter', () => {
1717
implementation: '',
1818
template: '',
1919
styles: '',
20+
extends: [],
2021
methods: [],
2122
methodsPublicExplicit: [],
2223
fieldsPublicExplicit: [],
@@ -34,6 +35,7 @@ describe('Component converter', () => {
3435
implementation: '',
3536
template: '',
3637
styles: '',
38+
extends: [],
3739
methods: [],
3840
methodsPublicExplicit: [],
3941
fieldsPublicExplicit: [],
@@ -51,6 +53,7 @@ describe('Component converter', () => {
5153
implementation: '',
5254
template: '',
5355
styles: '',
56+
extends: [],
5457
methods: [],
5558
methodsPublicExplicit: [],
5659
fieldsPublicExplicit: [],

src/converters/directive/directive.converter.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe('Directive converter', () => {
1414
inputs: [],
1515
outputs: [],
1616
implementation: '',
17+
extends: [],
1718
methods: [],
1819
methodsPublicExplicit: [],
1920
fieldsPublicExplicit: [],
@@ -28,6 +29,7 @@ describe('Directive converter', () => {
2829
inputs: [],
2930
outputs: [],
3031
implementation: '',
32+
extends: [],
3133
methods: [],
3234
methodsPublicExplicit: [],
3335
fieldsPublicExplicit: [],
@@ -42,6 +44,7 @@ describe('Directive converter', () => {
4244
inputs: [],
4345
outputs: [],
4446
implementation: '',
47+
extends: [],
4548
methods: [],
4649
methodsPublicExplicit: [],
4750
fieldsPublicExplicit: [],

src/converters/service/service.converter.component.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe('Service stats converter', () => {
99
className: 'first',
1010
type: NgParselOutputType.SERVICE,
1111
filePath: '',
12+
extends: [],
1213
fieldsPublicExplicit: [],
1314
methods: [],
1415
methodsPublicExplicit: [],
@@ -17,6 +18,7 @@ describe('Service stats converter', () => {
1718
className: 'second',
1819
type: NgParselOutputType.SERVICE,
1920
filePath: '',
21+
extends: [],
2022
fieldsPublicExplicit: [],
2123
methods: [],
2224
methodsPublicExplicit: [],
@@ -25,6 +27,7 @@ describe('Service stats converter', () => {
2527
className: 'third',
2628
type: NgParselOutputType.SERVICE,
2729
filePath: '',
30+
extends: [],
2831
fieldsPublicExplicit: [],
2932
methods: [],
3033
methodsPublicExplicit: [],

src/parser/component/component.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface NgParselComponent extends NgParselOutput {
88
selector: string;
99
standalone: boolean;
1010
cva: boolean;
11+
extends: string[];
1112
onPush: boolean;
1213
inputs: NgParselFieldDecorator[];
1314
outputs: NgParselFieldDecorator[];

src/parser/component/component.parser.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe('ComponentParser', () => {
4040
selector: 'my-test-comp',
4141
standalone: false,
4242
cva: false,
43+
extends: [],
4344
onPush: false,
4445
template: inlineTemplate,
4546
styles: [styles],
@@ -133,6 +134,7 @@ describe('ComponentParser', () => {
133134
selector: 'my-test-comp',
134135
standalone: true,
135136
cva: false,
137+
extends: [],
136138
onPush: false,
137139
template: inlineTemplate,
138140
styles: [styles],

src/parser/component/component.parser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as ts from 'typescript';
44
import { tsquery } from '@phenomnomnominal/tsquery';
55

66
import { isCva } from '../shared/parser/cva.parser.js';
7+
import { parseExtends } from '../shared/parser/extends.parser.js';
78
import { NgParselOutputType } from '../shared/model/types.model.js';
89
import { parseInputsAndOutputs } from '../shared/parser/field-decorator.parser.js';
910
import { getDecoratorProperties } from '../shared/parser/decorator.parser.js';
@@ -33,6 +34,7 @@ export function parseComponent(ast: ts.SourceFile, componentFilePath: string): N
3334
filePath: componentFilePath,
3435
selector: componentDecorators.selector as string,
3536
standalone: componentDecorators.standalone || false,
37+
extends: parseExtends(ast),
3638
template: template,
3739
cva: isCva(ast),
3840
onPush: isOnPushChangeDetection(ast),

src/parser/directive/directive.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface NgParselDirective extends NgParselOutput {
77
className: string;
88
selector: string;
99
standalone: boolean;
10+
extends: string[];
1011
cva: boolean;
1112
implementation: string;
1213
inputs: NgParselFieldDecorator[];

src/parser/directive/directive.parser.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ describe('DirectiveParser', () => {
3232
selector: '[myTestDirective]',
3333
standalone: false,
3434
cva: false,
35+
extends: [],
3536
inputs: [
3637
{
3738
decorator: '@Input()',
@@ -90,6 +91,7 @@ describe('DirectiveParser', () => {
9091
selector: '[myTestDirective]',
9192
standalone: true,
9293
cva: false,
94+
extends: [],
9395
inputs: [
9496
{
9597
decorator: '@Input()',

src/parser/directive/directive.parser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { parseClassName, parseClassJsDoc } from '../shared/parser/class.parser.j
1010
import { parseExplicitPublicMethods, parseMethods } from '../shared/parser/method.parser.js';
1111

1212
import { NgParselDirective } from './directive.model.js';
13+
import { parseExtends } from '../shared/parser/extends.parser.js';
1314

1415
export function parseDirective(ast: ts.SourceFile, directiveFilePath: string): NgParselDirective {
1516
const directiveDecorators = getDecoratorProperties(ast);
@@ -24,6 +25,7 @@ export function parseDirective(ast: ts.SourceFile, directiveFilePath: string): N
2425
filePath: directiveFilePath,
2526
selector: directiveDecorators.selector as string,
2627
standalone: directiveDecorators.standalone || false,
28+
extends: parseExtends(ast),
2729
cva: isCva(ast),
2830
implementation: directiveImplementation,
2931
inputs: inputsAndOutputs.inputs,

src/parser/services/service.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { NgParselMethod } from '../shared/model/method.model.js';
33
import { NgParselField } from '../shared/model/field.model.js';
44

55
export interface NgParselService extends NgParselOutput {
6+
extends: string[];
67
fieldsPublicExplicit: NgParselField[];
78
methods: NgParselMethod[];
89
methodsPublicExplicit: NgParselMethod[];

0 commit comments

Comments
 (0)