Commit 795ac49
committed
Honor
The previous commit reduced enablement to `!!config[CONFIG_KEY]`, which
meant `{ liveDebugger: { enable: false } }` silently kept the plugin
enabled. Every other plugin in this repo (`apps`, `error-tracking`,
`metrics`, `output`, `rum`) accepts an explicit `enable: false` — either
directly (`apps`) or implicitly via spread ordering (the rest).
Switch `validate.ts` to the explicit `apps`-style pattern:
enable: pluginConfig.enable ?? !!config[CONFIG_KEY]
so that:
- omitted `liveDebugger` key -> disabled
- `liveDebugger: {}` -> enabled
- `liveDebugger: { enable: true }` -> enabled
- `liveDebugger: { enable: false }` -> disabled
Also add a runtime `typeof enable === 'boolean'` check alongside the
existing boolean-option validations, and re-document `liveDebugger.enable`
in the README to match the `apps` README wording.
Test coverage:
- Restore the "return an empty array when enable is false" test in
`index.test.ts`.
- Add `enable: false` / `enable: true` cases to `validateOptions` defaults
tests and a new `invalid enable` describe block covering non-boolean
inputs. Extend the `multiple errors` aggregate test to include `enable`.liveDebugger.enable: false to match other plugins1 parent d63bd7f commit 795ac49
4 files changed
Lines changed: 56 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
297 | 306 | | |
298 | 307 | | |
299 | 308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
| |||
210 | 220 | | |
211 | 221 | | |
212 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
213 | 245 | | |
214 | 246 | | |
215 | 247 | | |
| |||
279 | 311 | | |
280 | 312 | | |
281 | 313 | | |
| 314 | + | |
282 | 315 | | |
283 | 316 | | |
284 | 317 | | |
| |||
291 | 324 | | |
292 | 325 | | |
293 | 326 | | |
| 327 | + | |
294 | 328 | | |
295 | 329 | | |
296 | 330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| |||
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
83 | | - | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
| |||
0 commit comments