From 4c58b0c33162c06a95803f33b00b6b0c078b023a Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 10 Jul 2017 05:41:30 -0700 Subject: [PATCH] MAINT: Upgrade ember to 2.14 (#10) --- .eslintrc.js | 13 +++++++ .gitignore | 7 +++- .travis.yml | 7 +--- README.md | 2 - app/app.js | 2 - config/environment.js | 7 ++-- config/targets.js | 9 +++++ ember-cli-build.js | 9 +++-- package.json | 52 +++++++++++++------------- testem.js | 17 ++++----- tests/.eslintrc.js | 5 +++ tests/helpers/module-for-acceptance.js | 4 +- tests/helpers/start-app.js | 9 ++--- tests/test-helper.js | 3 +- 14 files changed, 84 insertions(+), 62 deletions(-) create mode 100644 .eslintrc.js create mode 100644 config/targets.js create mode 100644 tests/.eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..2873e2f --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,13 @@ +module.exports = { + root: true, + parserOptions: { + ecmaVersion: 2017, + sourceType: 'module' + }, + extends: 'eslint:recommended', + env: { + browser: true + }, + rules: { + } +}; diff --git a/.gitignore b/.gitignore index 8a03bb8..3499423 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,11 @@ /coverage/* /libpeerconnection.log npm-debug.log* +yarn-error.log testem.log - .firebaserc + +# ember-try +.node_modules.ember-try/ +bower.json.ember-try +package.json.ember-try diff --git a/.travis.yml b/.travis.yml index a75f20e..385f003 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,21 @@ --- language: node_js node_js: - - "4" + - "6" sudo: false cache: directories: - $HOME/.npm - - $HOME/.cache # includes bowers cache before_install: - npm config set spin false - - npm install -g bower phantomjs-prebuilt - - bower --version + - npm install -g phantomjs-prebuilt - phantomjs --version install: - npm install - - bower install script: - npm test diff --git a/README.md b/README.md index 498cf90..a69437b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ You will need the following things properly installed on your computer. * [Git](https://git-scm.com/) * [Node.js](https://nodejs.org/) (with NPM) -* [Bower](https://bower.io/) * [Ember CLI](https://ember-cli.com/) * [PhantomJS](http://phantomjs.org/) @@ -18,7 +17,6 @@ You will need the following things properly installed on your computer. * `git clone ` this repository * `cd ccdb-web` * `npm install` -* `bower install` ## Running / Development diff --git a/app/app.js b/app/app.js index 831ad61..f796e79 100644 --- a/app/app.js +++ b/app/app.js @@ -5,8 +5,6 @@ import config from './config/environment'; let App; -Ember.MODEL_FACTORY_INJECTIONS = true; - App = Ember.Application.extend({ modulePrefix: config.modulePrefix, podModulePrefix: config.podModulePrefix, diff --git a/config/environment.js b/config/environment.js index 715a054..8fb60a9 100644 --- a/config/environment.js +++ b/config/environment.js @@ -1,9 +1,10 @@ -/* jshint node: true */ +/* eslint-env node */ +'use strict'; module.exports = function(environment) { - var ENV = { + let ENV = { modulePrefix: 'ccdb-web', - environment: environment, + environment, rootURL: '/', locationType: 'auto', EmberENV: { diff --git a/config/targets.js b/config/targets.js new file mode 100644 index 0000000..df7664c --- /dev/null +++ b/config/targets.js @@ -0,0 +1,9 @@ +/* eslint-env node */ +module.exports = { + browsers: [ + 'ie 9', + 'last 1 Chrome versions', + 'last 1 Firefox versions', + 'last 1 Safari versions' + ] +}; diff --git a/ember-cli-build.js b/ember-cli-build.js index 2537ce2..9a757ff 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -1,9 +1,10 @@ -/*jshint node:true*/ -/* global require, module */ -var EmberApp = require('ember-cli/lib/broccoli/ember-app'); +/* eslint-env node */ +'use strict'; + +const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = function(defaults) { - var app = new EmberApp(defaults, { + let app = new EmberApp(defaults, { // Add options here }); diff --git a/package.json b/package.json index b3509b3..286ff53 100644 --- a/package.json +++ b/package.json @@ -16,39 +16,37 @@ }, "devDependencies": { "broccoli-asset-rev": "^2.4.5", - "ember-ajax": "^2.4.1", - "ember-cli": "2.11.1", - "ember-cli-app-version": "^2.0.0", - "ember-cli-babel": "^5.1.7", + "ember-ajax": "^3.0.0", + "ember-cli": "~2.14.0", + "ember-cli-app-version": "^3.0.0", + "ember-cli-babel": "^6.3.0", "ember-cli-dependency-checker": "^1.3.0", - "ember-cli-flash": "1.3.16", - "ember-cli-htmlbars": "^1.1.1", - "ember-cli-htmlbars-inline-precompile": "^0.3.6", + "ember-cli-eslint": "^3.0.0", + "ember-cli-flash": "1.4.3", + "ember-cli-htmlbars": "^2.0.1", + "ember-cli-htmlbars-inline-precompile": "^0.4.3", "ember-cli-inject-live-reload": "^1.4.1", - "ember-cli-jshint": "^2.0.1", - "ember-cli-mirage": "0.2.1", - "ember-cli-moment-shim": "2.0.0", - "ember-cli-qunit": "^3.0.1", - "ember-cli-release": "^0.2.9", - "ember-cli-shims": "^1.0.2", + "ember-cli-mirage": "0.3.4", + "ember-cli-qunit": "^4.0.0", + "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-export-application-global": "^1.0.5", - "ember-load-initializers": "^0.6.0", - "ember-resolver": "^2.0.3", - "ember-source": "~2.11.0", - "ember-django-adapter": "1.1.2", - "ember-moment": "7.0.0-beta.3", - "ember-power-select": "1.0.0-alpha.14", - "ember-power-select-with-create": "0.1.10", - "ember-simple-auth": "1.1.0", - "ember-welcome-page": "^2.0.2", - "loader.js": "^4.0.10" + "ember-data": "~2.14.3", + "ember-export-application-global": "^2.0.0", + "ember-inflector": "^2.0.1", + "ember-load-initializers": "^1.0.0", + "ember-resolver": "^4.0.0", + "ember-source": "~2.14.0", + "ember-django-adapter": "1.1.3", + "ember-moment": "7.3.1", + "ember-power-select": "1.8.5", + "ember-power-select-with-create": "0.4.3", + "ember-simple-auth": "1.3.0", + "ember-welcome-page": "^3.0.0", + "loader.js": "^4.2.3" }, "engines": { - "node": ">= 0.12.0" + "node": "^4.5 || 6.* || >= 7.*" }, "private": true } diff --git a/testem.js b/testem.js index 26044b2..f413516 100644 --- a/testem.js +++ b/testem.js @@ -1,13 +1,12 @@ -/*jshint node:true*/ +/* eslint-env node */ module.exports = { - "framework": "qunit", - "test_page": "tests/index.html?hidepassed", - "disable_watching": true, - "launch_in_ci": [ - "PhantomJS" + test_page: 'tests/index.html?hidepassed', + disable_watching: true, + launch_in_ci: [ + 'PhantomJS' ], - "launch_in_dev": [ - "PhantomJS", - "Chrome" + launch_in_dev: [ + 'PhantomJS', + 'Chrome' ] }; diff --git a/tests/.eslintrc.js b/tests/.eslintrc.js new file mode 100644 index 0000000..fbf2555 --- /dev/null +++ b/tests/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + env: { + embertest: true + } +}; diff --git a/tests/helpers/module-for-acceptance.js b/tests/helpers/module-for-acceptance.js index 76996fd..5a1a583 100644 --- a/tests/helpers/module-for-acceptance.js +++ b/tests/helpers/module-for-acceptance.js @@ -3,7 +3,7 @@ import Ember from 'ember'; import startApp from '../helpers/start-app'; import destroyApp from '../helpers/destroy-app'; -const { RSVP: { Promise } } = Ember; +const { RSVP: { resolve } } = Ember; export default function(name, options = {}) { module(name, { @@ -17,7 +17,7 @@ export default function(name, options = {}) { afterEach() { let afterEach = options.afterEach && options.afterEach.apply(this, arguments); - return Promise.resolve(afterEach).then(() => destroyApp(this.application)); + return resolve(afterEach).then(() => destroyApp(this.application)); } }); } diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js index e098f1d..9a605eb 100644 --- a/tests/helpers/start-app.js +++ b/tests/helpers/start-app.js @@ -3,16 +3,13 @@ import Application from '../../app'; import config from '../../config/environment'; export default function startApp(attrs) { - let application; - let attributes = Ember.merge({}, config.APP); attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; - Ember.run(() => { - application = Application.create(attributes); + return Ember.run(() => { + let application = Application.create(attributes); application.setupForTesting(); application.injectTestHelpers(); + return application; }); - - return application; } diff --git a/tests/test-helper.js b/tests/test-helper.js index f9ddf8d..cbee281 100644 --- a/tests/test-helper.js +++ b/tests/test-helper.js @@ -1,8 +1,9 @@ import resolver from './helpers/resolver'; import './helpers/flash-message'; - import { setResolver } from 'ember-qunit'; +import { start } from 'ember-cli-qunit'; setResolver(resolver); +start();