Skip to content

Commit 9fc3cc5

Browse files
committed
Merge remote-tracking branch 'upstream/main' into mael/yield-override
2 parents d1a1b4d + 3cbc8d2 commit 9fc3cc5

File tree

5,592 files changed

+634465
-231424
lines changed

Some content is hidden

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

5,592 files changed

+634465
-231424
lines changed

.eslintrc.json

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
3737
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
3838

39+
"max-statements-per-line": ["error", { "max": 1 }],
40+
3941
"no-duplicate-imports": "off",
4042
"@typescript-eslint/no-duplicate-imports": "error",
4143

.github/pr_owners.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ ahejlsberg
1010
amcasey
1111
jessetrinity
1212
minestarks
13-
uniqueiniquity
13+
armanio123
14+
gabritto
15+
jakebailey
16+
DanielRosenwasser

.github/pull_request_template.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ Thank you for submitting a pull request!
33
44
Please verify that:
55
* [ ] There is an associated issue in the `Backlog` milestone (**required**)
6-
* [ ] Code is up-to-date with the `master` branch
6+
* [ ] Code is up-to-date with the `main` branch
77
* [ ] You've successfully run `gulp runtests` locally
88
* [ ] There are new or updated unit tests validating the change
99
1010
Refer to CONTRIBUTING.MD for more details.
11-
https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md
11+
https://github.com/Microsoft/TypeScript/blob/main/CONTRIBUTING.md
12+
13+
** Please don't send typo fixes! **
14+
Please don't send a PR solely for the purpose of fixing a typo, unless that
15+
typo truly hurts understanding of the text. Each PR represents work for the
16+
maintainers, and that work should provide commensurate value.
17+
18+
If you're interested in sending a PR, the issue tracker has many issues marked `help wanted`.
1219
-->
1320

1421
Fixes #
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"project": "../../src/tsconfig.json",
3+
"source": "../../package.json",
4+
"package": "../../package.json",
5+
"out": "../../typescript.lsif"
6+
}

.github/workflows/accept-baselines-fix-lints.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
git config user.email "typescriptbot@microsoft.com"
2121
git config user.name "TypeScript Bot"
2222
npm install
23+
git rm -r --quiet tests/baselines/reference :^tests/baselines/reference/docker :^tests/baselines/reference/user
2324
gulp runtests-parallel --ci --fix || true
2425
gulp baseline-accept
2526
git add ./src

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
- release-*
88
pull_request:
99
branches:
10-
- master
10+
- main
1111
- release-*
1212

1313
jobs:
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [10.x, 12.x, 14.x]
19+
node-version: [12.x, 14.x, 16.x]
2020

2121
steps:
2222
- uses: actions/checkout@v2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Ensures that repos which are related to TypeScript but may not have regular commits
2+
# have their GitHub Actions scheduled jobs still active due to the 6 week timeout
3+
# on OSS repos. This has already triggered a few times with microsoft/TypeScript-Make-Monaco-Builds
4+
# so, better to automate keeping on top of it.
5+
6+
name: Related Repo Commit Bumps
7+
8+
on:
9+
schedule:
10+
# Monthly, https://crontab.guru/#0_0_*_1-12_*
11+
- cron: '0 0 1 * *'
12+
workflow_dispatch: {}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Configure git and update package-lock.json
20+
run: |
21+
git config --global user.email "typescriptbot@microsoft.com"
22+
git config --global user.name "TypeScript Bot"
23+
24+
- uses: actions/checkout@v2
25+
with:
26+
repository: 'microsoft/TypeScript-Website'
27+
path: 'ts-site'
28+
29+
- name: Push Commit to TS Website
30+
run: |
31+
cd ts-site
32+
git commit --allow-empty -m "Monthly Bump"
33+
git push https://${{ secrets.TS_BOT_GITHUB_TOKEN }}@github.com/microsoft/TypeScript-Website.git
34+
35+
- uses: actions/checkout@v2
36+
with:
37+
repository: 'microsoft/TypeScript-Make-Monaco-Builds'
38+
path: 'monaco-builds'
39+
40+
- name: Push Commit to TS Make Monaco Builds
41+
run: |
42+
cd monaco-builds
43+
git commit --allow-empty -m "Monthly Bump"
44+
git push https://${{ secrets.TS_BOT_GITHUB_TOKEN }}@github.com/microsoft/TypeScript-Make-Monaco-Builds.git

.github/workflows/rich-navigation.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Rich Navigation Indexing"
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
- release-*
8+
pull_request:
9+
branches:
10+
- main
11+
- release-*
12+
13+
jobs:
14+
richnav:
15+
runs-on: windows-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 5
21+
22+
- uses: actions/setup-node@v2
23+
with:
24+
node-version: 14
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- uses: microsoft/RichCodeNavIndexer@v0.1
30+
with:
31+
languages: typescript
32+
repo-token: ${{ secrets.GITHUB_TOKEN }}
33+
typescriptVersion: 0.6.0-next.18
34+
configFiles: .github/workflow-resources/.lsifrc.json
35+
continue-on-error: true

.github/workflows/sync-branch.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
- run: |
2929
git config user.email "typescriptbot@microsoft.com"
3030
git config user.name "TypeScript Bot"
31-
git fetch origin master
32-
git merge origin/master --no-ff
31+
git fetch origin main
32+
git merge origin/main --no-ff
3333
npm ci
3434
npm test
3535
git push

.vscode/launch.template.json

+2-10
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,15 @@
4848
"outFiles": [
4949
"${workspaceRoot}/built/local/run.js"
5050
],
51-
52-
// NOTE: To use this, you must switch the "type" above to "pwa-node". You may also need to follow the instructions
53-
// here: https://github.com/microsoft/vscode-js-debug#nightly-extension to use the js-debug nightly until
54-
// this feature is shipping in insiders or to a release:
55-
// "customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
51+
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue",
5652
},
5753
{
5854
// See: https://github.com/microsoft/TypeScript/wiki/Debugging-Language-Service-in-VS-Code
5955
"type": "node",
6056
"request": "attach",
6157
"name": "Attach to VS Code TS Server via Port",
6258
"processId": "${command:PickProcess}",
63-
64-
// NOTE: To use this, you must switch the "type" above to "pwa-node". You may also need to follow the instructions
65-
// here: https://github.com/microsoft/vscode-js-debug#nightly-extension to use the js-debug nightly until
66-
// this feature is shipping in insiders or to a release:
67-
// "customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
59+
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue",
6860
}
6961
]
7062
}

.vscode/settings.template.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
// contents into your existing settings.
33
{
44
"eslint.validate": [
5-
{
6-
"language": "typescript",
7-
"autoFix": true
8-
}
5+
"typescript"
96
],
107
"eslint.options": {
118
"rulePaths": ["./scripts/eslint/built/rules/"],
@@ -16,4 +13,4 @@
1613

1714
// To use the locally built compiler, after 'npm run build':
1815
// "typescript.tsdk": "built/local"
19-
}
16+
}

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Some search tips:
2020
## 3. Do you have a question?
2121

