arcvision 0.1.24 → 0.1.25
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.js +13 -12
- package/package.json +1 -1
- package/src/engine/context_builder.js +16 -15
package/dist/index.js
CHANGED
|
@@ -56615,27 +56615,28 @@ var require_context_builder = __commonJS({
|
|
|
56615
56615
|
language = "javascript"
|
|
56616
56616
|
} = options;
|
|
56617
56617
|
const nodes = files.map((file) => {
|
|
56618
|
-
const
|
|
56619
|
-
const normalizedPath = relativePath.replace(/\\/g, "/");
|
|
56618
|
+
const normalizedPath = file.id;
|
|
56620
56619
|
return {
|
|
56621
56620
|
id: stableId(normalizedPath),
|
|
56622
56621
|
type: "file",
|
|
56623
56622
|
path: normalizedPath,
|
|
56624
56623
|
role: file.metadata.functions.length > 0 ? "Implementation" : "Structure",
|
|
56625
|
-
dependencies: file.metadata.imports.map((imp) => imp.source)
|
|
56624
|
+
dependencies: file.metadata.imports.map((imp) => imp.source),
|
|
56625
|
+
blast_radius: file.metadata.blast_radius || 0
|
|
56626
56626
|
};
|
|
56627
56627
|
});
|
|
56628
|
-
const schemaEdges =
|
|
56628
|
+
const schemaEdges = [];
|
|
56629
|
+
for (const edge of edges) {
|
|
56629
56630
|
const sourceNode = nodes.find((n) => n.path === edge.source);
|
|
56630
56631
|
const targetNode = nodes.find((n) => n.path === edge.target);
|
|
56631
|
-
|
|
56632
|
-
|
|
56633
|
-
|
|
56634
|
-
|
|
56635
|
-
|
|
56636
|
-
|
|
56637
|
-
}
|
|
56638
|
-
}
|
|
56632
|
+
if (sourceNode && targetNode) {
|
|
56633
|
+
schemaEdges.push({
|
|
56634
|
+
from: sourceNode.id,
|
|
56635
|
+
to: targetNode.id,
|
|
56636
|
+
relation: "imports"
|
|
56637
|
+
});
|
|
56638
|
+
}
|
|
56639
|
+
}
|
|
56639
56640
|
const metrics = {
|
|
56640
56641
|
total_files: nodes.length,
|
|
56641
56642
|
total_nodes: nodes.length,
|
package/package.json
CHANGED
|
@@ -17,34 +17,35 @@ function buildContext(files, edges, options = {}) {
|
|
|
17
17
|
|
|
18
18
|
// Build nodes from files
|
|
19
19
|
const nodes = files.map(file => {
|
|
20
|
-
|
|
21
|
-
const normalizedPath =
|
|
20
|
+
// Use the node's id field which is already the normalized relative path
|
|
21
|
+
const normalizedPath = file.id;
|
|
22
22
|
|
|
23
23
|
return {
|
|
24
24
|
id: stableId(normalizedPath),
|
|
25
25
|
type: 'file',
|
|
26
26
|
path: normalizedPath,
|
|
27
27
|
role: file.metadata.functions.length > 0 ? 'Implementation' : 'Structure',
|
|
28
|
-
dependencies: file.metadata.imports.map(imp => imp.source)
|
|
28
|
+
dependencies: file.metadata.imports.map(imp => imp.source),
|
|
29
|
+
blast_radius: file.metadata.blast_radius || 0
|
|
29
30
|
};
|
|
30
31
|
});
|
|
31
32
|
|
|
32
33
|
// Build edges from dependencies
|
|
33
|
-
const schemaEdges =
|
|
34
|
+
const schemaEdges = [];
|
|
35
|
+
for (const edge of edges) {
|
|
34
36
|
// Find source and target nodes to get their stable IDs
|
|
35
37
|
const sourceNode = nodes.find(n => n.path === edge.source);
|
|
36
38
|
const targetNode = nodes.find(n => n.path === edge.target);
|
|
37
|
-
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
39
|
+
|
|
40
|
+
// Only include edges where both source and target nodes exist
|
|
41
|
+
if (sourceNode && targetNode) {
|
|
42
|
+
schemaEdges.push({
|
|
43
|
+
from: sourceNode.id,
|
|
44
|
+
to: targetNode.id,
|
|
45
|
+
relation: 'imports'
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
48
49
|
|
|
49
50
|
// Calculate metrics
|
|
50
51
|
const metrics = {
|