Skip to content

Commit

Permalink
Update ember-cli
Browse files Browse the repository at this point in the history
- Removed unnecessary readOnly sets on certain CPs
- Updated use of `warn` to include `id`
  • Loading branch information
poteto committed Feb 17, 2016
1 parent 2410b70 commit de24ca8
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 88 deletions.
18 changes: 10 additions & 8 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -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
ember-cli-build.js
testem.json
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
language: node_js
node_js:
- "4.1.2"

sudo: required
dist: trusty
- "stable"

cache:
directories:
Expand Down
16 changes: 0 additions & 16 deletions addon/components/flash-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ export default Component.extend({
}

return `${prefix}${flashType}`;
},

set() {
warn('`alertType` is read only');

return this;
}
}),

Expand All @@ -50,12 +44,6 @@ export default Component.extend({
const flashType = getWithDefault(this, 'flash.type', '');

return classify(flashType);
},

set() {
warn('`flashType` is read only');

return this;
}
}),

Expand All @@ -74,10 +62,6 @@ export default Component.extend({
const duration = getWithDefault(this, 'flash.timeout', 0);

return htmlSafe(`transition-duration: ${duration}ms`);
},

set() {
warn('`progressDuration` is read only');
}
}),

Expand Down
4 changes: 3 additions & 1 deletion addon/services/flash-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ export default Service.extend({
const guid = get(flashInstance, '_guid');

if (preventDuplicates && this._hasDuplicate(guid)) {
warn('Attempting to add a duplicate message to the Flash Messages Service');
warn('Attempting to add a duplicate message to the Flash Messages Service', false, {
id: 'ember-cli-flash.duplicate-message'
});
return;
}

Expand Down
12 changes: 3 additions & 9 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
{
"name": "ember-cli-flash",
"dependencies": {
"ember": "1.13.12",
"ember-cli-shims": "0.0.6",
"ember-cli-test-loader": "0.2.1",
"ember-load-initializers": "0.1.7",
"ember-qunit": "0.4.20",
"ember": "~2.3.1",
"ember-cli-shims": "0.1.0",
"ember-cli-test-loader": "0.2.2",
"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",
"sinonjs": "^1.17.1"
}
}
2 changes: 1 addition & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,25 @@
},
"devDependencies": {
"broccoli-asset-rev": "^2.2.0",
"ember-cli": "1.13.15",
"ember-ajax": "0.7.1",
"ember-cli": "2.3.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-dependency-checker": "^1.2.0",
"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-qunit": "^1.2.1",
"ember-cli-release": "0.2.8",
"ember-cli-sri": "^1.2.0",
"ember-cli-sri": "^2.0.0",
"ember-cli-uglify": "^1.2.0",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-disable-prototype-extensions": "^1.1.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-load-initializers": "^0.5.0",
"ember-resolver": "^2.0.3",
"ember-sinon": "0.3.0",
"ember-suave": "2.0.0",
"ember-try": "0.1.2"
"ember-try": "^0.1.2",
"loader.js": "^4.0.0"
},
"keywords": [
"ember-addon",
Expand Down
4 changes: 2 additions & 2 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

let App;
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 @@ -7,19 +7,19 @@
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for 'head'}}
{{content-for "head"}}

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/dummy.css">

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

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

{{content-for 'body-footer'}}
{{content-for "body-footer"}}
</body>
</html>
3 changes: 3 additions & 0 deletions tests/dummy/app/resolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Resolver from 'ember-resolver';

export default Resolver;
2 changes: 1 addition & 1 deletion tests/helpers/resolver.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Resolver from 'ember/resolver';
import Resolver from '../../resolver';
import config from '../../config/environment';

const resolver = Resolver.create();
Expand Down
18 changes: 9 additions & 9 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for 'head'}}
{{content-for 'test-head'}}
{{content-for "head"}}
{{content-for "test-head"}}

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/dummy.css">
<link rel="stylesheet" href="assets/test-support.css">

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

<script src="testem.js" integrity=""></script>
<script src="assets/vendor.js"></script>
<script src="assets/test-support.js"></script>
<script src="assets/dummy.js"></script>
<script src="testem.js" integrity=""></script>
<script src="assets/tests.js"></script>
<script src="assets/test-loader.js"></script>

{{content-for 'body-footer'}}
{{content-for 'test-body-footer'}}
{{content-for "body-footer"}}
{{content-for "test-body-footer"}}
</body>
</html>
25 changes: 0 additions & 25 deletions tests/unit/components/flash-message-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
import FlashMessage from 'ember-cli-flash/flash/object';

const {
setProperties,
run,
get,
set
Expand Down Expand Up @@ -51,30 +50,6 @@ test('it renders with the right props', function(assert) {
});
});

test('read only methods cannot be set', function(assert) {
assert.expect(3);

const component = this.subject({ flash });
this.render();

run(() => {
setProperties(component, {
alertType: 'invalid',
flashType: 'invalid',
progressDuration: 'derp',
extendedTimeout: 'nope'
});
});

assert.deepEqual(get(component, 'flash'), flash);
assert.throws(() => {
set(component, 'showProgressBar', true);
});
assert.throws(() => {
set(component, 'hasBlock', true);
});
});

test('exiting the flash object sets exiting on the component', function(assert) {
assert.expect(2);

Expand Down

0 comments on commit de24ca8

Please sign in to comment.