Skip to content

Commit ab2e2cf

Browse files
authored
Merge pull request #1 from Microsoft/master
Merge upstream changes
2 parents 1552761 + eb80799 commit ab2e2cf

File tree

4,560 files changed

+51359
-24780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,560 files changed

+51359
-24780
lines changed

.mailmap

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Andy Hanson <anhans@microsoft.com> Andy <anhans@microsoft.com>
1717
Anil Anar <anilanar@hotmail.com>
1818
Anton Tolmachev <myste@mail.ru>
1919
Anubha Mathur <anubmat@microsoft.com> anubmat <anubmat@microsoft.com>
20+
Armando Aguirre <armando.aguirre@microsoft.com>
21+
Arnaud Tournier <ltearno@gmail.com>
2022
Arnavion <arnavion@gmail.com> # Arnav Singh
2123
Arthur Ozga <aozgaa@umich.edu> Arthur Ozga <t-arthoz@microsoft.com> Arthur Ozga <aozgaa-ms@outlook.com> Arthur Ozga <aozgaa@users.noreply.github.com> Arthur Ozga <arozga@microsoft.com>
2224
Asad Saeeduddin <masaeedu@gmail.com>
@@ -26,6 +28,7 @@ Bill Ticehurst <billti@hotmail.com> Bill Ticehurst <billti@microsoft.com>
2628
Ben Duffield <jebavarde@gmail.com>
2729
Ben Mosher <me@benmosher.com>
2830
Benjamin Bock <bb@users.noreply.github.com>
31+
Benjamin Lichtman <uniqueiniquity@users.noreply.github.com> uniqueiniquity <blichtman623@gmail.com>
2932
Blake Embrey <hello@blakeembrey.com>
3033
Bowden Kelly <wilkelly@microsoft.com>
3134
Brett Mayen <bmayen@midnightsnacks.net>
@@ -59,6 +62,7 @@ Evan Sebastian <evanlhoini@gmail.com>
5962
Eyas <eyas.sharaiha@gmail.com> # Eyas Sharaiha
6063
Fabian Cook <faybecook@gmail.com>
6164
falsandtru <falsandtru@users.noreply.github.com> # @falsandtru
65+
Filipe Silva <filipematossilva@gmail.com>
6266
flowmemo <flowmemo@outlook.com> # @flowmemo
6367
Frank Wallis <fwallis@outlook.com>
6468
František Žiacik <fziacik@gratex.com> František Žiacik <ziacik@gmail.com>
@@ -192,7 +196,7 @@ TruongSinh Tran-Nguyen <i@truongsinh.pro>
192196
vilicvane <i@vilic.info> # Vilic Vane
193197
Vladimir Matveev <vladima@microsoft.com> vladima <vladima@microsoft.com> v2m <desco.by@gmail.com>
194198
Vadi Taslim <vadz77@hotmail.com>
195-
Wesley Wigham <t-weswig@microsoft.com> Wesley Wigham <wwigham@gmail.com>
199+
Wesley Wigham <t-weswig@microsoft.com> Wesley Wigham <wwigham@gmail.com> Wesley Wigham <wewigham@microsoft.com>
196200
York Yao <plantain-00@users.noreply.github.com> york yao <yaoao12306@outlook.com> yaoyao <yaoyao12306@163.com>
197201
Yuichi Nukiyama <oscar.wilde84@hotmail.co.jp> YuichiNukiyama <oscar.wilde84@hotmail.co.jp>
198202
Zev Spitz <shivisi@etrog.net.il>
@@ -267,4 +271,9 @@ Reiner Dolp <reiner-dolp@users.noreply.github.com>
267271
t_ <t-mrt@users.noreply.github.com> # @t_
268272
TravCav <xurrux@gmail.com> # @TravCav
269273
Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
270-
William Orr <will@worrbase.com>
274+
William Orr <will@worrbase.com>
275+
Francois Wouts <f@codonut.com>
276+
Jan Melcher <jan.melcher@aeb.com> Jan Melcher <mail@jan-melcher.de>
277+
Matt Mitchell <mmitche@microsoft.com>
278+
Maxwell Paul Brickner <mbrickn@users.noreply.github.com>
279+
Tycho Grouwstra <tychogrouwstra@gmail.com>

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ Jakefile.js
1616
.gitattributes
1717
.settings/
1818
.travis.yml
19-
.vscode/
19+
.vscode/
20+
test.config

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ matrix:
1616
branches:
1717
only:
1818
- master
19+
- release-2.5
1920

2021
install:
2122
- npm uninstall typescript --no-save

.vscode/tasks.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
"problemMatcher": [
1919
"$tsc"
2020
]
21+
},
22+
{
23+
"taskName": "tests",
24+
"showOutput": "silent",
25+
"problemMatcher": [
26+
"$tsc"
27+
]
2128
}
2229
]
2330
}

