Skip to content

Commit

Permalink
Update ember-cli to 2.13 (#273)
Browse files Browse the repository at this point in the history
* Update ember-cli to 2.13

* Fix CI manifest

* Migrate to ember-native-dom-helpers using codemod

* Use eslint suave plugin

* Remove unsupported scenario
  • Loading branch information
cibernox committed Jun 7, 2017
1 parent 00f0078 commit 55086fe
Show file tree
Hide file tree
Showing 63 changed files with 1,194 additions and 1,716 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,16 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: [
'eslint:recommended',
'plugin:ember-suave/recommended'
],
env: {
browser: true
},
rules: {
}
};
2 changes: 1 addition & 1 deletion .npmignore
Expand Up @@ -8,7 +8,7 @@
.editorconfig
.ember-cli
.gitignore
.jshintrc
.eslintrc.js
.watchmanconfig
.travis.yml
bower.json
Expand Down
3 changes: 1 addition & 2 deletions addon/helpers/repeat.js
Expand Up @@ -5,8 +5,7 @@ export function repeat([length, value]) {
if (typeOf(length) !== 'number') {
return [value];
}

return Array.apply(null, { length }).map(() => value);
return Array.apply(null, { length }).map(() => value); // eslint-disable-line
}

export default helper(repeat);
14 changes: 7 additions & 7 deletions addon/utils/get-index.js
Expand Up @@ -4,13 +4,13 @@ import isEqual from '../utils/is-equal';
export default function getIndex(array, currentValue, useDeepEqual) {
let needle = currentValue;

 if (useDeepEqual) {
   needle = emberArray(array).find((object) => {
     return isEqual(object, currentValue, useDeepEqual);
   });
 }
if (useDeepEqual) {
needle = emberArray(array).find((object) => {
return isEqual(object, currentValue, useDeepEqual);
});
}

 let index = emberArray(array).indexOf(needle);
let index = emberArray(array).indexOf(needle);

 return index >= 0 ? index : null;
return index >= 0 ? index : null;
}
3 changes: 1 addition & 2 deletions addon/utils/is-promise.js
Expand Up @@ -2,8 +2,7 @@ import { typeOf } from 'ember-utils';
import isObject from './is-object';

function isPromiseLike(obj = {}) {
return typeOf(obj.then) === 'function' &&
typeOf(obj.catch) === 'function';
return typeOf(obj.then) === 'function' && typeOf(obj.catch) === 'function';
}

