Currently if you run the recommended Bun command to add a dependency (bunx jsr add @std/log) & use a global Bun config (~/.bunfig.toml), such as myself where I already have other scopes / registries declared, it will not check to see if a global Bun config exists & as such it will both:
Fail to add / install the dependency
Repeatedly add an install scope to any existing bunfig.toml file
This seems to be because Bun will not even read a local / relative scope if a global config exists.
Steps to reproduce
echo '[install.scopes]\n' > ~/.bunfig.toml
bunx jsr add @std/log
➜ bunx jsr add @std/log
Setting up bunfig.toml...ok
Installing @std/log...
$ bun add @std/log@npm:@jsr/std__log
bun add v1.0.30 (1424a196)
🔍 @jsr/std__log [1/1]
error: package "@jsr/std__log" not found registry.npmjs.org/@jsr%2fstd__log 404
error: @std/log@npm:@jsr/std__log failed to resolve
Possible solution
Currently it seems that JSR already checks the local / relative bunfig.toml file to see if a jsr scope exists & if not it adds it. This pre-script logic just needs to be extended to check if a global Bun config exists (~/.bunfig.toml) & if it does append the JSR scope to either that global config and/or a local config.
What is the issue?
Currently if you run the recommended Bun command to add a dependency (
bunx jsr add @std/log
) & use a global Bun config (~/.bunfig.toml
), such as myself where I already have other scopes / registries declared, it will not check to see if a global Bun config exists & as such it will both:bunfig.toml
fileThis seems to be because Bun will not even read a local / relative scope if a global config exists.
Steps to reproduce
echo '[install.scopes]\n' > ~/.bunfig.toml
bunx jsr add @std/log
Possible solution
Currently it seems that JSR already checks the local / relative
bunfig.toml
file to see if ajsr
scope exists & if not it adds it. This pre-script logic just needs to be extended to check if a global Bun config exists (~/.bunfig.toml
) & if it does append the JSR scope to either that global config and/or a local config.