nix-community / dream2nix

Simplified nix packaging for various programming language ecosystems [maintainer=@DavHau]
https://dream2nix.dev
MIT License
1.01k stars 124 forks source link

nodejs: add pnpm-lock.yaml translator #234

Open tinybeachthor opened 2 years ago

tinybeachthor commented 2 years ago

https://pnpm.io/

https://github.com/vercel/serve/blob/main/pnpm-lock.yaml

wmertens commented 2 years ago

sadly it will have to be an ifd translator because Nix can't parse yaml.

The discoverer will also need updating to figure out pnpm workspaces, I think?

It does have all the necessary information in the file; the npm urls have to be composed manually.

wmertens commented 2 years ago

Maybe this will be useful https://github.com/arcnmx/nixexprs/blob/f90f7c0a758f2142a448b9e59cc5d6f768b9275b/lib/from-yaml.nix

tinybeachthor commented 2 years ago

pnpm workspaces

example: https://github.com/vuejs/core

pnpm workspaces are defined a bit different than npm workspaces

The discoverer will need to be extended to handle pnpm projects.

hsjobeki commented 1 year ago

pnpm has that complex structure. It also is the only tool that is capable of resolving peerDependency conflicts. Translating pnpms lockfile is not enough to support pnpm as it can produce edge cases that are not representable with the plain npm node_modules structure. It is also necessary to change the node_modules structure of the builder(s)