mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 23:00:03 +00:00
fix(cli): fix CI format and typecheck failures
- Run oxfmt on cli.ts and client.ts - Replace literal placeholder comparison with phc_ prefix check (TS2367: comparing two different string literals has no overlap) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -50,7 +50,7 @@ export function shouldTrack(): boolean {
|
||||
}
|
||||
|
||||
// Placeholder API key means it hasn't been configured yet
|
||||
if (POSTHOG_API_KEY === "__POSTHOG_API_KEY__") {
|
||||
if (!POSTHOG_API_KEY.startsWith("phc_")) {
|
||||
telemetryEnabled = false;
|
||||
return false;
|
||||
}
|
||||
@@ -139,10 +139,14 @@ export function flushSync(): void {
|
||||
// Spawn a detached process to send the request so we don't block exit.
|
||||
// The subprocess inherits nothing and runs independently.
|
||||
const { execFileSync } = require("node:child_process") as typeof import("node:child_process");
|
||||
execFileSync(process.execPath, [
|
||||
"-e",
|
||||
`fetch(${JSON.stringify(`${POSTHOG_HOST}/batch/`)},{method:"POST",headers:{"Content-Type":"application/json"},body:${JSON.stringify(payload)},signal:AbortSignal.timeout(${FLUSH_TIMEOUT_MS})}).catch(()=>{})`,
|
||||
], { stdio: "ignore", timeout: FLUSH_TIMEOUT_MS });
|
||||
execFileSync(
|
||||
process.execPath,
|
||||
[
|
||||
"-e",
|
||||
`fetch(${JSON.stringify(`${POSTHOG_HOST}/batch/`)},{method:"POST",headers:{"Content-Type":"application/json"},body:${JSON.stringify(payload)},signal:AbortSignal.timeout(${FLUSH_TIMEOUT_MS})}).catch(()=>{})`,
|
||||
],
|
||||
{ stdio: "ignore", timeout: FLUSH_TIMEOUT_MS },
|
||||
);
|
||||
} catch {
|
||||
// Silently ignore
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user