2222
The issue tracker is for **issues**, in other words, bugs and suggestions.
23-
If you have a *question*, please use [Stack Overflow](http://stackoverflow.com/questions/tagged/typescript), [Gitter](https://gitter.im/Microsoft/TypeScript), your favorite search engine, or other resources.
23+
If you have a *question*, please use [Stack Overflow](https://stackoverflow.com/questions/tagged/typescript), [Gitter](https://gitter.im/Microsoft/TypeScript), your favorite search engine, or other resources.
2424
Due to increased traffic, we can no longer answer questions in the issue tracker.
2525

2626
## 4. Did you find a bug?
@@ -72,7 +72,7 @@ In general, things we find useful when reviewing suggestions are:
7272

7373
### Using a development container
7474

75-
This repository includes a [development container](https://code.visualstudio.com/docs/remote/containers) that you can use to quickly create an isolated development environment with all the tools you need to start working on TypeScript. To get started with a dev container and VS Code, either:
75+
If you prefer to develop using containers, this repository includes a [development container](https://code.visualstudio.com/docs/remote/containers) that you can use to quickly create an isolated development environment with all the tools you need to start working on TypeScript. To get started with a dev container and VS Code, either:
7676

7777
- Clone the TypeScript repository locally and use the `Open Folder in Container` command.
7878
- Use the `Clone Repository in Container Volume` command to clone the TypeScript repository into a new container.
@@ -102,7 +102,7 @@ You will need to complete a Contributor License Agreement (CLA). Briefly, this a
102102
Your pull request should:
103103

104104
* Include a description of what your change intends to do
105-
* Be based on reasonably recent commit in the **master** branch
105+
* Be based on reasonably recent commit in the **main** branch
106106
* Include adequate tests
107107
* At least one test should fail in the absence of your non-test code changes. If your PR does not match this criteria, please specify why
108108
* Tests should include reasonable permutations of the target fix/change
@@ -118,7 +118,7 @@ There are three relevant locations to be aware of when it comes to TypeScript's
118118
* `lib`: the location of the last-known-good (LKG) versions of the files which are updated periodically.
119119
* `built/local`: the build output location, including where `src/lib` files will be copied to.
120120

121-
Any changes should be made to [src/lib](https://github.com/Microsoft/TypeScript/tree/master/src/lib). **Most** of these files can be updated by hand, with the exception of any generated files (see below).
121+
Any changes should be made to [src/lib](https://github.com/Microsoft/TypeScript/tree/main/src/lib). **Most** of these files can be updated by hand, with the exception of any generated files (see below).
122122

123123
Library files in `built/local/` are updated automatically by running the standard build task:
124124

Gulpfile.js

+3-13
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,6 @@ task("watch-local").flags = {
437437
" --built": "Compile using the built version of the compiler."
438438
};
439439

440-
const generateCodeCoverage = () => exec("istanbul", ["cover", "node_modules/mocha/bin/_mocha", "--", "-R", "min", "-t", "" + cmdLineOptions.testTimeout, "built/local/run.js"]);
441-
task("generate-code-coverage", series(preBuild, buildTests, generateCodeCoverage));
442-
task("generate-code-coverage").description = "Generates code coverage data via istanbul";
443-
444440
const preTest = parallel(buildTsc, buildTests, buildServices, buildLssl);
445441
preTest.displayName = "preTest";
446442

@@ -510,21 +506,15 @@ task("baseline-accept").description = "Makes the most recent test results the ne
510506
task("baseline-accept-rwc", () => baselineAccept(localRwcBaseline, refRwcBaseline));
511507
task("baseline-accept-rwc").description = "Makes the most recent rwc test results the new baseline, overwriting the old baseline";
512508

513-
const buildLoggedIO = async () => {
514-
mkdirp.sync("built/local/temp");
515-
await exec(process.execPath, ["lib/tsc", "--types", "--target", "es5", "--lib", "es5", "--outdir", "built/local/temp", "src/harness/loggedIO.ts"]);
516-
fs.renameSync("built/local/temp/harness/loggedIO.js", "built/local/loggedIO.js");
517-
await del("built/local/temp");
518-
};
519-
520-
const cleanLoggedIO = () => del("built/local/temp/loggedIO.js");
509+
const buildLoggedIO = () => buildProject("src/loggedIO/tsconfig-tsc-instrumented.json");
510+
const cleanLoggedIO = () => del("built/local/loggedIO.js");
521511
cleanTasks.push(cleanLoggedIO);
522512

523513
const buildInstrumenter = () => buildProject("src/instrumenter");
524514
const cleanInstrumenter = () => cleanProject("src/instrumenter");
525515
cleanTasks.push(cleanInstrumenter);
526516

527-
const tscInstrumented = () => exec(process.execPath, ["built/local/instrumenter.js", "record", cmdLineOptions.tests || "iocapture", "built/local"]);
517+
const tscInstrumented = () => exec(process.execPath, ["built/local/instrumenter.js", "record", cmdLineOptions.tests || "iocapture", "built/local/tsc.js"]);
528518
task("tsc-instrumented", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildLoggedIO, buildInstrumenter), tscInstrumented));
529519
task("tsc-instrumented").description = "Builds an instrumented tsc.js";
530520
task("tsc-instrumented").flags = {

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ npm install -g typescript@next
2626

2727
## Contribute
2828

29-
There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
29+
There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md) to TypeScript.
3030
* [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
3131
* Review the [source code changes](https://github.com/microsoft/TypeScript/pulls).
3232
* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
3333
* Help each other in the [TypeScript Community Discord](https://discord.gg/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 archived language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.docx?raw=true),
37-
[pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec-ARCHIVED.md)).
35+
* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md).
36+
* Read the archived language specification ([docx](https://github.com/microsoft/TypeScript/blob/main/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.docx?raw=true),
37+
[pdf](https://github.com/microsoft/TypeScript/blob/main/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/main/doc/spec-ARCHIVED.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 [opencode@microsoft.com](mailto:opencode@microsoft.com)

SECURITY.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
2+
3+
## Security
4+
5+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6+
7+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
8+
9+
## Reporting Security Issues
10+
11+
**Please do not report security vulnerabilities through public GitHub issues.**
12+
13+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14+
15+
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16+
17+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18+
19+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20+
21+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
* Full paths of source file(s) related to the manifestation of the issue
23+
* The location of the affected source code (tag/branch/commit or direct URL)
24+
* Any special configuration required to reproduce the issue
25+
* Step-by-step instructions to reproduce the issue
26+
* Proof-of-concept or exploit code (if possible)
27+
* Impact of the issue, including how an attacker might exploit the issue
28+
29+
This information will help us triage your report more quickly.
30+
31+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32+
33+
## Preferred Languages
34+
35+
We prefer all communications to be in English.
36+
37+
## Policy
38+
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40+
41+
<!-- END MICROSOFT SECURITY.MD BLOCK -->

0 commit comments

Comments
 (0)