also looking at this
chore(deps): update dependency react to 19.2.7
#2137
222 files
+16350
-1825
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -0,0 +1,17 @@ | ||
| 1 | import type { QRConfig } from './types' | |
| 2 | import { loadConfig } from 'bunfig' | |
| 3 | import { defaults } from './config' | |
| 4 | ||
| 5 | /** | |
| 6 | * Load `qr.config.ts` from disk, falling back to `defaults`. | |
| 7 | * | |
| 8 | * Filesystem-only: bunfig reaches for node builtins, so this must NOT be | |
| 9 | * re-exported from `./index` — that entry is built for the browser. Import | |
| 10 | * this module directly from Bun/node (e.g. the CLI). | |
| 11 | */ | |
| 12 | export async function loadQRConfig(): Promise<QRConfig> { | |
| 13 | return await loadConfig({ | |
| 14 | name: 'qr', | |
| 15 | defaultConfig: defaults, | |
| 16 | }) | |
| 17 | } | |
| @@ -1,5 +1,4 @@ | ||
| 1 | 1 | import type { QRConfig } from './types' |
| 2 | import { loadConfig } from 'bunfig' | |
| 3 | 2 | |
| 4 | 3 | export const defaults: QRConfig = { |
| 5 | 4 | type: 'qr', |
| @@ -29,16 +28,13 @@ export const defaults: QRConfig = { | ||
| 29 | 28 | elementTag: 'svg', |
| 30 | 29 | }, |
| 31 | 30 | } |
| 32 | // eslint-disable-next-line import/no-mutable-exports | |
| 33 | export let config: QRConfig = defaults | |
| 34 | ; (async () => { | |
| 35 | config = await loadConfig({ | |
| 36 | name: 'qr', | |
| 37 | defaultConfig: defaults, | |
| 38 | }) | |
| 39 | })() | |
| 40 | ||
| 41 | // export const config: QRConfig = await loadConfig({ | |
| 42 | // name: 'qrx', | |
| 43 | // defaultConfig: defaults, | |
| 44 | // }) | |
| 31 | /** | |
| 32 | * The active config. | |
| 33 | * | |
| 34 | * This module is part of the browser build, so it resolves to `defaults`. | |
| 35 | * Reading a `qr.config.ts` file is a filesystem concern — importing bunfig | |
| 36 | * here pulled node builtins (`stream/promises`) into the browser bundle and | |
| 37 | * broke the build. Load file config explicitly with `loadQRConfig()` from | |
| 38 | * `./config-loader` (Bun/node only). | |
| 39 | */ | |
| 40 | export const config: QRConfig = defaults | |