Skip to content

Commit 7cc394b

Browse files
authored
Merge pull request #119 from aomran/version-3-7-upgrade-dependencies
Version 3.7: upgrade dependencies
2 parents c1918e5 + 128e8e7 commit 7cc394b

21 files changed

+9681
-3861
lines changed

.editorconfig

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
root = true
66

7-
87
[*]
98
end_of_line = lf
109
charset = utf-8

.eslintrc.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
'use strict';
2+
13
module.exports = {
24
root: true,
35
parser: 'babel-eslint',
46
parserOptions: {
57
ecmaVersion: 2018,
6-
sourceType: 'module'
8+
sourceType: 'module',
9+
ecmaFeatures: {
10+
legacyDecorators: true
11+
}
712
},
813
plugins: [
914
'ember'
@@ -15,9 +20,7 @@ module.exports = {
1520
env: {
1621
browser: true
1722
},
18-
rules: {
19-
'ember/no-jquery': 'error'
20-
},
23+
rules: {},
2124
overrides: [
2225
// node files
2326
{
@@ -45,9 +48,7 @@ module.exports = {
4548
node: true
4649
},
4750
plugins: ['node'],
48-
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
49-
// add your custom rules and overrides for node files here
50-
})
51+
extends: ['plugin:node/recommended']
5152
}
5253
]
5354
};

.template-lintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

33
module.exports = {
4-
extends: 'recommended'
4+
extends: 'octane'
55
};

.travis.yml

+15-11
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ language: node_js
33
node_js:
44
# we recommend testing addons with the same minimum supported node version as Ember CLI
55
# so that your addon works for all apps
6-
- "8"
6+
- "10"
77

8-
sudo: false
9-
dist: trusty
8+
dist: xenial
109

1110
addons:
1211
chrome: stable
@@ -27,29 +26,34 @@ branches:
2726
- /^v\d+\.\d+\.\d+/
2827

2928
jobs:
30-
fail_fast: true
29+
fast_finish: true
3130
allow_failures:
3231
- env: EMBER_TRY_SCENARIO=ember-canary
3332

3433
include:
3534
# runs linting and tests with current locked deps
36-
3735
- stage: "Tests"
3836
name: "Tests"
3937
script:
40-
- npm run lint:hbs
41-
- npm run lint:js
42-
- npm test
38+
- npm run lint
39+
- npm run test:ember
40+
41+
- stage: "Additional Tests"
42+
name: "Floating Dependencies"
43+
install:
44+
- npm install --no-package-lock
45+
script:
46+
- npm run test:ember
4347

4448
# we recommend new addons test the current and previous LTS
4549
# as well as latest stable release (bonus points to beta/canary)
46-
- stage: "Additional Tests"
47-
env: EMBER_TRY_SCENARIO=ember-lts-3.4
48-
- env: EMBER_TRY_SCENARIO=ember-lts-3.8
50+
- env: EMBER_TRY_SCENARIO=ember-lts-3.12
51+
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
4952
- env: EMBER_TRY_SCENARIO=ember-release
5053
- env: EMBER_TRY_SCENARIO=ember-beta
5154
- env: EMBER_TRY_SCENARIO=ember-canary
5255
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
56+
- env: EMBER_TRY_SCENARIO=ember-classic
5357

5458
script:
5559
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
* `ember serve`
2424
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).
2525

26-
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
26+
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).

README.md

