Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Ember-CLI / Remove prototype extensions #40

Merged
merged 6 commits into from
Jul 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false
indent_style = space
indent_size = 2

Expand Down
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
---
language: node_js
node_js:
- "0.12"

sudo: false

cache:
directories:
- node_modules

env:
- EMBER_TRY_SCENARIO=default
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary

matrix:
fast_finish: true
allow_failures:
- 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"

Expand All @@ -17,4 +31,4 @@ install:
- bower install

script:
- npm test
- ember try $EMBER_TRY_SCENARIO test
3 changes: 3 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["tmp"]
}
22 changes: 8 additions & 14 deletions Brocfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,16 @@

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

var app = new EmberAddon();
/*
This Brocfile specifes the options for the dummy test app of this
addon, located in `/tests/dummy`

// Use `app.import` to add additional libraries to the generated
// output files.
This Brocfile does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's Brocfile
*/

app.import('bower_components/chai-jquery/chai-jquery.js', {type: 'test'});
var app = new EmberAddon();

//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
app.import('bower_components/chai-jquery/chai-jquery.js', {type: 'test'});

module.exports = app.toTree();
4 changes: 3 additions & 1 deletion addon/components/x-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export default Ember.Component.extend({
*/
selected: Ember.computed('value', 'select.value', 'select.multiple', function() {
if (this.get('select.multiple') && isArray(this.get('select.value'))) {
return this.get('select.value').contains(this.get('value'));
let selectValue = Ember.A(this.get('select.value'));

return selectValue.contains(this.get('value'));
} else {
return this.get('value') === this.get('select.value');
}
Expand Down
7 changes: 5 additions & 2 deletions addon/components/x-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ export default Ember.Component.extend({
return option.$().is(':selected');
});

Ember.A(options);

var newValues = options.mapBy('value');

if (isArray(this.get('value'))) {
Expand All @@ -217,12 +219,13 @@ export default Ember.Component.extend({
*
* @private
*/
ensureProperType: Ember.observer('value', function() {
ensureProperType: Ember.on('init', Ember.observer('value', function() {
var value = this.get('value');

if (value != null && this.get('multiple') && !isArray(value)) {
throw new Error('x-select multiple=true was set, but value "' + value + '" is not enumerable.');
}
}).on('init'),
})),

/**
* @private
Expand Down
7 changes: 3 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
"dependencies": {
"jquery": "^1.11.1",
"ember": "1.13.2",
"ember-data": "1.0.0-beta.15",
"ember-resolver": "~0.1.12",
"ember-resolver": "~0.1.15",
"loader.js": "ember-cli/loader.js#3.2.0",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2",
"ember-mocha": "~0.5.2"
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4",
"ember-mocha": "~0.8.0"
},
"devDependencies": {
"chai-jquery": "~2.0.0"
Expand Down
35 changes: 35 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
}
}
]
};
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@
"broccoli-asset-rev": "2.0.6",
"ember-cli": "0.2.7",
"ember-cli-app-version": "0.4.0",
"ember-cli-content-security-policy": "0.3.0",
"ember-cli-dependency-checker": "0.0.8",
"ember-cli-htmlbars": "0.7.4",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.0.0",
"ember-cli-github-pages": "0.0.6",
"ember-cli-htmlbars": "0.7.6",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-mocha": "0.5.0",
"ember-cli-mocha": "0.8.0",
"ember-cli-uglify": "1.0.1",
"ember-data": "1.0.0-beta.15",
"ember-export-application-global": "^1.0.2"
"ember-disable-prototype-extensions": "^1.0.0",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.2",
"ember-try": "0.0.6"
},
"dependencies": {
"ember-cli-babel": "^5.0.0"
Expand All @@ -39,6 +42,7 @@
"select"
],
"ember-addon": {
"configPath": "tests/dummy/config"
"configPath": "tests/dummy/config",
"demoURL": "https://thefrontside.github.io/emberx-select"
}
}
1 change: 1 addition & 0 deletions testem.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"framework": "qunit",
"test_page": "tests/index.html?hidepassed",
"disable_watching": true,
"launch_in_ci": [
"PhantomJS"
],
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/x-select-multiple-blockless-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('XSelect: Multiple Selection Blockless', function() {
});

it("does not fire any actions on didInsertElement", function() {
expect(this.controller.get('changedSelections')).not.to.be.ok();
expect(this.controller.get('changedSelections')).not.to.be.ok;
});

it('marks all selected values', function() {
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/x-select-multiple-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('XSelect: Multiple Selection', function() {
});

it("does not fire any actions on didInsertElement", function() {
expect(this.controller.get('changedSelections')).not.to.be.ok();
expect(this.controller.get('changedSelections')).not.to.be.ok;
});

it('marks all selected values', function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('XSelect: Single Selection Blockless w/ Option Value', function() {
});

it("does not fire any actions on didInsertElement", function() {
expect(controller.get('tagged')).not.to.be.ok();
expect(controller.get('tagged')).not.to.be.ok;
});

it('is enabled by default', function() {
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/x-select-single-blockless-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('XSelect: Single Selection Blockless', function() {
});

it("does not fire any actions on didInsertElement", function() {
expect(this.controller.get('tagged')).not.to.be.ok();
expect(this.controller.get('tagged')).not.to.be.ok;
});

it('is enabled by default', function() {
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/x-select-single-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('XSelect: Single Selection', function() {
});

it("does not fire any actions on didInsertElement", function() {
expect(this.controller.get('tagged')).not.to.be.ok();
expect(this.controller.get('tagged')).not.to.be.ok;
});

it('is enabled by default', function() {
Expand Down
4 changes: 3 additions & 1 deletion tests/dummy/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import config from './config/environment';

var App;

Ember.MODEL_FACTORY_INJECTIONS = true;

var App = Ember.Application.extend({
App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver: Resolver
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = function(environment) {
}

if (environment === 'production') {

ENV.baseURL = '/emberx-select'
}

return ENV;
Expand Down
18 changes: 9 additions & 9 deletions tests/dummy/public/crossdomain.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->

<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>
<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>

<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
</cross-domain-policy>
1 change: 1 addition & 0 deletions tests/dummy/public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# http://www.robotstxt.org
User-agent: *
Disallow: