mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +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:
@@ -44,7 +44,10 @@ const main = defineCommand({
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
const commandArg = process.argv[2];
|
const commandArg = process.argv[2];
|
||||||
const isHelpOrVersion = process.argv.includes("--help") || process.argv.includes("--version") || process.argv.includes("-h");
|
const isHelpOrVersion =
|
||||||
|
process.argv.includes("--help") ||
|
||||||
|
process.argv.includes("--version") ||
|
||||||
|
process.argv.includes("-h");
|
||||||
const command = commandArg && commandArg in subCommands ? commandArg : "unknown";
|
const command = commandArg && commandArg in subCommands ? commandArg : "unknown";
|
||||||
|
|
||||||
if (command !== "telemetry" && command !== "unknown" && !isHelpOrVersion) {
|
if (command !== "telemetry" && command !== "unknown" && !isHelpOrVersion) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export function shouldTrack(): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Placeholder API key means it hasn't been configured yet
|
// 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;
|
telemetryEnabled = false;
|
||||||
return 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.
|
// Spawn a detached process to send the request so we don't block exit.
|
||||||
// The subprocess inherits nothing and runs independently.
|
// The subprocess inherits nothing and runs independently.
|
||||||
const { execFileSync } = require("node:child_process") as typeof import("node:child_process");
|
const { execFileSync } = require("node:child_process") as typeof import("node:child_process");
|
||||||
execFileSync(process.execPath, [
|
execFileSync(
|
||||||
"-e",
|
process.execPath,
|
||||||
`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 });
|
"-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 {
|
} catch {
|
||||||
// Silently ignore
|
// Silently ignore
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user