Skip to content

Commit e940942

Browse files
authored
Merge pull request #87 from typed-ember/upgrade-b-ts-c
Upgrade to [email protected].
2 parents adc49fe + d7a934e commit e940942

21 files changed

+1257
-574
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
/coverage/*
1515
/libpeerconnection.log
1616
npm-debug.log*
17+
yarn-error.log
1718
testem.log
1819

20+
# ember-try
21+
.node_modules.ember-try/
22+
bower.json.ember-try
23+
package.json.ember-try
24+
1925
# TypeScript
2026
jsconfig.json

.npmignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@
1414
bower.json
1515
ember-cli-build.js
1616
testem.js
17-
node-tests/
17+
18+
# ember-try
19+
.node_modules.ember-try/
20+
node-tests/
21+
bower.json.ember-try
22+
package.json.ember-try

.travis.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,39 @@ node_js:
44
- "6"
55

66
sudo: false
7+
dist: trusty
78

8-
cache:
9-
yarn: true
9+
addons:
10+
chrome: stable
11+
12+
cache: yarn
1013

1114
env:
12-
# we recommend testing LTS's and latest stable release (bonus points to beta/canary)
13-
- EMBER_TRY_SCENARIO=ember-lts-2.4
14-
- EMBER_TRY_SCENARIO=ember-lts-2.8
15-
- EMBER_TRY_SCENARIO=ember-release
16-
- EMBER_TRY_SCENARIO=ember-beta
17-
- EMBER_TRY_SCENARIO=ember-canary
18-
- EMBER_TRY_SCENARIO=ember-default
15+
global:
16+
# See https://git.io/vdao3 for details.
17+
- JOBS=1
18+
matrix:
19+
# we recommend new addons test the current and previous LTS
20+
# as well as latest stable release (bonus points to beta/canary)
21+
- EMBER_TRY_SCENARIO=ember-lts-2.12
22+
- EMBER_TRY_SCENARIO=ember-lts-2.16
23+
- EMBER_TRY_SCENARIO=ember-release
24+
- EMBER_TRY_SCENARIO=ember-beta
25+
- EMBER_TRY_SCENARIO=ember-canary
26+
- EMBER_TRY_SCENARIO=ember-default
1927

2028
matrix:
2129
fast_finish: true
2230
allow_failures:
2331
- env: EMBER_TRY_SCENARIO=ember-canary
2432

25-
before_install:
26-
- curl -o- -L https://yarnpkg.com/install.sh | bash
27-
- export PATH=$HOME/.yarn/bin:$PATH
28-
- yarn global add phantomjs-prebuilt
29-
- phantomjs --version
30-
3133
install:
3234
- yarn install --no-lockfile
3335

3436
script:
3537
# Usually, it's ok to finish the test scenario without reverting
3638
# to the addon's original dependency state, skipping "cleanup".
37-
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup
39+
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
3840
- yarn run nodetest
3941

4042
# We build PRs, but don't trigger separate builds for the PR from the branch.

appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ install:
1515
- git rev-parse HEAD
1616
# Get the latest stable version of Node 0.STABLE.latest
1717
- ps: Install-Product node $env:nodejs_version
18-
# Install PhantomJS
19-
- cinst PhantomJS -y
2018
# hide python so node-gyp won't try to build native extentions
2119
- rename C:\Python27 Python27hidden
2220
# Typical npm stuff.

config/ember-try.js

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,20 @@
22
module.exports = {
33
scenarios: [
44
{
5-
name: 'ember-lts-2.4',
6-
bower: {
7-
dependencies: {
8-
ember: 'components/ember#lts-2-4',
9-
},
10-
resolutions: {
11-
ember: 'lts-2-4',
12-
},
13-
},
5+
name: 'ember-lts-2.12',
146
npm: {
157
devDependencies: {
16-
'ember-source': null,
17-
},
18-
},
8+
'ember-source': '~2.12.0'
9+
}
10+
}
1911
},
2012
{
21-
name: 'ember-lts-2.8',
22-
bower: {
23-
dependencies: {
24-
ember: 'components/ember#lts-2-8',
25-
},
26-
resolutions: {
27-
ember: 'lts-2-8',
28-
},
29-
},
13+
name: 'ember-lts-2.16',
3014
npm: {
3115
devDependencies: {
32-
'ember-source': null,
33-
},
34-
},
16+
'ember-source': '~2.16.0'
17+
}
18+
}
3519
},
3620
{
3721
name: 'ember-release',

ember-cli-build.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/* eslint-env node */
2+
'use strict';
3+
24
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
35

