From 7ffa2e891b51be4363be9d62c0ee12585c003dec Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Sat, 9 May 2026 01:03:51 +0000 Subject: [PATCH] Remove dead esbuild build.js and flake.nix dependency build.js was an esbuild-based build script from the pre-Vite era (March 2026). It is not referenced by package.json, CI, or any config. Vite is used for both sync and rmo builds. Also dropped pkgs.esbuild from flake.nix devShell. --- CLEANUP.md | 12 ++----- build.js | 92 ------------------------------------------------------ flake.nix | 1 - 3 files changed, 3 insertions(+), 102 deletions(-) delete mode 100644 build.js diff --git a/CLEANUP.md b/CLEANUP.md index 305b3ec0..2254e00f 100644 --- a/CLEANUP.md +++ b/CLEANUP.md @@ -115,15 +115,9 @@ Once all routes are ported or confirmed dead, remove the entire `html/template/` --- -## 3. esbuild (`build.js`) — Dead Build Tool +## 3. esbuild (`build.js`) — Removed ✅ -**Status:** `build.js` is an esbuild-based build script that predates the Vite migration. It is not referenced by `package.json` scripts (those use `vite build`). It is also not referenced by any CI or Nix config. - -### 3a. Remove esbuild-related files - -- `build.js` — the esbuild build script -- Remove `pkgs.esbuild` from `flake.nix` devShell dependencies (if not used elsewhere) -- Remove esbuild-related dependencies from `package.json` if present (currently no esbuild deps are in `package.json` — they may have been already cleaned) +*(Completed 2026-05-09: `build.js` removed and `pkgs.esbuild` dropped from flake.nix devShell — Vite is the build tool)* --- @@ -291,7 +285,7 @@ Empty placeholder file. Remove. 1. **High impact, low effort:** - ~~Remove `tomtom/` (unused, no imports)~~ ✅ - - Remove `build.js` (dead, replaced by Vite) + - ~~Remove `build.js` (dead, replaced by Vite)~~ ✅ - Remove commented-out routes in `sync/routes.go` and `rmo/routes.go` - Remove `query.go` commented-out code - Remove `static/gen/main.js` stale artifact diff --git a/build.js b/build.js deleted file mode 100644 index 8c94ffed..00000000 --- a/build.js +++ /dev/null @@ -1,92 +0,0 @@ -import esbuild from "esbuild"; -import vue from "esbuild-plugin-vue3"; -import { sassPlugin } from "esbuild-sass-plugin"; - -const args = process.argv.slice(2); -const watch = args.includes("--watch"); -const minify = args.includes("--minify"); - -// Plugin to show build status -const buildStatusPlugin = { - name: "build-status", - setup(build) { - let buildStart; - - build.onStart(() => { - buildStart = Date.now(); - // Clear console and move cursor to top - console.clear(); - console.log( - "\x1b[36m%s\x1b[0m", - `🔨 Building... [${new Date().toLocaleTimeString()}]`, - ); - }); - - build.onEnd((result) => { - const buildTime = Date.now() - buildStart; - if (result.errors.length > 0) { - console.log( - "\x1b[31m%s\x1b[0m", - `❌ Build failed (${buildTime}ms) [${new Date().toLocaleTimeString()}]`, - ); - } else { - console.log( - "\x1b[32m%s\x1b[0m", - `✅ Build complete (${buildTime}ms) [${new Date().toLocaleTimeString()}]`, - ); - } - console.log("\x1b[33m%s\x1b[0m", "\n👀 Watching for changes..."); - }); - }, -}; - -const config = { - entryPoints: ["ts/main.ts"], - bundle: true, - format: "esm", - plugins: [ - buildStatusPlugin, // Add this first - sassPlugin({ - quietDeps: true, - precompile(source, pathname) { - // Only inject variables into Vue component styles - // (not the main scss files to avoid circular imports) - if (pathname.endsWith(".vue")) { - return `@import "./ts/style/variables.scss";\n${source}`; - } - return source; - }, - silenceDeprecations: ["import"], - type: "css", - }), - vue({ - sourceMap: true, - }), - ], - sourcemap: true, - sourcesContent: true, - define: { - __VUE_OPTIONS_API__: "true", - __VUE_PROD_DEVTOOLS__: "false", - __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false", - }, - minify, - loader: { - ".css": "css", - ".woff": "file", - ".woff2": "file", - ".ttf": "file", - ".eot": "file", - }, - outdir: "static/gen", - outbase: "ts", - assetNames: "fonts/[name]", -}; - -if (watch) { - const ctx = await esbuild.context(config); - await ctx.watch(); - console.log("\x1b[33m%s\x1b[0m", "👀 Watching for changes...\n"); -} else { - await esbuild.build(config); -} diff --git a/flake.nix b/flake.nix index 486d275f..e937e801 100644 --- a/flake.nix +++ b/flake.nix @@ -31,7 +31,6 @@ pkgs.air pkgs.autoprefixer pkgs.dart-sass - pkgs.esbuild pkgs.go pkgs.go-jet pkgs.golangci-lint