Skip to content

Add support for bun (shares most code with Npm)#4396

Open
Charlie Lin (clin1234) wants to merge 4 commits intoDevolutions:mainfrom
clin1234:bun
Open

Add support for bun (shares most code with Npm)#4396
Charlie Lin (clin1234) wants to merge 4 commits intoDevolutions:mainfrom
clin1234:bun

Conversation

@clin1234
Copy link

  • I have read the contributing guidelines, and I agree with the Code of Conduct.
  • Have you checked that there aren't other open pull requests for the same changes?
  • Have you tested that the committed code can be executed without errors?
  • This PR is not composed of garbage changes used to farm GitHub activity to enter potential Crypto AirDrops.
    Any user suspected of farming GitHub activity with crypto purposes will get banned. Submitting broken code wastes the contributors' time, who have to spend their free time reviewing, fixing, and testing code that does not even compile breaks other features, or does not introduce any useful changes. I appreciate your understanding.

Closes #2519

@clin1234 Charlie Lin (clin1234) marked this pull request as ready for review February 11, 2026 15:11
@mrixner
Copy link
Contributor

mrixner commented Feb 15, 2026

Isn't Bun drop-in compatible with NPM? We could just add it as an npm executable option.

@clin1234
Copy link
Author

Isn't Bun drop-in compatible with NPM? We could just add it as an npm executable option.

Theoretically yes, but I did not know where the input box for custom npm executable path is in the codebase.

@mrixner
Copy link
Contributor

mrixner commented Feb 15, 2026

In Npm.cs there's a LoadAvailablePaths method that returns a list of available paths. You can check for bun in there and return the paths there and it will become an option.

@clin1234
Copy link
Author

I can't find your mentioned path anywhere in upstream: https://github.com/search?q=repo%3Amarticliment%2FUniGetUI+LoadAvailablePaths&type=code

@mrixner
Copy link
Contributor

mrixner commented Feb 17, 2026

@clin1234
Copy link
Author

Apologies, the name has changed.

https://github.com/marticliment/UniGetUI/blob/386228d80387f05cd994f5d61b707e1bec39d4e1/src/UniGetUI.PackageEngine.Managers.Npm/Npm.cs#L191

Powershell 5 and Powershell 7 have separate PackageEngine.Managers, so why shouldn't bun be added through a separate Manager, even though the two versions are virtually identical in syntax?

@mrixner
Copy link
Contributor

mrixner commented Feb 18, 2026

The powershell versions were added before this was implemented, and I believe they have different syntax. Nonetheless, I'm not saying to do that instead of your current solution, I'm just pointing out an alternative approach to this problem in case Martí decides it better. Both have strengths and weaknesses.

@clin1234
Copy link
Author

Martí Climent (@marticliment) Care to weigh in on this debate?

@marticliment
Copy link
Collaborator

sorry, I forgot to answer. I have not used bun enough to have a formed opinion on this. However,

If bun is a drop-in replacement for npm (exact same install/update/uninstall commands, return codes, output structure, etc.) and it manages the same packages (global and user-scoped) then I guess the exe can be added as an alternative to Npm.

However, if there is any difference (cli output, behaviour, etc.) then I'd just add Bun as a separate package manager.

@mrixner
Copy link
Contributor

mrixner commented Feb 19, 2026

In terms of command structure, if I recall correctly it is supposed to be 1:1. However, while it's the same for project packages, I believe it installs global packages to a different place than NPM? So it might be better as a seperate package manager than as an NPM executable. I just wanted to weigh in with a potential alternative solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] (Add bun support)

3 participants