mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-10-30 17:27:09 +00:00
* feat(cli): write one diagnostic report when a command stays silent for 60 s * feat(cli): load the hang report only when it is asked for * fix(cli): the hang report is written without announcing itself on stderr * fix(cli): the hang report leaves out environment values or is not written, and is written once * refactor(cli): shorten the hang report comment to the line limit
18 lines
768 B
JavaScript
18 lines
768 B
JavaScript
#!/usr/bin/env node
|
|
|
|
import module from "node:module";
|
|
import { runtimeVersionError } from "../dist/runtimeVersion.js";
|
|
|
|
const error = runtimeVersionError(process.versions.node);
|
|
if (error) {
|
|
console.error(error);
|
|
process.exitCode = 1;
|
|
} else {
|
|
// Reuses V8 bytecode across runs (os.tmpdir()/node-compile-cache); Node 22.0 has no such API.
|
|
module.enableCompileCache?.();
|
|
if (process.env.HYPERFRAMES_HANG_REPORT) (await import("../dist/hangReport.js")).watchForHang();
|
|
const warm = process.argv[2] === "check" ? await import("../dist/warmCheckClient.js") : undefined;
|
|
if (warm?.warmCheckEligible()) process.once("exit", () => warm.startNextWarmCheck());
|
|
if (!(warm?.warmCheckEligible() && (await warm.runWarmCheck()))) await import("../dist/cli.js");
|
|
}
|