From 5e7ff4031803935a44553d276c6f8b71a23064c1 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 --- Gruntfile.js | 6 ++--- core/client/.watchmanconfig | 3 +++ .../authentication.js | 12 +++++----- core/client/bower.json | 2 +- core/client/lib/asset-delivery/index.js | 23 ++++++++++++------- core/client/package.json | 11 +++++---- 6 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 core/client/.watchmanconfig rename core/client/app/{initializers => instance-initializers}/authentication.js (57%) diff --git a/Gruntfile.js b/Gruntfile.js index f5c2d96447..accf378220 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -636,7 +636,7 @@ var _ = require('lodash'), // details of each of the test suites. // grunt.registerTask('test-all', 'Run tests and lint code', - ['test-routes', 'test-module', 'test-unit', 'test-integration', 'shell:ember:test', 'test-functional']); + ['test-routes', 'test-module', 'test-unit', 'test-integration', 'test-ember', 'test-functional']); // ### Lint // @@ -734,7 +734,7 @@ var _ = require('lodash'), ); // ### Ember unit tests *(sub task)* - // `grunt testem` will run just the ember unit tests + // `grunt test-ember` will run just the ember unit tests grunt.registerTask('test-ember', 'Run the ember unit tests', ['test-setup', 'shell:ember:test'] ); @@ -758,7 +758,7 @@ var _ = require('lodash'), // The purpose of the functional tests is to ensure that Ghost is working as is expected from a user perspective // including buttons and other important interactions in the admin UI. grunt.registerTask('test-functional', 'Run functional interface tests (CasperJS)', - ['test-setup', 'cleanDatabase', 'express:test', 'spawnCasperJS', 'express:test:stop', 'test-functional-setup'] + ['test-setup', 'shell:ember:dev', 'cleanDatabase', 'express:test', 'spawnCasperJS', 'express:test:stop', 'test-functional-setup'] ); // ### Functional tests for the setup process diff --git a/core/client/.watchmanconfig b/core/client/.watchmanconfig new file mode 100644 index 0000000000..5e9462c200 --- /dev/null +++ b/core/client/.watchmanconfig @@ -0,0 +1,3 @@ +{ + "ignore_dirs": ["tmp"] +} diff --git a/core/client/app/initializers/authentication.js b/core/client/app/instance-initializers/authentication.js similarity index 57% rename from core/client/app/initializers/authentication.js rename to core/client/app/instance-initializers/authentication.js index fe014b3190..9c7bd2d098 100644 --- a/core/client/app/initializers/authentication.js +++ b/core/client/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/core/client/bower.json b/core/client/bower.json index 3e6fd93fef..0d432d2223 100644 --- a/core/client/bower.json +++ b/core/client/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/core/client/lib/asset-delivery/index.js b/core/client/lib/asset-delivery/index.js index efd250f952..d24f55a346 100644 --- a/core/client/lib/asset-delivery/index.js +++ b/core/client/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/core/client/package.json b/core/client/package.json index dd6e409986..fad3701938 100644 --- a/core/client/package.json +++ b/core/client/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",