oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.41k stars 2.7k forks source link

Custom registry url gets trimmed if trailing forward slash is missing #14017

Open luciodale opened 1 week ago

luciodale commented 1 week ago

What version of Bun is running?

1.1.26

What platform is your computer?

x64

What steps can reproduce the bug?

Add under ~/ dir a .bunfig.toml file like this:

[install]
registry = { url = "https://www.my-repo/npm-enterprise", token = "..."}

Then:

bun install

What is the expected behavior?

When running bun install, I should see the url used to fetch the libs (react for example) as: https://www.my-repo/npm-enterprise/react

What do you see instead?

I see the url to fetch react as: https://www.my-repo/react

Additional information

Adding a trailing forward slash to the url fixes the problem i.e. https://www.my-repo/npm-enterprise/. Though, I don't think it should be required, as https://www.my-repo/npm-enterprise is a perfectly valid url.

Zooce commented 1 week ago

I'm seeing this as well, but I noticed it with bun outdated which printed no output:

$ bun oudated
bun outdated v1.1.28 (cf4e9cb6)

$