Skip to content

Commit 393b104

Browse files
authored
Merge pull request #106 from aomran/upgrade-cli-to-latest
Upgrade cli & Chart.js to latest
2 parents aa57557 + f226a18 commit 393b104

18 files changed

+7239
-5935
lines changed

.eslintrc.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
root: true,
33
parserOptions: {
4-
ecmaVersion: 2017,
4+
ecmaVersion: 2018,
55
sourceType: 'module'
66
},
77
plugins: [
@@ -36,8 +36,7 @@ module.exports = {
3636
'tests/dummy/app/**'
3737
],
3838
parserOptions: {
39-
sourceType: 'script',
40-
ecmaVersion: 2015
39+
sourceType: 'script'
4140
},
4241
env: {
4342
browser: false,

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/node_modules/
1010

1111
# misc
12+
/.env*
13+
/.pnp*
1214
/.sass-cache
1315
/connect.lock
1416
/coverage/

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/.bowerrc
1010
/.editorconfig
1111
/.ember-cli
12+
/.env*
1213
/.eslintignore
1314
/.eslintrc.js
1415
/.gitignore
@@ -17,6 +18,7 @@
1718
/.watchmanconfig
1819
/bower.json
1920
/config/ember-try.js
21+
/CONTRIBUTING.md
2022
/ember-cli-build.js
2123
/testem.js
2224
/tests/

.travis.yml

+8-23
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ 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-
- "6"
6+
- "8"
77

88
sudo: false
99
dist: trusty
@@ -20,35 +20,20 @@ env:
2020
# See https://git.io/vdao3 for details.
2121
- JOBS=1
2222

23+
branches:
24+
only:
25+
- master
26+
# npm version tags
27+
- /^v\d+\.\d+\.\d+/
28+
2329
jobs:
2430
fail_fast: true
25-
allow_failures:
26-
- env: EMBER_TRY_SCENARIO=ember-canary
2731

2832
include:
2933
# runs linting and tests with current locked deps
30-
3134
- stage: "Tests"
3235
name: "Tests"
3336
script:
3437
- npm run lint:hbs
3538
- npm run lint:js
36-
- npm test
37-
38-
# we recommend new addons test the current and previous LTS
39-
# as well as latest stable release (bonus points to beta/canary)
40-
- stage: "Additional Tests"
41-
env: EMBER_TRY_SCENARIO=ember-lts-2.16
42-
- env: EMBER_TRY_SCENARIO=ember-lts-2.18
43-
- env: EMBER_TRY_SCENARIO=ember-release
44-
- env: EMBER_TRY_SCENARIO=ember-beta
45-
- env: EMBER_TRY_SCENARIO=ember-canary
46-
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
47-
48-
before_install:
49-
- npm config set spin false
50-
- npm install -g npm@4
51-
- npm --version
52-
53-
script:
54-
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
39+
- npm run test:all

CONTRIBUTING.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# How To Contribute
2+
3+
## Installation
4+
5+
* `git clone <repository-url>`
6+
* `cd my-addon`
7+
* `npm install`
8+
9+
## Linting
10+
11+
* `npm run lint:hbs`
12+
* `npm run lint:js`
13+
* `npm run lint:js -- --fix`
14+
15+
## Running tests
16+
17+
* `ember test` – Runs the test suite on the current Ember version
18+
* `ember test --server` – Runs the test suite in "watch mode"
19+
* `ember try:each` – Runs the test suite against multiple Ember versions
20+
21+
## Running the dummy application
22+
23+
* `ember serve`
24+
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).
25+
26+
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).

LICENSE

