Skip to content

Commit f1d668e

Browse files
committed
refactor: some more comment cleanup
1 parent 551e529 commit f1d668e

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

src/ui/registry/registry.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ function getDefaultUIDistPath(): string {
1818

1919
/**
2020
* UI Registry that manages bundled UI HTML strings for tools.
21-
*
22-
* The registry:
23-
* - Loads default bundled HTML from dist/ui/ at runtime
24-
* - Allows custom UIs via constructor options
25-
* - Provides get() to retrieve UI HTML for a tool
2621
*/
2722
export class UIRegistry {
2823
private customUIs: Map<string, string> = new Map();
@@ -46,23 +41,19 @@ export class UIRegistry {
4641
* @returns The HTML string, or undefined if no UI exists for this tool
4742
*/
4843
get(toolName: string): string | undefined {
49-
// Check for custom UI first
5044
if (this.customUIs.has(toolName)) {
5145
return this.customUIs.get(toolName);
5246
}
5347

54-
// Check if we have a mapping for this tool
5548
const componentName = uiMap[toolName];
5649
if (!componentName) {
5750
return undefined;
5851
}
5952

60-
// Check cache
6153
if (this.cache.has(toolName)) {
6254
return this.cache.get(toolName);
6355
}
6456

65-
// Try to load from disk
6657
const filePath = join(this.uiDistPath, `${componentName}.html`);
6758
if (!existsSync(filePath)) {
6859
return undefined;

vite.ui.config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,11 @@ function generateHtmlEntries(): Plugin {
4848
const components = discoverComponents();
4949
const template = readFileSync(templatePath, "utf-8");
5050

51-
// Ensure entries directory exists
5251
if (!existsSync(entriesDir)) {
5352
mkdirSync(entriesDir, { recursive: true });
5453
}
5554

5655
for (const componentName of components) {
57-
// Generate HTML by replacing placeholders in template
5856
const html = template
5957
.replace("{{COMPONENT_NAME}}", componentName)
6058
.replace("{{TITLE}}", componentName.replace(/([A-Z])/g, " $1").trim()) // "ListDatabases" -> "List Databases"
@@ -70,13 +68,10 @@ function generateHtmlEntries(): Plugin {
7068

7169
const components = discoverComponents();
7270

73-
// https://vitejs.dev/config/
7471
export default defineConfig({
75-
// Set root to entries directory so output paths are relative to it
7672
root: entriesDir,
7773
plugins: [
7874
generateHtmlEntries(),
79-
// Cast to PluginOption due to Vite version mismatch in plugin types
8075
nodePolyfills({
8176
include: ["buffer", "stream"],
8277
globals: {
@@ -89,7 +84,6 @@ export default defineConfig({
8984
}),
9085
],
9186
build: {
92-
// Output relative to project root, not the Vite root
9387
outDir: resolve(__dirname, "dist/ui"),
9488
emptyOutDir: true,
9589
rollupOptions: {

0 commit comments

Comments
 (0)