Skip to content

Commit

Permalink
moment is now a bower dep and installed via default blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmit committed Jul 28, 2015
1 parent 8e728f4 commit 414d593
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion blueprints/ember-cli-moment-shim/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module.exports = {
afterInstall: function() {
// we need to install moment-timezone via bower since npmignore
// ignores `moment-timezone/builds/*`
return this.addBowerPackageToProject('moment-timezone');
return this.addBowerPackagesToProject([
{ name: 'moment', target: '>= 2.8.0' },
{ name: 'moment-timezone', target: '>= 0.1.0' }
]);
}
};
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"ember-resolver": "~0.1.18",
"jquery": "^1.11.1",
"loader.js": "ember-cli/loader.js#3.2.0",
"moment": "~2.10.5",
"moment-timezone": "~0.2.5",
"qunit": "~1.17.1"
}
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ var mergeTrees = require('broccoli-merge-trees');
var defaults = require('lodash.defaults');
var rename = require('broccoli-stew').rename;

var momentPath = path.dirname(require.resolve('moment'));

module.exports = {
name: 'moment',

Expand Down Expand Up @@ -75,6 +73,8 @@ module.exports = {
trees.push(vendorTree);
}

var momentPath = path.join(this.project.bowerDirectory, 'moment');

trees.push(new Funnel(momentPath, {
destDir: 'moment',
include: [new RegExp(/\.js$/)],
Expand Down Expand Up @@ -107,7 +107,7 @@ module.exports = {
timezonePath.push('moment-timezone.min.js');
break;
default:
throw new Error("Ember Moment: Please specify the moment-timezone dataset to include as either 'all', '2010-2020', or 'none'.");
throw new Error("ember-moment: Please specify the moment-timezone dataset to include as either 'all', '2010-2020', or 'none'.");
break;
}

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-cli-moment-shim",
"version": "0.5.0",
"version": "0.6.0",
"description": "Brings moment and moment-timezone into your Ember applications",
"scripts": {
"start": "ember server",
Expand All @@ -25,8 +25,7 @@
"broccoli-merge-trees": "^0.2.1",
"broccoli-stew": "^0.3.3",
"ember-cli-babel": "^5.0.0",
"lodash.defaults": "^3.1.2",
"moment": "~2.8.4"
"lodash.defaults": "^3.1.2"
},
"devDependencies": {
"broccoli-asset-rev": "^2.0.2",
Expand Down

0 comments on commit 414d593

Please sign in to comment.