From a5fd975d4c14a8714947e9a8f5152e5e1f124372 Mon Sep 17 00:00:00 2001 From: Bujorel Tecu Date: Wed, 17 Feb 2016 10:08:39 -0500 Subject: [PATCH] Update `ember-cli` to `2.3.0`. Use `npm` instead of `bower` to import the library. --- app/components/bs-datetimepicker.js | 2 +- .../index.js | 12 +++++---- bower.json | 16 +++--------- index.js | 26 ++++++++++++++++--- package.json | 25 +++++++++++------- 5 files changed, 50 insertions(+), 31 deletions(-) diff --git a/app/components/bs-datetimepicker.js b/app/components/bs-datetimepicker.js index cf7c691..28f786e 100644 --- a/app/components/bs-datetimepicker.js +++ b/app/components/bs-datetimepicker.js @@ -1 +1 @@ -export { default } from 'ember-cli-bootstrap-datetimepicker/components/bs-datetimepicker'; \ No newline at end of file +export { default } from 'ember-cli-bootstrap-datetimepicker/components/bs-datetimepicker'; diff --git a/blueprints/ember-cli-bootstrap-datetimepicker/index.js b/blueprints/ember-cli-bootstrap-datetimepicker/index.js index 001b4fb..385207c 100644 --- a/blueprints/ember-cli-bootstrap-datetimepicker/index.js +++ b/blueprints/ember-cli-bootstrap-datetimepicker/index.js @@ -4,10 +4,12 @@ module.exports = { normalizeEntityName: function() {}, afterInstall: function(options) { - var blueprint = this; - - return blueprint.addAddonToProject('ember-cli-moment-shim', '0.6.2').then(function() { - return blueprint.addBowerPackageToProject('eonasdan-bootstrap-datetimepicker', '4.17.37'); - }); + /* Use custom build until official is published + https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1438 + */ + return this.addPackagesToProject([ + { name: 'ember-cli-moment-shim', target: '1.0.0' }, + { name: 'eonasdan-bootstrap-datetimepicker-ie ', target: '4.17.42' } + ]); } }; diff --git a/bower.json b/bower.json index 4130915..4e8dd15 100644 --- a/bower.json +++ b/bower.json @@ -1,17 +1,9 @@ { "name": "ember-cli-bootstrap-datetimepicker", "dependencies": { - "ember": "1.13.11", - "ember-cli-shims": "0.0.6", - "ember-cli-test-loader": "0.2.1", - "ember-data": "1.13.15", - "ember-load-initializers": "0.1.7", - "ember-qunit": "0.4.16", - "ember-qunit-notifications": "0.1.0", - "ember-resolver": "~0.1.20", - "eonasdan-bootstrap-datetimepicker": "4.17.37", - "jquery": "^1.11.3", - "loader.js": "ember-cli/loader.js#3.4.0", - "qunit": "~1.20.0" + "ember": "~2.3.1", + "ember-cli-shims": "0.1.0", + "ember-cli-test-loader": "0.2.2", + "ember-qunit-notifications": "0.1.0" } } diff --git a/index.js b/index.js index 3ad5260..bd92f62 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,9 @@ /* jshint node: true */ 'use strict'; -var path = require('path'); +const Funnel = require('broccoli-funnel'); +const path = require('path'); +const mergeTrees = require('broccoli-merge-trees'); module.exports = { name: 'ember-cli-bootstrap-datetimepicker', @@ -10,7 +12,25 @@ module.exports = { this._super.included(app); // Import unminified css and js - app.import(path.join(app.bowerDirectory, '/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css')); - app.import(path.join(app.bowerDirectory , '/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js')); + let basePath = `${this.treePaths.vendor}/eonasdan-bootstrap-datetimepicker`; + app.import(`${basePath}/build/css/bootstrap-datetimepicker.css`); + app.import(`${basePath}/src/js/bootstrap-datetimepicker.js`); + }, + + treeForVendor: function(vendorTree) { + let trees = []; + + if (vendorTree) { + trees.push(vendorTree); + } + + let datetimepickerJs = require.resolve('eonasdan-bootstrap-datetimepicker'); + let datetimepickerPath = path.join(path.dirname(datetimepickerJs), '../../'); + trees.push(new Funnel(datetimepickerPath, { + destDir: 'eonasdan-bootstrap-datetimepicker', + include: ['build/css/bootstrap-datetimepicker.css', 'src/js/bootstrap-datetimepicker.js'] + })); + + return mergeTrees(trees); } }; diff --git a/package.json b/package.json index e654411..d97f1cd 100644 --- a/package.json +++ b/package.json @@ -19,23 +19,26 @@ "license": "MIT", "devDependencies": { "broccoli-asset-rev": "^2.2.0", - "ember-cli": "1.13.13", + "ember-ajax": "0.7.1", + "ember-cli": "2.3.0", "ember-cli-app-version": "^1.0.0", - "ember-cli-content-security-policy": "0.4.0", - "ember-cli-dependency-checker": "^1.1.0", + "ember-cli-dependency-checker": "^1.2.0", "ember-cli-htmlbars-inline-precompile": "^0.3.1", - "ember-cli-ic-ajax": "0.2.4", "ember-cli-inject-live-reload": "^1.3.1", - "ember-cli-qunit": "^1.0.4", - "ember-cli-moment-shim": "0.6.2", + "ember-cli-qunit": "^1.2.1", + "ember-cli-moment-shim": "1.0.0", "ember-cli-release": "0.2.8", - "ember-cli-sri": "^1.2.0", + "ember-cli-sri": "^2.0.0", "ember-cli-uglify": "^1.2.0", - "ember-data": "1.13.15", + "ember-data": "^2.3.0", + "ember-disable-prototype-extensions": "^1.1.0", "ember-disable-proxy-controllers": "^1.0.1", "ember-export-application-global": "^1.0.4", - "ember-disable-prototype-extensions": "^1.0.0", - "ember-try": "~0.0.8" + "ember-load-initializers": "^0.5.0", + "ember-resolver": "^2.0.3", + "ember-try": "^0.1.2", + "eonasdan-bootstrap-datetimepicker": "4.17.37", + "loader.js": "^4.0.0" }, "keywords": [ "ember-addon", @@ -52,6 +55,8 @@ "datetimepicker" ], "dependencies": { + "broccoli-funnel": "^1.0.1", + "broccoli-merge-trees": "^1.1.1", "ember-cli-babel": "^5.1.5", "ember-cli-htmlbars": "^1.0.1" },