added basic cli telemetry

This commit is contained in:
dswbx
2025-03-14 11:40:56 +01:00
parent a55d93b5ff
commit 6015acb914
6 changed files with 141 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
export type Env = {};
export const is_toggled = (given: unknown): boolean => {
return typeof given === "string" ? [1, "1", "true"].includes(given) : Boolean(given);
export const is_toggled = (given: unknown, fallback?: boolean): boolean => {
return typeof given === "string" ? [1, "1", "true"].includes(given) : Boolean(fallback);
};
export function isDebug(): boolean {
@@ -34,6 +34,13 @@ const envs = {
return typeof v === "string" ? v : undefined;
},
},
// cli telemetry
cli_telemetry: {
key: "BKND_CLI_TELEMETRY",
validate: (v: unknown) => {
return is_toggled(v, true);
},
},
// module manager debug: {
modules_debug: {
key: "BKND_MODULES_DEBUG",