Skip to content

Commit

Permalink
Update Ember CLI and libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoow committed Mar 25, 2016
1 parent 8d53eca commit 0c15087
Show file tree
Hide file tree
Showing 18 changed files with 150 additions and 82 deletions.
3 changes: 2 additions & 1 deletion .jscsrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"preset": "ember-suave",
"requireCommentsToIncludeAccess": false
"requireCommentsToIncludeAccess": false,
"disallowConstOutsideModuleScope": false
}
19 changes: 10 additions & 9 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
bower_components/
tests/
tmp/
dist/

/bower_components
/config/ember-try.js
/dist
/tests
/tmp
**/.gitkeep
.bowerrc
.editorconfig
.ember-cli
.gitignore
.jshintrc
.watchmanconfig
.travis.yml
.npmignore
**/.gitkeep
bower.json
ember-cli-build.js
Brocfile.js
testem.json
node-tests
node-tests/
17 changes: 5 additions & 12 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
{
"name": "ember-simple-auth",
"dependencies": {
"bootstrap": "~3.3.5",
"ember": "~2.3.0",
"bootstrap": "~3.3.6",
"ember": "~2.4.1",
"ember-cli-shims": "0.1.0",
"ember-cli-test-loader": "0.2.1",
"ember-load-initializers": "0.1.7",
"ember-cli-test-loader": "0.2.2",
"ember-mocha": "~0.8.7",
"ember-resolver": "~0.1.20",
"jquery": "1.11.3",
"loader.js": "ember-cli/loader.js#3.4.0",
"sinonjs": "~1.17.1",
"base64": "~0.3.0",
"pretender": "^0.10.1"
},
"resolutions": {
"ember": "~2.2.0"
"pretender": "^0.12.0"
}
}
}
1 change: 1 addition & 0 deletions config/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*jshint node:true*/
'use strict';

