From 414d59310a8e9fda02f8530f37ae84791af38b5a Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Mon, 27 Jul 2015 21:52:40 -0700 Subject: [PATCH] moment is now a bower dep and installed via default blueprint --- blueprints/ember-cli-moment-shim/index.js | 5 ++++- bower.json | 1 + index.js | 6 +++--- package.json | 5 ++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/blueprints/ember-cli-moment-shim/index.js b/blueprints/ember-cli-moment-shim/index.js index 2b5f460..ba93052 100644 --- a/blueprints/ember-cli-moment-shim/index.js +++ b/blueprints/ember-cli-moment-shim/index.js @@ -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' } + ]); } }; diff --git a/bower.json b/bower.json index 4cdf1e4..cc11348 100644 --- a/bower.json +++ b/bower.json @@ -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" } diff --git a/index.js b/index.js index 214c5dc..436eded 100644 --- a/index.js +++ b/index.js @@ -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', @@ -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$/)], @@ -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; } diff --git a/package.json b/package.json index fbc4f54..b26ba99 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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",