Skip to content

Commit

Permalink
Upgrade addon to EmberCLI 2.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
terrilldent committed Nov 2, 2017
1 parent 6e02ec2 commit 96f9050
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 97 deletions.
14 changes: 0 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 18 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
---
language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "4"

sudo: false
dist: trusty

addons:
chrome: stable

cache:
directories:
- node_modules
- $HOME/.npm

env:
- EMBER_TRY_SCENARIO=default
- EMBER_TRY_SCENARIO=ember-1.13
global:
# See https://git.io/vdao3 for details.
- JOBS=1
# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-lts-2.8
- EMBER_TRY_SCENARIO=ember-lts-2.12
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
- EMBER_TRY_SCENARIO=ember-default

matrix:
fast_finish: true
Expand All @@ -23,14 +35,10 @@ matrix:

before_install:
- npm config set spin false
- npm install -g bower
- npm install phantomjs-prebuilt

install:
- npm install
- bower install
- npm install -g npm@4
- npm --version

script:
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- ember try $EMBER_TRY_SCENARIO test --skip-cleanup
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
2 changes: 1 addition & 1 deletion addon/utils/computable.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var Computable = {
return Ember.computed(collectionKey, function(){
var collection = this.get(collectionKey);
return collection &&
((collection.includes && collection.includes(value)) || (collection.contains && collection.contains(value)));
((collection.includes && collection.includes(value)) || (!collection.includes && collection.contains && collection.contains(value)));
});
},

Expand Down
1 change: 1 addition & 0 deletions app/initializers/computable.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Ember from 'ember';
import Computable from 'ember-computable/utils/computable';
const { computed } = Ember;

Expand Down
6 changes: 3 additions & 3 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
module.exports = {
scenarios: [
{
name: 'ember-lts-2.10',
name: 'ember-lts-2.8',
bower: {
dependencies: {
'ember': 'components/ember#lts-2-10'
'ember': 'components/ember#lts-2-8'
},
resolutions: {
'ember': 'lts-2-10'
'ember': 'lts-2-8'
}
},
npm: {
Expand Down
7 changes: 4 additions & 3 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-env node */
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
'use strict';

const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
let app = new EmberAddon(defaults, {
// Add options here
});

Expand Down
68 changes: 34 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
{
"name": "ember-computable",
"version": "0.0.4",
"version": "0.0.5",
"description": "Computed Properties extension for Ember. Adds more functional programming capabilities to computed properties.",
"keywords": [
"ember-addon",
"computed",
"properties",
"reactive",
"compose",
"functional"
],
"license": "Apache-2.0",
"author": "Terrill Dent <tdent@squareup.com>",
"directories": {
"doc": "doc",
"test": "tests"
},
"repository": "",
"scripts": {
"build": "ember build",
"start": "ember server",
"test": "ember try:each"
},
"repository": "",
"engines": {
"node": ">= 0.10.0"
"dependencies": {
"ember-cli-babel": "^6.6.0"
},
"author": "Terrill Dent <tdent@squareup.com>",
"license": "Apache-2.0",
"devDependencies": {
"broccoli-asset-rev": "^2.4.2",
"ember-ajax": "^2.0.1",
"ember-cli": "^2.6.3",
"ember-cli-app-version": "^1.0.0",
"ember-cli-dependency-checker": "^1.2.0",
"ember-cli-htmlbars": "^1.0.3",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-inject-live-reload": "^1.4.0",
"ember-cli-jshint": "^1.0.0",
"ember-cli-qunit": "^1.4.0",
"ember-cli-release": "^0.2.9",
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^3.0.0",
"ember-cli": "~2.16.1",
"ember-cli-dependency-checker": "^2.0.0",
"ember-cli-eslint": "^4.0.0",
"ember-cli-htmlbars": "^2.0.1",
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-qunit": "^4.0.0",
"ember-cli-shims": "^1.1.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "^2.6.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"
"ember-cli-uglify": "^2.0.0",
"ember-disable-prototype-extensions": "^1.1.2",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.0.0",
"ember-resolver": "^4.0.0",
"ember-source": "~2.16.0",
"ember-welcome-page": "^3.0.0",
"loader.js": "^4.2.3"
},
"keywords": [
"ember-addon",
"computed",
"properties",
"reactive",
"compose"
],
"dependencies": {
"ember-cli-babel": "^5.1.6"
"engines": {
"node": "^4.5 || 6.* || >= 7.*"
},
"ember-addon": {
"configPath": "tests/dummy/config"
Expand Down
15 changes: 9 additions & 6 deletions testem.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ module.exports = {
'Chrome'
],
browser_args: {
Chrome: [
'--disable-gpu',
'--headless',
'--remote-debugging-port=9222',
'--window-size=1440,900'
]
Chrome: {
mode: 'ci',
args: [
'--disable-gpu',
'--headless',
'--remote-debugging-port=9222',
'--window-size=1440,900'
]
},
}
};
8 changes: 2 additions & 6 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import Ember from 'ember';
import Application from '@ember/application';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

let App;

Ember.MODEL_FACTORY_INJECTIONS = true;

App = Ember.Application.extend({
const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
Expand Down
8 changes: 4 additions & 4 deletions tests/dummy/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

{{content-for "head"}}

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/dummy.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/dummy.css">

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

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

{{content-for "body-footer"}}
</body>
Expand Down
7 changes: 4 additions & 3 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Ember from 'ember';
import EmberRouter from '@ember/routing/router';
import config from './config/environment';

const Router = Ember.Router.extend({
location: config.locationType
const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL
});

Router.map(function() {
Expand Down
12 changes: 8 additions & 4 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
/* eslint-env node */
'use strict';

module.exports = function(environment) {
var ENV = {
let ENV = {
modulePrefix: 'dummy',
environment: environment,
environment,
rootURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false
}
},

Expand All @@ -29,7 +34,6 @@ module.exports = function(environment) {

if (environment === 'test') {
// Testem prefers this...
ENV.rootURL = '/';
ENV.locationType = 'none';

// keep test console output quieter
Expand All @@ -40,7 +44,7 @@ module.exports = function(environment) {
}

if (environment === 'production') {

// here you can enable a production-specific feature
}

return ENV;
Expand Down
4 changes: 2 additions & 2 deletions tests/helpers/destroy-app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember';
import { run } from '@ember/runloop';

export default function destroyApp(application) {
Ember.run(application, 'destroy');
run(application, 'destroy');
}
4 changes: 1 addition & 3 deletions tests/helpers/module-for-acceptance.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { module } from 'qunit';
import Ember from 'ember';
import { resolve } from 'rsvp';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';

const { RSVP: { resolve } } = Ember;

export default function(name, options = {}) {
module(name, {
beforeEach() {
Expand Down
9 changes: 5 additions & 4 deletions tests/helpers/start-app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
import { merge } from '@ember/polyfills';
import { run } from '@ember/runloop';

export default function startApp(attrs) {
let attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
let attributes = merge({}, config.APP);
attributes = merge(attributes, attrs); // use defaults, but you can override;

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

0 comments on commit 96f9050

Please sign in to comment.