salsify / ember-cli-dependency-lint

Lint your app's addon dependencies, making sure you only have one version of each.
MIT License
83 stars 8 forks source link

Initial implementation #1

Closed dfreeman closed 7 years ago

dfreeman commented 7 years ago

In concert with predictable installations coming with our upgrade to Yarn, this addon provides an alternative to peerDependencies for understanding how many different versions of a given addon are included in an app, and whether that's likely to cause problems.

See the README for further details.

As an example, this is the failing test output generated in lightboxes, where it turns out we have two slightly different versions of ember-getowner-polyfill being included (unclear whether that's an actual dependency conflict or just an npm byproduct). Note that if more than 3 packages depended on ember-getowner-polyfill in that list, it would say and (n-3) others after the third.

image

Prime: @kehphin /cc @salsify/frontend-developers

kehphin commented 7 years ago

So is the usage for this just opening up the outputted file and seeing which dependencies failed? Or will it be tied into the app's tests

kehphin commented 7 years ago

Done reviewing, really cool stuff - :ship: at will

dfreeman commented 7 years ago

That generateTestFile method on Project will produce tests that pass or fail based on the testing system an app uses (e.g. QUnit or Mocha or whatever), and then by returning a LintResult node in the lintTree() hook in index.js, it gets included the same way ember-cli-eslint's tests do, so it'll show up as a failing test if any dependencies are misconfigured.