+20-14
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
This Ember CLI addon is a simple wrapper for [ChartJS](http://www.chartjs.org/) (v2.8.0).
77

8+
### Compatibility
9+
10+
- Ember.js v3.12 or above
11+
- Ember CLI v2.13 or above
12+
- Node.js v10 or above
13+
814
### Installation
915

1016
```
@@ -16,24 +22,24 @@ $ ember install ember-cli-chart
1622
In your handlebars template just do:
1723

1824
```hbs
19-
{{ember-chart
20-
type=CHARTTYPE
21-
data=CHARTDATA
22-
options=CHARTOPTIONS
23-
width=CHARTWIDTH
24-
height=CHARTHEIGHT
25+
{{ember-chart
26+
type=CHARTTYPE
27+
data=CHARTDATA
28+
options=CHARTOPTIONS
29+
width=CHARTWIDTH
30+
height=CHARTHEIGHT
2531
plugins=CHARTPLUGINS
2632
customLegendElement=CUSTOMLEGENDELEMENT
2733
}}
2834
```
2935

30-
* CHARTTYPE: String; one of the following -- `line`, `bar`, `radar`, `polarArea`, `pie` or `doughnut`.
31-
* CHARTDATA: Array; refer to the ChartJS documentation
32-
* CHARTOPTIONS: Object; refer to the ChartJS documentation. This is optional.
33-
* CHARTWIDTH: Number; pixel width of the canvas element. Only applies if the chart is NOT responsive.
34-
* CHARTHEIGHT: Number; pixel height of the canvas element. Only applies if the chart is NOT responsive.
35-
* CHARTPLUGINS: Array; refer to ChartJS documentaion. This is optional.
36-
* CUSTOMLEGENDELEMENT: HTMLElement; A custom element to put a custom legend in, when using `legendCallback`. This is optional.
36+
- CHARTTYPE: String; one of the following -- `line`, `bar`, `radar`, `polarArea`, `pie` or `doughnut`.
37+
- CHARTDATA: Array; refer to the ChartJS documentation
38+
- CHARTOPTIONS: Object; refer to the ChartJS documentation. This is optional.
39+
- CHARTWIDTH: Number; pixel width of the canvas element. Only applies if the chart is NOT responsive.
40+
- CHARTHEIGHT: Number; pixel height of the canvas element. Only applies if the chart is NOT responsive.
41+
- CHARTPLUGINS: Array; refer to ChartJS documentaion. This is optional.
42+
- CUSTOMLEGENDELEMENT: HTMLElement; A custom element to put a custom legend in, when using `legendCallback`. This is optional.
3743

3844
#### Example
3945

@@ -43,4 +49,4 @@ In your handlebars template just do:
4349

4450
#### More Resources
4551

46-
* [Screencast on creating bar charts with ember-cli-chart](https://www.emberscreencasts.com/posts/46-bar-charts-with-ember-cli-chart)
52+
- [Screencast on creating bar charts with ember-cli-chart](https://www.emberscreencasts.com/posts/46-bar-charts-with-ember-cli-chart)

addon/components/ember-chart.js

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* global Chart */
2-
import Component from '@ember/component';
2+
import Component from "@ember/component";
33

44
export default Component.extend({
5-
tagName: 'canvas',
6-
attributeBindings: ['width', 'height'],
5+
tagName: "canvas",
6+
attributeBindings: ["width", "height"],
77

88
init() {
99
this._super(...arguments);
@@ -14,11 +14,11 @@ export default Component.extend({
1414
didInsertElement() {
1515
this._super(...arguments);
1616

17-
let context = this.get('element');
18-
let data = this.get('data');
19-
let type = this.get('type');
20-
let options = this.get('options');
21-
let plugins = this.get('plugins');
17+
let context = this.element;
18+
let data = this.data;
19+
let type = this.type;
20+
let options = this.options;
21+
let plugins = this.plugins;
2222

2323
let chart = new Chart(context, {
2424
type: type,
@@ -27,12 +27,12 @@ export default Component.extend({
2727
plugins: plugins
2828
});
2929

30-
this.set('chart', chart);
30+
this.set("chart", chart);
3131
},
3232

3333
willDestroyElement() {
3434
this._super(...arguments);
35-
this.get('chart').destroy();
35+
this.chart.destroy();
3636
},
3737

3838
didUpdateAttrs() {
@@ -41,23 +41,23 @@ export default Component.extend({
4141
},
4242

4343
updateChart() {
44-
let chart = this.get('chart');
45-
let data = this.get('data');
46-
let options = this.get('options');
47-
let animate = this.get('animate');
48-
49-
if (chart) {
50-
chart.data = data;
51-
chart.options = options;
52-
if (animate) {
53-
chart.update();
54-
} else {
55-
chart.update(0);
56-
}
57-
58-
if (options.legendCallback && this.get('customLegendElement')) {
59-
this.get('customLegendElement').innerHTML = chart.generateLegend();
44+
let chart = this.chart;
45+
let data = this.data;
46+
let options = this.options;
47+
let animate = this.animate;
48+
49+
if (chart) {
50+
chart.data = data;
51+
chart.options = options;
52+
if (animate) {
53+
chart.update();
54+
} else {
55+
chart.update(0);
6056
}
61-
}
57+
58+
if (options.legendCallback && this.customLegendElement) {
59+
this.customLegendElement.innerHTML = chart.generateLegend();
60+
}
61+
}
6262
}
6363
});

app/components/ember-chart.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import EmberChart from 'ember-cli-chart/components/ember-chart';
1+
import EmberChart from "ember-cli-chart/components/ember-chart";
22

33
export default EmberChart;

config/ember-try.js

+19-4
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ module.exports = async function() {
66
return {
77
scenarios: [
88
{
9-
name: 'ember-lts-3.4',
9+
name: 'ember-lts-3.12',
1010
npm: {
1111
devDependencies: {
12-
'ember-source': '~3.4.0'
12+
'ember-source': '~3.12.0'
1313
}
1414
}
1515
},
1616
{
17-
name: 'ember-lts-3.8',
17+
name: 'ember-lts-3.16',
1818
npm: {
1919
devDependencies: {
20-
'ember-source': '~3.8.0'
20+
'ember-source': '~3.16.0'
2121
}
2222
}
2323
},
@@ -67,6 +67,21 @@ module.exports = async function() {
6767
'@ember/jquery': '^0.5.1'
6868
}
6969
}
70+
},
71+
{
72+
name: 'ember-classic',
73+
env: {
74+
EMBER_OPTIONAL_FEATURES: JSON.stringify({
75+
'application-template-wrapper': true,
76+
'default-async-observers': false,
77+
'template-only-glimmer-components': false
78+
})
79+
},
80+
npm: {
81+
ember: {
82+
edition: 'classic'
83+
}
84+
}
7085
}
7186
]
7287
};

0 commit comments

Comments
 (0)