Skip to content

Commit

Permalink
Avoid bower deprecations in ember-cli 4.3+
Browse files Browse the repository at this point in the history
SergeAstapov committed Apr 8, 2022

Verified

This commit was signed with the committer’s verified signature.
targos Michaël Zasso
1 parent db51b4b commit cd88962
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions lib/dependency-checker.js
Original file line number Diff line number Diff line change
@@ -134,13 +134,21 @@ class EmberCLIDependencyChecker {
}

normalizedBowerDependencies() {
const npmDependencies = this.project.dependencies();
const bowerDependencies = this.project.bowerDependencies();
Object.keys(bowerDependencies).forEach((pkg) => {
if(npmDependencies.hasOwnProperty(`@bower_components/${pkg}`)) {
delete bowerDependencies[pkg];
}
});
let bowerDependencies = {};

const bowerPath = path.join(this.project.root, 'bower.json');

if (fs.existsSync(bowerPath)) {
const npmDependencies = this.project.dependencies();
bowerDependencies = this.project.bowerDependencies();

Object.keys(bowerDependencies).forEach((pkg) => {
if(npmDependencies.hasOwnProperty(`@bower_components/${pkg}`)) {
delete bowerDependencies[pkg];
}
});
}

return bowerDependencies;
}

0 comments on commit cd88962

Please sign in to comment.