Remove ESBuild experiment. Add --install option for bash completions. Move shell scripts to separate files for auditability. Fix template inspect command autocomplete and output formatting

This commit is contained in:
2026-04-20 11:12:26 +00:00
parent ff2fe126c6
commit 32c42cdc2d
11 changed files with 706 additions and 1049 deletions

View File

@@ -1,62 +0,0 @@
#!/usr/bin/env node
/**
* Build script for xo-complete autocomplete helper.
*
* Bundles the autocomplete script with all dependencies into a single file
* for faster startup time. This avoids the ~600ms module import overhead
* that occurs with dynamic ESM imports.
*/
import * as esbuild from "esbuild";
import { join, dirname } from "path";
import { fileURLToPath } from "url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const projectRoot = join(__dirname, "..");
async function build() {
try {
const result = await esbuild.build({
entryPoints: [join(projectRoot, "src/cli/autocomplete/complete.ts")],
bundle: true,
platform: "node",
target: "node20",
format: "esm",
outfile: join(projectRoot, "dist/cli/autocomplete/complete.bundle.js"),
// Mark modules as external that either have native components or bundling issues
// We keep heavy deps external, and also keep offline-engine external so it stays
// as a dynamic import (it pulls in the heavy engine dependencies)
external: [
"better-sqlite3",
"fsevents",
"@bitauth/libauth",
"@xo-cash/*",
"@electrum-cash/*",
"./offline-engine.js",
],
// Generate source maps for debugging
sourcemap: true,
// Minify for slightly smaller bundle
minify: false,
// Keep names for better error messages
keepNames: true,
// Log build info
logLevel: "info",
});
console.log("Autocomplete bundle built successfully!");
if (result.warnings.length > 0) {
console.warn("Warnings:", result.warnings);
}
} catch (error) {
console.error("Build failed:", error);
process.exit(1);
}
}
build();