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.
This commit is contained in:
parent
be99baf64c
commit
7ffa2e891b
3 changed files with 3 additions and 102 deletions
12
CLEANUP.md
12
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.
|
*(Completed 2026-05-09: `build.js` removed and `pkgs.esbuild` dropped from flake.nix devShell — Vite is the build tool)*
|
||||||
|
|
||||||
### 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)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -291,7 +285,7 @@ Empty placeholder file. Remove.
|
||||||
|
|
||||||
1. **High impact, low effort:**
|
1. **High impact, low effort:**
|
||||||
- ~~Remove `tomtom/` (unused, no imports)~~ ✅
|
- ~~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 commented-out routes in `sync/routes.go` and `rmo/routes.go`
|
||||||
- Remove `query.go` commented-out code
|
- Remove `query.go` commented-out code
|
||||||
- Remove `static/gen/main.js` stale artifact
|
- Remove `static/gen/main.js` stale artifact
|
||||||
|
|
|
||||||
92
build.js
92
build.js
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
@ -31,7 +31,6 @@
|
||||||
pkgs.air
|
pkgs.air
|
||||||
pkgs.autoprefixer
|
pkgs.autoprefixer
|
||||||
pkgs.dart-sass
|
pkgs.dart-sass
|
||||||
pkgs.esbuild
|
|
||||||
pkgs.go
|
pkgs.go
|
||||||
pkgs.go-jet
|
pkgs.go-jet
|
||||||
pkgs.golangci-lint
|
pkgs.golangci-lint
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue