npm dependency-cruiser 9.12.0

latest releases: 16.4.2, 16.4.1, 16.4.0...
4 years ago

🌟 Features

  • feature(depcruise-fmt): add filter options (#354)

☝️ If you have a largish code base and want to make loads of overview pictures of parts of your repo fast this is the feature for you.

save the dependency-graph as a json. You probably know that if your repo is big (let's say > 5000 modules, > 20000 dependencies) this can take a minute as dependency-cruiser has to read each file from disk & parse it:

depcruise "^packages|lib" --config --output-type json -f result.json # might take some time

From the saved result generate a bunch of overview graphs. As the heavy lifting is done already, each will take typically < 1s (depending on the size of your graph):

depcruise-fmt result.json --output-type dot --include-only ^packages/search |\
   dot -T svg | depcruise-wrap-stream-in-html > search-graph.html

depcruise-fmt result.json --output-type dot --include-only ^packages/checkin |\
   dot -T svg | depcruise-wrap-stream-in-html > checkin-graph.html

depcruise-fmt result.json --output-type dot --include-only ^packages/trip |\
   dot -T svg | depcruise-wrap-stream-in-html > trip-graph.html

depcruise-fmt result.json --output-type dot --include-only ^packages/ancillaries --exclude "\\.spec.ts$|mocks" |\
   dot -T svg | depcruise-wrap-stream-in-html > ancillaries-graph-without-test-stuffs.html

The compressed architecture view will be fast as well:

depcruise-fmt result.json --output-type archi  |\
   dot -T svg | depcruise-wrap-stream-in-html > high-level-graph.html

It works on all reporters, so if you want to generate separate violation reports for parts of your repo you can do this:

# The focus filter only includes modules matching the regex + their direct neighbours, which is exactly
# what we want for violation reports:
depcruise-fmt result.json --output-type err-html --focus ^packages/ancillaries -f ancillary-violations.html
depcruise-fmt result.json --output-type err-html --focus ^packages/trip -f trip-violations.html
# ... etc

Enjoy! Bug reports (and ⭐ 's if you like it :-) ) welcome

🔧 Maintenance

  • build(npm): ⬆️ @typescript-eslint/eslint-plugin, @typescript-eslint/parser, lint-staged, mocha, prettier
  • ci(deepcode): adds .dcignore

📖 Documentation

  • doc: typo's & copy updates

912 is apparently the designation of another porsche
Porsche 912. Targa

Don't miss a new dependency-cruiser release

NewReleases is sending notifications on new releases.