From 44a818bba05e1ccbe70b204d60fc62996ad7ce6d Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Wed, 15 Oct 2025 10:43:31 -0400 Subject: [PATCH] Expose dev mode flag via instance config --- config/instance-config.js | 13 +++++++++++++ js/config.js | 10 +++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/config/instance-config.js b/config/instance-config.js index 76a03965..0fe993aa 100644 --- a/config/instance-config.js +++ b/config/instance-config.js @@ -13,6 +13,19 @@ // adjustments are safe. When in doubt, mirror the structure shown here so other // contributors can follow along. +/** + * Whether the current deployment should enable developer-centric behavior. + * + * When `true`, bitvid surfaces extra logging, debug helpers, and experimental + * UI affordances intended for development environments. Set the value to + * `false` before deploying to production so that end users receive the stable + * experience. Downstream modules read this flag via `js/config.js`, which also + * mirrors the legacy casing (`isDEVMODE`) for compatibility with older + * imports. + */ +export const IS_DEV_MODE = true; +export const isDEVMODE = IS_DEV_MODE; + /** * The primary administrator for this bitvid instance. * diff --git a/js/config.js b/js/config.js index ce79dc44..4e90081a 100644 --- a/js/config.js +++ b/js/config.js @@ -1,6 +1,8 @@ // js/config.js import { + IS_DEV_MODE, + isDEVMODE, ADMIN_SUPER_NPUB, ADMIN_DM_IMAGE_URL, BITVID_WEBSITE_URL, @@ -26,7 +28,13 @@ import { ENSURE_PRESENCE_REBROADCAST_COOLDOWN_SECONDS, } from "../config/instance-config.js"; -export const isDevMode = true; // Set to false for production +export const isDevMode = Boolean(IS_DEV_MODE); +export { IS_DEV_MODE }; +export { isDEVMODE }; + +if (typeof window !== "undefined") { + window.__BITVID_DEV_MODE__ = isDevMode; +} // ----------------------------------------------------------------------------- // Admin governance — production defaults rely on remote Nostr lists