mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-02 10:52:27 +00:00
Harden dev mode defaults
This commit is contained in:
1 parent
73c705831b
commit
31b5fc5c16
5 files changed
+79
-14
No files matched your search
+18
-2
@@ -28,14 +28,30 @@ an operator might change it.
|
||||
debug affordances. The value is re-exported as `isDevMode` in
|
||||
`js/config.js` and controls `window.__BITVID_DEV_MODE__` as well as
|
||||
logger routing.
|
||||
- **Why change it:** Set to `false` for production builds so only the stable
|
||||
UX and user-facing logging remain.
|
||||
- **Why change it:** Defaults to `false` for production builds. Set to `true`
|
||||
for local development, or use the runtime override described below to
|
||||
toggle dev mode without editing this file.
|
||||
|
||||
- **`IS_VERBOSE_DEV_MODE`**
|
||||
- **What it does:** Enables high-volume diagnostics inside dev mode (for
|
||||
example, repeated COUNT failures).
|
||||
- **Why change it:** Keep `true` while debugging noisy workflows and set to
|
||||
`false` when you want a quieter dev console without disabling dev mode.
|
||||
Defaults to `false` for production.
|
||||
|
||||
To override the dev flags at runtime (for example in a staging build) without
|
||||
changing `config/instance-config.js`, inject one or both of the following
|
||||
globals **before** `js/config.js` loads:
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.__BITVID_DEV_MODE_OVERRIDE__ = true;
|
||||
window.__BITVID_VERBOSE_DEV_MODE_OVERRIDE__ = true;
|
||||
</script>
|
||||
```
|
||||
|
||||
The overrides accept boolean values or the strings `"true"` / `"false"` so they
|
||||
can be injected at build time.
|
||||
|
||||
- **`IS_LOCKDOWN_MODE`**
|
||||
- **What it does:** Toggles a lockdown posture that limits access and switches
|
||||
|
||||
+16
-3
@@ -59,10 +59,23 @@ The source of truth lives in `config/instance-config.js`:
|
||||
|
||||
- Set `IS_DEV_MODE = true` while developing locally so the dev logger and other
|
||||
diagnostics are available.
|
||||
- Flip `IS_DEV_MODE = false` before shipping a production build. This change
|
||||
propagates to `isDevMode` (the module export), `window.__BITVID_DEV_MODE__`,
|
||||
and `logger.dev`, silencing development-only messages.
|
||||
- Keep `IS_DEV_MODE = false` for production builds. This value propagates to
|
||||
`isDevMode` (the module export), `window.__BITVID_DEV_MODE__`, and
|
||||
`logger.dev`, silencing development-only messages.
|
||||
|
||||
Always commit the flag change alongside deployment-ready configuration tweaks.
|
||||
Forgetting to update the flag leaves verbose traces in user consoles and can
|
||||
expose experimental behavior intended only for QA environments.
|
||||
|
||||
If you need to enable dev logging without editing `config/instance-config.js`,
|
||||
inject a runtime override before `js/config.js` loads:
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.__BITVID_DEV_MODE_OVERRIDE__ = true;
|
||||
window.__BITVID_VERBOSE_DEV_MODE_OVERRIDE__ = true;
|
||||
</script>
|
||||
```
|
||||
|
||||
Overrides accept boolean values or the strings `"true"` / `"false"` so they can
|
||||
be injected by a build pipeline.
|
||||
Reference in new issue
Block a user