dependency-cruiser

Validate and visualize dependencies. Your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.

MIT License

Downloads
1.5M
Stars
4.9K
Committers
47

Bot releases are hidden (Show)

dependency-cruiser -

Published by sverweij about 2 years ago

✨ features

  • 9db7963c feature(init): adds focus & reaches highlighting examples to the generated dependency-cruiser config

πŸ› fixes

  • 0091de8b/ 52e6c7fd bugfix(enrich): adds some missing options to cruiseResult's summary.optionsUsed

πŸ‘· maintenance

  • fa7c060b build(npm): update external dependencies
  • 47736f88 chore: adds 'reaches' depcruise run-script to package manifest
dependency-cruiser -

Published by sverweij over 2 years ago

✨ features

  • 1cdf74bd feature: adds focus depth option (#636)
  • f13d637a feature: adds reaches filter option (#635)
  • bdb70f6b feature: tags main targets of 'reaches' filter, so they can be highlighted in reporters (#637)
  • 19865a97 refactor(graph-utl): simplify add-focus implementation (#634)

πŸ› fixes

  • ec2234d3 bugfix: correct spelling of filter bank

πŸ“– documentation

  • 2b623629/ 472f88e6 doc: various spelling corrections (also in code/ code comments)

πŸ‘· maintenance

  • 8fc9898d/ e38a3bc9 build(npm): update external dependencies
  • 227ecb7f chore(ci): make GHA workflow manually dispatchable
  • 3ff5f9dd doc(PR): adds 'green ci' as a default thing providing testing
  • 81279c40 ci: change location of eslint cache

πŸ” sha-sum of the package on npm: 6671b5d117dfb2e7e64c790d3f7fd457091fc281

dependency-cruiser -

Published by sverweij over 2 years ago

✨ features

  • 3715b07f/ cd91eb09 feature(report): add minify option for mermaid reporter (#623) - thanks @MH4GF for the pull request!
  • 1bd66ff8 feature(report|text): highlight focused modules when passed an option to do so (#627)

πŸ‘· maintenance

  • e9c138df build(npm): update external dependencies (devDependencies only)
  • 394eb994/ 9305f522 chore(ci): refurbish github actions

πŸ” shasum: b1c6fe3fd685f6d0a567549c431485235c4791bc

dependency-cruiser -

Published by sverweij over 2 years ago

✨ features

  • d0088f96 feature(report): markdown: format cycle, metric and module only violations (#619)
  • 1bfe74b1 feature(report): markdown: adds (configurable) ignored violations (#618)
  • 3fff445d feature(metrics): calculate metrics when the current reporter's option specifies to show them (#617) (thanks to @czlowiek488 for helping me see this improvement)
  • acab0dbb feature(mermaid-plugin): adds focus highlighting (#616) (thanks @MH4GF for the PR review)
  • 92c7fe81 feature(report): converts the mermaid plugin to a regular reporter (#622)

πŸ“– documentation

  • 100b6c84 doc(report): metrics reporter: type the options parameter
  • 7cf6ceb9 doc(rules-reference): makes formula fit mathjax syntax

πŸ› fixes

  • d3a69bf2 bugfix(report): metrics reporter: prevent error by ignoring folders for which Ca/Ce/I can't be calculated (#620)

πŸ” sha-sum: ad728a8e510c65b1887970e5396f45d0e2b5321e

dependency-cruiser -

Published by sverweij over 2 years ago

✨ features

  • 148cde25 feature(report): adds (configurable) markdown reporter (#614)

You can use this e.g. in conjunction with GitHub actions job summaries to make dependency-cruiser's output appear there in a snazzied-up shape.

  # ...
  steps:
  - name: Saving dependency check report to the job summary
     run:  depcruise src --config --output-type markdown >> $GITHUB_STEP_SUMMARY
  # ...

... which then could look something like the example below in its most expanded form. It's possible to only emit parts of it - see the markdown option documentation for details.

Forbidden dependency check - results

πŸ“ˆ Summary

495 modulesΒ Β Β Β 1224 dependenciesΒ Β Β Β 1 errorsΒ Β Β Β 0 warningsΒ Β Β Β 5 informationalΒ Β Β Β 0 ignored

rule violations ignored explanation
❕ not-reachable-from-folder-index 3 0 (sample rule to demo reachable rules with capturing groups)
❕ utl-module-not-shared-enough 2 0 (sample rule to demo demo rules based on dependents)
❗ not-unreachable-from-cli 1 0 This module in the src/ tree is not reachable from the cli - and is likely dead wood. Either use it or remove it. If a module is flagged for which it's logical it is not reachable from cli (i.e. a configuration file), add it to the pathNot in the 'to' of this rule.

πŸ”₯ All violations

violated rule from to
❗ not-unreachable-from-cli src/schema/baseline-violations.schema.js src/schema/baseline-violations.schema.js
❕ not-reachable-from-folder-index src/cli/format.js src/cli/format.js
❕ not-reachable-from-folder-index src/cli/tools/wrap-stream-in-html.js src/cli/tools/wrap-stream-in-html.js
❕ not-reachable-from-folder-index src/cli/validate-node-environment.js src/cli/validate-node-environment.js
❕ utl-module-not-shared-enough src/utl/array-util.js src/utl/array-util.js
❕ utl-module-not-shared-enough src/utl/wrap-and-indent.js src/utl/wrap-and-indent.js

[email protected] / 2022-06-06T17:54:43.948Z

πŸ“– documentation

  • b44cfcc1 doc: clarify when the showMetrics dot reporter attribute works and when it doesn't (#615) - thanks @czlowiek488 for the question that led to this fix
  • 7ad82e3d doc: first step to introduce strict variants of types for internal use (#607)

πŸ› fixes

  • 3090ae44 bugfix(mermaid-plugin): replace some meta chars (#613) thanks again to @MH4GF

πŸ‘· maintenance

  • 01b41374 style: rename lodash function use to their real names
  • 97ddcb0b chore: adds highlighting configuration for modules 'matching focus'
  • 042be53b refactor(extract): use getExtension instead of endsWith to determine scannability of extensions (#609)
  • f7d95e86 build(npm): update external dependencies

πŸ” shasum: ba3d5cdb800a9a3bb04dc0ede2252d95c96163a0

dependency-cruiser -

Published by sverweij over 2 years ago

✨ features

  • 5e89c695 feature(init): makes jsconfig.json dectection a separate thing (#602)
  • 92754de0 feature(init): don't put dependency-types in doNotFollow (#603)
  • dcf12a45 feature(plugin): adds mermaid.js reporter plugin (#599) - thanks @MH4GF for the PR (and for your patience)!
  • 29b8ab5c feature(depcruise-fmt): adds a --prefix command line option (#606)

πŸ› fixes

  • 713ccae4 bugfix(validate): also include the 'from' when validating via's/ & viaNot exceptions to cycle rules (#605) - thanks @epaillous finding and raising the bug report for this!

πŸ“– documentation

  • e422bb58 doc(cli): to the --ts-config cli description adds it's possible to pass a jsconfig.json

πŸ‘· maintenance

  • e638ddee build(npm): update external dependencies

Thanks @ronalson for raising the issue that led to making the --init option more intuitive for jsconfig.jsons.

πŸ” shasum: 1463295cfda195dbddac2528ca144fa702e7679f

dependency-cruiser -

Published by sverweij over 2 years ago

πŸ› fixes

  • 719e5dbd bugfix(report): also anonymize folders; module dependents (#598)
  • 6f0c0ddc bugfix(main): also check via's for regex safety (#596)
  • 621f0e77 bugfix(main): also normalize viaOnly and viaSomeNot (#595)
  • 0e761784 bugfix(main): don't sort the moduleSystems passed as options; change default order from most used to least used (#594)

πŸ“– documentation

  • 31e5d545 doc: adds/ updates some typings (#597)

πŸ‘· maintenance

  • 6c649856/ ed1eb77a build(npm): update external dependencies

πŸ” shasum: 81e76968cdd74fcb8e197516368f5958a9b8664c

dependency-cruiser -

Published by sverweij over 2 years ago

✨ features

  • 6040154d feature(extract): makes an type import and an import of the same module in the same file two separate dependencies (#593) (thanks @fforres raising this issue!)
  • 84eac45f feature(init): exclude 'type-only' dependencies from the duplicate dependency type check in the initial template and the rule in configs (#592)
  • 5518ddeb feature(validate): adds group matching to folder scoped rules (#591)
  • b71566d1 feature(validate): adds viaOnly, viaSomeNot restrictions + group matching on those and the via and viaNot restrictions (#589) (thanks @PetFeld-ed for triggering the implementation of this feature)

πŸ“– Documentation

  • bfded6be doc(faq): adds performance tweak section - hides details for other sections in 'details' tags

πŸ‘· maintenance

  • e660ef00 build(npm): update external dependencies
  • 2eda48e3 refactor(test): bring validation rules closer to the 'validate' tests (#587)
  • b1ad574c chore: updates react and yarn-berry real world sample graphs
  • 818b5b73 chore(ci): adds node 18 to the environments to test against - drops node 17 from the same
  • 50d86e39 chore(ci): removes node 12 from the test matrix (node 12 is still supported - there's just some devDependencies that don't support node 12 anymore)

πŸ” shasum: e8390c1acb2fec171ff01b4aa8eadc6a0bcd4102

dependency-cruiser -

Published by sverweij over 2 years ago

✨ features

  • bae85590 feature(wrap-stream-in-html): adds ability to 'pin' a highlight with a left mouse click (#582) (thanks @KrekkieD for the suggestion!)
    You can try it on dependency-cruiser's own dependency-graph
  • 573fda71 feature(wrap-stream-in-html): adds simple help system (#584)
  • 6aefb35b feature(validate): adds possibility to put path restrictions in folder-scoped rules (#583)

πŸ› fixes

  • 2f2f9ef6 fix(doc): webpack typo (#581) (thanks @bestmike007 for detecting & submitting the fix)

πŸ”§ maintenance

  • 5cdb2787 build(npm): update external dependencies

πŸ” shasum of the published package: 11b85bc9e189c25a511568d3a522da8ed30254bf

dependency-cruiser -

Published by sverweij over 2 years ago

✨ features

9bb67861 feature(report): show folder cycles in textual reporters (#580)
3c83b7a5 feature(validate): adds possibility to validate folder cycles (#579)
a0f60782 feature(enrich): detect folder cycles (#578)

πŸ› fixes

79f4c11c bugfix(faq): correct links (#577)

πŸ”§ maintenance

39676fe9 build(npm): update external dependencies

πŸ” shasum of the published package: fda117dfd09c5f10a1c2fe68dff9384f58f4c818

dependency-cruiser - v11.4.1

Published by sverweij over 2 years ago

πŸ‘· Maintenance

  • d8d69cac ⬆️ @babel/core, @babel/plugin-transform-modules-commonjs, @swc/core, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, commander, eslint, eslint-config-moving-meadow, eslint-plugin-unicorn, inquirer, mocha, prettier, yarn

πŸ” shasum of the published package: d1dab68baf8d1d6481bc373ba1211757ff868ce5

dependency-cruiser -

Published by sverweij over 2 years ago

✨ features

  • b9aa0f20 feature(schema): allow known violations to be commented (#574) - thanks to @btiernay for suggesting this πŸ‘

πŸ› fixes

  • 4536eaee bugfix(init): removes 'assert' from deprecated core rule (#573) - thanks again to @btiernay for reporting this bug

πŸ‘· maintenance

  • b3431164 build(npm): ⬆️ @babel/core, @swc/core, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, @vue/compiler-sfc, enhanced-resolve, eslint-config-prettier, lint-staged, mocha, typescript
  • 6c5b14af chore: change e-mail address away from yandex

You might have noticed the publishing e-mail address for this package on npm also change from one on yandex.com to one on yahoo.com. This is intentional.

πŸ” shasum of the published package: 0a66cb83bd492a35d60e009436dc5951760461f4

dependency-cruiser -

Published by sverweij over 2 years ago

πŸ› fixes

  • b83cca82 bugfix(ci): ensure the prettier script actually checks files
  • d88e789d bugfix(extract): makes esm url matching more specific (#568) (thanks to @lukesmurray for reporting the issue!)
  • a3c187b0 bugfix(doc|init): fix link to dependencyType documentation (#561) (thanks @Silvere112 for detecting the bug and the submitting the fix!)

πŸ“– documentation

  • 06ec5c8f doc(output-format): add the 'folders' attribute & a link to the graphical schema overview

πŸ‘· maintenance

  • 7c2453b5 build(npm): ⬆️ @babel/core, @swc/core, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, @vue/compiler-sfc, ajv, chai, commander, enhanced-resolve, eslint, lint-staged, mocha, svelte
dependency-cruiser -

Published by sverweij over 2 years ago

✨ features

  • 1d5a7aad feature(extract): add vue script setup support (#556) - thanks @bashess for the addition of this feature!
  • 90c140a9 feature(validate): adds possibility to validate folder-dependency metrics (#554)

πŸ“– documentation

  • 7fbd38d2 doc(real-world-samples): adds howto to the dependency-cruiser graphs

πŸ‘· maintenance

  • 0ec0068c build(npm): ⬆️ @babel/core, @babel/plugin-transform-modules-commonjs, @babel/preset-typescript, @swc/core, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, @vue/compiler-sfc, acorn, acorn-loose, ajv, c8, eslint-plugin-import, eslint-plugin-unicorn, lint-staged, mocha, shx, svelte, typescript
    ☝️ this commit also ensures dependency-cruiser can handle the new way swc represents dynamic imports in their AST (while remaining backwards compatible).
  • e9478f5b chore(test): classifies tests - puts mocks in separate folders from fixtures (#557)
  • d470c0c5 chore: makes depcruise:graph:view show more details
  • 54888eb3 chore: adds requireJSON as an exotic-require
  • 76555ea3 chore: updates issue templates
  • 557c69fb chore: happy 2022
dependency-cruiser -

Published by sverweij almost 3 years ago

πŸ› Bugfixes

  • 75b330ad bugfix(types): adjusts 'format' type signature to use IFormatOptions (#552) - thanks @hikerpig for raising the bug report for this!

πŸ‘· Maintenance

  • 47832922 chore(make): updates makefile to regard all relevant sources (#549)
dependency-cruiser -

Published by sverweij almost 3 years ago

🌟 features

  • 3ea1b5aa feature(report): adds instability metrics to the err-html reporter (#544)
  • fc866d40 feature(report): adds instability metrics to the teamcity reporter (#543)
  • 9c192194 feature(enrich|report): adds instability metrics to the err reporter (#542)

πŸ“– documentation

  • 854f0faf doc(rules-reference): adds a caution about using metrics-as-a-gospel

πŸ‘· maintenance

  • 330e584a build(npm): ⬆️ @swc/core, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, lint-staged

🏭 refactoring

  • c05bc9c4 refactor(validate): re-organizes dependency validation (#548)
  • b33a42b8 refactor(extract): re-organizes metrics derivation (#546)
  • b9ee63fd refactor(tools|schema): splits off violation type and minifies generated .js schemas (#545)
  • a9a73c72 refactor(test): splits get-dependencies spec (#541)

🧹 chores

  • d688d84e chore: make double-sure generated meta.js is prettier'ed
  • 2a026b52 chore: set metrics config to include only bin & src
dependency-cruiser - v11.1.0

Published by sverweij almost 3 years ago

🌟 features

  • eef06ff0 feature(dot): shows (module-level) instability metrics if they're available (#536)
  • fdd6b846 feature(dot): makes showing metrics switcheable independent of whether they're available or not (#537)
  • a7887774/ 67f1af43/ 3a90580c feature(validate): adds moreUnstable attribute to enforce stable dependencies (#538)

πŸ› fixes

  • a02044a3 doc(README): corrects a typo
  • b01e2625 bugfix(test): makes the io unit test run more reliably (#539)

πŸ‘· maintenance

  • f0a43550/ f9e2f118/ 5623acd1 chore: improves naming & ergonomy of depcruise scripts in package.json
  • 44152bff bugfix(schema|types): adds metrics flag to options schema (#534)
  • 6cb12ac6 chore: adds .mailmap
  • 0a5e178a build(npm): @babel/core, @babel/plugin-transform-modules-commonjs, @babel/preset-typescript, @swc/core, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, @vue/compiler-sfc, prettier, svelte, teamcity-service-messages, typescript
dependency-cruiser - v10.9.0

Published by sverweij almost 3 years ago

This is a release of the v10 branch of dependency-cruiser. v10.9.0 contains the same changes as v11.1.0, with the exception of the ones listed below. On npm the v10 branch is published with the version-10 tag.

πŸ”™ backports

  • da2af61f backport: removes cycle from type definitions
dependency-cruiser - v11.0.0 - β€œNigel Tufnel”

Published by sverweij almost 3 years ago

🚨 breaking changes

b8516acc feature: TypeScript support in Vue files (BREAKING CHANGE) (#526)

This change is breaking only if you

  • use vue single file components AND
  • use typescript as the scripting language in them AND
  • you happen to have rules defined that touch these components.

In these cases rules might be triggered that weren't triggered before. When this occurs you can either fix the violations or temporarily ignore them (See --ignore-known in the documentation).

Thanks @rklos for raising the issue and for writing the pull request!

457a5d00 bugfix(extract): consistently treat .d.ts as a separate extension (BREAKING CHANGE) (#530)

This change is breaking only if

  • you have set the options.enhancedResolveOptions.extensions in your .dependency-cruiser.js AND
  • in there you did specify .d.ts and didn't specify .ts AND
  • you have rules that touch .d.ts modules

In these cases rules might be triggered that weren't triggered before. When this occurs you can either fix the violations or temporarily ignore them (See --ignore-known in the documentation).

dependency-cruiser - v10.8.0

Published by sverweij almost 3 years ago

Version 11 will be published soon. As an experiment we'll back port non-breaking features & fixes to v10 for some time when possible - these will be published on npm under the version-10 tag (latest will from the next release on be reserved for v11).

🌟 features

  • a0767fa7 feature: adds instability metric + dedicated metrics reporter (#524) - thanks @tujger for the suggestion and the feedback!

πŸ› fixes

  • e137300b bugfix: re-baseline so cycle fixed in v11 doesn't bother us here
  • 1d7c08d8 bugfix(known-violations): also soften self-cycling violations (#532)
  • 0ed8e287 doc(FAQ): correct some links + copy fixes

πŸ‘· maintenance

  • 9149e9f7 perf(enrich): use different caching strategy for finding modules by name (#531)
  • b9afb72a ci: add v10 branch to checked branches
  • fa2ac332 build(npm): ⬆️ @babel/core, @babel/plugin-transform-modules-commonjs, @babel/preset-typescript, @swc/core, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, @vue/compiler-sfc, acorn, ajv, chalk, eslint, eslint-plugin-import, eslint-plugin-unicorn, lint-staged, prettier, svelte, tsconfig-paths-webpack-plugin, typescript