Implement function to detect facade modules; Adjust depth check in dependency traversal.#114
Implement function to detect facade modules; Adjust depth check in dependency traversal.#114runem merged 8 commits intorunem:1.2.0from FelixSchuSi:1.2.0-componentDiscoveryModuleDepth
Conversation
…pendency traversal.
|
This is weird. I couldnt find out why the tests failed, because all tests pass on my machine an the pipelines logs show an opaque node error. |
|
First of all, thank you so much for this PR! I look forwarding taking a closer look at the code later today when I get some more time. I expect to merge into 1.2.0 shortly thereafter :-) It would be nice if you add some tests to Unfortunately, currently package-locks are not used when installing package dependencies through Lerna, so the CI could be using minor/patch versions with potential bugs. It seems like a bug was introduced in |
|
I just added two commits on top of your work :-) (1) I added some more tests to (2) I would prefer the parameters "SourceFile" and "TsModule" to be camel cased and for "TsModule" to be named "ts" instead to follow project conventions, so I changed the names of the parameters. |
This PR consists of two small changes:
Currently Dependencies are always traversed one level too few.
E. g. when MAX_EXTERNAL_DEPTH or MAX_INTERNAL_DEPTH are set to 1 not even directly imported modules (depth=1) are evaluated.
Currently external modules are evaluated two modules deep in order to support facade modules.
Facade modules are modules that only consist of import and export declarations. These types of modules are frequently used in component libraries.
With this change facade module are detected in dependency traversal and do not increase depth.
Since facade modules dont increase depth anymore, MAX_EXTERNAL_DEPTH can be reduced to one.
I have manually tested this with weightless components and carbon-custom-elements . It might be useful to take a look at other component libraries that use facade modules to see if the implemented function detects them corretcly.