Skip to content

Add ProjectWideDependencyChecker check API - #206

Merged
stefanpenner merged 1 commit into
masterfrom
pw-check
May 11, 2020
Merged

Add ProjectWideDependencyChecker check API#206
stefanpenner merged 1 commit into
masterfrom
pw-check

Conversation

@stefanpenner

@stefanpennerstefanpenner commented May 7, 2020

Copy link
Copy Markdown
Collaborator

Add ProjectWideDependencyChecker check API

This allows someone to make broader assertions against the project’s dependencies. The goal here is to handle the complexity of making these assertions here in ember-cli-version-checker.

  • no extra disk IO, all addon lookup goes through ember-cli's public APIs and ensures to only utilizes pathways that use ember-cli's authentication
  • good default errors
  • provides a layered API that allows the end user to run checks, but constraint their own rollup if needed.

Example:

constcheckerVersionChecker.forProject(project);checker.check({‘ember-data’: >=3.16.0,‘ember-resolver’: *,})==={/* typically what people want */isSatisfied: true|false,message: ‘’||‘usefulcannederrormessage’,/* checker.check(...).assert() will throw a canned error response *//* checker.check(...).assert(description) will throw a canned error response but with a custom description */assert(description?){}/* deeper details for power users*/node_modules: {‘ember-data’: {isSatisfied: true|false,message: ‘’||‘usefulcannederrormessage’,versions: [/* list of versions found */]}, ‘ember-resolver': { /* basically same as ember-datas blob, but for the results of ember-resolver */ },
}}

This Commit also fixes/cleans up the testing infrastructure to simplify the testing of the above new feature


TODO:

  • Update readme
  • ensure this meets our needs etc
  • add missing unit test for filterAddonsByNames for good measure

@stefanpennerstefanpenner changed the title Pw checkAdd ProjectWideDependencyChecker check APIMay 7, 2020
@stefanpenner
stefanpenner requested a review from rwjblueMay 7, 2020 20:46
Comment threadsrc/project-wide-dependency-checker.js
Comment threadsrc/project-wide-dependency-checker.js Outdated
Comment threadsrc/project-wide-dependency-checker.js Outdated
Comment threadsrc/project-wide-dependency-checker.js

@scalvertscalvert left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small changes, but otherwise looks good!

Comment threadREADME.md Outdated
Comment threadREADME.md Outdated
Comment threadREADME.md Outdated
Comment threadREADME.md Outdated
Comment threadREADME.md Outdated
Comment threadREADME.md
Comment threadREADME.md Outdated

@rwjbluerwjblue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only minor tweaks, LGTM

Comment threadREADME.md Outdated
Comment threadREADME.md Outdated
Comment threadREADME.md
This allows someone to make broader assertions against the project’s dependencies.
```js
const checker VersionChecker.forProject(project);
checker.check({
‘ember-data’: ‘>= 3.16.0’,
‘ember-resolver’: ‘*’,
}) === {
isSatisfied: true | false,
message: ‘’ || ‘useful canned error message’,
node_modules: {
‘ember-data’: {
isSatisfied: true | false,
message: ‘’ || ‘useful canned error message’,
Versions: [/* list of versions found */]
},
‘Ember-resolver: { /* basically same as ember-datas blob */ },
assert(message?) { } // throw a canned error, with an optional description
}
}
```
This Commit also fixes/cleans up the testing infrastructure to simplify the testing of the above new feature
@stefanpenner
stefanpenner merged commit 82c159d into masterMay 11, 2020
@delete-merged-branch
delete-merged-branchBot deleted the pw-check branch May 11, 2020 23:08
@stefanpenner

Copy link
Copy Markdown
CollaboratorAuthor

released as v5.1.0 🎉

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@stefanpenner@rwjblue@hjdivad@scalvert@runspired@xg-wang