How to bypass index.ts files in dependency-cruiser in monorepo to show real dependencies?

Viewed 69

We have a monorepo project with this structure:

- libs
  - library1
    - src
      - index.ts (exports lib/*.ts)
      - lib
        - service1.ts
        - controller1.ts (
            imports {service1} from './service.ts';
          )
  - library2
    - src
      - index.ts (exports lib/*.ts)
      - lib
        - service2.ts (
            imports {service1} from '@library1'
          )
        - extra-service2.ts (
            imports {service2} from './service2.ts';
            imports {service1} from '@library1';
          )
        - controller2.ts (
            imports {service1} from '@library1';
            imports {service2} from './service2.ts';
          )
  - library3
    - src
      - index.ts (exports lib/*.ts)
      - lib
        - service3.ts
        - controller3.ts (
            imports {service3} from './service3.ts';
          )
        - handler3.ts (
            imports {service2} from '@library2';
          )

...dependency-cruiser should filter only files "service.ts" and display this:

If we include index.ts there will be the index.ts file too:

If we exclude index.ts the result is like this:

0 Answers
Related