Skip to content

chore: drop bunfig keys Bun ignores and fix broken npm scripts - #91

Merged
navbytes merged 1 commit into
mainfrom
chore/prune-bunfig
Aug 19, 2026
Merged

chore: drop bunfig keys Bun ignores and fix broken npm scripts#91
navbytes merged 1 commit into
mainfrom
chore/prune-bunfig

Conversation

@navbytes

Copy link
Copy Markdown
Owner

Cleanup of tooling config that does not do what it says.

bunfig.toml — keys Bun silently ignores

Bun does not warn about unknown bunfig keys, so these had read as working configuration for a long time. Each removal was verified, not assumed:

Removed How it was checked
[build] (whole section) Set minify/sourcemap, ran bun build with no CLI flags → no .js.map, output kept original identifiers. Not a bunfig section at all.
[test] timeout = 5000 Set timeout = 100, ran a 300ms test → passed.
[test] bail = false Set bail = true with a failing first file → second file still ran.
[install] frozen Docs: the real key is frozenLockfile.
[install] auto = true Real key, but takes "auto"|"force"|"disable"|"fallback" — not a boolean. It also governs runtime auto-install of missing packages, not "peer dependencies" as the comment claimed.
[install] parallel No such option.
[install.scopes] Both scopes pointed at the default registry — a no-op.

registry is kept despite matching the default: stating it explicitly stops a user-level .npmrc or bunfig from silently redirecting installs for this project.

The file header now records what was removed and why, so the same keys don't get re-added.

Three npm scripts were broken

bun --shell '<command>' misuses --shell, which takes bun or system, not a command. clean, clean:all and dev:extension errored on every invocation:

error: Expected --shell to be one of 'bun' or 'system'.
Received: "rm -rf dist dev node_modules/.vite"

Confirmed pre-existing (same failure with this branch's bunfig change stashed). Scripts already run under Bun's shell via [run] shell, so the wrapper was only ever wrong. bun run clean now actually deletes its targets.

One judgement call worth reviewing

dev:extension needed more than the syntax fix. Without --mode development, Vite defaults to production, setupDevEnvironment() is never registered (it's gated on !isProduction), and output lands in dist/ — making the script identical to bun run build despite its name. With the flag it produces dev/, which is what .gitignore's dev/* expects.

No regression risk, since the script never ran at all before — but this is a behaviour choice rather than a mechanical fix, so it's the bit to push back on if you disagree.

Also dropped ./tests/example.test.ts from the four test scripts; that file doesn't exist and Bun was silently ignoring it.

Verification

  • Build succeeds; 495 unit pass; svelte-check 4053 files, 0 errors; biome ci clean (2 pre-existing warnings)
  • 54 e2e pass in real Chrome
  • bun run clean and dev:extension confirmed working by direct execution

An earlier local e2e run on this branch showed 2 beforeAll Chrome-launch timeouts; that was machine load average 49, and the suite passes 54/54 once load dropped.

Bun does not warn about unknown bunfig keys, so several plausible-looking
options had read as working configuration for a long time. Each removal below
was verified, not assumed:

  [build]              Set minify/sourcemap, then ran `bun build` with no CLI
                       flags: no .js.map was emitted and the output kept its
                       original identifiers. Not a bunfig section at all.
  [test] timeout       Set timeout=100 and ran a 300ms test: it passed.
  [test] bail          Set bail=true with a failing first file: the second file
                       still ran.
  [install] frozen     The real key is `frozenLockfile`.
  [install] auto       Real key, but it takes "auto"|"force"|"disable"|
                       "fallback", not a boolean — and it governs runtime
                       auto-install of missing packages, not peer deps as the
                       comment claimed.
  [install] parallel   No such option.
  [install.scopes]     Both scopes pointed at the default registry.

`registry` is kept even though it matches the default: stating it explicitly
stops a user-level .npmrc or bunfig from silently redirecting installs for this
project. The file header now records what was removed and why, so the same
keys don't get re-added.

Three npm scripts were broken and errored on every run: `bun --shell '<cmd>'`
misuses --shell, which takes "bun" or "system", not a command. Scripts already
run under Bun's shell via [run] shell, so the wrapper was only ever wrong.
`bun run clean` now actually deletes its targets.

dev:extension needed more than the syntax fix. Without `--mode development`,
Vite defaults to production, setupDevEnvironment() is never registered (it is
gated on !isProduction) and output lands in dist/ — making the script identical
to `bun run build` despite its name. With the flag it produces dev/, which is
what .gitignore's `dev/*` expects. No regression risk: the script never ran at
all before.

Also dropped ./tests/example.test.ts from the four test scripts; that file does
not exist and Bun was silently ignoring it.

Verified: build succeeds, 495 unit pass, svelte-check 4053 files 0 errors,
biome clean (2 pre-existing warnings), 54 e2e pass in real Chrome, and
`bun run clean` / `dev:extension` confirmed working by direct execution.
@navbytes
navbytes merged commit ef5d204 into main Aug 19, 2026
8 checks passed
@navbytes
navbytes deleted the chore/prune-bunfig branch August 19, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant