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

  • feature(extract): (🚨BREAKING) parse vue SFCs with the vue-template-compiler (#221)
    thanks @AlexanderShushunov for raising the issue and providing an excellent reproduction repo!
  • build(npm): ⬆️ eslint-plugin-import
  • doc(readme): replace a non-functioning swag badge with one for gh-actions

💥 Breaking change: better support for Vue Single File Components

impact classification:

  • low for projects using Vue Single File Components (SFC's) - rules that didn't trigger might start triggering because SFC parsing got more accurate.
  • none for all other projects

What changed?

From this version dependency-cruiser pre-processes *.vue with the vue-template-compiler before passing it to the javascript parser. This will give a more reliable view on the dependencies of Vue Single File Components (SFC's):

  • dependency-cruiser only looks at the <script> section - and it ignores other ones. With this it can more reliably identify dependencies defined in there. Dependencies not showing up before might appear after the merge of this PR.
  • This also means it doesn't look at the <style> section anymore, which might have yielded dependencies because of include syntax of some stylesheet languages is close to es6's.
dependency-cruiser -

Published by sverweij almost 5 years ago

  • build(npm): ⬆️ eslint, regexp-tree, typescript, yarn
  • feature(extract): specify dependency pre-compilation-only-ness (#219)
dependency-cruiser -

Published by sverweij almost 5 years ago

Support for exotic requires

There are codebases where modules aren't imported by regular means like es6 import or commonjs require. With this feature dependency-cruiser can detect the lion's share of these - just add them in the dependency-cruiser config in exoticRequireStrings and Bob's your uncle.

  • feature(extract): recognize composite exotic requires (e.g. window.require) (#218)
  • feature(extract): enable detection of commonjs dependencies not (directly) declared with 'require' (#216)

If you want to restrict the use of these alternative/ exotic requires, you can do so with the new exoticRequire and exoticRequireNot conditions.

  • feature(extract|validate): allow rule definitions based on exotic required'ness (#217)

Thanks @tvolodimir for requesting this feature (in #206)

regular maintenance

  • build(npm): ⬆️ eslint, eslint-plugin-mocha, lint-staged, yarn
  • ci(gh-actions): set up node modules cache (#215)
dependency-cruiser -

Published by sverweij almost 5 years ago

  • build(npm): ⬆️ eslint-config-prettier, handlebars, husky, regexp-tree
dependency-cruiser -

Published by sverweij almost 5 years ago

  • build(npm): ⬆️ commander, handlebars, lint-staged, regexp-tree, wrap-ansi
dependency-cruiser -

Published by sverweij almost 5 years ago

  • feature(report): add an 'anonymous' reporter (#213)
  • build(npm): ⬆️ chalk, prettier
dependency-cruiser -

Published by sverweij almost 5 years ago

  • build(npm): ⬆️ commander, glob, handlebars, eslint, eslint-config-prettier, eslint-plugin-mocha, tslint, typescript
  • build(npm): allow running on node 14 and up as well
  • doc(real-world-samples): update some 'real world sample' graphs & link them (#211)
  • fix(test): make the tests run with slightly more certainty (#210)
  • ci(appveyor|gh-actions): run windows jobs on gh-actions instead of on appveyor (#209)
dependency-cruiser -

Published by sverweij almost 5 years ago

  • chore(*): enable node 13 (#208)
  • build(npm): ⬆️ figures, glob, handlebars, wrap-ansi
dependency-cruiser -

Published by sverweij almost 5 years ago

  • refactor(types): split type defs in various modules & deduplicate (#205)
  • bugfix(resolve): if a file name contains query parameters strip them after enhanced-resolving it (#201) (thanks to @hckr for reporting the issue!)
  • feature(types): add type(s) for the cruise result (#202) (@tharun208)
  • build(npm): ⬆️ enhanced-resolve, eslint-config-prettier, eslint-plugin-mocha, handlebars, husky, lint-staged, mocha, typescript, yarn
dependency-cruiser - emit those cycles! (v5.2.0)

Published by sverweij about 5 years ago

  • feature(*): emit circular paths in internal output and in the err, err-long, err-html, teamcity and json reporters (#194)
  • doc(api|faq): various typos & corrections

Also some maintenance work:

  • build(npm): ⬆️ handlebars, eslint, husky, lint-staged
  • build(gh-actions): set up github actions (#197)
  • build(lgtm): set up (#195)
  • build(dependency-cruiser-config): add some rules
  • build(lint-staged): don't run eslint on json
dependency-cruiser -

Published by sverweij about 5 years ago

  • refactor(extract|validate): small maintenance (#193)
  • build(npm): ⬆️ commander, eslint, handlebars, husky, lint-staged, mocha, yarn
dependency-cruiser -

Published by sverweij about 5 years ago

  • build(npm): ⬆️ acorn, handlebars, regexp-tree, eslint, eslint-config-prettier, eslint-plugin-mocha, eslint-plugin-node, husky, lint-staged, symlink-dir, tslint, typescript, upem
  • bugfix(npm): also depcruise:report on everything in bin/
  • bugfix(options): remove a stray typeof so the arrayness check executes (#187)
  • fix(dot): make the edge colors more transparent so the output looks more pleasant (#186)
dependency-cruiser -

Published by sverweij about 5 years ago

  • refactor(extract): use acorn instead of acorn-dynamic-import for detecting dynamic imports (#185)
  • build(npm): ⬆️ commander, eslint, eslint-plugin-node, lint-staged, regexp-tree, typescript
dependency-cruiser -

Published by sverweij about 5 years ago

  • build(npm): ⬆️ acorn, commander, lodash, semver, eslint, eslint-plugin-import, husky, lint-staged, mocha, upem
dependency-cruiser - split the formatter (v5.1.0)

Published by sverweij about 5 years ago

  • feature(bin): add depcruise-fmt (#184)
  • bugfix(npm): don't package eslint-config
  • build(npm): ⬆️ acorn, acorn-loose, acorn-walk, eslint, eslint-config-prettier, eslint-plugin-mocha, husky, inquirer, lint-staged, tslint
dependency-cruiser -

Published by sverweij about 5 years ago

Functionality:

  • BREAKING build(npm): only support node versions supported by Node.js (#175)
  • BREAKING refactor(report): remove the 'rcdot' alias for the dot reporter (#176)
  • refactor(cli): extracts the platform check into a separate function (#178)
    The platform warning now also shows up on node versions as far back as 4 (the first version depenendency-cruiser supported).

Developer experience:

  • BREAKING; internal API only refactor(report): make reporters determine the exit code (#177)
  • ci(*): introduce prettier (#179)
  • ci(*): set up lint-staged (#180)
  • build(npm): set engine-strict to true
  • refactor(test): correctly set up tests that check for things throwing (#181)
  • doc(github): update pull request template copy

💥 Breaking change: dropped support for node <8.10, 9 and 11

impact classification: low (unless you're still on a node version not supported by Node.js)

What changed?

This change limits the support of node versions to ^8.10, ^10 and ^12, dropping
support for node versions ^6, ^7, ^9, ^11 and early versions of node 8.

Migrating

If you still are on one of these versions, you have two options:

  • upgrade your node version to > 8.10 (recommended)
  • keep using dependency-cruiser @^4.27.3

💥 Breaking change: rcdot alias for the dot output type removed

impact classification: very low

What changed?

The rcdot alias for the dot output type doesn't exist anymore.
It was already deprecated in an earlier minor version of the v4 range,
and wasn't listed as output type since.

Migrating

If you were still using the rcdot alias as an --output-type (-T) change it
to dot itself.

before:

depcruise --validate --output-type rcdot src | dot -T svg > dependency-graph.svg

after:

depcruise --validate --output-type dot src | dot -T svg > dependency-graph.svg

⚡ Breaking change to the internal cruise API

impact classification: no impact for users of the cli, low for apps consuming the (internal) API

What changed?

Where the cruise function previously returned a cruise result, with the
reporter hacked into the modules, it now returns an object with two attributes,
with the following interface:

export interface IReporterOutput {
  /**
   * The output proper of the reporter. For most reporters this will be
   * a string, if no reporter was passed this will be the cruise output
   * as a javascript object
   */
  output: any;
  /**
   * The exit code - reporters can return a non-zero value when they find
   * errors here. api consumers (like a cli) can use this to return a
   * non-zero exit code, so the build breaks when something is wrong
   *
   * This is e.g. the default behavior of the `err` and `err-long` reporters.
   */
  exitCode: number;
}

Migrating

before

// if you wanted the dependency tree and/ or the cruise summary
// you did this:
const results = cruise(["src"])

// if you wanted the output of a reporter, you did this:
const resultsInADotProgram = cruise(["src"], {outputType: "dot"}).modules

after

// if you want the dependency tree and/ or the cruise summary
// you do this:
const results = cruise(["src").output

// if you want the output of a reporter, you do this:
const resultsInADotProgram = cruise(["src"], {outputType: "dot"}).output
dependency-cruiser -

Published by sverweij about 5 years ago

A patch release to update dependencies - bumps up to stay secure, down to remain compatible with node 6 for those that might be using it still.

4.27 is definitely the last minor release in the 4 series; 4.27.3 might be the last one of the patch releases. Use it if you absolutely need to have dependency-cruiser run on node 6. If you haven't done that yet: upgrade to node >= 8.10 so you can use dependency-cruiser@^5.0.0, which is upcoming.

  • build(npm): ⬆️ acorn, lodash, eslint-plugin-import, mocha
  • build(npm): ⬇️ figures, strip-json-comments (as the latest of these are strictly (though not practically) not supporting node 6 anymore)
  • build(npm): set engine-strict to true (only prevents us from adding node 6 incompatible versions of dc's dependencies)
dependency-cruiser -

Published by sverweij over 5 years ago

  • build(npm): ⬆️ ajv
  • bugfix(extract): put bubblewrap on some of the typescript detectors (#168)
  • bugfix(resolve): in edge cases correctly determine relativeness (#172)
  • refactor(extract): only use individual lodash functions (#173)
  • doc(cli): bring --help output up to date (#171)
  • doc(faq|rules-reference): describe how to detect TypeScript tripple slash directives (#169)
  • build(npm): ⬆️ upem, yarn. ⬇️ eslint, eslint-plugin-node, pin symlink-dir (for node 6 compat)

This is probably the last version with support for node 6 and 7, as many of the external modules dependency-cruiser depends upon don't support node 6 and 7.

dependency-cruiser -

Published by sverweij over 5 years ago

  • build(npm): ⬆️ lodash, inquirer (🔐 security upgrades hence the out of rhythm release)
  • bugfix(validate): make group matching more complete (#166)
dependency-cruiser -

Published by sverweij over 5 years ago

  • feature(report): also show all rules when there's no violation (#165)
  • build(npm): ⬆️ lodash, typescript