ember-cli-version-checker
Advanced tools
Comparing version 2.1.1 to 2.1.2
{ | ||
"name": "ember-cli-version-checker", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Determine if your addon is being used by a minimum version of Ember CLI.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,2 +5,3 @@ 'use strict'; | ||
const DependencyVersionChecker = require('./dependency-version-checker'); | ||
const getProject = require('./get-project'); | ||
@@ -11,20 +12,10 @@ class BowerDependencyVersionChecker extends DependencyVersionChecker { | ||
let addon = this._parent._addon; | ||
let project = getProject(this._parent._addon); | ||
let root, bowerDirectory; | ||
let bowerDependencyPath = path.join( | ||
project.root, | ||
project.bowerDirectory, | ||
this.name | ||
); | ||
if (addon.project) { | ||
root = addon.project.root; | ||
bowerDirectory = addon.project.bowerDirectory; | ||
} else if (addon.root && addon.bowerDirectory) { | ||
root = addon.root; | ||
bowerDirectory = addon.bowerDirectory; | ||
} else { | ||
throw new Error( | ||
'You must provide an Addon, EmberApp/EmberAddon, or Project to check bower dependencies against' | ||
); | ||
} | ||
let bowerDependencyPath = path.join(root, bowerDirectory, this.name); | ||
this._jsonPath = path.join(bowerDependencyPath, '.bower.json'); | ||
@@ -31,0 +22,0 @@ this._fallbackJsonPath = path.join(bowerDependencyPath, 'bower.json'); |
@@ -7,2 +7,3 @@ 'use strict'; | ||
const NPMDependencyVersionChecker = require('./npm-dependency-version-checker'); | ||
const getProject = require('./get-project'); | ||
@@ -23,3 +24,5 @@ class VersionChecker { | ||
forEmber() { | ||
let emberVersionChecker = this.for('ember-source', 'npm'); | ||
let project = getProject(this._addon); | ||
let checker = project === this._addon ? this : new VersionChecker(project); | ||
let emberVersionChecker = checker.for('ember-source', 'npm'); | ||
@@ -30,3 +33,3 @@ if (emberVersionChecker.version) { | ||
return this.for('ember', 'bower'); | ||
return checker.for('ember', 'bower'); | ||
} | ||
@@ -33,0 +36,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9689
8
149