Skip to content

Commit c41948a

Browse files
authored
Merge pull request #36 from scottkidder/upgrade-ember-3
Upgrade to Ember 3
2 parents e5299c2 + 3a5d6f5 commit c41948a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6474
-499
lines changed

.bowerrc

-4
This file was deleted.

.editorconfig

-14
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,8 @@ insert_final_newline = true
1313
indent_style = space
1414
indent_size = 2
1515

16-
[*.js]
17-
indent_style = space
18-
indent_size = 2
19-
2016
[*.hbs]
2117
insert_final_newline = false
22-
indent_style = space
23-
indent_size = 2
24-
25-
[*.css]
26-
indent_style = space
27-
indent_size = 2
28-
29-
[*.html]
30-
indent_style = space
31-
indent_size = 2
3218

3319
[*.{diff,md}]
3420
trim_trailing_whitespace = false

.ember-cli

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55

66
Setting `disableAnalytics` to true will prevent any data from being sent.
77
*/
8-
"disableAnalytics": false
8+
"disableAnalytics": false,
9+
"yarn": true
910
}

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/blueprints/*/files/**/*.js

.eslintrc.js

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
ecmaVersion: 2017,
5+
sourceType: 'module'
6+
},
7+
plugins: [
8+
'ember'
9+
],
10+
extends: [
11+
'eslint:recommended',
12+
'plugin:ember/recommended'
13+
],
14+
env: {
15+
browser: true
16+
},
17+
rules: {
18+
},
19+
overrides: [
20+
// node files
21+
{
22+
files: [
23+
'ember-cli-build.js',
24+
'index.js',
25+
'testem.js',
26+
'blueprints/*/index.js',
27+
'config/**/*.js',
28+
'tests/dummy/config/**/*.js'
29+
],
30+
excludedFiles: [
31+
'addon/**',
32+
'addon-test-support/**',
33+
'app/**',
34+
'tests/dummy/app/**'
35+
],
36+
parserOptions: {
37+
sourceType: 'script',
38+
ecmaVersion: 2015
39+
},
40+
env: {
41+
browser: false,
42+
node: true
43+
},
44+
plugins: ['node'],
45+
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
46+
// add your custom rules and overrides for node files here
47+
})
48+
}
49+
]
50+
};

.gitignore

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# See http://help.github.com/ignore-files/ for more about ignoring files.
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
22

33
# compiled output
44
/dist
@@ -13,5 +13,11 @@
1313
/connect.lock
1414
/coverage/*
1515
/libpeerconnection.log
16-
npm-debug.log
16+
npm-debug.log*
17+
yarn-error.log
1718
testem.log
19+
20+
# ember-try
21+
.node_modules.ember-try/
22+
bower.json.ember-try
23+
package.json.ember-try

.jshintrc

-32
This file was deleted.

.npmignore

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
bower_components/
2-
tests/
3-
tmp/
4-
dist/
5-
1+
/bower_components
2+
/config/ember-try.js
3+
/dist
4+
/tests
5+
/tmp
6+
**/.gitkeep
67
.bowerrc
78
.editorconfig
89
.ember-cli
10+
.eslintrc.js
11+
.gitignore
12+
.watchmanconfig
913
.travis.yml
10-
.npmignore
11-
**/.gitkeep
1214
bower.json
13-
Brocfile.js
14-
testem.json
15+
ember-cli-build.js
16+
testem.js
17+
18+
# ember-try
19+
.node_modules.ember-try/
20+
bower.json.ember-try
21+
package.json.ember-try

.travis.yml

+27-14
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,47 @@
11
---
22
language: node_js
33
node_js:
4+
# we recommend testing addons with the same minimum supported node version as Ember CLI
5+
# so that your addon works for all apps
46
- "4"
57

68
sudo: false
9+
dist: trusty
10+
11+
addons:
12+
chrome: stable
713

814
cache:
915
directories:
10-
- node_modules
16+
- $HOME/.npm
1117

1218
env:
13-
- EMBER_TRY_SCENARIO=default
14-
- EMBER_TRY_SCENARIO=ember-release
15-
- EMBER_TRY_SCENARIO=ember-beta
16-
- EMBER_TRY_SCENARIO=ember-canary
19+
global:
20+
# See https://git.io/vdao3 for details.
21+
- JOBS=1
22+
matrix:
23+
# we recommend new addons test the current and previous LTS
24+
# as well as latest stable release (bonus points to beta/canary)
25+
- EMBER_TRY_SCENARIO=ember-lts-2.12
26+
- EMBER_TRY_SCENARIO=ember-lts-2.16
27+
- EMBER_TRY_SCENARIO=ember-lts-2.18
28+
- EMBER_TRY_SCENARIO=ember-release
29+
- EMBER_TRY_SCENARIO=ember-beta
30+
- EMBER_TRY_SCENARIO=ember-canary
31+
- EMBER_TRY_SCENARIO=ember-default
1732

1833
matrix:
1934
fast_finish: true
2035
allow_failures:
2136
- env: EMBER_TRY_SCENARIO=ember-canary
2237

2338
before_install:
24-
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
25-
- "npm config set spin false"
26-
- "npm install -g npm@^2"
27-
28-
install:
29-
- npm install -g bower
30-
- npm install
31-
- bower install
39+
- npm config set spin false
40+
- npm install -g npm@4
41+
- npm --version
3242

3343
script:
34-
- ember try $EMBER_TRY_SCENARIO test
44+
- npm run lint:js
45+
# Usually, it's ok to finish the test scenario without reverting
46+
# to the addon's original dependency state, skipping "cleanup".
47+
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016
3+
Copyright (c) 2018
44

55
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:
66

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ A loading indicator component for EmberJS that animates across the top of the vi
66

77
[![Build Status](https://travis-ci.org/jerel/ember-cli-loading-slider.svg?branch=master)](https://travis-ci.org/jerel/ember-cli-loading-slider)
88

9-
## Installation
9+
Installation
10+
------------------------------------------------------------------------------
1011

1112
`npm install ember-cli-loading-slider --save-dev`
1213

@@ -91,4 +92,3 @@ addition to using the `loading-slider` component.
9192
Copyright (c) 2014 Jerel Unruh
9293

9394
[Licensed under the MIT license](http://www.opensource.org/licenses/mit-license.php)
94-

app/components/loading-slider.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import Ember from 'ember';
2-
3-
const { Component, run, isBlank, inject, on } = Ember;
1+
import { inject as service } from '@ember/service';
2+
import Component from '@ember/component';
3+
import { run } from '@ember/runloop';
4+
import { isBlank } from '@ember/utils';
5+
import $ from 'jquery';
46

57
export default Component.extend({
68
tagName: 'div',
79
classNames: ['loading-slider'],
810
classNameBindings: 'expanding',
911
progressBarClass: null,
1012

11-
loadingSlider: inject.service(),
13+
loadingSlider: service(),
1214

1315
init() {
1416
this._super(...arguments);
@@ -22,7 +24,8 @@ export default Component.extend({
2224
});
2325
},
2426

25-
setAttrsThenManage: on('didReceiveAttrs', function() {
27+
didReceiveAttrs() {
28+
this._super(...arguments);
2629

2730
if (isFastBoot()) { return; }
2831

@@ -35,7 +38,7 @@ export default Component.extend({
3538
});
3639

3740
this.manage();
38-
}),
41+
},
3942

4043
willDestroy() {
4144
run.once(this, function() {
@@ -150,8 +153,7 @@ export default Component.extend({
150153
},
151154

152155
expandItem(color, cleanUp) {
153-
let self = this,
154-
inner = $('<span>').css({'background-color': color}),
156+
let inner = $('<span>').css({'background-color': color}),
155157
outer = this.$(),
156158
innerWidth = 0,
157159
outerWidth = outer.width(),

app/mixins/loading-slider.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import Ember from 'ember';
2-
3-
const { Mixin, inject, isPresent } = Ember;
1+
import { inject as service } from '@ember/service';
2+
import Mixin from '@ember/object/mixin';
3+
import { isPresent } from '@ember/utils';
44

55
export default Mixin.create({
6-
loadingSlider: inject.service(),
6+
loadingSlider: service(),
77

88
actions: {
99
loading() {
1010
let loadingSliderService = this.get('loadingSlider');
1111
loadingSliderService.startLoading();
12-
if (isPresent(this.router)) {
13-
this.router.one('didTransition', function() {
12+
if (isPresent(this._router)) {
13+
this._router.one('didTransition', function() {
1414
loadingSliderService.endLoading();
1515
});
1616
}

app/services/loading-slider.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import Ember from 'ember';
2-
3-
const { Service, Evented } = Ember;
1+
import Service from '@ember/service';
2+
import Evented from '@ember/object/evented';
43

54
export default Service.extend(Evented, {
65
startLoading() {

bower.json

-16
This file was deleted.

0 commit comments

Comments
 (0)