Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add register-version.js to vendor/ember-pouch #210

Merged
merged 1 commit into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

var path = require('path');
var stew = require('broccoli-stew');
var writeFile = require('broccoli-file-creator');
var version = require('./package.json').version;

module.exports = {
name: 'ember-pouch',
Expand Down Expand Up @@ -38,20 +40,35 @@ module.exports = {
files: ['shims.js']
});

var content = "Ember.libraries.register('Ember Pouch', '" + version + "');";
var registerVersionTree = writeFile(
'ember-pouch/register-version.js',
content
);

return stew.find([
pouchdb,
relationalPouch,
pouchdbFind,
shims
shims,
registerVersionTree
]);
},

included(app) {
this._super.included.apply(this, arguments);

// see: https://github.com/ember-cli/ember-cli/issues/3718
if (typeof app.import !== 'function' && app.app) {
app = app.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' ]}
});
app.import('vendor/ember-pouch/register-version.js');
}
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"loader.js": "^4.2.3"
},
"dependencies": {
"broccoli-file-creator": "^1.1.1",
"broccoli-stew": "^1.3.1",
"pouchdb": "^6.4.1",
"relational-pouch": "^3.0.0",
Expand Down