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 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 relativePath = path2.relative(directory, file.metadata.id);
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 = edges.map((edge) => {
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
- const sourceNodeId = sourceNode ? sourceNode.id : stableId(edge.source);
56632
- const targetNodeId = targetNode ? targetNode.id : stableId(edge.target);
56633
- return {
56634
- from: sourceNodeId,
56635
- to: targetNodeId,
56636
- relation: "imports"
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcvision",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "Architecture scanner for modern codebases",
5
5
  "bin": {
6
6
  "arcvision": "./dist/index.js"
@@ -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
- const relativePath = path.relative(directory, file.metadata.id);
21
- const normalizedPath = relativePath.replace(/\\/g, '/');
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 = edges.map(edge => {
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
- // Use the found node IDs, or generate stable IDs if nodes aren't found
39
- const sourceNodeId = sourceNode ? sourceNode.id : stableId(edge.source);
40
- const targetNodeId = targetNode ? targetNode.id : stableId(edge.target);
41
-
42
- return {
43
- from: sourceNodeId,
44
- to: targetNodeId,
45
- relation: 'imports'
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 = {