Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ProjectWideDependencyChecker check API #206

Merged
merged 1 commit into from
May 11, 2020
Merged

Add ProjectWideDependencyChecker check API #206

merged 1 commit into from
May 11, 2020

Conversation

stefanpenner
Copy link
Collaborator

@stefanpenner stefanpenner commented May 7, 2020

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:

const checker VersionChecker.forProject(project);

checker.check({
  ‘ember-data’: >= 3.16.0,
  ‘ember-resolver’: *,
}) === {
  /* typically what people want */
  isSatisfied: true | false,
  message: ‘’ || ‘useful canned error message’,
  
 /* 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: ‘’ || ‘useful canned error message’,
     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

@stefanpenner stefanpenner changed the title Pw check Add ProjectWideDependencyChecker check API May 7, 2020
@stefanpenner stefanpenner requested a review from rwjblue May 7, 2020 20:46
src/project-wide-dependency-checker.js Outdated Show resolved Hide resolved
src/project-wide-dependency-checker.js Outdated Show resolved Hide resolved
src/project-wide-dependency-checker.js Show resolved Hide resolved
Copy link

@scalvert scalvert left a comment

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!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

Only minor tweaks, LGTM

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
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 master May 11, 2020
@delete-merged-branch delete-merged-branch bot deleted the pw-check branch May 11, 2020 23:08
@stefanpenner
Copy link
Collaborator Author

released as v5.1.0 🎉

Sign up for free to 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