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

Move dependency checking to included hook #23

Merged
merged 1 commit into from
Feb 25, 2015

Conversation

quaertym
Copy link
Owner

No description provided.

@quaertym
Copy link
Owner Author

@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.

}

EmberCLIDependencyChecker.prototype.included = function(/*app*/) {
this.checkDependencies();
Copy link
Collaborator

Choose a reason for hiding this comment

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

the included hook currently gets called twice, do to a quirk that isn't fixed yet. We may want to guard.

cc @rwjblue should confirm

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is called twice, but there is a guard to prevent double warnings (because the constructor setup would have had the same problem).

if(alreadyChecked) {
return;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

soon we will fix that double invocation crap

@stefanpenner
Copy link
Collaborator

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

quaertym added a commit that referenced this pull request Feb 25, 2015
Move dependency checking to included hook
@quaertym quaertym merged commit 32a6c68 into master Feb 25, 2015
@rwjblue
Copy link
Collaborator

rwjblue commented Feb 25, 2015

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
Copy link
Collaborator

rwjblue commented Feb 25, 2015

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
Copy link
Owner Author

@rwjblue hmm I see. What do you suggest?

@stefanpenner
Copy link
Collaborator

ah, my bad. @rwjblue is correct.

@quaertym
Copy link
Owner Author

Another hook maybe for this kind of addons?

@rwjblue
Copy link
Collaborator

rwjblue commented Feb 25, 2015

@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
Copy link
Owner Author

@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?

@quaertym quaertym deleted the check-dependencies-when-included branch May 12, 2015 14:02
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.

3 participants