AUTHORS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ TypeScript is authored by:
2525
* Anton Khlynovskiy
2626
* Anton Tolmachev
2727
* Anubha Mathur
28+
* Armando Aguirre
29+
* Arnaud Tournier
2830
* Arnav Singh
2931
* Arthur Ozga
3032
* Asad Saeeduddin
@@ -33,6 +35,7 @@ TypeScript is authored by:
3335
* Ben Duffield
3436
* Ben Mosher
3537
* Benjamin Bock
38+
* Benjamin Lichtman
3639
* Benny Neugebauer
3740
* Bill Ticehurst
3841
* Blaine Bublitz
@@ -85,7 +88,9 @@ TypeScript is authored by:
8588
* Eyas Sharaiha
8689
* Fabian Cook
8790
* @falsandtru
91+
* Filipe Silva
8892
* @flowmemo
93+
* Francois Wouts
8994
* Frank Wallis
9095
* Franklin Tse
9196
* František Žiacik
@@ -112,6 +117,7 @@ TypeScript is authored by:
112117
* Jakub Młokosiewicz
113118
* James Henry
114119
* James Whitney
120+
* Jan Melcher
115121
* Jason Freeman
116122
* Jason Jarrett
117123
* Jason Killian
@@ -162,9 +168,11 @@ TypeScript is authored by:
162168
* Masahiro Wakame
163169
* Matt Bierner
164170
* Matt McCutchen
171+
* Matt Mitchell
165172
* Mattias Buelens
166173
* Mattias Buelens
167174
* Max Deepfield
175+
* Maxwell Paul Brickner
168176
* Micah Zoltu
169177
* Michael
170178
* Michael Bromley
@@ -243,6 +251,7 @@ TypeScript is authored by:
243251
* Torben Fitschen
244252
* @TravCav
245253
* TruongSinh Tran-Nguyen
254+
* Tycho Grouwstra
246255
* Vadi Taslim
247256
* Vidar Tonaas Fauske
248257
* Viktor Zozulyak

Gulpfile.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,11 @@ gulp.task(serverFile, /*help*/ false, [servicesFile, typingsInstallerJs, cancell
463463
.pipe(gulp.dest("src/server"));
464464
});
465465

466+
const typesMapJson = path.join(builtLocalDirectory, "typesMap.json");
466467
const tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js");
467468
const tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts");
468469

469-
gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile], (done) => {
470+
gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile, typesMapJson], (done) => {
470471
const serverLibraryProject = tsc.createProject("src/server/tsconfig.library.json", getCompilerSettings({}, /*useBuiltCompiler*/ true));
471472
const {js, dts}: { js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream } = serverLibraryProject.src()
472473
.pipe(sourcemaps.init())
@@ -485,6 +486,15 @@ gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile], (done) => {
485486
]);
486487
});
487488

