forked from adopted-ember-addons/ember-data-model-fragments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (26 loc) · 911 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict';
const merge = require('broccoli-merge-trees');
const version = require('./lib/version');
const calculateCacheKeyForTree = require('calculate-cache-key-for-tree');
module.exports = {
name: 'ember-data-model-fragments',
init() {
this._super.init && this._super.init.apply(this, arguments);
let bowerDeps = this.project.bowerDependencies();
if (bowerDeps['ember-data-model-fragments']) {
let message = 'Please remove `ember-data-model-fragments` from `bower.json`, it is no longer used as of v2.3.0';
if (this.ui.writeWarnLine) {
this.ui.writeWarnLine(message);
} else {
this.ui.writeLine(message);
}
}
},
treeForAddon(tree) {
let versioned = merge([version(), tree]);
return this._super.treeForAddon.call(this, versioned);
},
cacheKeyForTree(treeType) {
return calculateCacheKeyForTree(treeType, this);
}
};