Skip to content

Commit 9a71fbc

Browse files
committed
Merge branch 'master' into conditional-both-branch-relation
2 parents ae9831d + 370a596 commit 9a71fbc

File tree

3,210 files changed

+233860
-123166
lines changed

Some content is hidden

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

3,210 files changed

+233860
-123166
lines changed

.dockerignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
node_modules
2+
.node_modules
3+
built/*
4+
test-args.txt
5+
~*.docx
6+
\#*\#
7+
.\#*
8+
src/harness/*.js
9+
src/compiler/diagnosticInformationMap.generated.ts
10+
src/compiler/diagnosticMessages.generated.json
11+
src/parser/diagnosticInformationMap.generated.ts
12+
src/parser/diagnosticMessages.generated.json
13+
rwc-report.html
14+
*.swp
15+
build.json
16+
*.actual
17+
*.config
18+
scripts/debug.bat
19+
scripts/run.bat
20+
scripts/word2md.js
21+
scripts/buildProtocol.js
22+
scripts/ior.js
23+
scripts/authors.js
24+
scripts/configurePrerelease.js
25+
scripts/open-user-pr.js
26+
scripts/open-cherry-pick-pr.js
27+
scripts/processDiagnosticMessages.d.ts
28+
scripts/processDiagnosticMessages.js
29+
scripts/produceLKG.js
30+
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
31+
scripts/generateLocalizedDiagnosticMessages.js
32+
scripts/*.js.map
33+
scripts/typings/
34+
coverage/
35+
internal/
36+
**/.DS_Store
37+
.settings
38+
**/.vs
39+
.idea
40+
yarn.lock
41+
yarn-error.log
42+
.parallelperf.*
43+
.failed-tests
44+
TEST-results.xml
45+
package-lock.json
46+
tests
47+
.vscode
48+
.git

.github/pull_request_template.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!--
22
Thank you for submitting a pull request!
33
4-
Here's a checklist you might find useful.
5-
* [ ] There is an associated issue that is labeled 'Bug' or 'help wanted'
4+
Please verify that:
5+
* [ ] There is an associated issue in the `Backlog` milestone (**required**)
66
* [ ] Code is up-to-date with the `master` branch
77
* [ ] You've successfully run `gulp runtests` locally
88
* [ ] There are new or updated unit tests validating the change
@@ -12,4 +12,3 @@ Refer to CONTRIBUTING.MD for more details.
1212
-->
1313

1414
Fixes #
15-

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ tests/webTestServer.js.map
3434
tests/webhost/*.d.ts
3535
tests/webhost/webtsc.js
3636
tests/cases/**/*.js
37+
!tests/cases/docker/*.js/
3738
tests/cases/**/*.js.map
3839
*.config
3940
scripts/debug.bat
@@ -44,6 +45,7 @@ scripts/ior.js
4445
scripts/authors.js
4546
scripts/configurePrerelease.js
4647
scripts/open-user-pr.js
48+
scripts/open-cherry-pick-pr.js
4749
scripts/processDiagnosticMessages.d.ts
4850
scripts/processDiagnosticMessages.js
4951
scripts/produceLKG.js

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ package-lock.json
2929
yarn.lock
3030
CONTRIBUTING.md
3131
TEST-results.xml
32+
.dockerignore
33+
Dockerfile

.yarnrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--install.no-lockfile true

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ Run `gulp` to build a version of the compiler/language service that reflects cha
5959

6060
## Contributing bug fixes
6161

62-
TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort.
62+
TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved (labelled ["help wanted"](https://github.com/Microsoft/TypeScript/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)) by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort.
6363

6464
## Contributing features
6565

66-
Features (things that add new or improved functionality to TypeScript) may be accepted, but will need to first be approved (marked as "Milestone == Community" by a TypeScript coordinator with the message "Approved") in the suggestion issue. Features with language design impact, or that are adequately satisfied with external tools, will not be accepted.
66+
Features (things that add new or improved functionality to TypeScript) may be accepted, but will need to first be approved ([labelled "help wanted"](https://github.com/Microsoft/TypeScript/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) by a TypeScript project maintainer) in the suggestion issue. Features with language design impact, or that are adequately satisfied with external tools, will not be accepted.
6767

6868
Design changes will not be accepted at this time. If you have a design change proposal, please log a suggestion issue.
6969

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# We use this dockerfile to build a packed tarfile which we import in our `docker` tests
2+
FROM node:current
3+
COPY . /typescript
4+
WORKDIR /typescript
5+
RUN npm install
6+
RUN npm i -g gulp-cli
7+
RUN gulp configure-insiders && gulp LKG && gulp clean && npm pack .

Gulpfile.js

Lines changed: 28 additions & 19 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));
@@ -415,7 +415,9 @@ task("runtests").flags = {
415415
" --no-lint": "Disables lint",
416416
" --timeout=<ms>": "Overrides the default test timeout.",
417417
" --built": "Compile using the built version of the compiler.",
418-
}
418+
" --shards": "Total number of shards running tests (default: 1)",
419+
" --shardId": "1-based ID of this shard (default: 1)",
420+
};
419421

420422
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ true, /*watchMode*/ false);
421423
task("runtests-parallel", series(preBuild, preTest, runTestsParallel, postTest));
@@ -429,12 +431,15 @@ task("runtests-parallel").flags = {
429431
" --workers=<number>": "The number of parallel workers to use.",
430432
" --timeout=<ms>": "Overrides the default test timeout.",
431433
" --built": "Compile using the built version of the compiler.",
434+
" --skipPercent=<number>": "Skip expensive tests with <percent> chance to miss an edit. Default 5%.",
435+
" --shards": "Total number of shards running tests (default: 1)",
436+
" --shardId": "1-based ID of this shard (default: 1)",
432437
};
433438

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

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

