quaertym / ember-cli-dependency-checker

Ember CLI addon for checking missing node and bower dependencies before running ember commands
MIT License
40 stars 38 forks source link

Move dependency checking to included hook #23

Closed quaertym closed 9 years ago

quaertym commented 9 years ago

@stefanpenner Can I get some feedback?

This pr moves checkDependencies() method from constructor to included hook. What I have in mind is to pass options to dependency checker to skip bower or NPM dependency checking via app.options.dependencyCheckerOptions. Later these options can be overwritten inside ember-cli to fix problems with ember install:npm or ember install:bower.

stefanpenner commented 9 years ago

This pr moves checkDependencies() method from contsructor to included hook. What I have in mind is to pass options to dependency checker to skip bower or NPM dependency checking via app.options.dependencyCheckerOptions. Later these options can be overwritten inside ember-cli to fix problems with ember install:npm or ember install:bower.

cool, sounds good. We also plan to extract bower into an addon and hopefully deprecate, but this will allow us to have fine grain control of the dep checker

rwjblue commented 9 years ago

This pr moves checkDependencies() method from contsructor to included hook.

This means that we get no dependency check unless the command being run is for a build. That was the reason to put it into the constructor initially.

rwjblue commented 9 years ago

So for example:

ember generate awesome-thing-that-I-am-missing-from-an-addon

Will not error if the awesome-thing-that-I-am-missing-from-an-addon is missing.

quaertym commented 9 years ago

@rwjblue hmm I see. What do you suggest?

stefanpenner commented 9 years ago

ah, my bad. @rwjblue is correct.

quaertym commented 9 years ago

Another hook maybe for this kind of addons?

rwjblue commented 9 years ago

@quaertym - So the idea is that we don't want to do it in the constructor because there are limited ways to provide configuration to it that way?

I think that we just need a better config story, and I am working on an RFC for it. For now you can have the config put into config/environment.js and then call this.project.config(process.env.EMBER_ENV) to get at the config for disabling/whitelisting. In the long run we will have a better config story that does not require adding things to the browser payload.

quaertym commented 9 years ago

@rwjblue Great, this fixes the configuration.

Later these options can be overwritten inside ember-cli to fix problems with ember install:npm or ember install:bower.

Is this possible with the config solution? Can certain commands overwrite config?