Skip to content

Commit

Permalink
Merge pull request #292 from dnalagatla/dnalagatla/enforce-top-level-…
Browse files Browse the repository at this point in the history
…addon

Added a check to enforce top-level dependency #290.
  • Loading branch information
xg-wang authored Nov 27, 2019
2 parents 914f60a + 11d9d7e commit bac5db0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ module.exports = {
included: function() {
this._super.included.apply(this, arguments);

let isApp = !this.project.isEmberCLIAddon();

let hasEmberFetch = !!this.project.findAddonByName('ember-fetch');
let hasEmberCliFastboot = !!this.project.findAddonByName('ember-cli-fastboot');

if(isApp && hasEmberCliFastboot && !hasEmberFetch) {
throw new Error(`Ember fetch is not installed as top-level dependency of the application using fastboot. Add ember-fetch as dependecy in application's package.json.
For details check here - https://github.com/ember-cli/ember-fetch#top-level-addon`);
}

let app = this._findApp();
let importTarget = app;

Expand Down

0 comments on commit bac5db0

Please sign in to comment.