ort icon indicating copy to clipboard operation
ort copied to clipboard

Add `bun` support as a node.js package manager

Open OntjeHelmich opened this issue 6 months ago • 6 comments

What is the functionality you want to propose?

Add support for https://bun.sh node.js package manager, including bun.lock file as source for dependency information. Bun uses a package.json for dependency definition, but has it's own lock file and install scripts.

What is the use-case for your enhancement?

Node projects based on bun

Alternatives you have considered

  • Bun supports to create a yarn v1 compatible lock file, but distinct support would be preferred

OntjeHelmich avatar Jun 06 '25 13:06 OntjeHelmich

but has it's own lock file and install scripts.

Note that only as of Bun 1.2 the (default) lock file is textual (it was binary before).

sschuberth avatar Jun 06 '25 13:06 sschuberth

@OntjeHelmich can you add a bit information why this part of the solution is specified? "including bun.lock file as source for .."

fviernau avatar Jun 10 '25 06:06 fviernau

@fviernau I added it explicitly, because bun also has a command to create a yarn v1 lock file next to the bun.lock -> https://bun.sh/docs/install/lockfile.

However in terms of future reliability I would prefer to have the "native" lock file being scanned

OntjeHelmich avatar Jun 10 '25 08:06 OntjeHelmich

@OntjeHelmich does Bun also have means to output the needed information via its CLI ?

fviernau avatar Jun 10 '25 09:06 fviernau

There seems to be a list command available, but I am unsure if this is what you need? https://bun.sh/docs/cli/pm#ls

OntjeHelmich avatar Jun 10 '25 11:06 OntjeHelmich

There seems to be a list command available, but I am unsure if this is what you need? https://bun.sh/docs/cli/pm#ls

I propose to drop specifying the solution to use the lockfile, and instead make it part of this ticket to research which is the most suitable way of obtaining the data needed.

fviernau avatar Jun 11 '25 09:06 fviernau