ng-di-graph 0.6.0 → 0.8.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.
- package/README.md +5 -2
- package/dist/cli/index.cjs +167 -63
- package/dist/cli/index.cjs.map +1 -1
- package/dist/core/parser.d.ts +11 -7
- package/dist/types/index.d.ts +4 -0
- package/package.json +1 -1
package/dist/core/parser.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export declare class AngularParser {
|
|
|
7
7
|
private _project?;
|
|
8
8
|
private _typeResolutionCache;
|
|
9
9
|
private _circularTypeRefs;
|
|
10
|
+
private _angularCoreImportCache;
|
|
11
|
+
private _angularInjectIdentifiersCache;
|
|
12
|
+
private _angularCoreAliasMatchers;
|
|
10
13
|
private _processingStats;
|
|
11
14
|
private _structuredWarnings;
|
|
12
15
|
constructor(_options: CliOptions, _logger?: Logger | undefined);
|
|
@@ -90,6 +93,13 @@ export declare class AngularParser {
|
|
|
90
93
|
* @returns Original decorator name if alias found, null otherwise
|
|
91
94
|
*/
|
|
92
95
|
private resolveDecoratorAlias;
|
|
96
|
+
private cacheAngularCoreAliases;
|
|
97
|
+
private buildAliasMatcher;
|
|
98
|
+
private isAngularCorePathTarget;
|
|
99
|
+
private isAngularCoreModuleSpecifier;
|
|
100
|
+
private getAngularCoreImportMap;
|
|
101
|
+
private resolveDependencyOrigin;
|
|
102
|
+
private normalizeTokenForOrigin;
|
|
93
103
|
/**
|
|
94
104
|
* Determine NodeKind from Angular decorator
|
|
95
105
|
* @param decorator Angular decorator
|
|
@@ -236,13 +246,7 @@ export declare class AngularParser {
|
|
|
236
246
|
* @returns EdgeFlags object with detected decorators
|
|
237
247
|
*/
|
|
238
248
|
private analyzeParameterDecorators;
|
|
239
|
-
|
|
240
|
-
* Check if inject() function is imported from @angular/core
|
|
241
|
-
* Prevents false positives from custom inject() functions
|
|
242
|
-
* @param sourceFile Source file to check imports
|
|
243
|
-
* @returns True if Angular inject is imported
|
|
244
|
-
*/
|
|
245
|
-
private isAngularInjectImported;
|
|
249
|
+
private getAngularInjectIdentifiers;
|
|
246
250
|
/**
|
|
247
251
|
* Analyze inject() function call expression to extract token and options
|
|
248
252
|
* Implements TDD Cycle 2.1 - Modern Angular inject() pattern support
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Based on PRD requirements in @docs/prd/mvp-requirements.md
|
|
4
4
|
*/
|
|
5
5
|
export type NodeKind = 'service' | 'component' | 'directive' | 'unknown';
|
|
6
|
+
export type NodeOrigin = 'project' | 'angular-core' | 'external';
|
|
6
7
|
export interface NodeSource {
|
|
7
8
|
filePath: string;
|
|
8
9
|
line: number;
|
|
@@ -11,6 +12,7 @@ export interface NodeSource {
|
|
|
11
12
|
export interface Node {
|
|
12
13
|
id: string;
|
|
13
14
|
kind: NodeKind;
|
|
15
|
+
origin?: NodeOrigin;
|
|
14
16
|
source?: NodeSource;
|
|
15
17
|
}
|
|
16
18
|
export interface EdgeFlags {
|
|
@@ -41,6 +43,7 @@ export interface CliOptions {
|
|
|
41
43
|
entry?: string[];
|
|
42
44
|
direction: 'upstream' | 'downstream' | 'both';
|
|
43
45
|
includeDecorators: boolean;
|
|
46
|
+
includeAngularCore?: boolean;
|
|
44
47
|
out?: string;
|
|
45
48
|
verbose: boolean;
|
|
46
49
|
}
|
|
@@ -55,6 +58,7 @@ export interface ParsedDependency {
|
|
|
55
58
|
token: string;
|
|
56
59
|
flags?: EdgeFlags;
|
|
57
60
|
parameterName: string;
|
|
61
|
+
origin?: NodeOrigin;
|
|
58
62
|
}
|
|
59
63
|
export interface ParameterAnalysisResult {
|
|
60
64
|
token: string;
|