Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsr CLI ignores global Bun config #44

Open
NuroDev opened this issue Mar 6, 2024 · 0 comments
Open

jsr CLI ignores global Bun config #44

NuroDev opened this issue Mar 6, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@NuroDev
Copy link

NuroDev commented Mar 6, 2024

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:

  • 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.

@lucacasonato lucacasonato transferred this issue from jsr-io/jsr Mar 6, 2024
@lucacasonato lucacasonato added the bug Something isn't working label Mar 7, 2024
@lucacasonato lucacasonato moved this from Needs Triage to Needs Plan in JSR Mar 7, 2024
@lucacasonato lucacasonato moved this from Needs Plan to Ready in JSR Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready
Development

No branches or pull requests

3 participants