dream2nix
dream2nix copied to clipboard
Look for hoisted dependencies in yarn monorepos
Some monorepos have hoisted dependencies and require many dream2nix injections. I would say dream2nix can look upwards in a monorepo for the root package.json after it cannot locate missing dependencies.
Could you provide an example project that demonstrates the issue?
Potentially fixed. Also we don't have an example that triggers that issue. Therefore closing
@DavHau I was wrong. apologies.
Here's a minimal repository that demonstrates the issue. Basically, in yarn v1 workspaces the dependencies can be "hoisted" to the root package.json so that all subpackages match versions on the same dependency. Dream2nix's translator wont define root dependencies in the subpackages if the tooling is missing.
But what's the solution? yarn v1 was obviously a mess. I don't think it would be good design to just include all root packages in the subpackage's dependencies either.
https://github.com/tgunnoe/d2n-hoisted-deps-example
I just pushed 5c227d036c3ecdf428e27310d2e64fc50747fdd2 which introduces a new option workspacesInheritParentDeps.
I needed this for https://github.com/nix-community/ethereum.nix/pull/222 and it seemed like the most straight forward solution.