Skip to content

Commit 082eb62

Browse files
greenkeeper[bot]begedin
authored andcommitted
Update ember-cli to the latest version 🚀 (#1672)
* chore(package): update ember-cli to version 2.18.0 * Cleanup lint errors, update code based on latest ember-cli blueprint
1 parent c8c8ede commit 082eb62

10 files changed

+179
-87
lines changed

‎.eslintrc.js

+27-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,31 @@ module.exports = {
2121
globals: {
2222
'server': true,
2323
'$': true
24-
}
24+
},
25+
overrides: [
26+
// node files
27+
{
28+
files: [
29+
'testem.js',
30+
'ember-cli-build.js',
31+
'config/**/*.js'
32+
],
33+
parserOptions: {
34+
sourceType: 'script',
35+
ecmaVersion: 2015
36+
},
37+
env: {
38+
browser: false,
39+
node: true
40+
}
41+
},
42+
// test files
43+
{
44+
files: ['tests/**/*.js'],
45+
excludedFiles: ['tests/dummy/**/*.js'],
46+
env: {
47+
embertest: true
48+
}
49+
}
50+
]
2551
};

‎.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ install:
2525
- yarn install --non-interactive
2626

2727
script:
28+
- yarn lint:js
2829
- yarn test

‎config/deploy.js

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
var VALID_DEPLOY_TARGETS = [ //update these to match what you call your deployment targets
1+
let VALID_DEPLOY_TARGETS = [ // update these to match what you call your deployment targets
22
'development-postbuild',
33
'staging',
44
'production'
55
];
66

77
module.exports = function(deployTarget) {
8-
var ENV = {
8+
let ENV = {
99
build: {}
1010
};
1111

1212
if (VALID_DEPLOY_TARGETS.indexOf(deployTarget) === -1) {
13-
throw new Error('Invalid deployTarget ' + deployTarget);
13+
throw new Error(`Invalid deployTarget ${deployTarget}`);
1414
}
1515

1616
if (deployTarget === 'development-postbuild') {
@@ -23,48 +23,50 @@ module.exports = function(deployTarget) {
2323
ENV.s3 = {
2424
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
2525
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
26-
}
26+
};
27+
2728
ENV['s3-index'] = {
2829
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
2930
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
30-
}
31+
};
32+
3133
ENV.slack = {
3234
webhookURL: 'https://hooks.slack.com/services/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',
3335
username: 'ember-cli-deploy',
34-
iconEmoji: ':rocket:',
35-
}
36+
iconEmoji: ':rocket:'
37+
};
3638
}
3739

3840
if (deployTarget === 'staging') {
3941
ENV.build.environment = 'staging';
4042
ENV.s3.bucket = process.env.STAGING_S3_BUCKET;
4143
ENV.s3.region = process.env.STAGING_S3_REGION;
42-
ENV['s3-index']['bucket'] = process.env.STAGING_S3_INDEX_BUCKET;
43-
ENV['s3-index']['region'] = process.env.STAGING_S3_INDEX_REGION;
44+
ENV['s3-index'].bucket = process.env.STAGING_S3_INDEX_BUCKET;
45+
ENV['s3-index'].region = process.env.STAGING_S3_INDEX_REGION;
4446

4547
ENV.sentry = {
4648
publicUrl: process.env.STAGING_SENTRY_SITE_URL,
4749
sentryUrl: process.env.SENTRY_BASE_URL,
4850
sentryOrganizationSlug: process.env.STAGING_SENTRY_ORGANIZATION_SLUG,
4951
sentryProjectSlug: process.env.STAGING_SENTRY_PROJECT_SLUG,
50-
sentryApiKey: process.env.STAGING_SENTRY_API_KEY,
51-
}
52+
sentryApiKey: process.env.STAGING_SENTRY_API_KEY
53+
};
5254
}
5355

5456
if (deployTarget === 'production') {
5557
ENV.build.environment = 'production';
5658
ENV.s3.bucket = process.env.PRODUCTION_S3_BUCKET;
5759
ENV.s3.region = process.env.PRODUCTION_S3_REGION;
58-
ENV['s3-index']['bucket'] = process.env.PRODUCTION_S3_INDEX_BUCKET;
59-
ENV['s3-index']['region'] = process.env.PRODUCTION_S3_INDEX_REGION;
60+
ENV['s3-index'].bucket = process.env.PRODUCTION_S3_INDEX_BUCKET;
61+
ENV['s3-index'].region = process.env.PRODUCTION_S3_INDEX_REGION;
6062

6163
ENV.sentry = {
6264
publicUrl: process.env.PRODUCTION_SENTRY_SITE_URL,
6365
sentryUrl: process.env.SENTRY_BASE_URL,
6466
sentryOrganizationSlug: process.env.PRODUCTION_SENTRY_ORGANIZATION_SLUG,
6567
sentryProjectSlug: process.env.PRODUCTION_SENTRY_PROJECT_SLUG,
66-
sentryApiKey: process.env.PRODUCTION_SENTRY_API_KEY,
67-
}
68+
sentryApiKey: process.env.PRODUCTION_SENTRY_API_KEY
69+
};
6870
}
6971

7072
// Note: if you need to build some configuration asynchronously,ou can return

‎config/environment.js

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-env node */
21
'use strict';
32

43
module.exports = function(environment) {
@@ -68,7 +67,7 @@ module.exports = function(environment) {
6867
config: {
6968
key: 'Nz7hL2eY2yHzuIwUbExfDanbJp2q0IO0'
7069
}
71-
},
70+
}
7271
],
7372

7473
moment: {
@@ -77,7 +76,7 @@ module.exports = function(environment) {
7776

7877
pageTitle: {
7978
prepend: true,
80-
separator: " — "
79+
separator: ' — '
8180
},
8281

8382
sentry: {
@@ -113,39 +112,39 @@ module.exports = function(environment) {
113112
ENV.contentSecurityPolicy = {
114113
'default-src': "'none'",
115114
'script-src': [
116-
"'self'",
115+
"'self'"
117116
],
118117
// Allow fonts to be loaded from http://fonts.gstatic.com
119118
'font-src': [
120119
"'self'",
121-
"data:",
122-
"https://fonts.gstatic.com",
123-
"https://d3pgew4wbk2vb1.cloudfront.net",
124-
"https://dawxes9syhrgg.cloudfront.net"
120+
'data:',
121+
'https://fonts.gstatic.com',
122+
'https://d3pgew4wbk2vb1.cloudfront.net',
123+
'https://dawxes9syhrgg.cloudfront.net'
125124
],
126125
// Allow data (ajax/websocket) from api.lvh.me:4000
127126
'connect-src': [
128127
"'self'",
129-
"http://api.lvh.me:4000"
128+
'http://api.lvh.me:4000'
130129
],
131130
// Allow images from the origin itself (i.e. current domain), and data
132131
'img-src': [
133132
"'self'",
134-
"data:",
135-
"https://d3pgew4wbk2vb1.cloudfront.net",
136-
"https://dawxes9syhrgg.cloudfront.net",
137-
"http://lorempixel.com",
138-
"https://s3.amazonaws.com",
133+
'data:',
134+
'https://d3pgew4wbk2vb1.cloudfront.net',
135+
'https://dawxes9syhrgg.cloudfront.net',
136+
'http://lorempixel.com',
137+
'https://s3.amazonaws.com'
139138
],
140139
// Allow inline styles and loaded CSS from http://fonts.googleapis.com
141140
'style-src': [
142141
"'self'",
143-
"'unsafe-inline'",
142+
"'unsafe-inline'"
144143
],
145144
// `media-src` will be omitted from policy
146145
// Browser will fallback to default-src for media resources (which is to deny, see above).
147146
'media-src': null
148-
}
147+
};
149148
}
150149

151150
if (environment === 'remote-development') {
@@ -192,6 +191,8 @@ module.exports = function(environment) {
192191
// Testem prefers this...
193192
ENV.locationType = 'none';
194193

194+
ENV.APP.autoboot = false;
195+
195196
// keep test console output quieter
196197
ENV.APP.LOG_ACTIVE_GENERATION = false;
197198
ENV.APP.LOG_VIEW_LOOKUPS = false;
@@ -229,9 +230,9 @@ module.exports = function(environment) {
229230
}
230231

231232
ENV['ember-simple-auth-token'] = {
232-
serverTokenEndpoint: ENV.API_BASE_URL + '/token',
233-
serverTokenRefreshEndpoint: ENV.API_BASE_URL + '/token/refresh',
234-
refreshLeeway: 300, // 5 minutes before expiry
233+
serverTokenEndpoint: `${ENV.API_BASE_URL}/token`,
234+
serverTokenRefreshEndpoint: `${ENV.API_BASE_URL}/token/refresh`,
235+
refreshLeeway: 300 // 5 minutes before expiry
235236
};
236237

237238
return ENV;

‎config/targets.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-env node */
21
module.exports = {
32
browsers: [
43
'ie 9',

‎ember-cli-build.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
/* eslint-env node */
21
'use strict';
32

43
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
54

65
module.exports = function(defaults) {
7-
var env = EmberApp.env() || 'development';
8-
var isProductionLikeBuild = ['production', 'staging'].indexOf(env) > -1;
6+
let env = EmberApp.env() || 'development';
7+
let isProductionLikeBuild = ['production', 'staging'].indexOf(env) > -1;
98

10-
var fingerprintOptions = {
9+
let fingerprintOptions = {
1110
enabled: true,
1211
extensions: ['js', 'css', 'png', 'jpg', 'gif']
1312
};
1413

1514
switch (env) {
1615
case 'development':
1716
fingerprintOptions.prepend = 'http://localhost:4200/';
18-
break;
17+
break;
1918
case 'staging':
2019
fingerprintOptions.prepend = 'https://d3onq9263d8on4.cloudfront.net/';
21-
break;
20+
break;
2221
case 'production':
2322
fingerprintOptions.prepend = 'https://d3pgew4wbk2vb1.cloudfront.net/';
24-
break;
23+
break;
2524
}
2625

2726
let app = new EmberApp(defaults, {
@@ -41,7 +40,7 @@ module.exports = function(defaults) {
4140
// To see errors in Sentry, this is needed;
4241
// Our app is open source, so deal with it.
4342
enabled: true,
44-
extensions: ['js'],
43+
extensions: ['js']
4544
},
4645
minifyCSS: { enabled: isProductionLikeBuild },
4746
minifyJS: { enabled: isProductionLikeBuild },

‎package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"scripts": {
1313
"build": "ember build",
14+
"lint:js": "eslint ./*.js app config lib server tests",
1415
"start": "ember serve",
1516
"test": "ember try:one default"
1617
},
@@ -21,13 +22,13 @@
2122
"ember-auto-focus": "^2.0.1",
2223
"ember-autoresize": "1.0.0",
2324
"ember-can": "^0.8.4",
24-
"ember-cli": "~2.17.0",
25+
"ember-cli": "~2.18.0",
2526
"ember-cli-app-version": "^3.0.0",
2627
"ember-cli-autoprefixer": "0.8.1",
2728
"ember-cli-babel": "^6.6.0",
2829
"ember-cli-bourbon": "2.0.0-beta.1",
2930
"ember-cli-code-coverage": "^0.4.1",
30-
"ember-cli-dependency-checker": "^2.0.0",
31+
"ember-cli-dependency-checker": "^2.1.0",
3132
"ember-cli-deploy": "1.0.2",
3233
"ember-cli-deploy-build": "1.1.1",
3334
"ember-cli-deploy-display-revisions": "1.0.0",
@@ -62,7 +63,7 @@
6263
"ember-click-outside": "^0.1.10",
6364
"ember-composable-helpers": "2.1.0",
6465
"ember-concurrency": "^0.8.1",
65-
"ember-data": "~2.17",
66+
"ember-data": "~2.18.0",
6667
"ember-deferred-content": "0.2.0",
6768
"ember-disable-proxy-controllers": "^1.0.1",
6869
"ember-dragula": "1.9.3",
@@ -93,7 +94,7 @@
9394
"ember-simple-auth": "^1.2.1",
9495
"ember-simple-auth-token": "^2.1.0",
9596
"ember-sinon": "1.0.1",
96-
"ember-source": "~2.17.0",
97+
"ember-source": "~2.18.0",
9798
"ember-stripe-elements": "^0.3.0",
9899
"ember-stripe-service": "7.0.0",
99100
"ember-test-selectors": "^0.3.4",

‎tests/helpers/start-app.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import './responsive';
66

77
export default function startApp(attrs) {
88
let attributes = merge({}, config.APP);
9+
attributes.autoboot = true;
910
attributes = merge(attributes, attrs); // use defaults, but you can override;
1011

1112
return run(() => {

‎tests/test-helper.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import Application from '../app';
2+
import config from '../config/environment';
23
import { setApplication } from '@ember/test-helpers';
34
import { start } from 'ember-qunit';
45
import { run } from '@ember/runloop';
56
import loadEmberExam from 'ember-exam/test-support/load';
67
import './helpers/flash-message';
78

89
loadEmberExam();
9-
1010
run.later = run.next;
11-
12-
setApplication(Application.create({ autoboot: false }));
13-
11+
setApplication(Application.create(config.APP));
1412
start();

0 commit comments

Comments
 (0)