简体   繁体   中英

List all dependencies between 2 folders/library in angular app

I have a huge angular project, and for some code refactoring, I need to list all dependencies between 2 specifics folders/libs (I'm using nx). With an example:

 /apps
     /lib-1
       a.service.ts
       b.component.ts
     /lib-2
       /services
          string-util.service.ts
       /models
          custom-a.model.ts
          custom-b.model.ts
          index.ts
     /lib-3
       date-util.service.ts
       custom-c.model.Ts

In a.service.ts :

import {StringUtilService} from '../lib-2/services/string-util.service.ts';
import {CustomA, CustomB} from '../lib-2/models';
import {CustomC} from '../lib-3/custom-c.model.ts';
import {DateUtilService} from '../lib-3/date-util.service.ts';

So, I would like a script, or something, if I provide "lib-1", and "lib-2", it can give me dependance between it and the result would be:

StringUtilService,
CustomAModel,
CustomBModel,

Do you have any plugin or Webstorm tools, that can do something close to this?

Or another way to solve my problem would be: I provide "lib-2" to my tools, and it give me this result:

"StringUtilService" used in lib-1,
"CustomAModel" used in lib-1,
"CustomBModel" used in lib-1

We don't provide tooling that will list things down to the type level, but in the graph visualization you can click on any dependency and it will show the files causing it. See:

显示 1 个文件依赖项的可视化更改示例

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM