forked from pouchdb-community/ember-pouch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
57 lines (46 loc) · 1.82 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* jshint node: true, -W030 */
'use strict';
var path = require('path');
var stew = require('broccoli-stew');
module.exports = {
name: 'ember-pouch',
init: function() {
this._super.init && this._super.init.apply(this, arguments);
var bowerDeps = this.project.bowerDependencies();
if (bowerDeps['pouchdb']) {this.ui.writeWarnLine('Please remove `pouchdb` from `bower.json`. As of ember-pouch 4.2.0, only the NPM package is needed.');}
if (bowerDeps['relational-pouch']) {this.ui.writeWarnLine('Please remove `relational-pouch` from `bower.json`. As of ember-pouch 4.2.0, only the NPM package is needed.');}
if (bowerDeps['pouchdb-find']) {this.ui.writeWarnLine('Please remove `pouchdb-find` from `bower.json`. As of ember-pouch 4.2.0, only the NPM package is needed.');}
},
treeForVendor: function() {
var pouchdb = stew.find(path.join(path.dirname(require.resolve('pouchdb')), '..', 'dist'), {
destDir: 'pouchdb',
files: ['pouchdb.js']
});
var relationalPouch = stew.find(path.join(path.dirname(require.resolve('relational-pouch')), '..', 'dist'), {
destDir: 'pouchdb',
files: ['pouchdb.relational-pouch.js']
});
var pouchdbFind = stew.find(path.join(path.dirname(require.resolve('pouchdb-find')), '..', 'dist'), {
destDir: 'pouchdb',
files: ['pouchdb.find.js']
});
var shims = stew.find(__dirname + '/vendor/pouchdb', {
destDir: 'pouchdb',
files: ['shims.js']
});
return stew.find([
pouchdb,
relationalPouch,
pouchdbFind,
shims
]);
},
included(app) {
app.import('vendor/pouchdb/pouchdb.js');
app.import('vendor/pouchdb/pouchdb.relational-pouch.js');
app.import('vendor/pouchdb/pouchdb.find.js');
app.import('vendor/pouchdb/shims.js', {
exports: { 'pouchdb': [ 'default' ]}
});
}
};