module.exports = function(/* environment, appConfig */) {
Expand Down
2 changes: 1 addition & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const yuidoc = require('broccoli-yuidoc');
const version = require('git-repo-version')();
const Handlebars = require('handlebars');
const mergeTrees = require('broccoli-merge-trees');
const merge = require('lodash/object/merge');
const merge = require('lodash/merge');

var sourceTrees = [];

Expand Down
3 changes: 2 additions & 1 deletion node-tests/blueprints/authenticator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe('Acceptance: ember generate and destroy authenticator', function() {
setupTestHooks(this);

it('generates a torii authenticator', function() {
debugger;
return generateAndDestroy(['authenticator', 'application', '--base-class=torii'], {
files: [
{ file: 'app/authenticators/application.js', contains: ['\
Expand All @@ -20,7 +21,7 @@ export default Torii.extend({' + EOL + '\
});' + EOL + '\
']}
]
});
}).then(function() { debugger; }, function() { debugger; });
});

it('generates an OAuth 2.0 authenticator', function() {
Expand Down
22 changes: 22 additions & 0 deletions node-tests/fixtures/addon/package/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "my-addon",
"version": "0.0.0",
"description": "Addon fixture package for ember-cli-blueprint-test-helpers",
"engines": {
"node": ">= 0.10.0"
},
"devDependencies": {
"ember-cli": "*",
"ember-simple-auth": "*"
},
"keywords": [
"ember-addon"
],
"dependencies": {
"ember-cli-htmlbars": "*",
"ember-cli-babel": "*"
},
"ember-addon": {
"configPath": "tests/dummy/config"
}
}
13 changes: 13 additions & 0 deletions node-tests/fixtures/app/package/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "my-app",
"version": "0.0.0",
"description": "App fixture package for ember-cli-blueprint-test-helpers",
"private": true,
"engines": {
"node": ">= 0.10.0"
},
"devDependencies": {
"ember-cli": "*",
"ember-simple-auth": "*"
}
}
4 changes: 4 additions & 0 deletions node-tests/nodetest-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ var mocha = new Mocha({
reporter: 'spec'
});
var testFiles = glob.sync(root + '/**/*-test.js');
/*var jshintPosition = testFiles.indexOf('tests/unit/jshint-test.js');
var jshint = testFiles.splice(jshintPosition, 1);
testFiles = jshint.concat(testFiles);
*/
if (optionOrFile === 'all') {
addFiles(mocha, testFiles);
addFiles(mocha, 'node-tests/**/*-test.js');
Expand Down
41 changes: 22 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,45 @@
"devDependencies": {
"body-parser": "^1.2.0",
"broccoli-asset-rev": "^2.2.0",
"broccoli-merge-trees": "^0.2.3",
"broccoli-merge-trees": "^1.1.1",
"broccoli-yuidoc": "~2.1.0",
"ember-browserify": "~1.1.4",
"ember-cli": "1.13.13",
"ember-ajax": "0.7.1",
"ember-browserify": "~1.1.7",
"ember-cli": "2.4.0",
"ember-cli-app-version": "^1.0.0",
"ember-cli-base64": "~0.0.1",
"ember-cli-blueprint-test-helpers": "0.7.0",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.1.0",
"ember-cli-blueprint-test-helpers": "~0.10.0",
"ember-cli-content-security-policy": "~0.5.0",
"ember-cli-dependency-checker": "^1.2.0",
"ember-cli-htmlbars": "^1.0.1",
"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-internal-test-helpers": "^0.5.0",
"ember-cli-mocha": "~0.9.7",
"ember-cli-internal-test-helpers": "^0.7.0",
"ember-cli-mocha": "~0.10.0",
"ember-cli-pretender": "~0.5.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": "~2.3.0",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-data": "^2.4.0",
"ember-disable-prototype-extensions": "^1.1.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-sinon": "~0.3.0",
"ember-suave": "~1.2.2",
"ember-try": "~0.0.8",
"ember-load-initializers": "^0.5.0",
"ember-resolver": "^2.0.3",
"ember-sinon": "~0.5.0",
"ember-suave": "~2.0.1",
"ember-try": "^0.1.2",
"express": "^4.12.3",
"git-repo-version": "^0.3.0",
"glob": "^5.0.13",
"handlebars": "~3.0.3",
"lodash": "^3.10.1",
"handlebars": "~4.0.5",
"loader.js": "^4.0.0",
"lodash": "^4.5.1",
"marked": "^0.3.5",
"mocha": "^2.4.5",
"mocha-only-detector": "0.0.2",
"mocha-only-detector": "0.1.0",
"morgan": "^1.5.2",
"rimraf": "^2.3.2",
"rimraf": "^2.5.2",
"sinon-chai": "~2.8.0",
"torii": "~0.6.1"
},
Expand Down
7 changes: 4 additions & 3 deletions testem.json → testem.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"framework": "mocha",
/*jshint node:true*/
module.exports = {
"framework": "qunit",
"test_page": "tests/index.html?hidepassed",
"disable_watching": true,
"launch_in_ci": [
Expand All @@ -9,4 +10,4 @@
"PhantomJS",
"Chrome"
]
}
};
4 changes: 2 additions & 2 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

let App;
Expand Down
38 changes: 18 additions & 20 deletions tests/dummy/app/authenticators/torii.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
import Ember from 'ember';
import Torii from 'ember-simple-auth/authenticators/torii';
import raw from 'ic-ajax';

const { RSVP } = Ember;
const { service } = Ember.inject;
const { inject: { service } } = Ember;

export default Torii.extend({
torii: service('torii'),
torii: service(),
ajax: service(),

authenticate() {
return new RSVP.Promise((resolve, reject) => {
this._super(...arguments).then((data) => {
raw({
url: '/token',
type: 'POST',
dataType: 'json',
data: { 'grant_type': 'facebook_auth_code', 'auth_code': data.authorizationCode }
}).then((response) => {
resolve({
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
access_token: response.access_token,
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
provider: data.provider
});
}, reject);
}, reject);
const ajax = this.get('ajax');

return this._super(...arguments).then((data) => {
return ajax.request('/token', {
type: 'POST',
dataType: 'json',
data: { 'grant_type': 'facebook_auth_code', 'auth_code': data.authorizationCode }
}).then((response) => {
return {
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
access_token: response.access_token,
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
provider: data.provider
};
});
});
}
});
8 changes: 4 additions & 4 deletions tests/dummy/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for 'head'}}
{{content-for "head"}}

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/dummy.css">

{{content-for 'head-footer'}}
{{content-for "head-footer"}}
</head>
<body>
{{content-for 'body'}}
{{content-for "body"}}

<script src="assets/vendor.js"></script>
<script src="assets/dummy.js"></script>

{{content-for 'body-footer'}}
{{content-for "body-footer"}}
</body>
</html>
3 changes: 3 additions & 0 deletions tests/dummy/app/resolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Resolver from 'ember-resolver';

export default Resolver;
27 changes: 27 additions & 0 deletions tests/helpers/module-for-acceptance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { module } from 'qunit';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';

export default function(name, options = {}) {
module(name, {
beforeEach() {
this.application = startApp();

if (options.beforeEach) {
// jscs:disable requireSpread
options.beforeEach.apply(this, arguments);
// jscs:enable requireSpread
}
},

afterEach() {
if (options.afterEach) {
// jscs:disable requireSpread
options.afterEach.apply(this, arguments);
// jscs:enable requireSpread
}

destroyApp(this.application);
}
});
}
2 changes: 1 addition & 1 deletion tests/helpers/resolver.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Resolver from 'ember/resolver';
import Resolver from '../../resolver';
import config from '../../config/environment';

const resolver = Resolver.create();
Expand Down
18 changes: 9 additions & 9 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for 'head'}}
{{content-for 'test-head'}}
{{content-for "head"}}
{{content-for "test-head"}}

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/dummy.css">
<link rel="stylesheet" href="assets/test-support.css">

{{content-for 'head-footer'}}
{{content-for 'test-head-footer'}}
{{content-for "head-footer"}}
{{content-for "test-head-footer"}}
</head>
<body>
{{content-for 'body'}}
{{content-for 'test-body'}}
{{content-for "body"}}
{{content-for "test-body"}}

<script src="testem.js" integrity=""></script>
<script src="assets/vendor.js"></script>
<script src="assets/test-support.js"></script>
<script src="assets/dummy.js"></script>
<script src="testem.js" integrity=""></script>
<script src="assets/tests.js"></script>
<script src="assets/test-loader.js"></script>

{{content-for 'body-footer'}}
{{content-for 'test-body-footer'}}
{{content-for "body-footer"}}
{{content-for "test-body-footer"}}
</body>
</html>

0 comments on commit 0c15087

Please sign in to comment.