sverweij / dependency-cruiser

Validate and visualize dependencies. Your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.
https://npmjs.com/dependency-cruiser
MIT License
5.27k stars 250 forks source link

What am I missing about rcdot? "'rcdot' is not a valid output type" #906

Closed iftheshoefritz closed 8 months ago

iftheshoefritz commented 9 months ago

Summary

The rcdot output type seems like what I want for insights into my code, but I get this error when I try to use it:

yarn -s depcruise --include-only "^app" --exclude "test|mock|asset|icon" --focus "Checkout" --focus-depth 2 --output-type rcdot --ts-config ./tsconfig.json . | dot -T svg > graph.svg
ERROR: 'rcdot' is not a valid output type.

Do I have to install anything special to use --output-type rcdot?

Cheeky bonus issue: where can I find an explanation of what the different colours mean?

Context

I'm a beginner at dependency-cruiser. I'm just running it on my project, and can see the potential. Hints in the docs about finding dead code etc seem like they could be useful.

Environment

sverweij commented 9 months ago

Hi @iftheshoefritz up to version 5 (~4.5 years ago) rcdot was only an alias for the dot reporter. So you can use --output-type dot in stead.

I had to look that up in the git history as I had forgotten this even existed. Where did you find out about the rcdot reporter?

where can I find an explanation of what the different colors mean?

It's not documented outside the source code. The default theme uses this, at the moment:

This default theme is in src/report/dot/default-theme.mjs

_Note to self: not a bad idea to put this in the theme section of the reporter options documentation._

Hints in the docs about finding dead code etc seem like they could be useful.

Agree. The documentation could use more practical patterns. There is a little collection in the recipes section of the rules tutorial you might find helpful already, though.

Version used: 13.1.2 (I know it's old, I went to a random old version that would work with my version of node)

The latest version (dependency-cruiser@16.1.0) is compatible with node ^18.17.0 - and that node version is backwards compatible to the version of node you're on. I do recommend using the latest version of dependency-cruiser as well of node (even if you stay on node 18, than the latest 18 (18.19 right now it looks)). Unless there's a very good reason to stay on the older node 18.14.2, that is ...

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.