Skip to content

bunfig: load global ~/.bunfig.toml for runtime commands; fall back past $XDG_CONFIG_HOME - #34987

Closed
robobun wants to merge 10 commits into
mainfrom
claude/farm/55a9ccd1/global-bunfig-runtime
Closed

bunfig: load global ~/.bunfig.toml for runtime commands; fall back past $XDG_CONFIG_HOME#34987
robobun wants to merge 10 commits into
mainfrom
claude/farm/55a9ccd1/global-bunfig-runtime

test: cover XDG .npmrc precedence over $HOME/.npmrc

89523b4
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 21, 2026 in 24m 20s

Code review found 1 important issue

Found 2 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/options_types/command_tag.rs:89-94 Global bunfig preload not applied for RunAsNodeCommand (bun-node shim)
🟡 Nit src/install/PackageManager.rs:1852-1871 XDG→HOME config-path fallback duplicated between bunfig and PackageManager

Annotations

Check failure on line 94 in src/options_types/command_tag.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Global bunfig preload not applied for RunAsNodeCommand (bun-node shim)

`RunAsNodeCommand` (the bun-node shim, arg0 == `node`) still doesn't get global `preload`/`smol`/`[run]`: `load_config` now parses `~/.bunfig.toml` with `cmd = RunAsNodeCommand` and sets `has_loaded_global_config = true`, but `bunfig.rs:383`/`:406` only apply those keys when `cmd == RunCommand || cmd == AutoCommand` — and the later `Run::boot` fallback to `load_config_path(RunCommand, …)` hits the `has_loaded_global_config` early-return, so the file is never re-parsed with the tag that would app

Check warning on line 1871 in src/install/PackageManager.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

XDG→HOME config-path fallback duplicated between bunfig and PackageManager

The XDG→HOME fallback block added here is structurally identical to `get_home_config_path()` in `src/bunfig/arguments.rs` — same `XDG_CONFIG_HOME.get_not_empty()` → `join_abs_string_buf_z` → `bun_sys::exists_z` → fall through to `HOME` sequence, differing only in the filename. Per REVIEW.md ("the second time a multi-line block appears in your diff, extract a named helper and use it at EVERY parallel site"), consider a shared helper (e.g. in `bun_paths`) taking the filename and `&mut PathBuffer`,