@angular-modernizer/api 0.1.3 → 0.2.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/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/investigation/call-graph-builder.d.ts +95 -8
- package/dist/investigation/call-graph-builder.d.ts.map +1 -1
- package/dist/investigation/call-graph-builder.js +424 -81
- package/dist/investigation/call-graph-builder.js.map +1 -1
- package/dist/investigation/codebase-searcher.d.ts +68 -0
- package/dist/investigation/codebase-searcher.d.ts.map +1 -1
- package/dist/investigation/codebase-searcher.js +154 -10
- package/dist/investigation/codebase-searcher.js.map +1 -1
- package/dist/investigation/template-usage-finder.d.ts +64 -0
- package/dist/investigation/template-usage-finder.d.ts.map +1 -0
- package/dist/investigation/template-usage-finder.js +279 -0
- package/dist/investigation/template-usage-finder.js.map +1 -0
- package/dist/investigation/template-usage-scanner.d.ts +69 -0
- package/dist/investigation/template-usage-scanner.d.ts.map +1 -0
- package/dist/investigation/template-usage-scanner.js +375 -0
- package/dist/investigation/template-usage-scanner.js.map +1 -0
- package/dist/investigation/usage-finder.d.ts +51 -5
- package/dist/investigation/usage-finder.d.ts.map +1 -1
- package/dist/investigation/usage-finder.js +129 -36
- package/dist/investigation/usage-finder.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +16 -0
- package/src/investigation/call-graph-builder.ts +528 -103
- package/src/investigation/codebase-searcher.ts +240 -11
- package/src/investigation/template-usage-finder.ts +389 -0
- package/src/investigation/template-usage-scanner.ts +529 -0
- package/src/investigation/usage-finder.ts +194 -54
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
* Uses ts-morph `findReferences()` under the hood. The project must already have
|
|
10
10
|
* the relevant source files added before calling `findUsages`.
|
|
11
11
|
*
|
|
12
|
+
* Two additional sources close gaps that would otherwise produce a false
|
|
13
|
+
* "0 usages" all-clear:
|
|
14
|
+
* - `unresolved`: same-name identifiers whose symbol does not resolve (e.g. a
|
|
15
|
+
* class still used as a type after its import was removed, TS2304).
|
|
16
|
+
* - `template`: Angular template usages (component/directive selectors, pipe
|
|
17
|
+
* names, member reads/calls/bindings) in `templateUrl` files and inline
|
|
18
|
+
* templates, see `TemplateUsageFinder`.
|
|
19
|
+
*
|
|
12
20
|
* @example
|
|
13
21
|
* ```typescript
|
|
14
22
|
* const finder = new UsageFinder(project);
|
|
@@ -16,6 +24,8 @@
|
|
|
16
24
|
* // usages[0] → { file, line, col, snippet, usageType: 'read' }
|
|
17
25
|
* ```
|
|
18
26
|
*/
|
|
27
|
+
import { Node } from 'ts-morph';
|
|
28
|
+
import { TemplateUsageFinder, } from './template-usage-finder.js';
|
|
19
29
|
/**
|
|
20
30
|
* Finds all references to named symbols across a ts-morph Project.
|
|
21
31
|
*/
|
|
@@ -35,50 +45,109 @@ export class UsageFinder {
|
|
|
35
45
|
* @returns Array of resolved usages, sorted by file path then line number.
|
|
36
46
|
*/
|
|
37
47
|
findUsages(symbol, options = {}) {
|
|
48
|
+
const declarations = this.project
|
|
49
|
+
.getSourceFiles()
|
|
50
|
+
.flatMap((sf) => this.findSymbolNodes(sf, symbol));
|
|
51
|
+
const usages = [
|
|
52
|
+
...this.findReferenceUsages(declarations),
|
|
53
|
+
...(options.includeUnresolved === false
|
|
54
|
+
? []
|
|
55
|
+
: this.findUnresolvedUsages(symbol)),
|
|
56
|
+
...(options.includeTemplates === false
|
|
57
|
+
? []
|
|
58
|
+
: this.findTemplateUsages(symbol, declarations)),
|
|
59
|
+
];
|
|
60
|
+
const fileFilter = options.file === undefined ? undefined : normalizePath(options.file);
|
|
61
|
+
return this.deduplicate(usages)
|
|
62
|
+
.filter((u) => fileFilter === undefined || normalizePath(u.file) === fileFilter)
|
|
63
|
+
.filter((u) => options.usageType === undefined || u.usageType === options.usageType)
|
|
64
|
+
.sort((a, b) => a.file === b.file ? a.line - b.line || a.col - b.col : a.file.localeCompare(b.file));
|
|
65
|
+
}
|
|
66
|
+
findReferenceUsages(declarations) {
|
|
67
|
+
const usages = [];
|
|
68
|
+
const languageService = this.project.getLanguageService();
|
|
69
|
+
for (const node of declarations) {
|
|
70
|
+
// Query by the name node: a decorated class starts at its decorator.
|
|
71
|
+
for (const refSymbol of languageService.findReferences(nameNodeOf(node))) {
|
|
72
|
+
for (const ref of refSymbol.getReferences()) {
|
|
73
|
+
const refFile = ref.getSourceFile();
|
|
74
|
+
const pos = ref.getNode().getStart();
|
|
75
|
+
const lineAndCol = refFile.getLineAndColumnAtPos(pos);
|
|
76
|
+
usages.push({
|
|
77
|
+
file: refFile.getFilePath(),
|
|
78
|
+
line: lineAndCol.line,
|
|
79
|
+
col: lineAndCol.column,
|
|
80
|
+
snippet: lineTextAt(refFile, lineAndCol.line),
|
|
81
|
+
usageType: this.classifyUsage(ref.getNode()),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return usages;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Same-name identifiers whose symbol does not resolve. The language
|
|
90
|
+
* service cannot link them to any declaration, so `findReferences` never
|
|
91
|
+
* returns them; without this pass a removed import looks like "0 usages".
|
|
92
|
+
*/
|
|
93
|
+
findUnresolvedUsages(symbol) {
|
|
38
94
|
const usages = [];
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
: this.project.getSourceFiles();
|
|
42
|
-
for (const sourceFile of sourceFiles) {
|
|
43
|
-
if (!sourceFile) {
|
|
95
|
+
for (const sf of this.project.getSourceFiles()) {
|
|
96
|
+
if (sf.isDeclarationFile() || sf.isInNodeModules()) {
|
|
44
97
|
continue;
|
|
45
98
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const refs = this.project.getLanguageService().findReferences(node);
|
|
49
|
-
for (const refSymbol of refs) {
|
|
50
|
-
for (const ref of refSymbol.getReferences()) {
|
|
51
|
-
const refFile = ref.getSourceFile();
|
|
52
|
-
const refFilePath = refFile.getFilePath();
|
|
53
|
-
if (options.file && refFilePath !== options.file) {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
const pos = ref.getNode().getStart();
|
|
57
|
-
const lineAndCol = refFile.getLineAndColumnAtPos(pos);
|
|
58
|
-
const lineText = refFile.getFullText().split('\n')[lineAndCol.line - 1] ?? '';
|
|
59
|
-
const usageType = this.classifyUsage(ref.getNode());
|
|
60
|
-
if (options.usageType && usageType !== options.usageType) {
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
usages.push({
|
|
64
|
-
file: refFilePath,
|
|
65
|
-
line: lineAndCol.line,
|
|
66
|
-
col: lineAndCol.column,
|
|
67
|
-
snippet: lineText.trim(),
|
|
68
|
-
usageType,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
99
|
+
if (!sf.getFullText().includes(symbol)) {
|
|
100
|
+
continue;
|
|
72
101
|
}
|
|
102
|
+
sf.forEachDescendant((node) => {
|
|
103
|
+
if (!Node.isIdentifier(node) || node.getText() !== symbol) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const resolved = node.getSymbol();
|
|
107
|
+
const isResolved = resolved !== undefined && resolved.getDeclarations().length > 0;
|
|
108
|
+
if (isResolved) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const { line, column } = sf.getLineAndColumnAtPos(node.getStart());
|
|
112
|
+
usages.push({
|
|
113
|
+
file: sf.getFilePath(),
|
|
114
|
+
line,
|
|
115
|
+
col: column,
|
|
116
|
+
snippet: lineTextAt(sf, line),
|
|
117
|
+
usageType: 'unresolved',
|
|
118
|
+
note: unresolvedNote(node, symbol),
|
|
119
|
+
});
|
|
120
|
+
});
|
|
73
121
|
}
|
|
74
|
-
return
|
|
122
|
+
return usages;
|
|
123
|
+
}
|
|
124
|
+
findTemplateUsages(symbol, declarations) {
|
|
125
|
+
return new TemplateUsageFinder(this.project)
|
|
126
|
+
.findTemplateUsages(symbol, declarations)
|
|
127
|
+
.map((t) => ({
|
|
128
|
+
file: t.file,
|
|
129
|
+
line: t.line,
|
|
130
|
+
col: t.col,
|
|
131
|
+
snippet: t.snippet,
|
|
132
|
+
usageType: 'template',
|
|
133
|
+
templateKind: t.templateKind,
|
|
134
|
+
templateMatch: t.templateMatch,
|
|
135
|
+
component: t.component,
|
|
136
|
+
...(t.note === undefined ? {} : { note: t.note }),
|
|
137
|
+
}));
|
|
75
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Declaration-like nodes named `symbol`. Expressions that merely carry a
|
|
141
|
+
* name (`svc.getUser` property accesses) are not declarations and would
|
|
142
|
+
* make `findReferences` resolve their receiver instead.
|
|
143
|
+
*/
|
|
76
144
|
findSymbolNodes(sourceFile, symbol) {
|
|
77
|
-
if (!sourceFile) {
|
|
78
|
-
return [];
|
|
79
|
-
}
|
|
80
145
|
const nodes = [];
|
|
81
146
|
sourceFile.forEachDescendant((node) => {
|
|
147
|
+
if (Node.isPropertyAccessExpression(node) ||
|
|
148
|
+
Node.isElementAccessExpression(node)) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
82
151
|
if ('getName' in node &&
|
|
83
152
|
typeof node.getName === 'function') {
|
|
84
153
|
if (node.getName() === symbol) {
|
|
@@ -120,7 +189,7 @@ export class UsageFinder {
|
|
|
120
189
|
deduplicate(usages) {
|
|
121
190
|
const seen = new Set();
|
|
122
191
|
return usages.filter((u) => {
|
|
123
|
-
const key = `${u.file}:${u.line}:${u.col}`;
|
|
192
|
+
const key = `${u.file}:${u.line}:${u.col}:${u.templateKind ?? ''}`;
|
|
124
193
|
if (seen.has(key)) {
|
|
125
194
|
return false;
|
|
126
195
|
}
|
|
@@ -129,4 +198,28 @@ export class UsageFinder {
|
|
|
129
198
|
});
|
|
130
199
|
}
|
|
131
200
|
}
|
|
201
|
+
function normalizePath(path) {
|
|
202
|
+
return path.replaceAll('\\', '/');
|
|
203
|
+
}
|
|
204
|
+
function lineTextAt(sourceFile, line) {
|
|
205
|
+
return (sourceFile.getFullText().split('\n')[line - 1] ?? '').trim();
|
|
206
|
+
}
|
|
207
|
+
function unresolvedNote(node, symbol) {
|
|
208
|
+
const parent = node.getParent();
|
|
209
|
+
const isMemberName = parent !== undefined &&
|
|
210
|
+
Node.isPropertyAccessExpression(parent) &&
|
|
211
|
+
parent.getNameNode() === node;
|
|
212
|
+
if (isMemberName) {
|
|
213
|
+
return (`'${symbol}' is accessed on a receiver whose type is 'any' or unresolved; ` +
|
|
214
|
+
'it may or may not refer to the searched member.');
|
|
215
|
+
}
|
|
216
|
+
return (`'${symbol}' does not resolve to any declaration (missing import or ` +
|
|
217
|
+
'removed symbol, typically TS2304/TS2552). The file still depends on it.');
|
|
218
|
+
}
|
|
219
|
+
function nameNodeOf(node) {
|
|
220
|
+
const named = node;
|
|
221
|
+
return typeof named.getNameNode === 'function'
|
|
222
|
+
? (named.getNameNode() ?? node)
|
|
223
|
+
: node;
|
|
224
|
+
}
|
|
132
225
|
//# sourceMappingURL=usage-finder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-finder.js","sourceRoot":"","sources":["../../src/investigation/usage-finder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"usage-finder.js","sourceRoot":"","sources":["../../src/investigation/usage-finder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,IAAI,EAAiC,MAAM,UAAU,CAAC;AAC/D,OAAO,EACL,mBAAmB,GAEpB,MAAM,4BAA4B,CAAC;AAoEpC;;GAEG;AACH,MAAM,OAAO,WAAW;IAIO;IAH7B;;OAEG;IACH,YAA6B,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;IAEjD;;;;;;OAMG;IACH,UAAU,CAAC,MAAc,EAAE,UAA6B,EAAE;QACxD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO;aAC9B,cAAc,EAAE;aAChB,OAAO,CA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,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACvE,CAAC;AAED,SAAS,cAAc,CAAC,IAAU,EAAE,MAAc;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAChC,MAAM,YAAY,GAChB,MAAM,KAAK,SAAS;QACpB,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC;QACvC,MAAM,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC;IAChC,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CACL,IAAI,MAAM,iEAAiE;YAC3E,iDAAiD,CAClD,CAAC;IACJ,CAAC;IACD,OAAO,CACL,IAAI,MAAM,2DAA2D;QACrE,yEAAyE,CAC1E,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,IAAU;IAC5B,MAAM,KAAK,GAAG,IAAgD,CAAC;IAC/D,OAAO,OAAO,KAAK,CAAC,WAAW,KAAK,UAAU;QAC5C,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC;QAC/B,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -28,11 +28,24 @@ export {
|
|
|
28
28
|
type UsageType,
|
|
29
29
|
type FindUsagesOptions,
|
|
30
30
|
} from './investigation/usage-finder.js';
|
|
31
|
+
export {
|
|
32
|
+
TemplateUsageFinder,
|
|
33
|
+
type TemplateSymbolUsage,
|
|
34
|
+
type TemplateMatch,
|
|
35
|
+
} from './investigation/template-usage-finder.js';
|
|
36
|
+
export {
|
|
37
|
+
scanTemplate,
|
|
38
|
+
templateMayMatch,
|
|
39
|
+
type TemplateQuery,
|
|
40
|
+
type TemplateHit,
|
|
41
|
+
type TemplateUsageKind,
|
|
42
|
+
} from './investigation/template-usage-scanner.js';
|
|
31
43
|
export {
|
|
32
44
|
CallGraphBuilder,
|
|
33
45
|
type CallNode,
|
|
34
46
|
type CallGraphOptions,
|
|
35
47
|
type CallGraphResult,
|
|
48
|
+
type CallableKind,
|
|
36
49
|
} from './investigation/call-graph-builder.js';
|
|
37
50
|
export {
|
|
38
51
|
TypeResolver,
|
|
@@ -48,4 +61,7 @@ export {
|
|
|
48
61
|
type SearchResult,
|
|
49
62
|
type SearchOptions,
|
|
50
63
|
type SymbolKind,
|
|
64
|
+
type SearchCoverage,
|
|
65
|
+
type SearchWithCoverageResult,
|
|
66
|
+
EXCLUDED_SEARCH_DIRECTORIES,
|
|
51
67
|
} from './investigation/codebase-searcher.js';
|