export default function isPromise(obj) {
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
@@ -1,6 +1,6 @@
machine:
node:
version: "stable"
version: "6"
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"

Expand Down
2 changes: 1 addition & 1 deletion config/ember-try.js
@@ -1,4 +1,4 @@
/*jshint node:true*/
/* eslint-env node */
var command = [ 'ember', 'exam', '--split', '3', '--random' ];

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion config/environment.js
@@ -1,4 +1,4 @@
/*jshint node:true*/
/* eslint-env node */
'use strict';

module.exports = function(/* environment, appConfig */) {
Expand Down
5 changes: 2 additions & 3 deletions ember-cli-build.js
@@ -1,6 +1,5 @@
/*jshint node:true*/
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
/* eslint-env node */
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
Expand Down
4 changes: 1 addition & 3 deletions index.js
@@ -1,5 +1,4 @@
/* jshint node: true, esnext: false */
/* jscs: disable */
/* eslint-env node */
'use strict';

var Funnel = require('broccoli-funnel');
Expand Down Expand Up @@ -110,4 +109,3 @@ module.exports = {
return except;
}
};
/* jscs: enable */
37 changes: 19 additions & 18 deletions package.json
Expand Up @@ -16,43 +16,44 @@
"bugs": "https://github.com/DockYard/ember-composable-helpers/issues",
"homepage": "https://github.com/DockYard/ember-composable-helpers",
"engines": {
"node": ">= 0.10.0"
"node": ">= 4"
},
"author": [
"authors": [
"Lauren Tan <arr@sugarpirate.com>",
"Marten Schilstra <mail@martenschilstra.nl>"
],
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"chai": "^3.5.0",
"ember-ajax": "^2.4.1",
"ember-cli": "2.11.0",
"ember-cli-app-version": "^2.0.0",
"ember-ajax": "^3.0.0",
"ember-cli": "2.13.2",
"ember-cli-dependency-checker": "^1.3.0",
"ember-cli-eslint": "^3.0.0",
"ember-cli-htmlbars": "^1.1.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.3",
"ember-cli-htmlbars-inline-precompile": "^0.4.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-jshint": "^2.0.1",
"ember-cli-qunit": "^3.0.1",
"ember-cli-qunit": "^4.0.0",
"ember-cli-release": "^0.2.9",
"ember-cli-shims": "^1.0.2",
"ember-cli-shims": "^1.1.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-test-loader": "^1.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "2.11.0",
"ember-disable-prototype-extensions": "^1.1.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-each-in-polyfill": "^0.1.4",
"ember-exam": "0.4.6",
"ember-export-application-global": "^1.0.5",
"ember-exam": "^0.7.0",
"ember-export-application-global": "^2.0.0",
"ember-inflector": "1.9.6",
"ember-load-initializers": "^0.6.0",
"ember-resolver": "^2.0.3",
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-native-dom-event-dispatcher": "^0.6.1",
"ember-native-dom-helpers": "^0.4.1",
"ember-resolver": "^4.0.0",
"ember-sinon": "0.5.0",
"ember-source": "^2.11.0",
"ember-suave": "4.0.0",
"loader.js": "^4.0.10",
"ember-source": "~2.13.0",
"eslint-plugin-ember-suave": "1.0.0",
"loader.js": "^4.2.3",
"mocha": "^2.4.5"
},
"keywords": [
Expand All @@ -69,7 +70,7 @@
],
"dependencies": {
"broccoli-funnel": "^1.0.1",
"ember-cli-babel": "^5.1.7"
"ember-cli-babel": "^6.1.0"
},
"ember-addon": {
"configPath": "tests/dummy/config"
Expand Down
3 changes: 1 addition & 2 deletions testem.js
@@ -1,6 +1,5 @@
/*jshint node:true*/
/* eslint-env node */
module.exports = {
"framework": "qunit",
"test_page": "tests/index.html?hidepassed",
"disable_watching": true,
"parallel": "-1",
Expand Down
2 changes: 2 additions & 0 deletions tests/.eslintrc.js
@@ -0,0 +1,2 @@
module.exports = {
};
52 changes: 0 additions & 52 deletions tests/.jshintrc

This file was deleted.

2 changes: 1 addition & 1 deletion tests/dummy/config/environment.js
@@ -1,4 +1,4 @@
/* jshint node: true */
/* eslint-env node */

module.exports = function(environment) {
var ENV = {
Expand Down
10 changes: 10 additions & 0 deletions tests/dummy/config/targets.js
@@ -0,0 +1,10 @@
/* eslint-env node */

module.exports = {
browsers: [
'ie 9',
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
]
};
4 changes: 2 additions & 2 deletions tests/helpers/module-for-acceptance.js
Expand Up @@ -11,12 +11,12 @@ export default function(name, options = {}) {
this.application = startApp();

if (options.beforeEach) {
return options.beforeEach.call(this, ...arguments);
return options.beforeEach.apply(this, arguments);
}
},

afterEach() {
let afterEach = options.afterEach && options.afterEach.call(this, ...arguments);
let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
return Promise.resolve(afterEach).then(() => destroyApp(this.application));
}
});
Expand Down
8 changes: 3 additions & 5 deletions tests/helpers/start-app.js
Expand Up @@ -11,16 +11,14 @@ const {
const assign = emberAssign || emberMerge;

export default function startApp(attrs) {
let application;

let attributes = assign({}, config.APP);
attributes = assign(attributes, attrs); // use defaults, but you can override;

run(() => {
application = Application.create(attributes);
return run(() => {
let application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
return application;
});

return application;
}
7 changes: 4 additions & 3 deletions tests/integration/helpers/append-test.js
@@ -1,3 +1,4 @@
import { find } from 'ember-native-dom-helpers';
import Ember from 'ember';
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
Expand All @@ -20,7 +21,7 @@ test('It concats two arrays', function(assert) {

let expected = '246135';

assert.equal(this.$().text().trim(), expected, 'appends values');
assert.equal(find('*').textContent.trim(), expected, 'appends values');
});

test('It concats two arrays and a value', function(assert) {
Expand All @@ -36,7 +37,7 @@ test('It concats two arrays and a value', function(assert) {

let expected = '461352';

assert.equal(this.$().text().trim(), expected, 'appends values');
assert.equal(find('*').textContent.trim(), expected, 'appends values');
});

test('It watches for changes', function(assert) {
Expand All @@ -50,5 +51,5 @@ test('It watches for changes', function(assert) {
`);

run(() => this.get('odds').pushObject(7));
assert.equal(this.$().text().trim(), '13572', 'new value is added');
assert.equal(find('*').textContent.trim(), '13572', 'new value is added');
});
11 changes: 6 additions & 5 deletions tests/integration/helpers/array-test.js
@@ -1,3 +1,4 @@
import { find } from 'ember-native-dom-helpers';
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

Expand All @@ -12,7 +13,7 @@ test('creates array object in template', function(assert) {
{{~/each~}}
`);

assert.equal(this.$().text().trim(), '123', 'creates array object in template');
assert.equal(find('*').textContent.trim(), '123', 'creates array object in template');
});

test('has length property', function(assert) {
Expand All @@ -22,7 +23,7 @@ test('has length property', function(assert) {
{{~/with~}}
`);

assert.equal(this.$().text().trim(), '4', 'length is accessible');
assert.equal(find('*').textContent.trim(), '4', 'length is accessible');
});

test('re-evaluates when parameter changes', function(assert) {
Expand All @@ -32,15 +33,15 @@ test('re-evaluates when parameter changes', function(assert) {
{{~/each~}}
`);

assert.equal(this.$().text().trim(), '123', 'dynamic is not included when undefined');
assert.equal(find('*').textContent.trim(), '123', 'dynamic is not included when undefined');

this.set('dynamic', 'π');
assert.equal(this.$().text().trim(), '12π3', 'dynamic is included');
assert.equal(find('*').textContent.trim(), '12π3', 'dynamic is included');
});

test('if evaluates empty array to false', function(assert) {
this.render(hbs`
{{~if (array) 'true' 'false'~}}
`);
assert.equal(this.$().text().trim(), 'false', 'empty array evaluates to false in .hbs template');
assert.equal(find('*').textContent.trim(), 'false', 'empty array evaluates to false in .hbs template');
});

0 comments on commit 55086fe

Please sign in to comment.