From bc6eca22f6289452d2701577a1dc73ed5c4ce870 Mon Sep 17 00:00:00 2001 From: Oleg Nechiporenko Date: Mon, 1 Aug 2016 17:54:34 +0300 Subject: [PATCH] Move to ember-2.7.0 --- .editorconfig | 14 ------- .jshintrc | 2 +- .npmignore | 20 +++++----- .travis.yml | 15 +++++--- LICENSE.md | 2 +- addon/components/models-table.js | 11 ++++-- bower.json | 13 ++----- config/ember-try.js | 51 +++++++++++++++++-------- ember-cli-build.js | 2 +- package.json | 38 ++++++++++--------- testem.js | 13 +++++++ tests/.jshintrc | 2 +- tests/dummy/app/index.html | 52 +++++++++++++------------- tests/dummy/app/resolver.js | 3 ++ tests/dummy/config/environment.js | 5 +-- tests/helpers/module-for-acceptance.js | 12 +++--- tests/helpers/resolver.js | 2 +- tests/index.html | 33 ++++++++-------- 18 files changed, 157 insertions(+), 133 deletions(-) create mode 100644 testem.js create mode 100644 tests/dummy/app/resolver.js diff --git a/.editorconfig b/.editorconfig index 47c54384..219985c2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,22 +13,8 @@ insert_final_newline = true indent_style = space indent_size = 2 -[*.js] -indent_style = space -indent_size = 2 - [*.hbs] insert_final_newline = false -indent_style = space -indent_size = 2 - -[*.css] -indent_style = space -indent_size = 2 - -[*.html] -indent_style = space -indent_size = 2 [*.{diff,md}] trim_trailing_whitespace = false diff --git a/.jshintrc b/.jshintrc index ec217145..776c46f4 100644 --- a/.jshintrc +++ b/.jshintrc @@ -27,6 +27,6 @@ "strict": false, "white": false, "eqnull": true, - "esnext": true, + "esversion": 6, "unused": true } diff --git a/.npmignore b/.npmignore index 49996f5a..fa8b147a 100644 --- a/.npmignore +++ b/.npmignore @@ -1,14 +1,16 @@ -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 -Brocfile.js -testem.json +ember-cli-build.js +testem.js diff --git a/.travis.yml b/.travis.yml index b105b1ea..cb0a8736 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ cache: env: - EMBER_TRY_SCENARIO=default + - EMBER_TRY_SCENARIO=ember-1.13 - EMBER_TRY_SCENARIO=ember-release - EMBER_TRY_SCENARIO=ember-beta - EMBER_TRY_SCENARIO=ember-canary @@ -20,18 +21,22 @@ env: matrix: fast_finish: true allow_failures: + - env: EMBER_TRY_SCENARIO=ember-1.13 - env: EMBER_TRY_SCENARIO=ember-canary before_install: - - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH - - "npm config set spin false" - - "npm install -g npm@^2" + - npm config set spin false + - npm install -g bower + - bower --version + - npm install phantomjs-prebuilt + - phantomjs --version install: - - npm install -g bower - npm install - bower install - ember install ember-get-helper script: - - ember try $EMBER_TRY_SCENARIO test + # Usually, it's ok to finish the test scenario without reverting + # to the addon's original dependency state, skipping "cleanup". + - ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup diff --git a/LICENSE.md b/LICENSE.md index 00e9fbbf..02000b56 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 +Copyright (c) 2016 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/addon/components/models-table.js b/addon/components/models-table.js index 67648e98..0652953b 100644 --- a/addon/components/models-table.js +++ b/addon/components/models-table.js @@ -812,12 +812,15 @@ export default Component.extend({ }), /** - * Recalculate processedColumns when the columns attr changes + * Recalculate processedColumns when the columns attr changes **/ - updateColumns: on('didReceiveAttrs', function(){ - this._setupColumns(); + updateColumns: on('didReceiveAttrs', function() { + var columnsAreUpdateable = get(this, 'columnsAreUpdateable'); + if (columnsAreUpdateable) { + this._setupColumns(); + } }), - + /** * Focus on "Global filter" on component render * diff --git a/bower.json b/bower.json index 1ac0a756..29bb4935 100644 --- a/bower.json +++ b/bower.json @@ -1,15 +1,8 @@ { "name": "ember-models-table", "dependencies": { - "ember": "1.13.11", - "ember-cli-shims": "0.0.6", - "ember-cli-test-loader": "0.2.1", - "ember-load-initializers": "0.1.7", - "ember-qunit": "0.4.16", - "ember-qunit-notifications": "0.1.0", - "ember-resolver": "~0.1.20", - "jquery": "1.11.3", - "loader.js": "ember-cli/loader.js#3.4.0", - "qunit": "~1.20.0" + "ember": "~2.7.0", + "ember-cli-shims": "0.1.1", + "ember-qunit-notifications": "0.1.0" } } \ No newline at end of file diff --git a/config/ember-try.js b/config/ember-try.js index 3e88bc61..014f603d 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -3,33 +3,52 @@ module.exports = { scenarios: [ { name: 'default', - dependencies: { } + bower: { + dependencies: { } + } + }, + { + name: 'ember-1.13', + bower: { + dependencies: { + 'ember': '~1.13.0' + }, + resolutions: { + 'ember': '~1.13.0' + } + } }, { name: 'ember-release', - dependencies: { - 'ember': 'components/ember#release' - }, - resolutions: { - 'ember': 'release' + bower: { + dependencies: { + 'ember': 'components/ember#release' + }, + resolutions: { + 'ember': 'release' + } } }, { name: 'ember-beta', - dependencies: { - 'ember': 'components/ember#beta' - }, - resolutions: { - 'ember': 'beta' + bower: { + dependencies: { + 'ember': 'components/ember#beta' + }, + resolutions: { + 'ember': 'beta' + } } }, { name: 'ember-canary', - dependencies: { - 'ember': 'components/ember#canary' - }, - resolutions: { - 'ember': 'canary' + bower: { + dependencies: { + 'ember': 'components/ember#canary' + }, + resolutions: { + 'ember': 'canary' + } } } ] diff --git a/ember-cli-build.js b/ember-cli-build.js index c8c48f84..4ac39137 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -8,7 +8,7 @@ module.exports = function(defaults) { }); /* - This build file specifes the options for the dummy test app of this + This build file specifies the options for the dummy test app of this addon, located in `/tests/dummy` This build file does *not* influence how the addon or the app using it behave. You most likely want to be modifying `./index.js` or app's build file diff --git a/package.json b/package.json index b511eec3..422466ba 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "scripts": { "build": "ember build", "start": "ember server", - "test": "ember try:testall" + "test": "ember try:each" }, "repository": "https://github.com/onechiporenko/ember-models-table", "engines": { @@ -18,33 +18,35 @@ "author": "Oleg Nechiporenko", "license": "MIT", "devDependencies": { - "broccoli-asset-rev": "^2.2.0", - "ember-cli": "1.13.13", + "broccoli-asset-rev": "^2.4.2", + "ember-ajax": "^2.0.1", + "ember-cli": "2.7.0", "ember-cli-app-version": "^1.0.0", - "ember-cli-content-security-policy": "0.4.0", - "ember-cli-dependency-checker": "^1.1.0", - "ember-cli-htmlbars": "^1.0.1", + "ember-cli-dependency-checker": "^1.2.0", + "ember-cli-htmlbars": "^1.0.3", "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-qunit": "^1.0.4", - "ember-cli-release": "0.2.8", - "ember-cli-sri": "^1.2.0", + "ember-cli-inject-live-reload": "^1.4.0", + "ember-cli-jshint": "^1.0.0", + "ember-cli-qunit": "^2.0.0", + "ember-cli-release": "^0.2.9", + "ember-cli-sri": "^2.1.0", + "ember-cli-test-loader": "^1.1.0", "ember-cli-uglify": "^1.2.0", - "ember-disable-prototype-extensions": "^1.0.0", - "ember-disable-proxy-controllers": "^1.0.1", - "ember-export-application-global": "^1.0.4", - "ember-to-string": "1.0.1", - "ember-try": "~0.0.8" + "ember-data": "^2.7.0", + "ember-disable-prototype-extensions": "^1.1.0", + "ember-export-application-global": "^1.0.5", + "ember-load-initializers": "^0.5.1", + "ember-resolver": "^2.0.3", + "ember-welcome-page": "^1.0.1", + "loader.js": "^4.0.1" }, "keywords": [ "ember-addon" ], "dependencies": { - "ember-cli-babel": "^5.1.5" + "ember-cli-babel": "^5.1.6" }, "ember-addon": { - "demoURL": "http://onechiporenko.github.io/ember-models-table/", "configPath": "tests/dummy/config" } } diff --git a/testem.js b/testem.js new file mode 100644 index 00000000..26044b2f --- /dev/null +++ b/testem.js @@ -0,0 +1,13 @@ +/*jshint node:true*/ +module.exports = { + "framework": "qunit", + "test_page": "tests/index.html?hidepassed", + "disable_watching": true, + "launch_in_ci": [ + "PhantomJS" + ], + "launch_in_dev": [ + "PhantomJS", + "Chrome" + ] +}; diff --git a/tests/.jshintrc b/tests/.jshintrc index 44c826a5..18842b80 100644 --- a/tests/.jshintrc +++ b/tests/.jshintrc @@ -47,6 +47,6 @@ "strict": false, "white": false, "eqnull": true, - "esnext": true, + "esversion": 6, "unused": true } diff --git a/tests/dummy/app/index.html b/tests/dummy/app/index.html index 671f44bc..4b65f69f 100644 --- a/tests/dummy/app/index.html +++ b/tests/dummy/app/index.html @@ -1,37 +1,37 @@ - - - - Ember Models Table - - + + + + Ember Models Table + + - {{content-for 'head'}} + {{content-for "head"}} - - + + - {{content-for 'head-footer'}} + {{content-for "head-footer"}} + + + {{content-for "body"}} - - -{{content-for 'body'}} + + - - - - - - - - + + + + + + -{{content-for 'body-footer'}} + {{content-for "body-footer"}} - - Fork me on GitHub - + + Fork me on GitHub + - + diff --git a/tests/dummy/app/resolver.js b/tests/dummy/app/resolver.js new file mode 100644 index 00000000..2fb563d6 --- /dev/null +++ b/tests/dummy/app/resolver.js @@ -0,0 +1,3 @@ +import Resolver from 'ember-resolver'; + +export default Resolver; diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index 0481fb64..380e8944 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -4,7 +4,7 @@ module.exports = function(environment) { var ENV = { modulePrefix: 'dummy', environment: environment, - baseURL: '/', + rootURL: '/', locationType: 'auto', EmberENV: { FEATURES: { @@ -29,7 +29,6 @@ module.exports = function(environment) { if (environment === 'test') { // Testem prefers this... - ENV.baseURL = '/'; ENV.locationType = 'none'; // keep test console output quieter @@ -40,7 +39,7 @@ module.exports = function(environment) { } if (environment === 'production') { - ENV.baseURL = '/ember-models-table/'; + ENV.rootURL = '/ember-models-table/'; } return ENV; diff --git a/tests/helpers/module-for-acceptance.js b/tests/helpers/module-for-acceptance.js index ed23003d..76996fd0 100644 --- a/tests/helpers/module-for-acceptance.js +++ b/tests/helpers/module-for-acceptance.js @@ -1,23 +1,23 @@ import { module } from 'qunit'; +import Ember from 'ember'; import startApp from '../helpers/start-app'; import destroyApp from '../helpers/destroy-app'; +const { RSVP: { Promise } } = Ember; + export default function(name, options = {}) { module(name, { beforeEach() { this.application = startApp(); if (options.beforeEach) { - options.beforeEach.apply(this, arguments); + return options.beforeEach.apply(this, arguments); } }, afterEach() { - destroyApp(this.application); - - if (options.afterEach) { - options.afterEach.apply(this, arguments); - } + let afterEach = options.afterEach && options.afterEach.apply(this, arguments); + return Promise.resolve(afterEach).then(() => destroyApp(this.application)); } }); } diff --git a/tests/helpers/resolver.js b/tests/helpers/resolver.js index ebfb4e4d..b208d38d 100644 --- a/tests/helpers/resolver.js +++ b/tests/helpers/resolver.js @@ -1,4 +1,4 @@ -import Resolver from 'ember/resolver'; +import Resolver from '../../resolver'; import config from '../../config/environment'; const resolver = Resolver.create(); diff --git a/tests/index.html b/tests/index.html index a3202fdf..f7ff6521 100644 --- a/tests/index.html +++ b/tests/index.html @@ -7,28 +7,27 @@ - {{content-for 'head'}} - {{content-for 'test-head'}} + {{content-for "head"}} + {{content-for "test-head"}} - - - + + + - {{content-for 'head-footer'}} - {{content-for 'test-head-footer'}} + {{content-for "head-footer"}} + {{content-for "test-head-footer"}} + {{content-for "body"}} + {{content-for "test-body"}} - {{content-for 'body'}} - {{content-for 'test-body'}} - - - - - - + + + + + - {{content-for 'body-footer'}} - {{content-for 'test-body-footer'}} + {{content-for "body-footer"}} + {{content-for "test-body-footer"}}