From a3ad292b818bda135210c8c209a26c580f582673 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Wed, 3 Dec 2025 21:01:56 -0800 Subject: [PATCH] Use vanilla JS for aggregator frontend (no React bundling needed) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The HTML import with React/TSX doesn't work well in Docker production builds. Replace with a self-contained HTML file with vanilla JS that works reliably across all environments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/aggregator/index.ts | 19 ++- src/aggregator/web/index.html | 311 +++++++++++++++++++++++++++++++++- 2 files changed, 325 insertions(+), 5 deletions(-) diff --git a/src/aggregator/index.ts b/src/aggregator/index.ts index 115ab69..b53357c 100644 --- a/src/aggregator/index.ts +++ b/src/aggregator/index.ts @@ -16,10 +16,14 @@ import { parseTask } from "../markdown/parser.ts"; import type { Task } from "../types/index.ts"; import { sortByTaskId } from "../utils/task-sorting.ts"; -// @ts-expect-error - Bun HTML import -import indexHtml from "./web/index.html"; // @ts-expect-error - Bun file import import favicon from "../web/favicon.png" with { type: "file" }; +import { dirname, join as pathJoin } from "node:path"; +import { fileURLToPath } from "node:url"; + +// Get the directory of this file +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); interface ProjectConfig { path: string; @@ -87,7 +91,16 @@ export class BacklogAggregator { port: this.config.port, development: process.env.NODE_ENV === "development", routes: { - "/": indexHtml, + "/": async () => { + const htmlPath = pathJoin(__dirname, "web", "index.html"); + const htmlFile = Bun.file(htmlPath); + return new Response(htmlFile, { headers: { "Content-Type": "text/html" } }); + }, + "/app.tsx": async () => { + const tsxPath = pathJoin(__dirname, "web", "app.tsx"); + const tsxFile = Bun.file(tsxPath); + return new Response(tsxFile, { headers: { "Content-Type": "application/javascript" } }); + }, "/api/projects": { GET: async () => this.handleGetProjects(), }, diff --git a/src/aggregator/web/index.html b/src/aggregator/web/index.html index f18111b..dab290a 100644 --- a/src/aggregator/web/index.html +++ b/src/aggregator/web/index.html @@ -5,9 +5,316 @@ Backlog Aggregator - Real-time Task View - + -
+
+
+

Backlog Aggregator

+ Connecting... +
+
Loading...
+
+ +
+ + +
+ +
+
+
+

To Do

+ 0 +
+
+
+
+
+

In Progress

+ 0 +
+
+
+
+
+

Done

+ 0 +
+
+
+
+ +