Skip to content

Build Dependency Graphs

Latest
Compare
Choose a tag to compare
@TylorS TylorS released this 16 Jan 21:54
· 40 commits to master since this release

Northbrook will now traverse all of your packages dependencies, building a
graph of inter-dependencies between only packages being managed by Northbrook.
This is done to sort your packages in a more correct order that will allow tools
that do building or bundling of some kind (maybe others!) that deal with these
inter-dependencies directly or indirectly more reliable.

In the case of circular dependencies being detected an error will be thrown informing you to
add configuration to eliminate the errors you are having. The package identified in the
error message will from then on be excluded from northbrook link and continue to use
NPM installed packages (or however you chose to setup your projects) to avoid impossible Cycles.

An example:

pasted image at 2017_01_16 01_58 pm

As displayed a new property to a Northbrook configuration object has been added named circular that shouldn't have to be used too often.

Plugins will now have access to a Dependency Graph object with the following type signature

class DepGraph {
  dependenciesOf(packageName: string): Array<string>;
  configOf(packageName: string): Pkg;
  paths(): Array<string>;
  packages(): Array<Pkg>;
  packageNames(): Array<string>;
}