46
module.exports = function(defaults) {
5-
var app = new EmberAddon(defaults, {
7+
let app = new EmberAddon(defaults, {
68
// Add options here
79
});
810

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ module.exports = {
3232
);
3333
} catch (ex) {
3434
throw new SilentError(
35-
`Failed to instantiate TypeScript preprocessor, probably due to an invalid tsconfig.json. Please fix or run \`ember generate ember-cli-typescript\`.\n${ex}`
35+
`Failed to instantiate TypeScript preprocessor, probably due to an invalid tsconfig.json. Please fix or run \`ember generate ember-cli-typescript\`.\n${
36+
ex
37+
}`
3638
);
3739
}
3840
},

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"homepage": "https://github.com/emberwatch/ember-cli-typescript",
2525
"scripts": {
2626
"build": "ember build",
27-
"start": "ember server",
27+
"start": "ember serve",
2828
"test": "ember try:each",
2929
"nodetest": "mocha node-tests --recursive"
3030
},
@@ -35,32 +35,33 @@
3535
"broccoli-plugin": "^1.2.1",
3636
"broccoli-source": "^1.1.0",
3737
"broccoli-stew": "^1.4.0",
38-
"broccoli-typescript-compiler": "^2.1.0",
38+
"broccoli-typescript-compiler": "^2.1.1",
3939
"debug": "^2.2.0",
40-
"ember-cli-babel": "^6.3.0",
40+
"ember-cli-babel": "^6.6.0",
4141
"silent-error": "^1.1.0"
4242
},
4343
"devDependencies": {
4444
"@types/ember": "^2.7.43",
4545
"broccoli-asset-rev": "^2.4.5",
46-
"ember-cli": "^2.13.3",
46+
"ember-cli": "~2.17.1",
4747
"ember-cli-app-version": "^2.0.0",
4848
"ember-cli-blueprint-test-helpers": "^0.18.3",
49-
"ember-cli-dependency-checker": "^1.3.0",
50-
"ember-cli-eslint": "^3.0.0",
51-
"ember-cli-htmlbars": "^1.1.1",
52-
"ember-cli-htmlbars-inline-precompile": "^0.4.0",
49+
"ember-cli-dependency-checker": "^2.0.0",
50+
"ember-cli-eslint": "^4.2.1",
51+
"ember-cli-htmlbars": "^2.0.1",
52+
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
5353
"ember-cli-inject-live-reload": "^1.4.1",
54-
"ember-cli-qunit": "^4.0.0",
54+
"ember-cli-qunit": "^4.1.1",
5555
"ember-cli-release": "^0.2.9",
56-
"ember-cli-shims": "^1.1.0",
56+
"ember-cli-shims": "^1.2.0",
5757
"ember-cli-sri": "^2.1.0",
58-
"ember-cli-uglify": "^1.2.0",
58+
"ember-cli-uglify": "^2.0.0",
59+
"ember-cli-update": "^0.13.2",
5960
"ember-disable-prototype-extensions": "^1.1.2",
6061
"ember-export-application-global": "^2.0.0",
6162
"ember-load-initializers": "^1.0.0",
6263
"ember-resolver": "^4.0.0",
63-
"ember-source": "~2.13.3",
64+
"ember-source": "~2.17.0",
6465
"loader.js": "^4.2.3",
6566
"mocha": "^2.2.1",
6667
"typescript": "^2.4.2"

testem.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
module.exports = {
33
test_page: 'tests/index.html?hidepassed',
44
disable_watching: true,
5-
launch_in_ci: ['PhantomJS'],
6-
launch_in_dev: ['PhantomJS', 'Chrome'],
5+
launch_in_ci: [
6+
'Chrome'
7+
],
8+
launch_in_dev: [
9+
'Chrome'
10+
],
11+
browser_args: {
12+
Chrome: {
13+
mode: 'ci',
14+
args: [
15+
'--disable-gpu',
16+
'--headless',
17+
'--remote-debugging-port=0',
18+
'--window-size=1440,900'
19+
]
20+
}
21+
}
722
};

tests/dummy/app/app.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
import Ember from 'ember';
1+
import Application from '@ember/application';
22
import Resolver from './resolver';
33
import loadInitializers from 'ember-load-initializers';
44
import config from './config/environment';
55

6-
let App;
7-
8-
Ember.MODEL_FACTORY_INJECTIONS = true;
9-
10-
App = Ember.Application.extend({
6+
const App = Application.extend({
117
modulePrefix: config.modulePrefix,
128
podModulePrefix: config.podModulePrefix,
139
Resolver,

tests/dummy/app/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
{{content-for "head"}}
1111

12-
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
13-
<link rel="stylesheet" href="{{rootURL}}assets/dummy.css">
12+
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
13+
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/dummy.css">
1414

1515
{{content-for "head-footer"}}
1616
</head>

tests/dummy/app/router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import Ember from 'ember';
1+
import EmberRouter from '@ember/routing/router';
22
import config from './config/environment';
33

4-
const Router = Ember.Router.extend({
4+
const Router = EmberRouter.extend({
55
location: config.locationType,
66
rootURL: config.rootURL,
77
});

tests/dummy/app/templates/application.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1>Hello</h1>
1+
<h2 id="title">Welcome to Ember</h2>
22

33
This is code from ember-cli-typescript's test application.
44

tests/dummy/config/environment.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* eslint-env node */
2+
'use strict';
23

34
module.exports = function(environment) {
4-
var ENV = {
5+
let ENV = {
56
modulePrefix: 'dummy',
6-
environment: environment,
7+
environment,
78
rootURL: '/',
89
locationType: 'auto',
910
EmberENV: {
@@ -43,6 +44,7 @@ module.exports = function(environment) {
4344
}
4445

4546
if (environment === 'production') {
47+
// here you can enable a production-specific feature
4648
}
4749

4850
return ENV;

tests/dummy/config/targets.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-env node */
2-
32
module.exports = {
43
browsers: ['ie 9', 'last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions'],
54
};

tests/helpers/destroy-app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Ember from 'ember';
1+
import { run } from '@ember/runloop';
22

33
export default function destroyApp(application) {
4-
Ember.run(application, 'destroy');
4+
run(application, 'destroy');
55
}
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { module } from 'qunit';
2-
import Ember from 'ember';
2+
import { resolve } from 'rsvp';
33
import startApp from '../helpers/start-app';
44
import destroyApp from '../helpers/destroy-app';
55

6-
const { RSVP: { Promise } } = Ember;
7-
86
export default function(name, options = {}) {
97
module(name, {
108
beforeEach() {
@@ -17,7 +15,7 @@ export default function(name, options = {}) {
1715

1816
afterEach() {
1917
let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
20-
return Promise.resolve(afterEach).then(() => destroyApp(this.application));
21-
},
18+
return resolve(afterEach).then(() => destroyApp(this.application));
19+
}
2220
});
2321
}

tests/helpers/resolver.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/helpers/start-app.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import Ember from 'ember';
21
import Application from '../../app';
32
import config from '../../config/environment';
3+
import { merge } from '@ember/polyfills';
4+
import { run } from '@ember/runloop';
45

56
export default function startApp(attrs) {
6-
let attributes = Ember.merge({}, config.APP);
7-
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
7+
let attributes = merge({}, config.APP);
8+
attributes = merge(attributes, attrs); // use defaults, but you can override;
89

9-
return Ember.run(() => {
10+
return run(() => {
1011
let application = Application.create(attributes);
1112
application.setupForTesting();
1213
application.injectTestHelpers();

tests/test-helper.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import resolver from './helpers/resolver';
2-
import { setResolver } from 'ember-qunit';
3-
import { start } from 'ember-cli-qunit';
1+
import Application from '../app';
2+
import { setApplication } from '@ember/test-helpers';
3+
import { start } from 'ember-qunit';
4+
5+
setApplication(Application.create({ autoboot: false }));
46

5-
setResolver(resolver);
67
start();

0 commit comments

Comments
 (0)