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 almost 7 years ago

  • 🐣 adds an initial type description for typescript (70737d6)
  • ⬆️ acorn (and a bunch of development dependencies)
  • 📖 improve the rules reference (add ToC, re-structure, better copy) and the cli documentation

Technical/ internal things:

  • 🔧 small refactoring (70dee11)
  • 👷 tweaks the gitlab config to run more efficiently
dependency-cruiser - con figure (v2.10.0)

Published by sverweij almost 7 years ago

  • 🐣 add command line options to the .dependency-cruiser.json config format (see #26)
  • renames the initRules option to init (and the command line option --init-rules to --init). It's shorter and closer to the intent, since we're now initialising more than only rules.
dependency-cruiser - coffee? (v2.9.0)

Published by sverweij almost 7 years ago

  • Adds support for coffee script 2.x.x and csx/ csjx
  • Updates several dependencies and development dependencies
dependency-cruiser - license not (v2.8.0)

Published by sverweij almost 7 years ago

  • #24: adds the possibility to define rules based on the license of dependencies. See license and licenseNot in the rules reference for details.
  • ⬆️ ajv, commander, js-makedepend
dependency-cruiser -

Published by sverweij almost 7 years ago

  • Fixes #22
  • Also ⬆️ eslint and nsp
  • nsp doesn't support node 4 anymore => updated the ci configs (gitlab and travis) to reflect this
  • adds a question about jsx and tsx to the faq
dependency-cruiser -

Published by sverweij almost 7 years ago

  • Deprecates the --system option in favour of --module-systems. It's clearer and simplified the code a bit. The shorthand (-M) stays. --system will be available until the 3.0.0 release, but will will issue a deprecation warning.
  • makes the --init-rules use the file name from -v. It's a hack for testing purposes. I won't document it and don't recommend using it
  • 🐛 if you pass multiple module systems with not only comma's but also spaces between them (which you can do if you're very persistent, like so: --module-systems "amd, cjs") the cli strips the spaces.
  • The behaviour of the CLI stays the same for all other cases; the API changes a bit though as parameter validation moved over there and it'll throw an occasional Error if you feed it erroneous options.
  • ⬆️ typescript
  • 🔍 Adds some tests. line, statement and function coverage are now on 100%
  • 🔧 some refactoring so stuff is (hopefully) easier to find and maintain.
dependency-cruiser - do not follow (v2.7.0)

Published by sverweij almost 7 years ago

  • 🐣 adds a --do-not-follow option. For details see #18
  • 🔧 small changes to improve maintainability
  • ⬆️ acorn, eslint
dependency-cruiser - Max depth (v2.6.0)

Published by sverweij almost 7 years ago

  • 🐣 adds an option to specify the maximum depth - as suggested in #16 by @brian428 see below for a description
  • ⬆️ various npm dependencies to latest
  • 🔧 adds travis as a ci (in addition to gitlab ci, which we've used from the start)

max-depth

Adds an option to limit the cruise depth - see command line option for the documentation.

Screenshots

depcruise -T dot -x node_modules --max-depth 1 bin/dependency-cruiser | dot -T png > 1.png

--max-depth 1
1

--max-depth 2
2

--max-depth 3
3

--max-depth 4
4

no max-depth specified:
0

dependency-cruiser - jsx (v2.5.0)

Published by sverweij about 7 years ago

  • 🐣 adds support for jsx
  • ⬆️ some development dependencies to latest

Feedback on jsx support is very welcome

This release introduces support for jsx - which is used in almost
any react project out there. I'm interested in any feedback!

dependency-cruiser -

Published by sverweij about 7 years ago

  • 🐥 Small change that makes tsx gets translated to more valid javascript - so acorn has an easier job (and doesn't have to fall back to acorn_loose)
  • ⬆️ eslint, npm-check-updates
  • 📖 tiny documentation updates
dependency-cruiser -

Published by sverweij about 7 years ago

DEPRECATED; use 2.4.1 or later
Adds support for tsx, but also introduces shrink-wrap which has a (for dependency-cruiser) the unwanted side effect of also installing all devDependencies on an npm i => better use 2.4.1, which doesn't have the shrink-wrap.

dependency-cruiser - tsx (v2.4.1)

Published by sverweij about 7 years ago

  • 🐣 adds support for tsx
  • ⬆️ updates dependencies & devDependencies to latest
  • (and removes npm-shrinkwrap.json for now)
dependency-cruiser -

Published by sverweij about 7 years ago

  • ⬆️ acorn, ajv, resolve, ajv and several development dependencies
  • with the upgrade of chai-ison-schema we can run on the ci for node 4 again
  • 📖 some copy improvements in the documentation
dependency-cruiser - bundle dependencies (v2.3.0)

Published by sverweij over 7 years ago

  • 🐣 adds support for recognizing 'bundled dependencies'
  • ⬆️ various dependencies (a.o. commander, chalk)
dependency-cruiser -

Published by sverweij over 7 years ago

  • 🐛 make the deprecation check work under npm 5 - improves the check for npm versions < 5
  • ⬆️ ajv, handlebars, commander
  • ⬆️ various development dependencies
dependency-cruiser -

Published by sverweij over 7 years ago

Small maintenance release

  • ⬆️ ajv, handlebars and some development dependencies
  • 🔧 small refactoring
dependency-cruiser -

Published by sverweij over 7 years ago

  • improves the performance of circular dependency detection by ~30%
dependency-cruiser - circles (v2.2.0)

Published by sverweij over 7 years ago

  • Adds a circular dependency check to the arsenal of dependency-cruiser validations (#5) - see below for an exposition.
  • Adds the circular check to the --init-rules configuration with a warning level.
  • ⬆️ various dependencies to latest versions

Usage

  • Add a rule to your .dependency-cruiser.json like this:
{
        "name": "no-circular",
        "severity": "warn",
        "comment": "Warn in case there's circular dependencies",
        "from": {},
        "to": { "circular": true }
}

For each dependency this will answer the question: When I follow this dependency, will I end up with myself? and hoist a warning flag when it is.

  • Run dependency-cruiser
depcruise -v -- src

Detecting circular dependencies is heavy work. Especially on larger code bases (thousands of files in one dependency graph) you might notice an impact on the performance when you add a rule that checks for circular dependencies.

Example: the coffee-script compiler source

Running with this rule e.g. against the coffeescript transpiler code base will yield

  warn no-circular: coffee-script.coffee → register.coffee
  warn no-circular: register.coffee → coffee-script.coffee

✖ 2 dependency violations (0 errors, 2 warnings). 23 modules cruised.

or, rendered as a graph (depcruise -v -x node_modules -T dot src | dot -T svg > coffee-deps.svg)
coffee-deps

dependency-cruiser -

Published by sverweij over 7 years ago

  • 🐥 adds support for scoped modules in detecting dependency-types (For all other uses in dependency-cruiser, scoped modules already worked out of the box).
dependency-cruiser - deprecate check (v2.1.0)

Published by sverweij over 7 years ago

  • Adds the possibility to check on deprecated npm modules (see sample rule snippet below).
    deprecated is just an other 'dependency type' - so it should be a doddle to use.
  • ⬆️ ajv
  • 📖 documents some of the internal interfaces so maintaining dependency-cruiser will still be fun half a year or more from now

In your dependency-cruiser config you can use the 'deprecated' attribute, just like you use other dependency types e.g. like this:

    {
        "name": "no-deprecated-npm",
        "comment": "These npm modules are deprecated - find an alternative.",
        "severity": "warn",
        "from": {},
        "to": { "dependencyTypes": ["deprecated"] }
    }