code-kg 0.1.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/LICENSE +21 -0
- package/README.md +100 -0
- package/dist/cli/index.d.ts +14 -0
- package/dist/cli/index.js +68 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/codekg-config.d.ts +14 -0
- package/dist/codekg-config.js +81 -0
- package/dist/codekg-config.js.map +1 -0
- package/dist/commands/graph.d.ts +7 -0
- package/dist/commands/graph.js +49 -0
- package/dist/commands/graph.js.map +1 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.js +13 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/insights.d.ts +7 -0
- package/dist/commands/insights.js +31 -0
- package/dist/commands/insights.js.map +1 -0
- package/dist/commands/path.d.ts +7 -0
- package/dist/commands/path.js +47 -0
- package/dist/commands/path.js.map +1 -0
- package/dist/commands/reindex.d.ts +6 -0
- package/dist/commands/reindex.js +13 -0
- package/dist/commands/reindex.js.map +1 -0
- package/dist/commands/run.d.ts +6 -0
- package/dist/commands/run.js +20 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/serve.d.ts +8 -0
- package/dist/commands/serve.js +25 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/config/defaults.d.ts +6 -0
- package/dist/config/defaults.js +30 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +602 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer/babel-fallback.d.ts +7 -0
- package/dist/indexer/babel-fallback.js +583 -0
- package/dist/indexer/babel-fallback.js.map +1 -0
- package/dist/indexer/file-discovery.d.ts +6 -0
- package/dist/indexer/file-discovery.js +106 -0
- package/dist/indexer/file-discovery.js.map +1 -0
- package/dist/indexer/indexer.d.ts +90 -0
- package/dist/indexer/indexer.js +620 -0
- package/dist/indexer/indexer.js.map +1 -0
- package/dist/indexer/metrics.d.ts +39 -0
- package/dist/indexer/metrics.js +147 -0
- package/dist/indexer/metrics.js.map +1 -0
- package/dist/indexer/structure-detector.d.ts +16 -0
- package/dist/indexer/structure-detector.js +159 -0
- package/dist/indexer/structure-detector.js.map +1 -0
- package/dist/indexer/ts-parser.d.ts +86 -0
- package/dist/indexer/ts-parser.js +437 -0
- package/dist/indexer/ts-parser.js.map +1 -0
- package/dist/model/edge.d.ts +21 -0
- package/dist/model/edge.js +25 -0
- package/dist/model/edge.js.map +1 -0
- package/dist/model/graph.d.ts +10 -0
- package/dist/model/graph.js +20 -0
- package/dist/model/graph.js.map +1 -0
- package/dist/model/node.d.ts +24 -0
- package/dist/model/node.js +22 -0
- package/dist/model/node.js.map +1 -0
- package/dist/query/query-dsl.d.ts +17 -0
- package/dist/query/query-dsl.js +75 -0
- package/dist/query/query-dsl.js.map +1 -0
- package/dist/query/query-engine.d.ts +32 -0
- package/dist/query/query-engine.js +126 -0
- package/dist/query/query-engine.js.map +1 -0
- package/dist/server/api.d.ts +19 -0
- package/dist/server/api.js +29 -0
- package/dist/server/api.js.map +1 -0
- package/dist/server/app.d.ts +7 -0
- package/dist/server/app.js +509 -0
- package/dist/server/app.js.map +1 -0
- package/dist/server/graph-controller.d.ts +147 -0
- package/dist/server/graph-controller.js +186 -0
- package/dist/server/graph-controller.js.map +1 -0
- package/dist/server/routes.d.ts +3 -0
- package/dist/server/routes.js +19 -0
- package/dist/server/routes.js.map +1 -0
- package/dist/server/ui.d.ts +1 -0
- package/dist/server/ui.js +1165 -0
- package/dist/server/ui.js.map +1 -0
- package/dist/store/sqlite-store.d.ts +83 -0
- package/dist/store/sqlite-store.js +647 -0
- package/dist/store/sqlite-store.js.map +1 -0
- package/dist/utils/ids.d.ts +2 -0
- package/dist/utils/ids.js +9 -0
- package/dist/utils/ids.js.map +1 -0
- package/dist/utils/path.d.ts +3 -0
- package/dist/utils/path.js +21 -0
- package/dist/utils/path.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.parseWithTypeScript = parseWithTypeScript;
|
|
37
|
+
const path = __importStar(require("node:path"));
|
|
38
|
+
const EXPRESS_ROUTE_METHODS = new Set([
|
|
39
|
+
"get",
|
|
40
|
+
"post",
|
|
41
|
+
"put",
|
|
42
|
+
"patch",
|
|
43
|
+
"delete",
|
|
44
|
+
"options",
|
|
45
|
+
"head",
|
|
46
|
+
"all",
|
|
47
|
+
"use",
|
|
48
|
+
]);
|
|
49
|
+
function dynamicRequire(moduleName) {
|
|
50
|
+
try {
|
|
51
|
+
const req = (0, eval)("require");
|
|
52
|
+
return req(moduleName);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function getScriptKind(ts, filePath) {
|
|
59
|
+
const extension = path.extname(filePath).toLowerCase();
|
|
60
|
+
switch (extension) {
|
|
61
|
+
case ".tsx":
|
|
62
|
+
return ts.ScriptKind.TSX;
|
|
63
|
+
case ".jsx":
|
|
64
|
+
return ts.ScriptKind.JSX;
|
|
65
|
+
case ".js":
|
|
66
|
+
return ts.ScriptKind.JS;
|
|
67
|
+
case ".ts":
|
|
68
|
+
default:
|
|
69
|
+
return ts.ScriptKind.TS;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function nodeLoc(ts, sourceFile, node) {
|
|
73
|
+
try {
|
|
74
|
+
const start = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile, false));
|
|
75
|
+
const end = sourceFile.getLineAndCharacterOfPosition(node.getEnd());
|
|
76
|
+
return {
|
|
77
|
+
line: start.line + 1,
|
|
78
|
+
column: start.character + 1,
|
|
79
|
+
endLine: end.line + 1,
|
|
80
|
+
endColumn: end.character + 1,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function hasModifier(ts, node, kind) {
|
|
88
|
+
if (!node || !Array.isArray(node.modifiers)) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
return node.modifiers.some((modifier) => modifier.kind === kind);
|
|
92
|
+
}
|
|
93
|
+
function isExported(ts, node) {
|
|
94
|
+
return hasModifier(ts, node, ts.SyntaxKind.ExportKeyword);
|
|
95
|
+
}
|
|
96
|
+
function isDefaultExport(ts, node) {
|
|
97
|
+
return hasModifier(ts, node, ts.SyntaxKind.DefaultKeyword);
|
|
98
|
+
}
|
|
99
|
+
function collectBindingNames(ts, bindingName, names) {
|
|
100
|
+
if (!bindingName) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (ts.isIdentifier(bindingName)) {
|
|
104
|
+
names.push(bindingName.text);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (ts.isObjectBindingPattern(bindingName) || ts.isArrayBindingPattern(bindingName)) {
|
|
108
|
+
for (const element of bindingName.elements ?? []) {
|
|
109
|
+
if (ts.isBindingElement(element)) {
|
|
110
|
+
collectBindingNames(ts, element.name, names);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function maybeStringLiteral(ts, node) {
|
|
116
|
+
if (!node) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
if (ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) {
|
|
120
|
+
return node.text;
|
|
121
|
+
}
|
|
122
|
+
if (ts.isTemplateExpression(node) && node.templateSpans.length === 0) {
|
|
123
|
+
return node.head.text;
|
|
124
|
+
}
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
function diagnosticMessage(ts, diagnostic) {
|
|
128
|
+
if (!diagnostic) {
|
|
129
|
+
return "Unknown parser diagnostic.";
|
|
130
|
+
}
|
|
131
|
+
if (typeof diagnostic.messageText === "string") {
|
|
132
|
+
return diagnostic.messageText;
|
|
133
|
+
}
|
|
134
|
+
return ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
135
|
+
}
|
|
136
|
+
function isDeclarationIdentifier(ts, node, parent) {
|
|
137
|
+
if (!parent || !node) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if ((ts.isFunctionDeclaration(parent) && parent.name === node) ||
|
|
141
|
+
(ts.isClassDeclaration(parent) && parent.name === node) ||
|
|
142
|
+
(ts.isInterfaceDeclaration(parent) && parent.name === node) ||
|
|
143
|
+
(ts.isTypeAliasDeclaration(parent) && parent.name === node) ||
|
|
144
|
+
(ts.isVariableDeclaration(parent) && parent.name === node) ||
|
|
145
|
+
(ts.isParameter(parent) && parent.name === node) ||
|
|
146
|
+
(ts.isImportClause(parent) && parent.name === node) ||
|
|
147
|
+
(ts.isImportSpecifier(parent) && (parent.name === node || parent.propertyName === node)) ||
|
|
148
|
+
(ts.isNamespaceImport(parent) && parent.name === node) ||
|
|
149
|
+
(ts.isExportSpecifier(parent) && (parent.name === node || parent.propertyName === node)) ||
|
|
150
|
+
(ts.isPropertyAssignment(parent) && parent.name === node) ||
|
|
151
|
+
(ts.isPropertyDeclaration(parent) && parent.name === node)) {
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
function getHandlerName(ts, node, sourceFile) {
|
|
157
|
+
if (!node) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
if (ts.isIdentifier(node)) {
|
|
161
|
+
return node.text;
|
|
162
|
+
}
|
|
163
|
+
if (ts.isFunctionExpression(node) || ts.isArrowFunction(node)) {
|
|
164
|
+
return node.name?.text ?? "<anonymous>";
|
|
165
|
+
}
|
|
166
|
+
try {
|
|
167
|
+
return node.getText(sourceFile);
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function parseWithTypeScript(filePath, fileContent) {
|
|
174
|
+
const ts = dynamicRequire("typescript");
|
|
175
|
+
if (!ts) {
|
|
176
|
+
return {
|
|
177
|
+
success: false,
|
|
178
|
+
diagnosticsCount: 0,
|
|
179
|
+
error: "TypeScript compiler API not available.",
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
try {
|
|
183
|
+
const sourceFile = ts.createSourceFile(filePath, fileContent, ts.ScriptTarget.Latest, true, getScriptKind(ts, filePath));
|
|
184
|
+
const diagnostics = sourceFile.parseDiagnostics ?? [];
|
|
185
|
+
if (diagnostics.length > 0) {
|
|
186
|
+
return {
|
|
187
|
+
success: false,
|
|
188
|
+
diagnosticsCount: diagnostics.length,
|
|
189
|
+
error: diagnosticMessage(ts, diagnostics[0]),
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
const extraction = {
|
|
193
|
+
filePath,
|
|
194
|
+
parser: "typescript",
|
|
195
|
+
imports: [],
|
|
196
|
+
exports: [],
|
|
197
|
+
functions: [],
|
|
198
|
+
classes: [],
|
|
199
|
+
interfaces: [],
|
|
200
|
+
variables: [],
|
|
201
|
+
references: [],
|
|
202
|
+
calls: [],
|
|
203
|
+
routes: [],
|
|
204
|
+
};
|
|
205
|
+
const visit = (node, parent) => {
|
|
206
|
+
if (ts.isImportDeclaration(node)) {
|
|
207
|
+
const source = maybeStringLiteral(ts, node.moduleSpecifier);
|
|
208
|
+
if (source) {
|
|
209
|
+
const specifiers = [];
|
|
210
|
+
const importClause = node.importClause;
|
|
211
|
+
if (importClause?.name) {
|
|
212
|
+
specifiers.push("default");
|
|
213
|
+
}
|
|
214
|
+
const namedBindings = importClause?.namedBindings;
|
|
215
|
+
if (namedBindings) {
|
|
216
|
+
if (ts.isNamespaceImport(namedBindings)) {
|
|
217
|
+
specifiers.push("*");
|
|
218
|
+
}
|
|
219
|
+
else if (ts.isNamedImports(namedBindings)) {
|
|
220
|
+
for (const element of namedBindings.elements) {
|
|
221
|
+
specifiers.push(element.name.text);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
extraction.imports.push({
|
|
226
|
+
source,
|
|
227
|
+
specifiers,
|
|
228
|
+
isTypeOnly: Boolean(importClause?.isTypeOnly),
|
|
229
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (ts.isImportEqualsDeclaration(node)) {
|
|
234
|
+
if (ts.isExternalModuleReference(node.moduleReference) &&
|
|
235
|
+
node.moduleReference.expression &&
|
|
236
|
+
ts.isStringLiteral(node.moduleReference.expression)) {
|
|
237
|
+
extraction.imports.push({
|
|
238
|
+
source: node.moduleReference.expression.text,
|
|
239
|
+
specifiers: node.name ? [node.name.text] : [],
|
|
240
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (ts.isVariableDeclaration(node) &&
|
|
245
|
+
node.initializer &&
|
|
246
|
+
ts.isCallExpression(node.initializer) &&
|
|
247
|
+
ts.isIdentifier(node.initializer.expression) &&
|
|
248
|
+
node.initializer.expression.text === "require" &&
|
|
249
|
+
node.initializer.arguments.length > 0) {
|
|
250
|
+
const source = maybeStringLiteral(ts, node.initializer.arguments[0]);
|
|
251
|
+
if (source) {
|
|
252
|
+
const specifiers = [];
|
|
253
|
+
collectBindingNames(ts, node.name, specifiers);
|
|
254
|
+
extraction.imports.push({
|
|
255
|
+
source,
|
|
256
|
+
specifiers: specifiers.length > 0 ? specifiers : ["default"],
|
|
257
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (ts.isExportDeclaration(node)) {
|
|
262
|
+
const from = maybeStringLiteral(ts, node.moduleSpecifier);
|
|
263
|
+
const exportClause = node.exportClause;
|
|
264
|
+
if (exportClause && ts.isNamedExports(exportClause)) {
|
|
265
|
+
for (const element of exportClause.elements) {
|
|
266
|
+
extraction.exports.push({
|
|
267
|
+
name: element.name.text,
|
|
268
|
+
localName: element.propertyName?.text,
|
|
269
|
+
kind: from ? "reexport" : "named",
|
|
270
|
+
from,
|
|
271
|
+
isTypeOnly: Boolean(element.isTypeOnly || node.isTypeOnly),
|
|
272
|
+
loc: nodeLoc(ts, sourceFile, element),
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
extraction.exports.push({
|
|
278
|
+
name: "*",
|
|
279
|
+
kind: "all",
|
|
280
|
+
from,
|
|
281
|
+
isTypeOnly: Boolean(node.isTypeOnly),
|
|
282
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (ts.isExportAssignment(node)) {
|
|
287
|
+
extraction.exports.push({
|
|
288
|
+
name: "default",
|
|
289
|
+
kind: "default",
|
|
290
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
if (ts.isFunctionDeclaration(node)) {
|
|
294
|
+
const functionName = node.name?.text ?? "<anonymous>";
|
|
295
|
+
const exported = isExported(ts, node);
|
|
296
|
+
const defaultExport = isDefaultExport(ts, node);
|
|
297
|
+
extraction.functions.push({
|
|
298
|
+
name: functionName,
|
|
299
|
+
exported,
|
|
300
|
+
async: Boolean(node.modifiers?.some((mod) => mod.kind === ts.SyntaxKind.AsyncKeyword)),
|
|
301
|
+
generator: Boolean(node.asteriskToken),
|
|
302
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
303
|
+
});
|
|
304
|
+
if (exported) {
|
|
305
|
+
extraction.exports.push({
|
|
306
|
+
name: defaultExport ? "default" : functionName,
|
|
307
|
+
kind: defaultExport ? "default" : "named",
|
|
308
|
+
localName: functionName,
|
|
309
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (ts.isClassDeclaration(node)) {
|
|
314
|
+
const className = node.name?.text ?? "<anonymous-class>";
|
|
315
|
+
const exported = isExported(ts, node);
|
|
316
|
+
const defaultExport = isDefaultExport(ts, node);
|
|
317
|
+
extraction.classes.push({
|
|
318
|
+
name: className,
|
|
319
|
+
exported,
|
|
320
|
+
extends: node.heritageClauses
|
|
321
|
+
?.find((clause) => clause.token === ts.SyntaxKind.ExtendsKeyword)
|
|
322
|
+
?.types?.[0]
|
|
323
|
+
?.expression?.getText(sourceFile) ?? undefined,
|
|
324
|
+
implements: node.heritageClauses
|
|
325
|
+
?.find((clause) => clause.token === ts.SyntaxKind.ImplementsKeyword)
|
|
326
|
+
?.types?.map((typeNode) => typeNode.expression.getText(sourceFile)) ?? undefined,
|
|
327
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
328
|
+
});
|
|
329
|
+
if (exported) {
|
|
330
|
+
extraction.exports.push({
|
|
331
|
+
name: defaultExport ? "default" : className,
|
|
332
|
+
kind: defaultExport ? "default" : "named",
|
|
333
|
+
localName: className,
|
|
334
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (ts.isInterfaceDeclaration(node)) {
|
|
339
|
+
const exported = isExported(ts, node);
|
|
340
|
+
extraction.interfaces.push({
|
|
341
|
+
name: node.name.text,
|
|
342
|
+
exported,
|
|
343
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
344
|
+
});
|
|
345
|
+
if (exported) {
|
|
346
|
+
extraction.exports.push({
|
|
347
|
+
name: node.name.text,
|
|
348
|
+
kind: "named",
|
|
349
|
+
localName: node.name.text,
|
|
350
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
if (ts.isVariableStatement(node)) {
|
|
355
|
+
const exported = isExported(ts, node);
|
|
356
|
+
const declarationKind = node.declarationList.flags & ts.NodeFlags.Const
|
|
357
|
+
? "const"
|
|
358
|
+
: node.declarationList.flags & ts.NodeFlags.Let
|
|
359
|
+
? "let"
|
|
360
|
+
: "var";
|
|
361
|
+
for (const declaration of node.declarationList.declarations) {
|
|
362
|
+
const names = [];
|
|
363
|
+
collectBindingNames(ts, declaration.name, names);
|
|
364
|
+
for (const variableName of names) {
|
|
365
|
+
extraction.variables.push({
|
|
366
|
+
name: variableName,
|
|
367
|
+
kind: declarationKind,
|
|
368
|
+
exported,
|
|
369
|
+
loc: nodeLoc(ts, sourceFile, declaration),
|
|
370
|
+
});
|
|
371
|
+
if (exported) {
|
|
372
|
+
extraction.exports.push({
|
|
373
|
+
name: variableName,
|
|
374
|
+
kind: "named",
|
|
375
|
+
localName: variableName,
|
|
376
|
+
loc: nodeLoc(ts, sourceFile, declaration),
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (ts.isCallExpression(node)) {
|
|
383
|
+
let callee = "<unknown>";
|
|
384
|
+
try {
|
|
385
|
+
callee = node.expression.getText(sourceFile);
|
|
386
|
+
}
|
|
387
|
+
catch {
|
|
388
|
+
callee = "<unknown>";
|
|
389
|
+
}
|
|
390
|
+
extraction.calls.push({
|
|
391
|
+
callee,
|
|
392
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
393
|
+
});
|
|
394
|
+
if (ts.isPropertyAccessExpression(node.expression)) {
|
|
395
|
+
const methodName = node.expression.name.getText(sourceFile).toLowerCase();
|
|
396
|
+
if (EXPRESS_ROUTE_METHODS.has(methodName)) {
|
|
397
|
+
const routePath = maybeStringLiteral(ts, node.arguments[0]);
|
|
398
|
+
const baseObject = node.expression.expression.getText(sourceFile);
|
|
399
|
+
if (routePath && /(^|\.)(app|router|server)$/i.test(baseObject)) {
|
|
400
|
+
extraction.routes.push({
|
|
401
|
+
framework: "express",
|
|
402
|
+
method: methodName.toUpperCase(),
|
|
403
|
+
path: routePath,
|
|
404
|
+
kind: "handler",
|
|
405
|
+
filePath,
|
|
406
|
+
handlerName: getHandlerName(ts, node.arguments[1], sourceFile),
|
|
407
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
if (ts.isIdentifier(node) && !isDeclarationIdentifier(ts, node, parent)) {
|
|
414
|
+
extraction.references.push({
|
|
415
|
+
name: node.text,
|
|
416
|
+
kind: "identifier",
|
|
417
|
+
loc: nodeLoc(ts, sourceFile, node),
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
ts.forEachChild(node, (child) => visit(child, node));
|
|
421
|
+
};
|
|
422
|
+
visit(sourceFile);
|
|
423
|
+
return {
|
|
424
|
+
success: true,
|
|
425
|
+
diagnosticsCount: 0,
|
|
426
|
+
extraction,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
catch (error) {
|
|
430
|
+
return {
|
|
431
|
+
success: false,
|
|
432
|
+
diagnosticsCount: 0,
|
|
433
|
+
error: error instanceof Error ? error.message : String(error),
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
//# sourceMappingURL=ts-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ts-parser.js","sourceRoot":"","sources":["../../src/indexer/ts-parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsPA,kDAuSC;AA7hBD,gDAAkC;AAoGlC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,KAAK;IACL,MAAM;IACN,KAAK;IACL,OAAO;IACP,QAAQ;IACR,SAAS;IACT,MAAM;IACN,KAAK;IACL,KAAK;CACN,CAAC,CAAC;AAEH,SAAS,cAAc,CAAC,UAAkB;IACxC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,SAAS,CAA0B,CAAC;QAC1D,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,EAAO,EAAE,QAAgB;IAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QA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;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { JsonValue } from "./node";
|
|
2
|
+
export declare enum EdgeType {
|
|
3
|
+
CONTAINS = "CONTAINS",
|
|
4
|
+
IMPORTS = "IMPORTS",
|
|
5
|
+
EXPORTS = "EXPORTS",
|
|
6
|
+
DEFINES = "DEFINES",
|
|
7
|
+
REFERENCES = "REFERENCES",
|
|
8
|
+
CALLS = "CALLS",
|
|
9
|
+
EXTENDS = "EXTENDS",
|
|
10
|
+
IMPLEMENTS = "IMPLEMENTS",
|
|
11
|
+
HANDLES_ROUTE = "HANDLES_ROUTE",
|
|
12
|
+
DEPENDS_ON = "DEPENDS_ON"
|
|
13
|
+
}
|
|
14
|
+
export interface GraphEdge {
|
|
15
|
+
id: string;
|
|
16
|
+
source: string;
|
|
17
|
+
target: string;
|
|
18
|
+
type: EdgeType;
|
|
19
|
+
json_props?: Record<string, JsonValue>;
|
|
20
|
+
}
|
|
21
|
+
export declare const createGraphEdge: (id: string, source: string, target: string, type: EdgeType, jsonProps?: Record<string, JsonValue>) => GraphEdge;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createGraphEdge = exports.EdgeType = void 0;
|
|
4
|
+
var EdgeType;
|
|
5
|
+
(function (EdgeType) {
|
|
6
|
+
EdgeType["CONTAINS"] = "CONTAINS";
|
|
7
|
+
EdgeType["IMPORTS"] = "IMPORTS";
|
|
8
|
+
EdgeType["EXPORTS"] = "EXPORTS";
|
|
9
|
+
EdgeType["DEFINES"] = "DEFINES";
|
|
10
|
+
EdgeType["REFERENCES"] = "REFERENCES";
|
|
11
|
+
EdgeType["CALLS"] = "CALLS";
|
|
12
|
+
EdgeType["EXTENDS"] = "EXTENDS";
|
|
13
|
+
EdgeType["IMPLEMENTS"] = "IMPLEMENTS";
|
|
14
|
+
EdgeType["HANDLES_ROUTE"] = "HANDLES_ROUTE";
|
|
15
|
+
EdgeType["DEPENDS_ON"] = "DEPENDS_ON";
|
|
16
|
+
})(EdgeType || (exports.EdgeType = EdgeType = {}));
|
|
17
|
+
const createGraphEdge = (id, source, target, type, jsonProps = {}) => ({
|
|
18
|
+
id,
|
|
19
|
+
source,
|
|
20
|
+
target,
|
|
21
|
+
type,
|
|
22
|
+
json_props: jsonProps
|
|
23
|
+
});
|
|
24
|
+
exports.createGraphEdge = createGraphEdge;
|
|
25
|
+
//# sourceMappingURL=edge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge.js","sourceRoot":"","sources":["../../src/model/edge.ts"],"names":[],"mappings":";;;AAEA,IAAY,QAWX;AAXD,WAAY,QAAQ;IAClB,iCAAqB,CAAA;IACrB,+BAAmB,CAAA;IACnB,+BAAmB,CAAA;IACnB,+BAAmB,CAAA;IACnB,qCAAyB,CAAA;IACzB,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,qCAAyB,CAAA;IACzB,2CAA+B,CAAA;IAC/B,qCAAyB,CAAA;AAC3B,CAAC,EAXW,QAAQ,wBAAR,QAAQ,QAWnB;AAUM,MAAM,eAAe,GAAG,CAC7B,EAAU,EACV,MAAc,EACd,MAAc,EACd,IAAc,EACd,YAAuC,EAAE,EAC9B,EAAE,CAAC,CAAC;IACf,EAAE;IACF,MAAM;IACN,MAAM;IACN,IAAI;IACJ,UAAU,EAAE,SAAS;CACtB,CAAC,CAAC;AAZU,QAAA,eAAe,mBAYzB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GraphEdge } from "./edge";
|
|
2
|
+
import type { GraphNode, JsonValue } from "./node";
|
|
3
|
+
export interface GraphData {
|
|
4
|
+
nodes: GraphNode[];
|
|
5
|
+
edges: GraphEdge[];
|
|
6
|
+
json_props?: Record<string, JsonValue>;
|
|
7
|
+
}
|
|
8
|
+
export declare const createGraphData: (jsonProps?: Record<string, JsonValue>) => GraphData;
|
|
9
|
+
export declare const addGraphNode: (graph: GraphData, node: GraphNode) => GraphData;
|
|
10
|
+
export declare const addGraphEdge: (graph: GraphData, edge: GraphEdge) => GraphData;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addGraphEdge = exports.addGraphNode = exports.createGraphData = void 0;
|
|
4
|
+
const createGraphData = (jsonProps = {}) => ({
|
|
5
|
+
nodes: [],
|
|
6
|
+
edges: [],
|
|
7
|
+
json_props: jsonProps
|
|
8
|
+
});
|
|
9
|
+
exports.createGraphData = createGraphData;
|
|
10
|
+
const addGraphNode = (graph, node) => ({
|
|
11
|
+
...graph,
|
|
12
|
+
nodes: [...graph.nodes, node]
|
|
13
|
+
});
|
|
14
|
+
exports.addGraphNode = addGraphNode;
|
|
15
|
+
const addGraphEdge = (graph, edge) => ({
|
|
16
|
+
...graph,
|
|
17
|
+
edges: [...graph.edges, edge]
|
|
18
|
+
});
|
|
19
|
+
exports.addGraphEdge = addGraphEdge;
|
|
20
|
+
//# sourceMappingURL=graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../src/model/graph.ts"],"names":[],"mappings":";;;AASO,MAAM,eAAe,GAAG,CAC7B,YAAuC,EAAE,EAC9B,EAAE,CAAC,CAAC;IACf,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,UAAU,EAAE,SAAS;CACtB,CAAC,CAAC;AANU,QAAA,eAAe,mBAMzB;AAEI,MAAM,YAAY,GAAG,CAAC,KAAgB,EAAE,IAAe,EAAa,EAAE,CAAC,CAAC;IAC7E,GAAG,KAAK;IACR,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC;CAC9B,CAAC,CAAC;AAHU,QAAA,YAAY,gBAGtB;AAEI,MAAM,YAAY,GAAG,CAAC,KAAgB,EAAE,IAAe,EAAa,EAAE,CAAC,CAAC;IAC7E,GAAG,KAAK;IACR,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC;CAC9B,CAAC,CAAC;AAHU,QAAA,YAAY,gBAGtB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
2
|
+
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
3
|
+
[key: string]: JsonValue;
|
|
4
|
+
};
|
|
5
|
+
export declare enum NodeType {
|
|
6
|
+
File = "File",
|
|
7
|
+
Directory = "Directory",
|
|
8
|
+
Function = "Function",
|
|
9
|
+
Class = "Class",
|
|
10
|
+
Interface = "Interface",
|
|
11
|
+
Variable = "Variable",
|
|
12
|
+
Route = "Route",
|
|
13
|
+
EntryPoint = "EntryPoint"
|
|
14
|
+
}
|
|
15
|
+
export interface GraphNode {
|
|
16
|
+
id: string;
|
|
17
|
+
type: NodeType;
|
|
18
|
+
name: string;
|
|
19
|
+
path?: string;
|
|
20
|
+
startLine?: number;
|
|
21
|
+
endLine?: number;
|
|
22
|
+
json_props?: Record<string, JsonValue>;
|
|
23
|
+
}
|
|
24
|
+
export declare const createGraphNode: (id: string, type: NodeType, name: string, jsonProps?: Record<string, JsonValue>) => GraphNode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createGraphNode = exports.NodeType = void 0;
|
|
4
|
+
var NodeType;
|
|
5
|
+
(function (NodeType) {
|
|
6
|
+
NodeType["File"] = "File";
|
|
7
|
+
NodeType["Directory"] = "Directory";
|
|
8
|
+
NodeType["Function"] = "Function";
|
|
9
|
+
NodeType["Class"] = "Class";
|
|
10
|
+
NodeType["Interface"] = "Interface";
|
|
11
|
+
NodeType["Variable"] = "Variable";
|
|
12
|
+
NodeType["Route"] = "Route";
|
|
13
|
+
NodeType["EntryPoint"] = "EntryPoint";
|
|
14
|
+
})(NodeType || (exports.NodeType = NodeType = {}));
|
|
15
|
+
const createGraphNode = (id, type, name, jsonProps = {}) => ({
|
|
16
|
+
id,
|
|
17
|
+
type,
|
|
18
|
+
name,
|
|
19
|
+
json_props: jsonProps
|
|
20
|
+
});
|
|
21
|
+
exports.createGraphNode = createGraphNode;
|
|
22
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/model/node.ts"],"names":[],"mappings":";;;AAGA,IAAY,QASX;AATD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,mCAAuB,CAAA;IACvB,iCAAqB,CAAA;IACrB,2BAAe,CAAA;IACf,mCAAuB,CAAA;IACvB,iCAAqB,CAAA;IACrB,2BAAe,CAAA;IACf,qCAAyB,CAAA;AAC3B,CAAC,EATW,QAAQ,wBAAR,QAAQ,QASnB;AAYM,MAAM,eAAe,GAAG,CAC7B,EAAU,EACV,IAAc,EACd,IAAY,EACZ,YAAuC,EAAE,EAC9B,EAAE,CAAC,CAAC;IACf,EAAE;IACF,IAAI;IACJ,IAAI;IACJ,UAAU,EAAE,SAAS;CACtB,CAAC,CAAC;AAVU,QAAA,eAAe,mBAUzB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ReferencesQuery {
|
|
2
|
+
type: "references";
|
|
3
|
+
symbol: string;
|
|
4
|
+
depth?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface DependenciesQuery {
|
|
7
|
+
type: "dependencies";
|
|
8
|
+
target?: string;
|
|
9
|
+
depth?: number;
|
|
10
|
+
}
|
|
11
|
+
export type GraphQuery = ReferencesQuery | DependenciesQuery;
|
|
12
|
+
export declare const MAX_QUERY_DEPTH = 32;
|
|
13
|
+
export declare function isReferencesQuery(query: GraphQuery): query is ReferencesQuery;
|
|
14
|
+
export declare function isDependenciesQuery(query: GraphQuery): query is DependenciesQuery;
|
|
15
|
+
export declare function normalizeDepth(depth: number | undefined, fallback?: number): number;
|
|
16
|
+
export declare function canonicalizeQuery(query: GraphQuery): GraphQuery;
|
|
17
|
+
export declare function parseGraphQuery(input: unknown): GraphQuery;
|