Configure lefthook formatter checks (#231)

* Add lefthook formatter checks

* Fix SDK mode hydration

* Stabilize SDK mode integration test
This commit is contained in:
Nathan Flurry 2026-03-10 23:03:11 -07:00 committed by GitHub
parent 0471214d65
commit d2346bafb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
282 changed files with 5840 additions and 8399 deletions

View file

@ -1,13 +1,5 @@
import * as childProcess from "node:child_process";
import {
closeSync,
existsSync,
mkdirSync,
openSync,
readFileSync,
rmSync,
writeFileSync
} from "node:fs";
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { homedir } from "node:os";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
@ -141,7 +133,7 @@ function removeStateFiles(host: string, port: number): void {
async function checkHealth(host: string, port: number): Promise<boolean> {
return await checkBackendHealth({
endpoint: `http://${host}:${port}/api/rivet`,
timeoutMs: HEALTH_TIMEOUT_MS
timeoutMs: HEALTH_TIMEOUT_MS,
});
}
@ -206,25 +198,14 @@ function resolveLaunchSpec(host: string, port: number): LaunchSpec {
return {
command: resolveBunCommand(),
args: [backendEntry, "start", "--host", host, "--port", String(port)],
cwd: repoRoot
cwd: repoRoot,
};
}
return {
command: "pnpm",
args: [
"--filter",
"@openhandoff/backend",
"exec",
"bun",
"src/index.ts",
"start",
"--host",
host,
"--port",
String(port)
],
cwd: repoRoot
args: ["--filter", "@openhandoff/backend", "exec", "bun", "src/index.ts", "start", "--host", host, "--port", String(port)],
cwd: repoRoot,
};
}
@ -252,7 +233,7 @@ async function startBackend(host: string, port: number): Promise<void> {
cwd: launch.cwd,
detached: true,
stdio: ["ignore", fd, fd],
env: process.env
env: process.env,
});
child.on("error", (error) => {
@ -298,7 +279,7 @@ function findProcessOnPort(port: number): number | null {
const out = childProcess
.execFileSync("lsof", ["-i", `:${port}`, "-t", "-sTCP:LISTEN"], {
encoding: "utf8",
stdio: ["ignore", "pipe", "ignore"]
stdio: ["ignore", "pipe", "ignore"],
})
.trim();
@ -372,7 +353,7 @@ export async function getBackendStatus(host: string, port: number): Promise<Back
pid,
version: readBackendVersion(host, port),
versionCurrent: isVersionCurrent(host, port),
logPath
logPath,
};
}
removeStateFiles(host, port);
@ -384,7 +365,7 @@ export async function getBackendStatus(host: string, port: number): Promise<Back
pid: null,
version: readBackendVersion(host, port),
versionCurrent: isVersionCurrent(host, port),
logPath
logPath,
};
}
@ -393,7 +374,7 @@ export async function getBackendStatus(host: string, port: number): Promise<Back
pid: null,
version: readBackendVersion(host, port),
versionCurrent: false,
logPath
logPath,
};
}