-
-
Notifications
You must be signed in to change notification settings - Fork 6
refactor(LLMs): improve generator tools #889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Copyright (c) BootstrapBlazor & Argo Zhang ([email protected]). All rights reserved. | ||
| // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
| // Website: https://www.blazor.zone | ||
|
|
||
| using BootstrapBlazorLLMsDocsGenerator; | ||
| using System.CommandLine; | ||
|
|
||
| namespace BootstrapBlazor.LLMsDocsGenerator; | ||
|
|
||
| internal static class ArgumentsHelper | ||
| { | ||
| public static ParseResult Parse(string[] args) | ||
| { | ||
| var rootFolderOption = new Option<string?>("--root") { Description = "Set the root folder of project" }; | ||
|
|
||
| var rootCommand = new RootCommand("BootstrapBlazor LLMs Documentation Generator") | ||
| { | ||
| rootFolderOption | ||
| }; | ||
|
|
||
| rootCommand.SetAction(async result => | ||
| { | ||
| var rootFolder = result.GetValue(rootFolderOption); | ||
| if (string.IsNullOrEmpty(rootFolder)) | ||
| { | ||
| return; | ||
| } | ||
|
Comment on lines
+24
to
+27
|
||
|
|
||
| await DocsGenerator.GenerateAllAsync(rootFolder); | ||
|
Comment on lines
+23
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Handling of missing Right now, omitting |
||
| }); | ||
|
|
||
| return rootCommand.Parse(args); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,11 +1,12 @@ | ||||||
| <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|
|
||||||
| <PropertyGroup> | ||||||
| <Version>10.0.0</Version> | ||||||
| <Version>10.0.1</Version> | ||||||
| <OutputType>Exe</OutputType> | ||||||
| <TargetFramework>net10.0</TargetFramework> | ||||||
| <ImplicitUsings>enable</ImplicitUsings> | ||||||
| <Nullable>enable</Nullable> | ||||||
| <SatelliteResourceLanguages>false</SatelliteResourceLanguages> | ||||||
|
||||||
| <SatelliteResourceLanguages>false</SatelliteResourceLanguages> | |
| <SatelliteResourceLanguages></SatelliteResourceLanguages> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |||||
| using Microsoft.CodeAnalysis.CSharp.Syntax; | ||||||
| using System.Text.RegularExpressions; | ||||||
|
|
||||||
| namespace LlmsDocsGenerator; | ||||||
| namespace BootstrapBlazorLLMsDocsGenerator; | ||||||
|
||||||
| namespace BootstrapBlazorLLMsDocsGenerator; | |
| namespace BootstrapBlazor.LLMsDocsGenerator; |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |||||
| // See the LICENSE file in the project root for more information. | ||||||
| // Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone | ||||||
|
|
||||||
| namespace LlmsDocsGenerator; | ||||||
| namespace BootstrapBlazorLLMsDocsGenerator; | ||||||
|
||||||
| namespace BootstrapBlazorLLMsDocsGenerator; | |
| namespace BootstrapBlazor.LLMsDocsGenerator; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,241 +3,56 @@ | |||||||||||||||||||||||||||||||||||||||||||
| // See the LICENSE file in the project root for more information. | ||||||||||||||||||||||||||||||||||||||||||||
| // Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| namespace LlmsDocsGenerator; | ||||||||||||||||||||||||||||||||||||||||||||
| namespace BootstrapBlazorLLMsDocsGenerator; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
| namespace BootstrapBlazorLLMsDocsGenerator; | |
| namespace BootstrapBlazor.LLMsDocsGenerator; |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target framework version "net10.0" is hard-coded in the output path. This makes the tool brittle - if the framework version changes or if the tool needs to support multiple framework versions, this path will break. Consider making this configurable or dynamically detecting the framework version.
| var _outputPath = Path.Combine(rootFolder, "bin", "Release", "net10.0", "publish", "wwwroot", "llms"); | |
| var releaseDir = Path.Combine(rootFolder, "bin", "Release"); | |
| string targetFrameworkDir; | |
| if (Directory.Exists(releaseDir)) | |
| { | |
| targetFrameworkDir = Path.Combine(releaseDir, "net10.0"); | |
| foreach (var dir in Directory.GetDirectories(releaseDir)) | |
| { | |
| var frameworkName = Path.GetFileName(dir); | |
| if (frameworkName.StartsWith("net", StringComparison.OrdinalIgnoreCase)) | |
| { | |
| targetFrameworkDir = dir; | |
| break; | |
| } | |
| } | |
| } | |
| else | |
| { | |
| targetFrameworkDir = Path.Combine(releaseDir, "net10.0"); | |
| } | |
| var _outputPath = Path.Combine(targetFrameworkDir, "publish", "wwwroot", "llms"); |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the source path doesn't exist, the method silently returns without any error message or logging. This makes it difficult to debug why documentation generation failed. Consider adding an error message or throwing an exception to inform the user that the source path was not found.
| { | |
| { | |
| Logger($"Source path not found: {_sourcePath}. Documentation generation aborted."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a namespace inconsistency: line 5 uses
BootstrapBlazorLLMsDocsGenerator(no dots between words) while line 8 declares the namespace asBootstrapBlazor.LLMsDocsGenerator(with dots). This mismatch will cause a compilation error. The using statement should match the actual namespace of the DocsGenerator class, which appears to beBootstrapBlazorLLMsDocsGeneratorbased on DocsGenerator.cs line 6.