|
18 | 18 |
|
19 | 19 | namespace Core.Apps.Development |
20 | 20 | { |
| 21 | + /// <inheritdoc cref="ICommand" /> |
| 22 | + /// <summary> |
| 23 | + /// Builds a map of project dependencies by scanning .csproj files in a given directory. It extracts both NuGet package references and project references, creating a structured representation of how projects depend on each other and on external libraries. The resulting map is stored in the registry for use in WPF visualizations or scripts, allowing developers to easily understand and analyze their project's dependency graph. |
| 24 | + /// </summary> |
| 25 | + /// <seealso cref="Weaver.Interfaces.ICommand" /> |
| 26 | + /// <seealso cref="Weaver.Interfaces.IRegistryProducer" /> |
21 | 27 | public sealed class DependencyExplorer : ICommand, IRegistryProducer |
22 | 28 | { |
23 | 29 | /// <summary> |
@@ -58,6 +64,7 @@ public DependencyExplorer(IVariableRegistry variables) |
58 | 64 | /// <inheritdoc /> |
59 | 65 | public CommandSignature Signature => new(Namespace, Name, ParameterCount); |
60 | 66 |
|
| 67 | + /// <inheritdoc /> |
61 | 68 | /// <inheritdoc /> |
62 | 69 | public CommandResult Execute(params string[] args) |
63 | 70 | { |
@@ -89,14 +96,9 @@ public CommandResult Execute(params string[] args) |
89 | 96 | .Where(v => !string.IsNullOrEmpty(v)) |
90 | 97 | .ToList(); |
91 | 98 |
|
92 | | - // 4. Create a Sub-Object for this project |
93 | | - var details = new Dictionary<string, VmValue> |
94 | | - { |
95 | | - { "packages", VmValue.FromString(string.Join(", ", packages)) }, |
96 | | - { "references", VmValue.FromString(string.Join(", ", refs)) } |
97 | | - }; |
98 | | - |
99 | | - projectMap[projName] = VmValue.FromObject(); // In your registry, this links to the dict |
| 99 | + // 4. Flatten directly into projectMap using prefixed keys |
| 100 | + projectMap[$"{projName}.packages"] = VmValue.FromString(string.Join(", ", packages)); |
| 101 | + projectMap[$"{projName}.references"] = VmValue.FromString(string.Join(", ", refs)); |
100 | 102 |
|
101 | 103 | sb.AppendLine($"Project: {projName}"); |
102 | 104 | sb.AppendLine($" - Libraries: {string.Join(", ", packages)}"); |
|
0 commit comments