Skip to content

Commit 7b9fc28

Browse files
filipesilvaBrocco
authored andcommitted
feat(@angular/cli): support TypeScript 2.4
This PR doesn't change new projects to use 2.4 since I have seen some reports of possible problems in `@angular/*`. Instead, it: - removes the dependency restrictions on <2.3 - bumps related dependencies to the minimum that supports 2.4 (`rxjs@^5.4.2`, `ts-node@~3.2.0`) - builds the CLI itself using 2.4 So if you want to install ts 2.4 in your new project, the CLI itself won't stop you. Fix #6827
1 parent 61b4e22 commit 7b9fc28

File tree

13 files changed

+69
-42
lines changed

13 files changed

+69
-42
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"raw-loader": "^0.5.1",
8686
"resolve": "^1.1.7",
8787
"rsvp": "^3.0.17",
88-
"rxjs": "^5.0.1",
88+
"rxjs": "^5.4.2",
8989
"sass-loader": "^6.0.3",
9090
"script-loader": "^0.7.0",
9191
"semver": "^5.3.0",
@@ -96,7 +96,7 @@
9696
"stylus": "^0.54.5",
9797
"stylus-loader": "^3.0.1",
9898
"temp": "0.8.3",
99-
"typescript": "~2.3.1",
99+
"typescript": "~2.4.2",
100100
"url-loader": "^0.5.7",
101101
"walk-sync": "^0.3.1",
102102
"webpack": "~3.3.0",
@@ -111,15 +111,15 @@
111111
"@angular/core": "^4.0.0",
112112
"@types/chalk": "^0.4.28",
113113
"@types/common-tags": "^1.2.4",
114-
"@types/denodeify": "^1.2.29",
114+
"@types/denodeify": "^1.2.30",
115115
"@types/express": "^4.0.32",
116116
"@types/fs-extra": "~3.0.2",
117117
"@types/glob": "^5.0.29",
118118
"@types/jasmine": "2.5.45",
119119
"@types/lodash": "4.14.50",
120120
"@types/minimist": "^1.2.0",
121121
"@types/mock-fs": "^3.6.30",
122-
"@types/node": "^6.0.36",
122+
"@types/node": "^6.0.84",
123123
"@types/request": "0.0.39",
124124
"@types/semver": "^5.3.30",
125125
"@types/source-map": "^0.5.0",
@@ -141,7 +141,7 @@
141141
"tar": "^3.1.5",
142142
"through": "^2.3.6",
143143
"tree-kill": "^1.0.0",
144-
"ts-node": "^3.0.6",
144+
"ts-node": "^3.2.0",
145145
"tslint": "^5.1.0"
146146
},
147147
"optionalDependencies": {

packages/@angular/cli/blueprints/ng/files/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@angular/platform-browser-dynamic": "^4.2.4",
2626
"@angular/router": "^4.2.4",
2727
"core-js": "^2.4.1",
28-
"rxjs": "^5.4.1",
28+
"rxjs": "^5.4.2",
2929
"zone.js": "^0.8.14"
3030
},
3131
"devDependencies": {
@@ -45,7 +45,7 @@
4545
"karma-jasmine": "~1.1.0",
4646
"karma-jasmine-html-reporter": "^0.2.2",
4747
"protractor": "~5.1.2",
48-
"ts-node": "~3.0.4",
48+
"ts-node": "~3.2.0",
4949
"tslint": "~5.3.2",<% } %>
5050
"typescript": "~2.3.3"
5151
}

packages/@angular/cli/commands/new.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import { oneLine } from 'common-tags';
1111
const Command = require('../ember-cli/lib/models/command');
1212
const Project = require('../ember-cli/lib/models/project');
1313
const SilentError = require('silent-error');
14-
const mkdir = denodeify(fs.mkdir);
14+
15+
// There's some problem with the generic typings for fs.makedir.
16+
// Couldn't find matching types for the callbacks so leaving it as any for now.
17+
const mkdir = denodeify<string, void>(fs.mkdir as any);
1518