-21
This file was deleted.

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) 2018
3+
Copyright (c) 2019
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/aomran/ember-cli-chart.svg)](https://travis-ci.org/aomran/ember-cli-chart)
44

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

77
### Installation
88

addon/components/ember-chart.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import Component from '@ember/component';
44
export default Component.extend({
55
tagName: 'canvas',
66
attributeBindings: ['width', 'height'],
7-
plugins: [],
7+
8+
init() {
9+
this._super(...arguments);
10+
11+
this.plugins = this.plugins || [];
12+
},
813

914
didInsertElement() {
1015
this._super(...arguments);
@@ -38,7 +43,7 @@ export default Component.extend({
3843
let data = this.get('data');
3944
let options = this.get('options');
4045
let animate = this.get('animate');
41-
46+
4247
if (chart) {
4348
chart.data = data;
4449
chart.options = options;

config/ember-try.js

+60-70
Original file line numberDiff line numberDiff line change
@@ -2,82 +2,72 @@
22

33
const getChannelURL = require('ember-source-channel-url');
44

5-
module.exports = function() {
6-
return Promise.all([
7-
getChannelURL('release'),
8-
getChannelURL('beta'),
9-
getChannelURL('canary')
10-
]).then((urls) => {
11-
return {
12-
scenarios: [
13-
{
14-
name: 'ember-lts-2.16',
15-
env: {
16-
EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true })
17-
},
18-
npm: {
19-
devDependencies: {
20-
'@ember/jquery': '^0.5.1',
21-
'ember-source': '~2.16.0'
22-
}
5+
module.exports = async function() {
6+
return {
7+
scenarios: [
8+
{
9+
name: 'ember-lts-3.4',
10+
npm: {
11+
devDependencies: {
12+
'ember-source': '~3.4.0'
2313
}
24-
},
25-
{
26-
name: 'ember-lts-2.18',
27-
env: {
28-
EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true })
29-
},
30-
npm: {
31-
devDependencies: {
32-
'@ember/jquery': '^0.5.1',
33-
'ember-source': '~2.18.0'
34-
}
35-
}
36-
},
37-
{
38-
name: 'ember-release',
39-
npm: {
40-
devDependencies: {
41-
'ember-source': urls[0]
42-
}
14+
}
15+
},
16+
{
17+
name: 'ember-lts-3.8',
18+
npm: {
19+
devDependencies: {
20+
'ember-source': '~3.8.0'
4321
}
44-
},
45-
{
46-
name: 'ember-beta',
47-
npm: {
48-
devDependencies: {
49-
'ember-source': urls[1]
50-
}
22+
}
23+
},
24+
{
25+
name: 'ember-release',
26+
npm: {
27+
devDependencies: {
28+
'ember-source': await getChannelURL('release')
5129
}
52-
},
53-
{
54-
name: 'ember-canary',
55-
npm: {
56-
devDependencies: {
57-
'ember-source': urls[2]
58-
}
30+
}
31+
},
32+
{
33+
name: 'ember-beta',
34+
npm: {
35+
devDependencies: {
36+
'ember-source': await getChannelURL('beta')
5937
}
60-
},
61-
{
62-
name: 'ember-default',
63-
npm: {
64-
devDependencies: {}
38+
}
39+
},
40+
{
41+
name: 'ember-canary',
42+
npm: {
43+
devDependencies: {
44+
'ember-source': await getChannelURL('canary')
6545
}
46+
}
47+
},
48+
// The default `.travis.yml` runs this scenario via `npm test`,
49+
// not via `ember try`. It's still included here so that running
50+
// `ember try:each` manually or from a customized CI config will run it
51+
// along with all the other scenarios.
52+
{
53+
name: 'ember-default',
54+
npm: {
55+
devDependencies: {}
56+
}
57+
},
58+
{
59+
name: 'ember-default-with-jquery',
60+
env: {
61+
EMBER_OPTIONAL_FEATURES: JSON.stringify({
62+
'jquery-integration': true
63+
})
6664
},
67-
{
68-
name: 'ember-default-with-jquery',
69-
env: {
70-
EMBER_OPTIONAL_FEATURES: JSON.stringify({
71-
'jquery-integration': true
72-
})
73-
},
74-
npm: {
75-
devDependencies: {
76-
'@ember/jquery': '^0.5.1'
77-
}
65+
npm: {
66+
devDependencies: {
67+
'@ember/jquery': '^0.5.1'
7868
}
7969
}
80-
]
81-
};
82-
});
70+
}
71+
]
72+
};
8373
};

index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
/* eslint-env node */
1+
'use strict';
2+
23
const FastbootTransform = require('fastboot-transform');
34

45
module.exports = {
5-
name: 'ember-cli-chart',
6+
name: require('./package').name,
67
options: {
78
nodeAssets: {
89
'chart.js': {

0 commit comments

Comments
 (0)