From 83322010267c1b8af493851d5c6cd6146591dcb6 Mon Sep 17 00:00:00 2001 From: Austin Burdine Date: Wed, 3 Jun 2015 00:25:56 -0600 Subject: [PATCH] updates Ember-CLI to 0.2.7 No issue - moves the authentication initializer to be an instance initializer - updates dependencies - fixes error with asset-delivery not copying - fixes problem with testing by re-building ember before casper tests --- ghost/admin/.watchmanconfig | 3 +++ .../authentication.js | 12 +++++----- ghost/admin/bower.json | 2 +- ghost/admin/lib/asset-delivery/index.js | 23 ++++++++++++------- ghost/admin/package.json | 11 +++++---- 5 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 ghost/admin/.watchmanconfig rename ghost/admin/app/{initializers => instance-initializers}/authentication.js (57%) diff --git a/ghost/admin/.watchmanconfig b/ghost/admin/.watchmanconfig new file mode 100644 index 0000000000..5e9462c200 --- /dev/null +++ b/ghost/admin/.watchmanconfig @@ -0,0 +1,3 @@ +{ + "ignore_dirs": ["tmp"] +} diff --git a/ghost/admin/app/initializers/authentication.js b/ghost/admin/app/instance-initializers/authentication.js similarity index 57% rename from ghost/admin/app/initializers/authentication.js rename to ghost/admin/app/instance-initializers/authentication.js index fe014b3190..9c7bd2d098 100644 --- a/ghost/admin/app/initializers/authentication.js +++ b/ghost/admin/app/instance-initializers/authentication.js @@ -1,16 +1,16 @@ import Ember from 'ember'; -import Session from 'simple-auth/session'; -import OAuth2 from 'simple-auth-oauth2/authenticators/oauth2'; var AuthenticationInitializer = { name: 'authentication', - before: 'simple-auth', - after: 'registerTrailingLocationHistory', - initialize: function (container) { + initialize: function (instance) { + var store = instance.container.lookup('store:main'), + Session = instance.container.lookup('simple-auth-session:main'), + OAuth2 = instance.container.lookup('simple-auth-authenticator:oauth2-password-grant'); + Session.reopen({ user: Ember.computed(function () { - return container.lookup('store:main').find('user', 'me'); + return store.find('user', 'me'); }) }); diff --git a/ghost/admin/bower.json b/ghost/admin/bower.json index 3e6fd93fef..0d432d2223 100644 --- a/ghost/admin/bower.json +++ b/ghost/admin/bower.json @@ -8,8 +8,8 @@ "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", "ember-cli-test-loader": "0.1.3", "ember-data": "1.0.0-beta.18", - "ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2", "ember-mocha": "0.7.0", + "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4", "ember-resolver": "0.1.15", "ember-simple-auth": "0.8.0-beta.2", "fastclick": "1.0.6", diff --git a/ghost/admin/lib/asset-delivery/index.js b/ghost/admin/lib/asset-delivery/index.js index efd250f952..d24f55a346 100644 --- a/ghost/admin/lib/asset-delivery/index.js +++ b/ghost/admin/lib/asset-delivery/index.js @@ -1,9 +1,16 @@ - module.exports = { - name: 'asset-delivery', - postBuild: function (results) { - var fs = this.project.require('fs-extra'); +module.exports = { + name: 'asset-delivery', + postBuild: function (results) { + var fs = this.project.require('fs-extra'), + cpd = this.project.require('ember-cli-copy-dereference'), + templateOut = '../server/views/default.hbs', + assetsOut = '../built/assets'; - fs.copySync(results.directory + '/index.html', '../server/views/default.hbs'); - fs.copySync('./dist/assets', '../built/assets'); - } - }; + fs.removeSync(templateOut); + fs.removeSync(assetsOut); + fs.ensureDirSync(assetsOut); + + cpd.sync(results.directory + '/index.html', templateOut); + cpd.sync(results.directory + '/assets', assetsOut); + } +}; diff --git a/ghost/admin/package.json b/ghost/admin/package.json index dd6e409986..fad3701938 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -20,19 +20,20 @@ "license": "MIT", "devDependencies": { "broccoli-asset-rev": "^2.0.2", - "ember-cli": "0.2.2", + "ember-cli": "0.2.7", "ember-cli-app-version": "0.3.3", - "ember-cli-babel": "^4.1.0", + "ember-cli-babel": "^5.0.0", "ember-cli-content-security-policy": "0.4.0", - "ember-cli-dependency-checker": "0.0.8", + "ember-cli-copy-dereference": "1.0.0", + "ember-cli-dependency-checker": "^1.0.0", "ember-cli-fastclick": "1.0.3", - "ember-cli-htmlbars": "^0.7.4", + "ember-cli-htmlbars": "0.7.6", "ember-cli-ic-ajax": "0.1.1", "ember-cli-inject-live-reload": "^1.3.0", "ember-cli-mocha": "^0.7.0", "ember-cli-simple-auth": "0.8.0-beta.2", "ember-cli-simple-auth-oauth2": "0.8.0-beta.2", - "ember-cli-uglify": "1.0.1", + "ember-cli-uglify": "^1.0.1", "ember-data": "1.0.0-beta.18", "ember-export-application-global": "^1.0.2", "ember-myth": "0.0.2",