1619
const configFile = '.angular-cli.json';
1720
const changeLater = (path: string) => `You can later change the value in "${configFile}" (${path})`;
@@ -177,7 +180,7 @@ const NewCommand = Command.extend({
177180
});
178181
} else {
179182
createDirectory = mkdir(directoryName)
180-
.catch(err => {
183+
.catch((err) => {
181184
if (err.code === 'EEXIST') {
182185
if (this.isProject(directoryName)) {
183186
throw new SilentError(oneLine`

packages/@angular/cli/models/config/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class CliConfig<JsonType> {
3030
get config(): JsonType { return <any>this._config; }
3131

3232
save(path: string = this._configPath) {
33-
return fs.writeFileSync(path, this.serialize(), 'utf-8');
33+
return fs.writeFileSync(path, this.serialize(), {encoding: 'utf-8'});
3434
}
3535
serialize(mimetype = 'application/json'): string {
3636
return this._config.$$serialize(mimetype);

packages/@angular/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"raw-loader": "^0.5.1",
7171
"resolve": "^1.1.7",
7272
"rsvp": "^3.0.17",
73-
"rxjs": "^5.0.1",
73+
"rxjs": "^5.4.2",
7474
"sass-loader": "^6.0.3",
7575
"script-loader": "^0.7.0",
7676
"semver": "^5.1.0",
@@ -81,7 +81,7 @@
8181
"stylus": "^0.54.5",
8282
"stylus-loader": "^3.0.1",
8383
"temp": "0.8.3",
84-
"typescript": ">=2.0.0 <2.4.0",
84+
"typescript": ">=2.0.0 <2.5.0",
8585
"url-loader": "^0.5.7",
8686
"walk-sync": "^0.3.1",
8787
"webpack": "~3.3.0",

packages/@ngtools/logger/src/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class Logger extends Observable<LogEntry> {
9797
return `<Logger(${this.name})>`;
9898
}
9999

100-
lift(operator: Operator<LogEntry, LogEntry>): Observable<LogEntry> {
100+
lift<R>(operator: Operator<LogEntry, R>): Observable<R> {
101101
return this._observable.lift(operator);
102102
}
103103

tests/e2e/assets/webpack/test-app-weird/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@angular/router": ">=4.0.0-beta <5.0.0",
1414
"@ngtools/webpack": "0.0.0",
1515
"core-js": "^2.4.1",
16-
"rxjs": "^5.0.1",
16+
"rxjs": "^5.4.2",
1717
"zone.js": "^0.8.14"
1818
},
1919
"devDependencies": {
@@ -22,7 +22,7 @@
2222
"preprocess-loader": "^0.2.2",
2323
"raw-loader": "^0.5.1",
2424
"sass-loader": "^3.2.0",
25-
"typescript": "~2.1.0",
25+
"typescript": "~2.4.2",
2626
"webpack": "2.2.0"
2727
}
2828
}

tests/e2e/assets/webpack/test-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"@angular/router": "^3.3.1",
1414
"@ngtools/webpack": "0.0.0",
1515
"core-js": "^2.4.1",
16-
"rxjs": "^5.0.1",
16+
"rxjs": "^5.4.2",
1717
"zone.js": "^0.8.14"
1818
},
1919
"devDependencies": {
2020
"node-sass": "^3.7.0",
2121
"performance-now": "^0.2.0",
2222
"raw-loader": "^0.5.1",
2323
"sass-loader": "^3.2.0",
24-
"typescript": "~2.0.3",
24+
"typescript": "~2.4.2",
2525
"webpack": "2.2.0"
2626
}
2727
}

tests/e2e/assets/webpack/test-server-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
"@angular/router": "^4.0.0",
1515
"@ngtools/webpack": "0.0.0",
1616
"core-js": "^2.4.1",
17-
"rxjs": "^5.3.1",
17+
"rxjs": "^5.4.2",
1818
"zone.js": "^0.8.14"
1919
},
2020
"devDependencies": {
2121
"node-sass": "^4.5.0",
2222
"performance-now": "^0.2.0",
2323
"raw-loader": "^0.5.1",
2424
"sass-loader": "^6.0.3",
25-
"typescript": "^2.3.2",
25+
"typescript": "~2.4.2",
2626
"webpack": "2.2.1"
2727
}
2828
}

tests/e2e/tests/test/test-fail-watch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
killAllProcesses,
33
waitForAnyProcessOutputToMatch,
4-
execAndWaitForOutputToMatch
4+
execAndWaitForOutputToMatch,
55
} from '../../utils/process';
66
import { expectToFail } from '../../utils/utils';
77
import { readFile, writeFile } from '../../utils/fs';
@@ -20,7 +20,7 @@ export default function () {
2020
.then(() => expectToFail(() => waitForAnyProcessOutputToMatch(karmaGoodRegEx, 10000)))
2121
// Restore working spec.
2222
.then(() => writeFile('src/app/app.component.spec.ts', originalSpec))
23-
.then(() => waitForAnyProcessOutputToMatch(karmaGoodRegEx, 10000))
23+
.then(() => waitForAnyProcessOutputToMatch(karmaGoodRegEx, 20000))
2424
.then(() => killAllProcesses(), (err: any) => {
2525
killAllProcesses();
2626
throw err;

0 commit comments

Comments
 (0)