Skip to content

Commit 2b8ce2d

Browse files
committed
Merge branch 'master' into instanceof-narrowing
2 parents 798405c + b57b5fe commit 2b8ce2d

File tree

869 files changed

+123588
-87722
lines changed

Some content is hidden

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

869 files changed

+123588
-87722
lines changed

Gulpfile.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const generateLibs = () => {
4141
.pipe(concat(relativeTarget, { newLine: "\n\n" }))
4242
.pipe(dest("built/local"))));
4343
};
44-
task("lib", generateLibs)
44+
task("lib", generateLibs);
4545
task("lib").description = "Builds the library targets";
4646

4747
const cleanLib = () => del(libs.map(lib => lib.target));
@@ -168,7 +168,7 @@ task("services", series(preBuild, buildServices));
168168
task("services").description = "Builds the language service";
169169
task("services").flags = {
170170
" --built": "Compile using the built version of the compiler."
171-
}
171+
};
172172

173173
const cleanServices = async () => {
174174
if (fs.existsSync("built/local/typescriptServices.tsconfig.json")) {
@@ -200,14 +200,14 @@ task("watch-services", series(preBuild, parallel(watchLib, watchDiagnostics, wat
200200
task("watch-services").description = "Watches for changes and rebuild language service only";
201201
task("watch-services").flags = {
202202
" --built": "Compile using the built version of the compiler."
203-
}
203+
};
204204

205205
const buildServer = () => buildProject("src/tsserver", cmdLineOptions);
206206
task("tsserver", series(preBuild, buildServer));
207207
task("tsserver").description = "Builds the language server";
208208
task("tsserver").flags = {
209209
" --built": "Compile using the built version of the compiler."
210-
}
210+
};
211211

212212
const cleanServer = () => cleanProject("src/tsserver");
213213
cleanTasks.push(cleanServer);
@@ -219,13 +219,13 @@ task("watch-tsserver", series(preBuild, parallel(watchLib, watchDiagnostics, wat
219219
task("watch-tsserver").description = "Watch for changes and rebuild the language server only";
220220
task("watch-tsserver").flags = {
221221
" --built": "Compile using the built version of the compiler."
222-
}
222+
};
223223

224224
task("min", series(preBuild, parallel(buildTsc, buildServer)));
225225
task("min").description = "Builds only tsc and tsserver";
226226
task("min").flags = {
227227
" --built": "Compile using the built version of the compiler."
228-
}
228+
};
229229

230230
task("clean-min", series(cleanTsc, cleanServer));
231231
task("clean-min").description = "Cleans outputs for tsc and tsserver";
@@ -234,7 +234,7 @@ task("watch-min", series(preBuild, parallel(watchLib, watchDiagnostics, watchTsc
234234
task("watch-min").description = "Watches for changes to a tsc and tsserver only";
235235
task("watch-min").flags = {
236236
" --built": "Compile using the built version of the compiler."
237-
}
237+
};
238238

239239
const buildLssl = (() => {
240240
// build tsserverlibrary.out.js
@@ -268,7 +268,7 @@ task("lssl", series(preBuild, buildLssl));
268268
task("lssl").description = "Builds language service server library";
269269
task("lssl").flags = {
270270
" --built": "Compile using the built version of the compiler."
271-
}
271+
};
272272

273273
const cleanLssl = async () => {
274274
if (fs.existsSync("built/local/tsserverlibrary.tsconfig.json")) {
@@ -302,14 +302,14 @@ task("watch-lssl", series(preBuild, parallel(watchLib, watchDiagnostics, watchLs
302302
task("watch-lssl").description = "Watch for changes and rebuild tsserverlibrary only";
303303
task("watch-lssl").flags = {
304304
" --built": "Compile using the built version of the compiler."
305-
}
305+
};
306306

307307
const buildTests = () => buildProject("src/testRunner");
308308
task("tests", series(preBuild, parallel(buildLssl, buildTests)));
309309
task("tests").description = "Builds the test infrastructure";
310310
task("tests").flags = {
311311
" --built": "Compile using the built version of the compiler."
312-
}
312+
};
313313

314314
const cleanTests = () => cleanProject("src/testRunner");
315315
cleanTasks.push(cleanTests);
@@ -381,13 +381,13 @@ task("local", series(buildFoldStart, preBuild, parallel(localize, buildTsc, buil
381381
task("local").description = "Builds the full compiler and services";
382382
task("local").flags = {
383383
" --built": "Compile using the built version of the compiler."
384-
}
384+
};
385385

386386
task("watch-local", series(preBuild, parallel(watchLib, watchDiagnostics, watchTsc, watchServices, watchServer, watchLssl)));
387387
task("watch-local").description = "Watches for changes to projects in src/ (but does not execute tests).";
388388
task("watch-local").flags = {
389389
" --built": "Compile using the built version of the compiler."
390-
}
390+
};
391391

392392
const generateCodeCoverage = () => exec("istanbul", ["cover", "node_modules/mocha/bin/_mocha", "--", "-R", "min", "-t", "" + cmdLineOptions.testTimeout, "built/local/run.js"]);
393393
task("generate-code-coverage", series(preBuild, buildTests, generateCodeCoverage));
@@ -417,7 +417,7 @@ task("runtests").flags = {
417417
" --built": "Compile using the built version of the compiler.",
418418
" --shards": "Total number of shards running tests (default: 1)",
419419
" --shardId": "1-based ID of this shard (default: 1)",
420-
}
420+
};
421421

422422
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ true, /*watchMode*/ false);
423423
task("runtests-parallel", series(preBuild, preTest, runTestsParallel, postTest));
@@ -436,10 +436,10 @@ task("runtests-parallel").flags = {
436436
" --shardId": "1-based ID of this shard (default: 1)",
437437
};
438438

439-
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true }));
439+
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true, waitForExit: false }));
440440
task("diff").description = "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable";
441441

442-
task("diff-rwc", () => exec(getDiffTool(), [refRwcBaseline, localRwcBaseline], { ignoreExitCode: true }));
442+
task("diff-rwc", () => exec(getDiffTool(), [refRwcBaseline, localRwcBaseline], { ignoreExitCode: true, waitForExit: false }));
443443
task("diff-rwc").description = "Diffs the RWC baselines using the diff tool specified by the 'DIFF' environment variable";
444444

445445
/**
@@ -478,7 +478,7 @@ task("tsc-instrumented", series(lkgPreBuild, parallel(localize, buildTsc, buildS
478478
task("tsc-instrumented").description = "Builds an instrumented tsc.js";
479479
task("tsc-instrumented").flags = {
480480
"-t --tests=<testname>": "The test to run."
481-
}
481+
};
482482

483483
// TODO(rbuckton): Determine if we still need this task. Depending on a relative
484484
// path here seems like a bad idea.
@@ -533,7 +533,7 @@ task("LKG", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildS
533533
task("LKG").description = "Makes a new LKG out of the built js files";
534534
task("LKG").flags = {
535535
" --built": "Compile using the built version of the compiler.",
536-
}
536+
};
537537

538538
const generateSpec = () => exec("cscript", ["//nologo", "scripts/word2md.js", path.resolve("doc/TypeScript Language Specification.docx"), path.resolve("doc/spec.md")]);
539539
task("generate-spec", series(buildScripts, generateSpec));
@@ -542,15 +542,15 @@ task("generate-spec").description = "Generates a Markdown version of the Languag
542542
task("clean", series(parallel(cleanTasks), cleanBuilt));
543543
task("clean").description = "Cleans build outputs";
544544

545-
const configureNightly = () => exec(process.execPath, ["scripts/configurePrerelease.js", "dev", "package.json", "src/compiler/core.ts"])
545+
const configureNightly = () => exec(process.execPath, ["scripts/configurePrerelease.js", "dev", "package.json", "src/compiler/core.ts"]);
546546
task("configure-nightly", series(buildScripts, configureNightly));
547547
task("configure-nightly").description = "Runs scripts/configurePrerelease.ts to prepare a build for nightly publishing";
548548

549-
const configureInsiders = () => exec(process.execPath, ["scripts/configurePrerelease.js", "insiders", "package.json", "src/compiler/core.ts"])
549+
const configureInsiders = () => exec(process.execPath, ["scripts/configurePrerelease.js", "insiders", "package.json", "src/compiler/core.ts"]);
550550
task("configure-insiders", series(buildScripts, configureInsiders));
551551
task("configure-insiders").description = "Runs scripts/configurePrerelease.ts to prepare a build for insiders publishing";
552552

553-
const configureExperimental = () => exec(process.execPath, ["scripts/configurePrerelease.js", "experimental", "package.json", "src/compiler/core.ts"])
553+
const configureExperimental = () => exec(process.execPath, ["scripts/configurePrerelease.js", "experimental", "package.json", "src/compiler/core.ts"]);
554554
task("configure-experimental", series(buildScripts, configureExperimental));
555555
task("configure-experimental").description = "Runs scripts/configurePrerelease.ts to prepare a build for experimental publishing";
556556

README.md

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
# TypeScript
33

4-
[![Join the chat at https://gitter.im/Microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5-
[![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript)
4+
[![Join the chat at https://gitter.im/microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5+
[![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/microsoft/TypeScript)
66
[![VSTS Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build/latest?definitionId=4&view=logs)
77
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
88
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
@@ -27,14 +27,14 @@ npm install -g typescript@next
2727

2828
## Contribute
2929

30-
There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
31-
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
32-
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
30+
There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
31+
* [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
32+
* Review the [source code changes](https://github.com/microsoft/TypeScript/pulls).
3333
* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
3434
* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
35-
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
36-
* Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true),
37-
[pdf](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)).
35+
* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md).
36+
* Read the language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true),
37+
[pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)).
3838

3939
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
4040
the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected])
@@ -44,7 +44,7 @@ with any additional questions or comments.
4444

4545
* [Quick tutorial](https://www.typescriptlang.org/docs/tutorial.html)
4646
* [Programming handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html)
47-
* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)
47+
* [Language specification](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)
4848
* [Homepage](https://www.typescriptlang.org/)
4949

5050
## Building
@@ -54,7 +54,7 @@ In order to build the TypeScript compiler, ensure that you have [Git](https://gi
5454
Clone a copy of the repo:
5555

5656
```bash
57-
git clone https://github.com/Microsoft/TypeScript.git
57+
git clone https://github.com/microsoft/TypeScript.git
5858
```
5959

6060
Change to the TypeScript directory:
@@ -73,17 +73,25 @@ npm install
7373
Use one of the following to build and test:
7474

7575
```
76-
gulp local # Build the compiler into built/local
77-
gulp clean # Delete the built compiler
78-
gulp LKG # Replace the last known good with the built one.
79-
# Bootstrapping step to be executed when the built compiler reaches a stable state.
80-
gulp tests # Build the test infrastructure using the built compiler.
81-
gulp runtests # Run tests using the built compiler and test infrastructure.
82-
# You can override the host or specify a test for this command.
83-
# Use --host=<hostName> or --tests=<testPath>.
84-
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
85-
gulp lint # Runs tslint on the TypeScript source.
86-
gulp help # List the above commands.
76+
gulp local # Build the compiler into built/local.
77+
gulp clean # Delete the built compiler.
78+
gulp LKG # Replace the last known good with the built one.
79+
# Bootstrapping step to be executed when the built compiler reaches a stable state.
80+
gulp tests # Build the test infrastructure using the built compiler.
81+
gulp runtests # Run tests using the built compiler and test infrastructure.
82+
# Some low-value tests are skipped when not on a CI machine - you can use the
83+
# --skipPercent=0 command to override this behavior and run all tests locally.
84+
# You can override the specific suite runner used or specify a test for this command.
85+
# Use --tests=<testPath> for a specific test and/or --runner=<runnerName> for a specific suite.
86+
# Valid runners include conformance, compiler, fourslash, project, user, and docker
87+
# The user and docker runners are extended test suite runners - the user runner
88+
# works on disk in the tests/cases/user directory, while the docker runner works in containers.
89+
# You'll need to have the docker executable in your system path for the docker runner to work.
90+
gulp runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
91+
# core count by default. Use --workers=<number> to adjust this.
92+
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
93+
gulp lint # Runs tslint on the TypeScript source.
94+
gulp help # List the above commands.
8795
```
8896

8997

@@ -96,4 +104,4 @@ node built/local/tsc.js hello.ts
96104

97105
## Roadmap
98106

99-
For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap).
107+
For details on our planned features and future direction please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap).

0 commit comments

Comments
 (0)