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

+5-5
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

+2-2
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

+5-2
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

+1-1
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

+2-2
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

+1-1
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

+2-2
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

+2-2
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

+2-2
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

+2-2
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;

tools/publish/src/build-schema.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function build(args: string[], _opts: any, logger: Logger): void {
2222

2323
const output = require('./build-schema').buildSchema(inFile, logger);
2424
if (outFile) {
25-
fs.writeFileSync(outFile, output, 'utf-8');
25+
fs.writeFileSync(outFile, output, { encoding: 'utf-8' });
2626
} else {
2727
logger.info(output);
2828
}

tools/publish/src/build.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default function build(packagesToBuild: string[], _opts: any,
7878
.then(() => {
7979
const input = path.join(root, 'packages/@angular/cli/lib/config/schema.json');
8080
const output = path.join(root, 'packages/@angular/cli/lib/config/schema.d.ts');
81-
fs.writeFileSync(output, buildSchema(input, logger), 'utf-8');
81+
fs.writeFileSync(output, buildSchema(input, logger), { encoding: 'utf-8' });
8282
})
8383
.then(() => logger.info('Compiling packages...'))
8484
.then(() => {

yarn.lock

+43-19
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
version "1.2.5"
4646
resolved "https://registry.yarnpkg.com/@types/common-tags/-/common-tags-1.2.5.tgz#14f29893992eb325594b83d739af02f2b6520f46"
4747

48-
"@types/denodeify@^1.2.29":
48+
"@types/denodeify@^1.2.30":
4949
version "1.2.30"
5050
resolved "https://registry.yarnpkg.com/@types/denodeify/-/denodeify-1.2.30.tgz#9e356062b44524e7a399fb446d836fcfe352b9dc"
5151

@@ -107,9 +107,9 @@
107107
dependencies:
108108
"@types/node" "*"
109109

110-
"@types/node@*", "@types/node@^6.0.36":
111-
version "6.0.78"
112-
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.78.tgz#5d4a3f579c1524e01ee21bf474e6fba09198f470"
110+
"@types/node@*", "@types/node@^6.0.84":
111+
version "6.0.84"
112+
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.84.tgz#193ffe5a9f42864d425ffd9739d95b753c6a1eab"
113113

114114
115115
version "0.0.39"
@@ -253,6 +253,12 @@ ansi-styles@^2.2.1:
253253
version "2.2.1"
254254
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
255255

256+
ansi-styles@^3.1.0:
257+
version "3.1.0"
258+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.1.0.tgz#09c202d5c917ec23188caa5c9cb9179cd9547750"
259+
dependencies:
260+
color-convert "^1.0.0"
261+
256262
anymatch@^1.3.0:
257263
version "1.3.0"
258264
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507"
@@ -723,6 +729,14 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
723729
strip-ansi "^3.0.0"
724730
supports-color "^2.0.0"
725731

732+
chalk@^2.0.0:
733+
version "2.0.1"
734+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d"
735+
dependencies:
736+
ansi-styles "^3.1.0"
737+
escape-string-regexp "^1.0.5"
738+
supports-color "^4.0.0"
739+
726740
chokidar@^1.6.0, chokidar@^1.7.0:
727741
version "1.7.0"
728742
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
@@ -827,7 +841,7 @@ code-point-at@^1.0.0:
827841
version "1.1.0"
828842
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
829843

830-
color-convert@^1.3.0:
844+
color-convert@^1.0.0, color-convert@^1.3.0:
831845
version "1.9.0"
832846
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a"
833847
dependencies:
@@ -2294,6 +2308,10 @@ has-flag@^1.0.0:
22942308
version "1.0.0"
22952309
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"
22962310

2311+
has-flag@^2.0.0:
2312+
version "2.0.0"
2313+
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51"
2314+
22972315
has-unicode@^2.0.0:
22982316
version "2.0.1"
22992317
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
@@ -4536,9 +4554,9 @@ rx-lite@^3.1.2:
45364554
version "3.1.2"
45374555
resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102"
45384556

4539-
rxjs@^5.0.1:
4540-
version "5.4.1"
4541-
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.1.tgz#b62f757f279445d265a18a58fb0a70dc90e91626"
4557+
rxjs@^5.4.2:
4558+
version "5.4.2"
4559+
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.2.tgz#2a3236fcbf03df57bae06fd6972fd99e5c08fcf7"
45424560
dependencies:
45434561
symbol-observable "^1.0.1"
45444562

@@ -5021,6 +5039,12 @@ supports-color@^3.1.0, supports-color@^3.1.1, supports-color@^3.2.3:
50215039
dependencies:
50225040
has-flag "^1.0.0"
50235041

5042+
supports-color@^4.0.0:
5043+
version "4.2.0"
5044+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.2.0.tgz#ad986dc7eb2315d009b4d77c8169c2231a684037"
5045+
dependencies:
5046+
has-flag "^2.0.0"
5047+
50245048
svgo@^0.7.0:
50255049
version "0.7.2"
50265050
resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5"
@@ -5166,19 +5190,19 @@ tryit@^1.0.1:
51665190
version "1.0.3"
51675191
resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb"
51685192

5169-
ts-node@^3.0.6:
5170-
version "3.1.0"
5171-
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-3.1.0.tgz#a75ec5aeb48f3058b1b945dba765f1150ba88f8c"
5193+
ts-node@^3.2.0:
5194+
version "3.2.1"
5195+
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-3.2.1.tgz#9595dd840d03e62bc79214ce5a7b51e55e3c4ffc"
51725196
dependencies:
51735197
arrify "^1.0.0"
5174-
chalk "^1.1.1"
5198+
chalk "^2.0.0"
51755199
diff "^3.1.0"
51765200
make-error "^1.1.1"
51775201
minimist "^1.2.0"
51785202
mkdirp "^0.5.1"
51795203
source-map-support "^0.4.0"
51805204
tsconfig "^6.0.0"
5181-
v8flags "^2.0.11"
5205+
v8flags "^3.0.0"
51825206
yn "^2.0.0"
51835207

51845208
tsconfig@^6.0.0:
@@ -5251,9 +5275,9 @@ typedarray@^0.0.6:
52515275
version "0.0.6"
52525276
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
52535277

5254-
typescript@^2.3.3, typescript@~2.3.1:
5255-
version "2.3.4"
5256-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.4.tgz#3d38321828231e434f287514959c37a82b629f42"
5278+
typescript@^2.3.3, typescript@~2.4.2:
5279+
version "2.4.2"
5280+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.2.tgz#f8395f85d459276067c988aa41837a8f82870844"
52575281

52585282
52595283
version "3.0.19"
@@ -5389,9 +5413,9 @@ uuid@^3.0.0:
53895413
version "3.1.0"
53905414
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"
53915415

5392-
v8flags@^2.0.11:
5393-
version "2.1.1"
5394-
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4"
5416+
v8flags@^3.0.0:
5417+
version "3.0.0"
5418+
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.0.tgz#4be9604488e0c4123645def705b1848d16b8e01f"
53955419
dependencies:
53965420
user-home "^1.1.1"
53975421

0 commit comments

Comments
 (0)