@codesentinel/codesentinel 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/dist/index.d.ts +2 -0
- package/dist/index.js +473 -0
- package/dist/index.js.map +1 -0
- package/package.json +36 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
|
|
6
|
+
// ../code-graph/dist/index.js
|
|
7
|
+
import { extname, isAbsolute, relative, resolve } from "path";
|
|
8
|
+
import * as ts from "typescript";
|
|
9
|
+
var edgeKey = (from, to) => `${from}\0${to}`;
|
|
10
|
+
var createGraphData = (nodes, rawEdges) => {
|
|
11
|
+
const sortedNodes = [...nodes].sort((a, b) => a.id.localeCompare(b.id));
|
|
12
|
+
const knownNodeIds = new Set(sortedNodes.map((node) => node.id));
|
|
13
|
+
const uniqueEdgeMap = /* @__PURE__ */ new Map();
|
|
14
|
+
for (const edge of rawEdges) {
|
|
15
|
+
if (edge.from === edge.to) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
if (!knownNodeIds.has(edge.from) || !knownNodeIds.has(edge.to)) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
uniqueEdgeMap.set(edgeKey(edge.from, edge.to), edge);
|
|
22
|
+
}
|
|
23
|
+
const sortedEdges = [...uniqueEdgeMap.values()].sort((a, b) => {
|
|
24
|
+
const fromCompare = a.from.localeCompare(b.from);
|
|
25
|
+
if (fromCompare !== 0) {
|
|
26
|
+
return fromCompare;
|
|
27
|
+
}
|
|
28
|
+
return a.to.localeCompare(b.to);
|
|
29
|
+
});
|
|
30
|
+
const adjacency = /* @__PURE__ */ new Map();
|
|
31
|
+
for (const node of sortedNodes) {
|
|
32
|
+
adjacency.set(node.id, []);
|
|
33
|
+
}
|
|
34
|
+
for (const edge of sortedEdges) {
|
|
35
|
+
adjacency.get(edge.from)?.push(edge.to);
|
|
36
|
+
}
|
|
37
|
+
const adjacencyById = /* @__PURE__ */ new Map();
|
|
38
|
+
for (const [nodeId, targets] of adjacency.entries()) {
|
|
39
|
+
adjacencyById.set(nodeId, [...targets]);
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
nodes: sortedNodes,
|
|
43
|
+
edges: sortedEdges,
|
|
44
|
+
adjacencyById
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
var runTarjanScc = (adjacencyById) => {
|
|
48
|
+
let index = 0;
|
|
49
|
+
const indices = /* @__PURE__ */ new Map();
|
|
50
|
+
const lowLink = /* @__PURE__ */ new Map();
|
|
51
|
+
const stack = [];
|
|
52
|
+
const onStack = /* @__PURE__ */ new Set();
|
|
53
|
+
const components = [];
|
|
54
|
+
const strongConnect = (nodeId) => {
|
|
55
|
+
indices.set(nodeId, index);
|
|
56
|
+
lowLink.set(nodeId, index);
|
|
57
|
+
index += 1;
|
|
58
|
+
stack.push(nodeId);
|
|
59
|
+
onStack.add(nodeId);
|
|
60
|
+
const neighbors = adjacencyById.get(nodeId) ?? [];
|
|
61
|
+
for (const nextId of neighbors) {
|
|
62
|
+
if (!indices.has(nextId)) {
|
|
63
|
+
strongConnect(nextId);
|
|
64
|
+
const nodeLowLink2 = lowLink.get(nodeId);
|
|
65
|
+
const nextLowLink = lowLink.get(nextId);
|
|
66
|
+
if (nodeLowLink2 !== void 0 && nextLowLink !== void 0 && nextLowLink < nodeLowLink2) {
|
|
67
|
+
lowLink.set(nodeId, nextLowLink);
|
|
68
|
+
}
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (onStack.has(nextId)) {
|
|
72
|
+
const nodeLowLink2 = lowLink.get(nodeId);
|
|
73
|
+
const nextIndex = indices.get(nextId);
|
|
74
|
+
if (nodeLowLink2 !== void 0 && nextIndex !== void 0 && nextIndex < nodeLowLink2) {
|
|
75
|
+
lowLink.set(nodeId, nextIndex);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const nodeLowLink = lowLink.get(nodeId);
|
|
80
|
+
const nodeIndex = indices.get(nodeId);
|
|
81
|
+
if (nodeLowLink === void 0 || nodeIndex === void 0 || nodeLowLink !== nodeIndex) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const component = [];
|
|
85
|
+
for (; ; ) {
|
|
86
|
+
const popped = stack.pop();
|
|
87
|
+
if (popped === void 0) {
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
onStack.delete(popped);
|
|
91
|
+
component.push(popped);
|
|
92
|
+
if (popped === nodeId) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
component.sort((a, b) => a.localeCompare(b));
|
|
97
|
+
components.push(component);
|
|
98
|
+
};
|
|
99
|
+
const nodeIds = [...adjacencyById.keys()].sort((a, b) => a.localeCompare(b));
|
|
100
|
+
for (const nodeId of nodeIds) {
|
|
101
|
+
if (!indices.has(nodeId)) {
|
|
102
|
+
strongConnect(nodeId);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
components.sort((a, b) => {
|
|
106
|
+
const firstA = a[0] ?? "";
|
|
107
|
+
const firstB = b[0] ?? "";
|
|
108
|
+
return firstA.localeCompare(firstB);
|
|
109
|
+
});
|
|
110
|
+
return { components };
|
|
111
|
+
};
|
|
112
|
+
var hasSelfLoop = (nodeId, adjacencyById) => {
|
|
113
|
+
const targets = adjacencyById.get(nodeId) ?? [];
|
|
114
|
+
return targets.includes(nodeId);
|
|
115
|
+
};
|
|
116
|
+
var computeCyclesAndDepth = (graph) => {
|
|
117
|
+
const { components } = runTarjanScc(graph.adjacencyById);
|
|
118
|
+
const cycles = [];
|
|
119
|
+
const componentByNodeId = /* @__PURE__ */ new Map();
|
|
120
|
+
components.forEach((component, index) => {
|
|
121
|
+
for (const nodeId of component) {
|
|
122
|
+
componentByNodeId.set(nodeId, index);
|
|
123
|
+
}
|
|
124
|
+
if (component.length > 1) {
|
|
125
|
+
cycles.push({ nodes: [...component] });
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const onlyNode = component[0];
|
|
129
|
+
if (onlyNode !== void 0 && hasSelfLoop(onlyNode, graph.adjacencyById)) {
|
|
130
|
+
cycles.push({ nodes: [...component] });
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
const dagOutgoing = /* @__PURE__ */ new Map();
|
|
134
|
+
const inDegree = /* @__PURE__ */ new Map();
|
|
135
|
+
for (let i = 0; i < components.length; i += 1) {
|
|
136
|
+
dagOutgoing.set(i, /* @__PURE__ */ new Set());
|
|
137
|
+
inDegree.set(i, 0);
|
|
138
|
+
}
|
|
139
|
+
for (const edge of graph.edges) {
|
|
140
|
+
const fromComponent = componentByNodeId.get(edge.from);
|
|
141
|
+
const toComponent = componentByNodeId.get(edge.to);
|
|
142
|
+
if (fromComponent === void 0 || toComponent === void 0 || fromComponent === toComponent) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const outgoing = dagOutgoing.get(fromComponent);
|
|
146
|
+
if (outgoing?.has(toComponent) === true) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
outgoing?.add(toComponent);
|
|
150
|
+
inDegree.set(toComponent, (inDegree.get(toComponent) ?? 0) + 1);
|
|
151
|
+
}
|
|
152
|
+
const queue = [];
|
|
153
|
+
const depthByComponent = /* @__PURE__ */ new Map();
|
|
154
|
+
for (let i = 0; i < components.length; i += 1) {
|
|
155
|
+
if ((inDegree.get(i) ?? 0) === 0) {
|
|
156
|
+
queue.push(i);
|
|
157
|
+
depthByComponent.set(i, 0);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
let cursor = 0;
|
|
161
|
+
while (cursor < queue.length) {
|
|
162
|
+
const componentId = queue[cursor];
|
|
163
|
+
cursor += 1;
|
|
164
|
+
if (componentId === void 0) {
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
const currentDepth = depthByComponent.get(componentId) ?? 0;
|
|
168
|
+
const outgoing = dagOutgoing.get(componentId) ?? /* @__PURE__ */ new Set();
|
|
169
|
+
for (const nextComponent of outgoing) {
|
|
170
|
+
const nextDepth = depthByComponent.get(nextComponent) ?? 0;
|
|
171
|
+
if (currentDepth + 1 > nextDepth) {
|
|
172
|
+
depthByComponent.set(nextComponent, currentDepth + 1);
|
|
173
|
+
}
|
|
174
|
+
const remainingIncoming = (inDegree.get(nextComponent) ?? 0) - 1;
|
|
175
|
+
inDegree.set(nextComponent, remainingIncoming);
|
|
176
|
+
if (remainingIncoming === 0) {
|
|
177
|
+
queue.push(nextComponent);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const depthByNodeId = /* @__PURE__ */ new Map();
|
|
182
|
+
let graphDepth = 0;
|
|
183
|
+
components.forEach((component, componentId) => {
|
|
184
|
+
const componentDepth = depthByComponent.get(componentId) ?? 0;
|
|
185
|
+
if (componentDepth > graphDepth) {
|
|
186
|
+
graphDepth = componentDepth;
|
|
187
|
+
}
|
|
188
|
+
for (const nodeId of component) {
|
|
189
|
+
depthByNodeId.set(nodeId, componentDepth);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
cycles.sort((a, b) => {
|
|
193
|
+
const firstA = a.nodes[0] ?? "";
|
|
194
|
+
const firstB = b.nodes[0] ?? "";
|
|
195
|
+
return firstA.localeCompare(firstB);
|
|
196
|
+
});
|
|
197
|
+
return {
|
|
198
|
+
depthByNodeId,
|
|
199
|
+
graphDepth,
|
|
200
|
+
cycles
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
var createGraphAnalysisSummary = (targetPath, graph) => {
|
|
204
|
+
const fanInById = /* @__PURE__ */ new Map();
|
|
205
|
+
const fanOutById = /* @__PURE__ */ new Map();
|
|
206
|
+
for (const node of graph.nodes) {
|
|
207
|
+
fanInById.set(node.id, 0);
|
|
208
|
+
fanOutById.set(node.id, graph.adjacencyById.get(node.id)?.length ?? 0);
|
|
209
|
+
}
|
|
210
|
+
for (const edge of graph.edges) {
|
|
211
|
+
fanInById.set(edge.to, (fanInById.get(edge.to) ?? 0) + 1);
|
|
212
|
+
}
|
|
213
|
+
const { cycles, depthByNodeId, graphDepth } = computeCyclesAndDepth(graph);
|
|
214
|
+
let maxFanIn = 0;
|
|
215
|
+
let maxFanOut = 0;
|
|
216
|
+
const files = graph.nodes.map((node) => {
|
|
217
|
+
const fanIn = fanInById.get(node.id) ?? 0;
|
|
218
|
+
const fanOut = fanOutById.get(node.id) ?? 0;
|
|
219
|
+
if (fanIn > maxFanIn) {
|
|
220
|
+
maxFanIn = fanIn;
|
|
221
|
+
}
|
|
222
|
+
if (fanOut > maxFanOut) {
|
|
223
|
+
maxFanOut = fanOut;
|
|
224
|
+
}
|
|
225
|
+
return {
|
|
226
|
+
id: node.id,
|
|
227
|
+
relativePath: node.relativePath,
|
|
228
|
+
directDependencies: graph.adjacencyById.get(node.id) ?? [],
|
|
229
|
+
fanIn,
|
|
230
|
+
fanOut,
|
|
231
|
+
depth: depthByNodeId.get(node.id) ?? 0
|
|
232
|
+
};
|
|
233
|
+
});
|
|
234
|
+
const metrics = {
|
|
235
|
+
nodeCount: graph.nodes.length,
|
|
236
|
+
edgeCount: graph.edges.length,
|
|
237
|
+
cycleCount: cycles.length,
|
|
238
|
+
graphDepth,
|
|
239
|
+
maxFanIn,
|
|
240
|
+
maxFanOut
|
|
241
|
+
};
|
|
242
|
+
return {
|
|
243
|
+
targetPath,
|
|
244
|
+
nodes: graph.nodes,
|
|
245
|
+
edges: graph.edges,
|
|
246
|
+
cycles,
|
|
247
|
+
files,
|
|
248
|
+
metrics
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
var SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"]);
|
|
252
|
+
var normalizePath = (pathValue) => pathValue.replaceAll("\\", "/");
|
|
253
|
+
var isProjectSourceFile = (filePath, projectRoot) => {
|
|
254
|
+
const extension = extname(filePath);
|
|
255
|
+
if (!SOURCE_EXTENSIONS.has(extension)) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
const relativePath = relative(projectRoot, filePath);
|
|
259
|
+
if (relativePath.startsWith("..")) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
return !relativePath.includes("node_modules");
|
|
263
|
+
};
|
|
264
|
+
var findProjectFiles = (projectRoot) => {
|
|
265
|
+
const files = ts.sys.readDirectory(projectRoot, [...SOURCE_EXTENSIONS], void 0, void 0);
|
|
266
|
+
return files.map((filePath) => resolve(filePath));
|
|
267
|
+
};
|
|
268
|
+
var parseTsConfig = (projectRoot) => {
|
|
269
|
+
const configPath = ts.findConfigFile(projectRoot, ts.sys.fileExists, "tsconfig.json");
|
|
270
|
+
if (configPath === void 0) {
|
|
271
|
+
return {
|
|
272
|
+
fileNames: findProjectFiles(projectRoot),
|
|
273
|
+
options: {
|
|
274
|
+
allowJs: true,
|
|
275
|
+
moduleResolution: ts.ModuleResolutionKind.NodeNext
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
const parsedCommandLine = ts.getParsedCommandLineOfConfigFile(
|
|
280
|
+
configPath,
|
|
281
|
+
{},
|
|
282
|
+
{
|
|
283
|
+
...ts.sys,
|
|
284
|
+
onUnRecoverableConfigFileDiagnostic: () => {
|
|
285
|
+
throw new Error(`Failed to parse TypeScript configuration at ${configPath}`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
if (parsedCommandLine === void 0) {
|
|
290
|
+
throw new Error(`Failed to parse TypeScript configuration at ${configPath}`);
|
|
291
|
+
}
|
|
292
|
+
const fileNames = parsedCommandLine.fileNames.map((filePath) => resolve(filePath));
|
|
293
|
+
if (fileNames.length === 0) {
|
|
294
|
+
return {
|
|
295
|
+
fileNames: findProjectFiles(projectRoot),
|
|
296
|
+
options: parsedCommandLine.options
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
fileNames,
|
|
301
|
+
options: parsedCommandLine.options
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
var getSpecifierFromExpression = (expression) => {
|
|
305
|
+
if (ts.isStringLiteral(expression)) {
|
|
306
|
+
return expression.text;
|
|
307
|
+
}
|
|
308
|
+
if (ts.isNoSubstitutionTemplateLiteral(expression)) {
|
|
309
|
+
return expression.text;
|
|
310
|
+
}
|
|
311
|
+
return void 0;
|
|
312
|
+
};
|
|
313
|
+
var hasRuntimeImport = (importDeclaration) => {
|
|
314
|
+
const importClause = importDeclaration.importClause;
|
|
315
|
+
if (importClause === void 0) {
|
|
316
|
+
return true;
|
|
317
|
+
}
|
|
318
|
+
if (importClause.isTypeOnly) {
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
if (importClause.name !== void 0) {
|
|
322
|
+
return true;
|
|
323
|
+
}
|
|
324
|
+
const namedBindings = importClause.namedBindings;
|
|
325
|
+
if (namedBindings === void 0) {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
if (ts.isNamespaceImport(namedBindings)) {
|
|
329
|
+
return true;
|
|
330
|
+
}
|
|
331
|
+
if (namedBindings.elements.length === 0) {
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
334
|
+
return namedBindings.elements.some((element) => !element.isTypeOnly);
|
|
335
|
+
};
|
|
336
|
+
var extractModuleSpecifiers = (sourceFile) => {
|
|
337
|
+
const specifiers = /* @__PURE__ */ new Set();
|
|
338
|
+
const visit = (node) => {
|
|
339
|
+
if (ts.isImportDeclaration(node)) {
|
|
340
|
+
if (hasRuntimeImport(node) && node.moduleSpecifier !== void 0) {
|
|
341
|
+
const specifier = getSpecifierFromExpression(node.moduleSpecifier);
|
|
342
|
+
if (specifier !== void 0) {
|
|
343
|
+
specifiers.add(specifier);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (ts.isExportDeclaration(node)) {
|
|
349
|
+
if (!node.isTypeOnly && node.moduleSpecifier !== void 0) {
|
|
350
|
+
const specifier = getSpecifierFromExpression(node.moduleSpecifier);
|
|
351
|
+
if (specifier !== void 0) {
|
|
352
|
+
specifiers.add(specifier);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
if (ts.isCallExpression(node)) {
|
|
358
|
+
if (node.expression.kind === ts.SyntaxKind.ImportKeyword && node.arguments.length > 0) {
|
|
359
|
+
const firstArgument = node.arguments[0];
|
|
360
|
+
if (firstArgument !== void 0) {
|
|
361
|
+
const specifier = getSpecifierFromExpression(firstArgument);
|
|
362
|
+
if (specifier !== void 0) {
|
|
363
|
+
specifiers.add(specifier);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (ts.isIdentifier(node.expression) && node.expression.text === "require" && node.arguments.length > 0) {
|
|
368
|
+
const firstArgument = node.arguments[0];
|
|
369
|
+
if (firstArgument !== void 0) {
|
|
370
|
+
const specifier = getSpecifierFromExpression(firstArgument);
|
|
371
|
+
if (specifier !== void 0) {
|
|
372
|
+
specifiers.add(specifier);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
ts.forEachChild(node, visit);
|
|
378
|
+
};
|
|
379
|
+
visit(sourceFile);
|
|
380
|
+
return [...specifiers];
|
|
381
|
+
};
|
|
382
|
+
var parseTypescriptProject = (projectPath) => {
|
|
383
|
+
const projectRoot = isAbsolute(projectPath) ? projectPath : resolve(projectPath);
|
|
384
|
+
const { fileNames, options } = parseTsConfig(projectRoot);
|
|
385
|
+
const sourceFilePaths = fileNames.filter((filePath) => isProjectSourceFile(filePath, projectRoot)).map((filePath) => normalizePath(resolve(filePath)));
|
|
386
|
+
const uniqueSourceFilePaths = [...new Set(sourceFilePaths)].sort((a, b) => a.localeCompare(b));
|
|
387
|
+
const sourceFilePathSet = new Set(uniqueSourceFilePaths);
|
|
388
|
+
const program2 = ts.createProgram({
|
|
389
|
+
rootNames: uniqueSourceFilePaths,
|
|
390
|
+
options
|
|
391
|
+
});
|
|
392
|
+
const nodeByAbsolutePath = /* @__PURE__ */ new Map();
|
|
393
|
+
for (const sourcePath of uniqueSourceFilePaths) {
|
|
394
|
+
const relativePath = normalizePath(relative(projectRoot, sourcePath));
|
|
395
|
+
const nodeId = relativePath;
|
|
396
|
+
nodeByAbsolutePath.set(sourcePath, {
|
|
397
|
+
id: nodeId,
|
|
398
|
+
absolutePath: sourcePath,
|
|
399
|
+
relativePath
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
const resolverCache = /* @__PURE__ */ new Map();
|
|
403
|
+
const edges = [];
|
|
404
|
+
for (const sourcePath of uniqueSourceFilePaths) {
|
|
405
|
+
const sourceFile = program2.getSourceFile(sourcePath);
|
|
406
|
+
if (sourceFile === void 0) {
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
const fromNode = nodeByAbsolutePath.get(sourcePath);
|
|
410
|
+
if (fromNode === void 0) {
|
|
411
|
+
continue;
|
|
412
|
+
}
|
|
413
|
+
const moduleSpecifiers = extractModuleSpecifiers(sourceFile);
|
|
414
|
+
for (const specifier of moduleSpecifiers) {
|
|
415
|
+
const cacheKey = `${sourcePath}\0${specifier}`;
|
|
416
|
+
let resolvedPath = resolverCache.get(cacheKey);
|
|
417
|
+
if (resolvedPath === void 0 && !resolverCache.has(cacheKey)) {
|
|
418
|
+
const resolved = ts.resolveModuleName(specifier, sourcePath, options, ts.sys).resolvedModule;
|
|
419
|
+
if (resolved !== void 0) {
|
|
420
|
+
resolvedPath = normalizePath(resolve(resolved.resolvedFileName));
|
|
421
|
+
}
|
|
422
|
+
resolverCache.set(cacheKey, resolvedPath);
|
|
423
|
+
}
|
|
424
|
+
if (resolvedPath === void 0 || !sourceFilePathSet.has(resolvedPath)) {
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
const toNode = nodeByAbsolutePath.get(resolvedPath);
|
|
428
|
+
if (toNode === void 0) {
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
edges.push({ from: fromNode.id, to: toNode.id });
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return {
|
|
435
|
+
nodes: [...nodeByAbsolutePath.values()],
|
|
436
|
+
edges
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
var buildProjectGraphSummary = (input) => {
|
|
440
|
+
const parsedProject = parseTypescriptProject(input.projectPath);
|
|
441
|
+
const graphData = createGraphData(parsedProject.nodes, parsedProject.edges);
|
|
442
|
+
return createGraphAnalysisSummary(input.projectPath, graphData);
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
// ../core/dist/index.js
|
|
446
|
+
import { resolve as resolve2 } from "path";
|
|
447
|
+
var resolveTargetPath = (inputPath, cwd = process.cwd()) => {
|
|
448
|
+
const absolutePath = resolve2(cwd, inputPath ?? ".");
|
|
449
|
+
return { absolutePath };
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
// src/application/run-analyze-command.ts
|
|
453
|
+
var runAnalyzeCommand = (inputPath) => {
|
|
454
|
+
const invocationCwd = process.env["INIT_CWD"] ?? process.cwd();
|
|
455
|
+
const target = resolveTargetPath(inputPath, invocationCwd);
|
|
456
|
+
const summary = buildProjectGraphSummary({ projectPath: target.absolutePath });
|
|
457
|
+
return JSON.stringify(summary, null, 2);
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
// src/index.ts
|
|
461
|
+
var program = new Command();
|
|
462
|
+
program.name("codesentinel").description("Structural and evolutionary risk analysis for TypeScript/JavaScript codebases").version("0.1.0");
|
|
463
|
+
program.command("analyze").argument("[path]", "path to the project to analyze").action((path) => {
|
|
464
|
+
const output = runAnalyzeCommand(path);
|
|
465
|
+
process.stdout.write(`${output}
|
|
466
|
+
`);
|
|
467
|
+
});
|
|
468
|
+
if (process.argv.length <= 2) {
|
|
469
|
+
program.outputHelp();
|
|
470
|
+
process.exit(0);
|
|
471
|
+
}
|
|
472
|
+
program.parse(process.argv);
|
|
473
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../../code-graph/src/domain/graph-model.ts","../../code-graph/src/domain/tarjan.ts","../../code-graph/src/domain/graph-metrics.ts","../../code-graph/src/infrastructure/typescript-project.ts","../../code-graph/src/application/build-project-graph-summary.ts","../../core/src/index.ts","../src/application/run-analyze-command.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { runAnalyzeCommand } from \"./application/run-analyze-command.js\";\n\nconst program = new Command();\n\nprogram\n .name(\"codesentinel\")\n .description(\"Structural and evolutionary risk analysis for TypeScript/JavaScript codebases\")\n .version(\"0.1.0\");\n\nprogram\n .command(\"analyze\")\n .argument(\"[path]\", \"path to the project to analyze\")\n .action((path?: string) => {\n const output = runAnalyzeCommand(path);\n process.stdout.write(`${output}\\n`);\n });\n\nif (process.argv.length <= 2) {\n program.outputHelp();\n process.exit(0);\n}\n\nprogram.parse(process.argv);\n","export type NodeRecord = {\n id: string;\n absolutePath: string;\n relativePath: string;\n};\n\nexport type EdgeRecord = {\n from: string;\n to: string;\n};\n\nexport type GraphData = {\n nodes: readonly NodeRecord[];\n edges: readonly EdgeRecord[];\n adjacencyById: ReadonlyMap<string, readonly string[]>;\n};\n\nconst edgeKey = (from: string, to: string): string => `${from}\\u0000${to}`;\n\nexport const createGraphData = (\n nodes: readonly NodeRecord[],\n rawEdges: readonly EdgeRecord[],\n): GraphData => {\n const sortedNodes = [...nodes].sort((a, b) => a.id.localeCompare(b.id));\n const knownNodeIds = new Set(sortedNodes.map((node) => node.id));\n\n const uniqueEdgeMap = new Map<string, EdgeRecord>();\n for (const edge of rawEdges) {\n if (edge.from === edge.to) {\n continue;\n }\n\n if (!knownNodeIds.has(edge.from) || !knownNodeIds.has(edge.to)) {\n continue;\n }\n\n uniqueEdgeMap.set(edgeKey(edge.from, edge.to), edge);\n }\n\n const sortedEdges = [...uniqueEdgeMap.values()].sort((a, b) => {\n const fromCompare = a.from.localeCompare(b.from);\n if (fromCompare !== 0) {\n return fromCompare;\n }\n\n return a.to.localeCompare(b.to);\n });\n\n const adjacency = new Map<string, string[]>();\n for (const node of sortedNodes) {\n adjacency.set(node.id, []);\n }\n\n for (const edge of sortedEdges) {\n adjacency.get(edge.from)?.push(edge.to);\n }\n\n const adjacencyById = new Map<string, readonly string[]>();\n for (const [nodeId, targets] of adjacency.entries()) {\n adjacencyById.set(nodeId, [...targets]);\n }\n\n return {\n nodes: sortedNodes,\n edges: sortedEdges,\n adjacencyById,\n };\n};\n","type TarjanResult = {\n components: readonly (readonly string[])[];\n};\n\nexport const runTarjanScc = (adjacencyById: ReadonlyMap<string, readonly string[]>): TarjanResult => {\n let index = 0;\n const indices = new Map<string, number>();\n const lowLink = new Map<string, number>();\n const stack: string[] = [];\n const onStack = new Set<string>();\n const components: string[][] = [];\n\n const strongConnect = (nodeId: string): void => {\n indices.set(nodeId, index);\n lowLink.set(nodeId, index);\n index += 1;\n\n stack.push(nodeId);\n onStack.add(nodeId);\n\n const neighbors = adjacencyById.get(nodeId) ?? [];\n for (const nextId of neighbors) {\n if (!indices.has(nextId)) {\n strongConnect(nextId);\n const nodeLowLink = lowLink.get(nodeId);\n const nextLowLink = lowLink.get(nextId);\n if (nodeLowLink !== undefined && nextLowLink !== undefined && nextLowLink < nodeLowLink) {\n lowLink.set(nodeId, nextLowLink);\n }\n continue;\n }\n\n if (onStack.has(nextId)) {\n const nodeLowLink = lowLink.get(nodeId);\n const nextIndex = indices.get(nextId);\n if (nodeLowLink !== undefined && nextIndex !== undefined && nextIndex < nodeLowLink) {\n lowLink.set(nodeId, nextIndex);\n }\n }\n }\n\n const nodeLowLink = lowLink.get(nodeId);\n const nodeIndex = indices.get(nodeId);\n if (nodeLowLink === undefined || nodeIndex === undefined || nodeLowLink !== nodeIndex) {\n return;\n }\n\n const component: string[] = [];\n for (;;) {\n const popped = stack.pop();\n if (popped === undefined) {\n break;\n }\n\n onStack.delete(popped);\n component.push(popped);\n if (popped === nodeId) {\n break;\n }\n }\n\n component.sort((a, b) => a.localeCompare(b));\n components.push(component);\n };\n\n const nodeIds = [...adjacencyById.keys()].sort((a, b) => a.localeCompare(b));\n for (const nodeId of nodeIds) {\n if (!indices.has(nodeId)) {\n strongConnect(nodeId);\n }\n }\n\n components.sort((a, b) => {\n const firstA = a[0] ?? \"\";\n const firstB = b[0] ?? \"\";\n return firstA.localeCompare(firstB);\n });\n\n return { components };\n};\n","import type { FileDependency, GraphAnalysisSummary, GraphCycle, GraphMetrics } from \"@codesentinel/core\";\nimport type { GraphData } from \"./graph-model.js\";\nimport { runTarjanScc } from \"./tarjan.js\";\n\ntype DepthComputation = {\n depthByNodeId: ReadonlyMap<string, number>;\n graphDepth: number;\n cycles: readonly GraphCycle[];\n};\n\nconst hasSelfLoop = (nodeId: string, adjacencyById: ReadonlyMap<string, readonly string[]>): boolean => {\n const targets = adjacencyById.get(nodeId) ?? [];\n return targets.includes(nodeId);\n};\n\nconst computeCyclesAndDepth = (graph: GraphData): DepthComputation => {\n const { components } = runTarjanScc(graph.adjacencyById);\n\n const cycles: GraphCycle[] = [];\n const componentByNodeId = new Map<string, number>();\n components.forEach((component, index) => {\n for (const nodeId of component) {\n componentByNodeId.set(nodeId, index);\n }\n\n if (component.length > 1) {\n cycles.push({ nodes: [...component] });\n return;\n }\n\n const onlyNode = component[0];\n if (onlyNode !== undefined && hasSelfLoop(onlyNode, graph.adjacencyById)) {\n cycles.push({ nodes: [...component] });\n }\n });\n\n const dagOutgoing = new Map<number, Set<number>>();\n const inDegree = new Map<number, number>();\n\n for (let i = 0; i < components.length; i += 1) {\n dagOutgoing.set(i, new Set());\n inDegree.set(i, 0);\n }\n\n for (const edge of graph.edges) {\n const fromComponent = componentByNodeId.get(edge.from);\n const toComponent = componentByNodeId.get(edge.to);\n\n if (fromComponent === undefined || toComponent === undefined || fromComponent === toComponent) {\n continue;\n }\n\n const outgoing = dagOutgoing.get(fromComponent);\n if (outgoing?.has(toComponent) === true) {\n continue;\n }\n\n outgoing?.add(toComponent);\n inDegree.set(toComponent, (inDegree.get(toComponent) ?? 0) + 1);\n }\n\n const queue: number[] = [];\n const depthByComponent = new Map<number, number>();\n\n for (let i = 0; i < components.length; i += 1) {\n if ((inDegree.get(i) ?? 0) === 0) {\n queue.push(i);\n depthByComponent.set(i, 0);\n }\n }\n\n let cursor = 0;\n while (cursor < queue.length) {\n const componentId = queue[cursor];\n cursor += 1;\n\n if (componentId === undefined) {\n continue;\n }\n\n const currentDepth = depthByComponent.get(componentId) ?? 0;\n const outgoing = dagOutgoing.get(componentId) ?? new Set<number>();\n\n for (const nextComponent of outgoing) {\n const nextDepth = depthByComponent.get(nextComponent) ?? 0;\n if (currentDepth + 1 > nextDepth) {\n depthByComponent.set(nextComponent, currentDepth + 1);\n }\n\n const remainingIncoming = (inDegree.get(nextComponent) ?? 0) - 1;\n inDegree.set(nextComponent, remainingIncoming);\n if (remainingIncoming === 0) {\n queue.push(nextComponent);\n }\n }\n }\n\n const depthByNodeId = new Map<string, number>();\n let graphDepth = 0;\n\n components.forEach((component, componentId) => {\n const componentDepth = depthByComponent.get(componentId) ?? 0;\n if (componentDepth > graphDepth) {\n graphDepth = componentDepth;\n }\n\n for (const nodeId of component) {\n depthByNodeId.set(nodeId, componentDepth);\n }\n });\n\n cycles.sort((a, b) => {\n const firstA = a.nodes[0] ?? \"\";\n const firstB = b.nodes[0] ?? \"\";\n return firstA.localeCompare(firstB);\n });\n\n return {\n depthByNodeId,\n graphDepth,\n cycles,\n };\n};\n\nexport const createGraphAnalysisSummary = (\n targetPath: string,\n graph: GraphData,\n): GraphAnalysisSummary => {\n const fanInById = new Map<string, number>();\n const fanOutById = new Map<string, number>();\n\n for (const node of graph.nodes) {\n fanInById.set(node.id, 0);\n fanOutById.set(node.id, graph.adjacencyById.get(node.id)?.length ?? 0);\n }\n\n for (const edge of graph.edges) {\n fanInById.set(edge.to, (fanInById.get(edge.to) ?? 0) + 1);\n }\n\n const { cycles, depthByNodeId, graphDepth } = computeCyclesAndDepth(graph);\n\n let maxFanIn = 0;\n let maxFanOut = 0;\n\n const files: FileDependency[] = graph.nodes.map((node) => {\n const fanIn = fanInById.get(node.id) ?? 0;\n const fanOut = fanOutById.get(node.id) ?? 0;\n\n if (fanIn > maxFanIn) {\n maxFanIn = fanIn;\n }\n\n if (fanOut > maxFanOut) {\n maxFanOut = fanOut;\n }\n\n return {\n id: node.id,\n relativePath: node.relativePath,\n directDependencies: graph.adjacencyById.get(node.id) ?? [],\n fanIn,\n fanOut,\n depth: depthByNodeId.get(node.id) ?? 0,\n };\n });\n\n const metrics: GraphMetrics = {\n nodeCount: graph.nodes.length,\n edgeCount: graph.edges.length,\n cycleCount: cycles.length,\n graphDepth,\n maxFanIn,\n maxFanOut,\n };\n\n return {\n targetPath,\n nodes: graph.nodes,\n edges: graph.edges,\n cycles,\n files,\n metrics,\n };\n};\n","import { extname, isAbsolute, relative, resolve } from \"node:path\";\nimport * as ts from \"typescript\";\nimport type { EdgeRecord, NodeRecord } from \"../domain/graph-model.js\";\n\ntype ParsedProject = {\n nodes: readonly NodeRecord[];\n edges: readonly EdgeRecord[];\n};\n\nconst SOURCE_EXTENSIONS = new Set([\".ts\", \".tsx\", \".mts\", \".cts\", \".js\", \".jsx\", \".mjs\", \".cjs\"]);\n\nconst normalizePath = (pathValue: string): string => pathValue.replaceAll(\"\\\\\", \"/\");\n\nconst isProjectSourceFile = (filePath: string, projectRoot: string): boolean => {\n const extension = extname(filePath);\n if (!SOURCE_EXTENSIONS.has(extension)) {\n return false;\n }\n\n const relativePath = relative(projectRoot, filePath);\n if (relativePath.startsWith(\"..\")) {\n return false;\n }\n\n return !relativePath.includes(\"node_modules\");\n};\n\nconst findProjectFiles = (projectRoot: string): readonly string[] => {\n const files = ts.sys.readDirectory(projectRoot, [...SOURCE_EXTENSIONS], undefined, undefined);\n return files.map((filePath) => resolve(filePath));\n};\n\nconst parseTsConfig = (projectRoot: string): { fileNames: readonly string[]; options: ts.CompilerOptions } => {\n const configPath = ts.findConfigFile(projectRoot, ts.sys.fileExists, \"tsconfig.json\");\n if (configPath === undefined) {\n return {\n fileNames: findProjectFiles(projectRoot),\n options: {\n allowJs: true,\n moduleResolution: ts.ModuleResolutionKind.NodeNext,\n },\n };\n }\n\n const parsedCommandLine = ts.getParsedCommandLineOfConfigFile(\n configPath,\n {},\n {\n ...ts.sys,\n onUnRecoverableConfigFileDiagnostic: () => {\n throw new Error(`Failed to parse TypeScript configuration at ${configPath}`);\n },\n },\n );\n\n if (parsedCommandLine === undefined) {\n throw new Error(`Failed to parse TypeScript configuration at ${configPath}`);\n }\n\n const fileNames = parsedCommandLine.fileNames.map((filePath) => resolve(filePath));\n if (fileNames.length === 0) {\n return {\n fileNames: findProjectFiles(projectRoot),\n options: parsedCommandLine.options,\n };\n }\n\n return {\n fileNames,\n options: parsedCommandLine.options,\n };\n};\n\nconst getSpecifierFromExpression = (expression: ts.Expression): string | undefined => {\n if (ts.isStringLiteral(expression)) {\n return expression.text;\n }\n\n if (ts.isNoSubstitutionTemplateLiteral(expression)) {\n return expression.text;\n }\n\n return undefined;\n};\n\nconst hasRuntimeImport = (importDeclaration: ts.ImportDeclaration): boolean => {\n const importClause = importDeclaration.importClause;\n if (importClause === undefined) {\n return true;\n }\n\n if (importClause.isTypeOnly) {\n return false;\n }\n\n if (importClause.name !== undefined) {\n return true;\n }\n\n const namedBindings = importClause.namedBindings;\n if (namedBindings === undefined) {\n return false;\n }\n\n if (ts.isNamespaceImport(namedBindings)) {\n return true;\n }\n\n if (namedBindings.elements.length === 0) {\n return true;\n }\n\n return namedBindings.elements.some((element) => !element.isTypeOnly);\n};\n\nconst extractModuleSpecifiers = (sourceFile: ts.SourceFile): readonly string[] => {\n const specifiers = new Set<string>();\n\n const visit = (node: ts.Node): void => {\n if (ts.isImportDeclaration(node)) {\n if (hasRuntimeImport(node) && node.moduleSpecifier !== undefined) {\n const specifier = getSpecifierFromExpression(node.moduleSpecifier);\n if (specifier !== undefined) {\n specifiers.add(specifier);\n }\n }\n return;\n }\n\n if (ts.isExportDeclaration(node)) {\n if (!node.isTypeOnly && node.moduleSpecifier !== undefined) {\n const specifier = getSpecifierFromExpression(node.moduleSpecifier);\n if (specifier !== undefined) {\n specifiers.add(specifier);\n }\n }\n return;\n }\n\n if (ts.isCallExpression(node)) {\n if (node.expression.kind === ts.SyntaxKind.ImportKeyword && node.arguments.length > 0) {\n const firstArgument = node.arguments[0];\n if (firstArgument !== undefined) {\n const specifier = getSpecifierFromExpression(firstArgument);\n if (specifier !== undefined) {\n specifiers.add(specifier);\n }\n }\n }\n\n if (ts.isIdentifier(node.expression) && node.expression.text === \"require\" && node.arguments.length > 0) {\n const firstArgument = node.arguments[0];\n if (firstArgument !== undefined) {\n const specifier = getSpecifierFromExpression(firstArgument);\n if (specifier !== undefined) {\n specifiers.add(specifier);\n }\n }\n }\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return [...specifiers];\n};\n\nexport const parseTypescriptProject = (projectPath: string): ParsedProject => {\n const projectRoot = isAbsolute(projectPath) ? projectPath : resolve(projectPath);\n const { fileNames, options } = parseTsConfig(projectRoot);\n\n const sourceFilePaths = fileNames\n .filter((filePath) => isProjectSourceFile(filePath, projectRoot))\n .map((filePath) => normalizePath(resolve(filePath)));\n\n const uniqueSourceFilePaths = [...new Set(sourceFilePaths)].sort((a, b) => a.localeCompare(b));\n const sourceFilePathSet = new Set(uniqueSourceFilePaths);\n\n const program = ts.createProgram({\n rootNames: uniqueSourceFilePaths,\n options,\n });\n\n const nodeByAbsolutePath = new Map<string, NodeRecord>();\n for (const sourcePath of uniqueSourceFilePaths) {\n const relativePath = normalizePath(relative(projectRoot, sourcePath));\n const nodeId = relativePath;\n nodeByAbsolutePath.set(sourcePath, {\n id: nodeId,\n absolutePath: sourcePath,\n relativePath,\n });\n }\n\n const resolverCache = new Map<string, string | undefined>();\n const edges: EdgeRecord[] = [];\n\n for (const sourcePath of uniqueSourceFilePaths) {\n const sourceFile = program.getSourceFile(sourcePath);\n if (sourceFile === undefined) {\n continue;\n }\n\n const fromNode = nodeByAbsolutePath.get(sourcePath);\n if (fromNode === undefined) {\n continue;\n }\n\n const moduleSpecifiers = extractModuleSpecifiers(sourceFile);\n for (const specifier of moduleSpecifiers) {\n const cacheKey = `${sourcePath}\\u0000${specifier}`;\n let resolvedPath = resolverCache.get(cacheKey);\n\n if (resolvedPath === undefined && !resolverCache.has(cacheKey)) {\n const resolved = ts.resolveModuleName(specifier, sourcePath, options, ts.sys).resolvedModule;\n if (resolved !== undefined) {\n resolvedPath = normalizePath(resolve(resolved.resolvedFileName));\n }\n resolverCache.set(cacheKey, resolvedPath);\n }\n\n if (resolvedPath === undefined || !sourceFilePathSet.has(resolvedPath)) {\n continue;\n }\n\n const toNode = nodeByAbsolutePath.get(resolvedPath);\n if (toNode === undefined) {\n continue;\n }\n\n edges.push({ from: fromNode.id, to: toNode.id });\n }\n }\n\n return {\n nodes: [...nodeByAbsolutePath.values()],\n edges,\n };\n};\n","import type { GraphAnalysisSummary } from \"@codesentinel/core\";\nimport { createGraphData } from \"../domain/graph-model.js\";\nimport { createGraphAnalysisSummary } from \"../domain/graph-metrics.js\";\nimport { parseTypescriptProject } from \"../infrastructure/typescript-project.js\";\n\nexport type BuildProjectGraphSummaryInput = {\n projectPath: string;\n};\n\nexport const buildProjectGraphSummary = (\n input: BuildProjectGraphSummaryInput,\n): GraphAnalysisSummary => {\n const parsedProject = parseTypescriptProject(input.projectPath);\n const graphData = createGraphData(parsedProject.nodes, parsedProject.edges);\n return createGraphAnalysisSummary(input.projectPath, graphData);\n};\n","import { resolve } from \"node:path\";\n\nexport type AnalyzeTarget = {\n absolutePath: string;\n};\n\nexport type GraphNode = {\n id: string;\n absolutePath: string;\n relativePath: string;\n};\n\nexport type GraphEdge = {\n from: string;\n to: string;\n};\n\nexport type GraphCycle = {\n nodes: readonly string[];\n};\n\nexport type FileDependency = {\n id: string;\n relativePath: string;\n directDependencies: readonly string[];\n fanIn: number;\n fanOut: number;\n depth: number;\n};\n\nexport type GraphMetrics = {\n nodeCount: number;\n edgeCount: number;\n cycleCount: number;\n graphDepth: number;\n maxFanIn: number;\n maxFanOut: number;\n};\n\nexport type GraphAnalysisSummary = {\n targetPath: string;\n nodes: readonly GraphNode[];\n edges: readonly GraphEdge[];\n cycles: readonly GraphCycle[];\n files: readonly FileDependency[];\n metrics: GraphMetrics;\n};\n\nexport const resolveTargetPath = (\n inputPath: string | undefined,\n cwd: string = process.cwd(),\n): AnalyzeTarget => {\n const absolutePath = resolve(cwd, inputPath ?? \".\");\n return { absolutePath };\n};\n","import { buildProjectGraphSummary } from \"@codesentinel/code-graph\";\nimport { resolveTargetPath } from \"@codesentinel/core\";\n\nexport const runAnalyzeCommand = (inputPath: string | undefined): string => {\n const invocationCwd = process.env[\"INIT_CWD\"] ?? process.cwd();\n const target = resolveTargetPath(inputPath, invocationCwd);\n const summary = buildProjectGraphSummary({ projectPath: target.absolutePath });\n return JSON.stringify(summary, null, 2);\n};\n"],"mappings":";;;AAAA,SAAS,eAAe;;;AIAxB,SAAS,SAAS,YAAY,UAAU,eAAe;AACvD,YAAY,QAAQ;AHgBpB,IAAM,UAAU,CAAC,MAAc,OAAuB,GAAG,IAAI,KAAS,EAAE;AAEjE,IAAM,kBAAkB,CAC7B,OACA,aACc;AACd,QAAM,cAAc,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,GAAG,cAAc,EAAE,EAAE,CAAC;AACtE,QAAM,eAAe,IAAI,IAAI,YAAY,IAAI,CAAC,SAAS,KAAK,EAAE,CAAC;AAE/D,QAAM,gBAAgB,oBAAI,IAAwB;AAClD,aAAW,QAAQ,UAAU;AAC3B,QAAI,KAAK,SAAS,KAAK,IAAI;AACzB;IACF;A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AC;AACxC;;;APLA,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,cAAc,EACnB,YAAY,+EAA+E,EAC3F,QAAQ,OAAO;AAElB,QACG,QAAQ,SAAS,EACjB,SAAS,UAAU,gCAAgC,EACnD,OAAO,CAAC,SAAkB;AACzB,QAAM,SAAS,kBAAkB,IAAI;AACrC,UAAQ,OAAO,MAAM,GAAG,MAAM;AAAA,CAAI;AACpC,CAAC;AAEH,IAAI,QAAQ,KAAK,UAAU,GAAG;AAC5B,UAAQ,WAAW;AACnB,UAAQ,KAAK,CAAC;AAChB;AAEA,QAAQ,MAAM,QAAQ,IAAI;","names":["nodeLowLink","program","resolve"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codesentinel/codesentinel",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Command-line interface for CodeSentinel.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=24"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"codesentinel": "dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsup",
|
|
15
|
+
"dev": "node --import tsx/esm src/index.ts",
|
|
16
|
+
"prepack": "pnpm --filter @codesentinel/core build && pnpm --filter @codesentinel/code-graph build && pnpm run build",
|
|
17
|
+
"test": "vitest run"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"commander": "^12.1.0",
|
|
21
|
+
"typescript": "^5.6.3"
|
|
22
|
+
},
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
}
|
|
36
|
+
}
|