Description
Is your feature request related to a problem? Please describe.
We use a package manager that utilizes symlinks to build the dependency tree from a flat storage area of all installed packages. Because of that, packages can not require()
other packages that live closer to the root of the dependency tree, because their on-disk location doesn't have the required dependency as a parent.
Describe the solution you'd like
npm allows to declare peerDependencies
to advertise the desire to a load a module that is not directly depended upon. Declaring a module as a peer dependency ensures that it will be made available to the depending module if it exists in the dependency tree.
Thus, declaring all dependencies moleculer might want to require should be declared as peerDependencies
. This will also ensure that it is clear which versions of the dependency moleculer is designed to run with.
Describe alternatives you've considered
Peering can be manually configured in our package manager and that would work just fine for us. I would consider adding the peer dependencies more correct for the reasons given above.
Additional context
It seems some work in this area existed once: #37