Butterwire / serverless-plugin-monorepo

A Serverless plugin that allows use of serverless in a JS mono repo.
Mozilla Public License 2.0
167 stars 31 forks source link

Recurse All Dependencies #3

Closed martin-css closed 6 years ago

martin-css commented 6 years ago

The current dependency recursion is incorrectly assuming that it can ignore checking the dependencies of packages already created.

This isn't correct. See example layout below:

A/
A/node_modules/B
B/
C/
C/node_modules/A

The current logic will not create a symlink for dependency B as it will stop traversing C/A because it has already created A. The link for B would correctly not have been created for A/B because the logic deduced this is a contained dependency.

Modify to always recurse dependencies fully. The only dependencies that should be ignored are circular dependencies.