489+
gulp.task(typesMapJson, /*help*/ false, [], () => {
490+
return gulp.src("src/server/typesMap.json")
491+
.pipe(insert.transform((contents, file) => {
492+
JSON.parse(contents);
493+
return contents;
494+
}))
495+
.pipe(gulp.dest(builtLocalDirectory));
496+
});
497+
488498
gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile]);
489499
gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON, tsserverLibraryFile]);
490500
gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]);
@@ -776,7 +786,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
776786
const file = new Vinyl({ contents, path: bundlePath });
777787
console.log(`Fixing sourcemaps for ${file.path}`);
778788
// assumes contents is a Buffer, since that's what browserify yields
779-
const maps = convertMap.fromSource(stringContent, /*largeSource*/ true).toObject();
789+
const maps = convertMap.fromSource(stringContent).toObject();
780790
delete maps.sourceRoot;
781791
maps.sources = maps.sources.map(s => path.resolve(s === "_stream_0.js" ? "built/local/_stream_0.js" : s));
782792
// Strip browserify's inline comments away (could probably just let sorcery do this, but then we couldn't fix the paths)
@@ -968,7 +978,7 @@ const instrumenterPath = path.join(harnessDirectory, "instrumenter.ts");
968978
const instrumenterJsPath = path.join(builtLocalDirectory, "instrumenter.js");
969979
gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => {
970980
const settings: tsc.Settings = getCompilerSettings({
971-
outFile: instrumenterJsPath,
981+
module: "commonjs",
972982
target: "es5",
973983
lib: [
974984
"es6",
@@ -980,8 +990,8 @@ gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => {
980990
.pipe(newer(instrumenterJsPath))
981991
.pipe(sourcemaps.init())
982992
.pipe(tsc(settings))
983-
.pipe(sourcemaps.write("."))
984-
.pipe(gulp.dest("."));
993+
.pipe(sourcemaps.write(builtLocalDirectory))
994+
.pipe(gulp.dest(builtLocalDirectory));
985995
});
986996

987997
gulp.task("tsc-instrumented", "Builds an instrumented tsc.js", ["local", loggedIOJsPath, instrumenterJsPath, servicesFile], (done) => {

Jakefile.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ var watchGuardSources = filesFromConfig(path.join(serverDirectory, "watchGuard/t
8888
var serverSources = filesFromConfig(path.join(serverDirectory, "tsconfig.json"))
8989
var languageServiceLibrarySources = filesFromConfig(path.join(serverDirectory, "tsconfig.library.json"));
9090

91+
var typesMapOutputPath = path.join(builtLocalDirectory, 'typesMap.json');
92+
9193
var harnessCoreSources = [
9294
"harness.ts",
9395
"virtualFileSystem.ts",
@@ -133,12 +135,15 @@ var harnessSources = harnessCoreSources.concat([
133135
"projectErrors.ts",
134136
"matchFiles.ts",
135137
"initializeTSConfig.ts",
138+
"extractMethods.ts",
136139
"printer.ts",
137140
"textChanges.ts",
138141
"telemetry.ts",
139142
"transform.ts",
140143
"customTransforms.ts",
141144
"programMissingFiles.ts",
145+
"symbolWalker.ts",
146+
"languageService.ts",
142147
].map(function (f) {
143148
return path.join(unittestsDirectory, f);
144149
})).concat([
@@ -422,6 +427,7 @@ var buildProtocolTs = path.join(scriptsDirectory, "buildProtocol.ts");
422427
var buildProtocolJs = path.join(scriptsDirectory, "buildProtocol.js");
423428
var buildProtocolDts = path.join(builtLocalDirectory, "protocol.d.ts");
424429
var typescriptServicesDts = path.join(builtLocalDirectory, "typescriptServices.d.ts");
430+
var typesMapJson = path.join(builtLocalDirectory, "typesMap.json");
425431

426432
file(buildProtocolTs);
427433

@@ -533,7 +539,6 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
533539
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);
534540

535541
var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
536-
var servicesFileInBrowserTest = path.join(builtLocalDirectory, "typescriptServicesInBrowserTest.js");
537542
var standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts");
538543
var nodePackageFile = path.join(builtLocalDirectory, "typescript.js");
539544
var nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts");
@@ -572,22 +577,6 @@ compileFile(servicesFile, servicesSources, [builtLocalDirectory, copyright].conc
572577
fs.writeFileSync(nodeStandaloneDefinitionsFile, nodeStandaloneDefinitionsFileContents);
573578
});
574579

575-
compileFile(
576-
servicesFileInBrowserTest,
577-
servicesSources,
578-
[builtLocalDirectory, copyright].concat(servicesSources),
579-
/*prefixes*/[copyright],
580-
/*useBuiltCompiler*/ true,
581-
{
582-
noOutFile: false,
583-
generateDeclarations: true,
584-
preserveConstEnums: true,
585-
keepComments: true,
586-
noResolve: false,
587-
stripInternal: true,
588-
inlineSourceMap: true
589-
});
590-
591580
file(typescriptServicesDts, [servicesFile]);
592581

593582
var cancellationTokenFile = path.join(builtLocalDirectory, "cancellationToken.js");
@@ -603,6 +592,16 @@ var serverFile = path.join(builtLocalDirectory, "tsserver.js");
603592
compileFile(serverFile, serverSources, [builtLocalDirectory, copyright, cancellationTokenFile, typingsInstallerFile, watchGuardFile].concat(serverSources).concat(servicesSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { types: ["node"], preserveConstEnums: true, lib: "es6" });
604593
var tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js");
605594
var tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts");
595+
file(typesMapOutputPath, function() {
596+
var content = fs.readFileSync(path.join(serverDirectory, 'typesMap.json'));
597+
// Validate that it's valid JSON
598+
try {
599+
JSON.parse(content);
600+
} catch (e) {
601+
console.log("Parse error in typesMap.json: " + e);
602+
}
603+
fs.writeFileSync(typesMapOutputPath, content);
604+
});
606605
compileFile(
607606
tsserverLibraryFile,
608607
languageServiceLibrarySources,
@@ -625,7 +624,7 @@ compileFile(
625624

626625
// Local target to build the language service server library
627626
desc("Builds language service server library");
628-
task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile]);
627+
task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile, typesMapOutputPath]);
629628

630629
desc("Emit the start of the build fold");
631630
task("build-fold-start", [], function () {
@@ -654,7 +653,6 @@ task("release", function () {
654653
// Set the default task to "local"
655654
task("default", ["local"]);
656655

657-
658656
// Cleans the built directory
659657
desc("Cleans the compiler output, declare files, and tests");
660658
task("clean", function () {
@@ -725,7 +723,7 @@ compileFile(
725723
/*prereqs*/[builtLocalDirectory, tscFile].concat(libraryTargets).concat(servicesSources).concat(harnessSources),
726724
/*prefixes*/[],
727725
/*useBuiltCompiler:*/ true,
728-
/*opts*/ { inlineSourceMap: true, types: ["node", "mocha", "chai"], lib: "es6" });
726+
/*opts*/ { types: ["node", "mocha", "chai"], lib: "es6" });
729727

730728
var internalTests = "internal/";
731729

@@ -961,13 +959,14 @@ var nodeServerInFile = "tests/webTestServer.ts";
961959
compileFile(nodeServerOutFile, [nodeServerInFile], [builtLocalDirectory, tscFile], [], /*useBuiltCompiler:*/ true, { noOutFile: true, lib: "es6" });
962960

963961
desc("Runs browserify on run.js to produce a file suitable for running tests in the browser");
964-
task("browserify", ["tests", run, builtLocalDirectory, nodeServerOutFile], function() {
965-
var cmd = 'browserify built/local/run.js -t ./scripts/browserify-optional -d -o built/local/bundle.js';
962+
task("browserify", [], function() {
963+
// Shell out to `gulp`, since we do the work to handle sourcemaps correctly w/o inline maps there
964+
var cmd = 'gulp browserify --silent';
966965
exec(cmd);
967966
}, { async: true });
968967

969968
desc("Runs the tests using the built run.js file like 'jake runtests'. Syntax is jake runtests-browser. Additional optional parameters tests=[regex], browser=[chrome|IE]");
970-
task("runtests-browser", ["tests", "browserify", builtLocalDirectory, servicesFileInBrowserTest], function () {
969+
task("runtests-browser", ["browserify", nodeServerOutFile], function () {
971970
cleanTestDirs();
972971
host = "node";
973972
browser = process.env.browser || process.env.b || (os.platform() === "linux" ? "chrome" : "IE");
@@ -1101,7 +1100,7 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function () {
11011100

11021101
var instrumenterPath = harnessDirectory + 'instrumenter.ts';
11031102
var instrumenterJsPath = builtLocalDirectory + 'instrumenter.js';
1104-
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath].concat(libraryTargets), [], /*useBuiltCompiler*/ true, { lib: "es6", types: ["node"] });
1103+
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath].concat(libraryTargets), [], /*useBuiltCompiler*/ true, { lib: "es6", types: ["node"], noOutFile: true, outDir: builtLocalDirectory });
11051104

11061105
desc("Builds an instrumented tsc.js");
11071106
task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function () {
@@ -1122,14 +1121,15 @@ task("update-sublime", ["local", serverFile], function () {
11221121

11231122
var tslintRuleDir = "scripts/tslint";
11241123
var tslintRules = [
1125-
"nextLineRule",
11261124
"booleanTriviaRule",
1127-
"typeOperatorSpacingRule",
1128-
"noInOperatorRule",
1125+
"debugAssertRule",
1126+
"nextLineRule",
1127+
"noBomRule",
11291128
"noIncrementDecrementRule",
1130-
"objectLiteralSurroundingSpaceRule",
1129+
"noInOperatorRule",
11311130
"noTypeAssertionWhitespaceRule",
1132-
"noBomRule"
1131+
"objectLiteralSurroundingSpaceRule",
1132+
"typeOperatorSpacingRule",
11331133
];
11341134
var tslintRulesFiles = tslintRules.map(function (p) {
11351135
return path.join(tslintRuleDir, p + ".ts");

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313
For the latest stable version:
1414

15-
```
15+
```bash
1616
npm install -g typescript
1717
```
1818

1919
For our nightly builds:
2020

21-
```
21+
```bash
2222
npm install -g typescript@next
2323
```
2424

@@ -50,19 +50,19 @@ In order to build the TypeScript compiler, ensure that you have [Git](https://gi
5050

5151
Clone a copy of the repo:
5252

53-
```
53+
```bash
5454
git clone https://github.com/Microsoft/TypeScript.git
5555
```
5656

5757
Change to the TypeScript directory:
5858

59-
```
59+
```bash
6060
cd TypeScript
6161
```
6262

6363
Install Gulp tools and dev dependencies:
6464

65-
```
65+
```bash
6666
npm install -g gulp
6767
npm install
6868
```
@@ -88,7 +88,7 @@ gulp help # List the above commands.
8888

8989
## Usage
9090

91-
```shell
91+
```bash
9292
node built/local/tsc.js hello.ts
9393
```
9494

0 commit comments

Comments
 (0)