440445
/**
@@ -473,7 +478,7 @@ task("tsc-instrumented", series(lkgPreBuild, parallel(localize, buildTsc, buildS
473478
task("tsc-instrumented").description = "Builds an instrumented tsc.js";
474479
task("tsc-instrumented").flags = {
475480
"-t --tests=<testname>": "The test to run."
476-
}
481+
};
477482

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

533538
const generateSpec = () => exec("cscript", ["//nologo", "scripts/word2md.js", path.resolve("doc/TypeScript Language Specification.docx"), path.resolve("doc/spec.md")]);
534539
task("generate-spec", series(buildScripts, generateSpec));
@@ -537,14 +542,18 @@ task("generate-spec").description = "Generates a Markdown version of the Languag
537542
task("clean", series(parallel(cleanTasks), cleanBuilt));
538543
task("clean").description = "Cleans build outputs";
539544

540-
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"]);
541546
task("configure-nightly", series(buildScripts, configureNightly));
542547
task("configure-nightly").description = "Runs scripts/configurePrerelease.ts to prepare a build for nightly publishing";
543548

544-
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"]);
545550
task("configure-insiders", series(buildScripts, configureInsiders));
546551
task("configure-insiders").description = "Runs scripts/configurePrerelease.ts to prepare a build for insiders publishing";
547552

553+
const configureExperimental = () => exec(process.execPath, ["scripts/configurePrerelease.js", "experimental", "package.json", "src/compiler/core.ts"]);
554+
task("configure-experimental", series(buildScripts, configureExperimental));
555+
task("configure-experimental").description = "Runs scripts/configurePrerelease.ts to prepare a build for experimental publishing";
556+
548557
const publishNightly = () => exec("npm", ["publish", "--tag", "next"]);
549558
task("publish-nightly", series(task("clean"), task("LKG"), task("clean"), task("runtests-parallel"), publishNightly));
550559
task("publish-nightly").description = "Runs `npm publish --tag next` to create a new nightly build on npm";

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
[![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript)
2-
[![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)
3-
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
4-
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
51

62
# TypeScript
73

84
[![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)
6+
[![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)
7+
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
8+
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
9+
10+
911

10-
[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescriptlang).
12+
[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript).
1113

1214
## Installing
1315

@@ -28,14 +30,14 @@ npm install -g typescript@next
2830
There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
2931
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
3032
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
31-
* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
33+
* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
3234
* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
3335
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
3436
* Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true),
3537
[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)).
3638

37-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
38-
the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected])
39+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
40+
the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected])
3941
with any additional questions or comments.
4042

4143
## Documentation
@@ -71,19 +73,17 @@ npm install
7173
Use one of the following to build and test:
7274

7375
```
74-
gulp local # Build the compiler into built/local
75-
gulp clean # Delete the built compiler
76+
gulp local # Build the compiler into built/local
77+
gulp clean # Delete the built compiler
7678
gulp LKG # Replace the last known good with the built one.
7779
# Bootstrapping step to be executed when the built compiler reaches a stable state.
78-
gulp tests # Build the test infrastructure using the built compiler.
79-
gulp runtests # Run tests using the built compiler and test infrastructure.
80-
# You can override the host or specify a test for this command.
81-
# Use --host=<hostName> or --tests=<testPath>.
82-
gulp runtests-browser # Runs the tests using the built run.js file. Syntax is gulp runtests. Optional
83-
parameters '--host=', '--tests=[regex], --reporter=[list|spec|json|<more>]'.
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>.
8484
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
8585
gulp lint # Runs tslint on the TypeScript source.
86-
gulp help # List the above commands.
86+
gulp help # List the above commands.
8787
```
8888

8989

0 commit comments

Comments
 (0)