Feature request: Allow module names instead of paths for reaches
, doNotFollow
, etc.
#806
Labels
enhancement
this will make dependency-cruiser sweeter
Context
I'd like to be able to pass module names to
dependency-cruiser
, instead of paths to node modules, so that I can match those without having to list all potential paths.I'm using the JS API, and want to support user input in my wrapper. The below references to "chalk" are just for example.
Expected Behavior
In this scenario, I want to find all modules that reach
chalk
, but not modules withinchalk
that reference otherchalk
modules.Current Behavior
The example above returns no matches. With pnpm (7.x, 8.x), I need to use the following to get the example above to work.
If someone installed a new version of chalk in the monorepo, this wouldn't catch that version.
Possible Solution
I think adding
moduleNames
(ormodules
) alongsidepaths
might be a good solution here.Considered alternatives
I realise that I can just pass the string, but this would match any package with "chalk" in its name, i.e.
definitely-not-chalk
.I could also pass with slashes, but that could match an internal directory of the same name, i.e.
utils/chalk/wrapper.ts
.The text was updated successfully, but these errors were encountered: