npm dependency-cruiser 5.0.0

latest releases: 16.7.0-beta-2, 16.7.0-beta-1, 16.6.0...
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

Don't miss a new dependency-cruiser release

NewReleases is sending notifications on new releases.