Skip to content

Commit cedc792

Browse files
Merge remote-tracking branch 'remotes/origin/master' into GH-35629-2
2 parents 7ddb796 + 57df466 commit cedc792

File tree

1,382 files changed

+71661
-15927
lines changed

Some content is hidden

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

1,382 files changed

+71661
-15927
lines changed

.eslintrc.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
"@typescript-eslint/no-inferrable-types": "error",
2727
"@typescript-eslint/no-misused-new": "error",
2828
"@typescript-eslint/no-this-alias": "error",
29+
30+
"no-unused-expressions": "off",
31+
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
32+
2933
"@typescript-eslint/prefer-for-of": "error",
3034
"@typescript-eslint/prefer-function-type": "error",
3135
"@typescript-eslint/prefer-namespace-keyword": "error",
@@ -36,6 +40,13 @@
3640
"semi": "off",
3741
"@typescript-eslint/semi": "error",
3842

43+
"space-before-function-paren": "off",
44+
"@typescript-eslint/space-before-function-paren": ["error", {
45+
"asyncArrow": "always",
46+
"anonymous": "always",
47+
"named": "never"
48+
}],
49+
3950
"@typescript-eslint/triple-slash-reference": "error",
4051
"@typescript-eslint/type-annotation-spacing": "error",
4152
"@typescript-eslint/unified-signatures": "error",
@@ -97,7 +108,6 @@
97108
"no-trailing-spaces": "error",
98109
"no-undef-init": "error",
99110
"no-unsafe-finally": "error",
100-
"no-unused-expressions": ["error", { "allowTernary": true }],
101111
"no-unused-labels": "error",
102112
"no-var": "error",
103113
"object-shorthand": "error",

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
---
12
blank_issues_enabled: false
2-
contact_links:
3-
- name: Question
4-
url: https://stackoverflow.com/questions/tagged/typescript
5-
about: Please ask and answer questions here.
6-
- name: TypeScript FAQ
7-
url: https://github.com/microsoft/TypeScript/wiki/FAQ
8-
about: Please check the FAQ before filing new issues
9-
- name: Website
10-
url: https://github.com/microsoft/TypeScript-Website/issues/new
11-
about: Please raise issues about the site on it's own repo.
3+
contact_links:
4+
-
5+
about: "Please ask and answer usage questions on Stack Overflow."
6+
name: Question
7+
url: "https://stackoverflow.com/questions/tagged/typescript"
8+
-
9+
about: "Alternatively, you can use the TypeScript Community Discord."
10+
name: Chat
11+
url: "https://discord.gg/typescript"
12+
-
13+
about: "Please check the FAQ before filing new issues"
14+
name: "TypeScript FAQ"
15+
url: "https://github.com/microsoft/TypeScript/wiki/FAQ"
16+
-
17+
about: "Please raise issues about the site on it's own repo."
18+
name: Website
19+
url: "https://github.com/microsoft/TypeScript-Website/issues/new"

.github/pr_owners.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
sandersn
2+
elibarzilay
3+
weswigham
4+
andrewbranch
5+
RyanCavanaugh
6+
sheetalkamat
7+
orta
8+
rbuckton

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ jobs:
3535
npm install
3636
npm update
3737
npm test
38+
- name: Validate the browser can import TypeScript
39+
run: gulp test-browser-integration
40+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: New Release Branch
2+
3+
on:
4+
repository_dispatch:
5+
types: new-release-branch
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Use node version 12.x
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 12.x
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 5
19+
- run: |
20+
git checkout -b ${{ github.event.client_payload.branch_name }}
21+
sed -i -e 's/"version": ".*"/"version": "${{ github.event.client_payload.package_version }}"/g' package.json
22+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' src/compiler/corePublic.ts
23+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
24+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
25+
sed -i -e 's/const version = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts
26+
npm install
27+
gulp LKG
28+
npm test
29+
git diff
30+
git add package.json
31+
git add src/compiler/corePublic.ts
32+
git add tests/baselines/reference/api/typescript.d.ts
33+
git add tests/baselines/reference/api/tsserverlibrary.d.ts
34+
git add ./lib
35+
git config user.email "[email protected]"
36+
git config user.name "TypeScript Bot"
37+
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'
38+
git push --set-upstream origin ${{ github.event.client_payload.branch_name }}

.github/workflows/nightly.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish Nightly
2+
3+
on:
4+
schedule:
5+
- cron: '0 23 * * *'
6+
repository_dispatch:
7+
types: publish-nightly
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Use node version 12
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12
19+
registry-url: https://registry.npmjs.org/
20+
- name: Setup and publish nightly
21+
run: |
22+
npm whoami
23+
npm i
24+
gulp configure-nightly
25+
gulp LKG
26+
gulp runtests-parallel
27+
gulp clean
28+
npm publish --tag next
29+
env:
30+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
31+
CI: true
32+

.github/workflows/set-version.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Set branch version
2+
3+
on:
4+
repository_dispatch:
5+
types: set-version
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Use node version 12.x
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 12.x
16+
- uses: actions/checkout@v2
17+
with:
18+
ref: ${{ github.event.client_payload.branch_name }}
19+
# notably, this is essentially the same script as `new-release-branch.yaml` (with fewer inputs), but it assumes the branch already exists
20+
# do note that executing the transform below will prevent the `configurePrerelease` script from running on the source, as it makes the
21+
# `version` identifier no longer match the regex it uses
22+
# required client_payload members:
23+
# branch_name - the target branch
24+
# package_version - the full version string (eg, `3.9.1-rc` or `3.9.2`)
25+
# core_major_minor - the major.minor pair associated with the desired package_version (eg, `3.9` for `3.9.3`)
26+
- run: |
27+
sed -i -e 's/"version": ".*"/"version": "${{ github.event.client_payload.package_version }}"/g' package.json
28+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' src/compiler/corePublic.ts
29+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
30+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
31+
sed -i -e 's/const version = .*;/const version = "${{ github.event.client_payload.package_version }}" as string;/g' src/compiler/corePublic.ts
32+
npm install
33+
gulp LKG
34+
npm test
35+
git diff
36+
git add package.json
37+
git add src/compiler/corePublic.ts
38+
git add tests/baselines/reference/api/typescript.d.ts
39+
git add tests/baselines/reference/api/tsserverlibrary.d.ts
40+
git add ./lib
41+
git config user.email "[email protected]"
42+
git config user.name "TypeScript Bot"
43+
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'
44+
git push

.github/workflows/sync-branch.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Sync branch with master
2+
3+
on:
4+
repository_dispatch:
5+
types: sync-branch
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Use node version 12.x
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 12.x
16+
- uses: actions/checkout@v2
17+
with:
18+
ref: ${{ github.event.client_payload.branch_name }}
19+
# This does a test post-merge and only pushes the result if the test succeeds
20+
# required client_payload members:
21+
# branch_name - the target branch
22+
- run: |
23+
git config user.email "[email protected]"
24+
git config user.name "TypeScript Bot"
25+
git fetch origin master
26+
git merge master --no-ff
27+
npm install
28+
npm test
29+
git push

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"recommendations": [
3-
"dbaeumer.vscode-eslint"
3+
"dbaeumer.vscode-eslint",
4+
"rbuckton.tsserver-live-reload"
45
],
56

67
"unwantedRecommendations": [

CopyrightNotice.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*! *****************************************************************************
2-
Copyright (c) Microsoft Corporation. All rights reserved.
2+
Copyright (c) Microsoft Corporation. All rights reserved.
33
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
44
this file except in compliance with the License. You may obtain a copy of the
5-
License at http://www.apache.org/licenses/LICENSE-2.0
6-
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
77
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
88
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10-
MERCHANTABLITY OR NON-INFRINGEMENT.
11-
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
1212
See the Apache Version 2.0 License for specific language governing permissions
1313
and limitations under the License.
1414
***************************************************************************** */

Gulpfile.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,6 @@ const lintFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("lin
346346

347347
/** @type { (folder: string) => { (): Promise<any>; displayName?: string } } */
348348
const eslint = (folder) => async () => {
349-
const ESLINTRC_CI = ".eslintrc.ci.json";
350-
const isCIEnv = cmdLineOptions.ci || process.env.CI === "true";
351349

352350
const args = [
353351
"node_modules/eslint/bin/eslint",
@@ -358,13 +356,6 @@ const eslint = (folder) => async () => {
358356
"--ext", ".ts",
359357
];
360358

361-
if (
362-
isCIEnv &&
363-
fs.existsSync(path.resolve(folder, ESLINTRC_CI))
364-
) {
365-
args.push("--config", path.resolve(folder, ESLINTRC_CI));
366-
}
367-
368359
if (cmdLineOptions.fix) {
369360
args.push("--fix");
370361
}
@@ -417,7 +408,18 @@ task("generate-types-map", generateTypesMap);
417408
const cleanTypesMap = () => del("built/local/typesMap.json");
418409
cleanTasks.push(cleanTypesMap);
419410

420-
const buildOtherOutputs = parallel(buildCancellationToken, buildTypingsInstaller, buildWatchGuard, generateTypesMap);
411+
// Drop a copy of diagnosticMessages.generated.json into the built/local folder. This allows
412+
// it to be synced to the Azure DevOps repo, so that it can get picked up by the build
413+
// pipeline that generates the localization artifacts that are then fed into the translation process.
414+
const builtLocalDiagnosticMessagesGeneratedJson = "built/local/diagnosticMessages.generated.json";
415+
const copyBuiltLocalDiagnosticMessages = () => src(diagnosticMessagesGeneratedJson)
416+
.pipe(newer(builtLocalDiagnosticMessagesGeneratedJson))
417+
.pipe(dest("built/local"));
418+
419+
const cleanBuiltLocalDiagnosticMessages = () => del(builtLocalDiagnosticMessagesGeneratedJson);
420+
cleanTasks.push(cleanBuiltLocalDiagnosticMessages);
421+
422+
const buildOtherOutputs = parallel(buildCancellationToken, buildTypingsInstaller, buildWatchGuard, generateTypesMap, copyBuiltLocalDiagnosticMessages);
421423
task("other-outputs", series(preBuild, buildOtherOutputs));
422424
task("other-outputs").description = "Builds miscelaneous scripts and documents distributed with the LKG";
423425

@@ -439,7 +441,7 @@ const generateCodeCoverage = () => exec("istanbul", ["cover", "node_modules/moch
439441
task("generate-code-coverage", series(preBuild, buildTests, generateCodeCoverage));
440442
task("generate-code-coverage").description = "Generates code coverage data via istanbul";
441443

442-
const preTest = parallel(buildTests, buildServices, buildLssl);
444+
const preTest = parallel(buildTsc, buildTests, buildServices, buildLssl);
443445
preTest.displayName = "preTest";
444446

445447
const postTest = (done) => cmdLineOptions.lint ? lint(done) : done();
@@ -465,7 +467,7 @@ task("runtests").flags = {
465467
" --shardId": "1-based ID of this shard (default: 1)",
466468
};
467469

468-
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ true, /*watchMode*/ false);
470+
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ cmdLineOptions.workers > 1, /*watchMode*/ false);
469471
task("runtests-parallel", series(preBuild, preTest, runTestsParallel, postTest));
470472
task("runtests-parallel").description = "Runs all the tests in parallel using the built run.js file.";
471473
task("runtests-parallel").flags = {
@@ -481,6 +483,11 @@ task("runtests-parallel").flags = {
481483
" --shardId": "1-based ID of this shard (default: 1)",
482484
};
483485

486+
487+
task("test-browser-integration", () => exec(process.execPath, ["scripts/browserIntegrationTest.js"]));
488+
task("test-browser-integration").description = "Runs scripts/browserIntegrationTest.ts which tests that typescript.js loads in a browser";
489+
490+
484491
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true, waitForExit: false }));
485492
task("diff").description = "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable";
486493

lib/cancellationToken.js

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ja/diagnosticMessages.generated.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@
454454
"Generic_type_0_requires_1_type_argument_s_2314": "ジェネリック型 '{0}' には {1} 個の型引数が必要です。",
455455
"Generic_type_0_requires_between_1_and_2_type_arguments_2707": "ジェネリック型 '{0}' には、{1} 個から {2} 個までの型引数が必要です。",
456456
"Generic_type_instantiation_is_excessively_deep_and_possibly_infinite_2550": "ジェネリック型のインスタンス化は非常に深く、無限である可能性があります。",
457-
"Getter_and_setter_accessors_do_not_agree_in_visibility_2379": "ゲッターおよびセッターで表示が許可されていません",
457+
"Getter_and_setter_accessors_do_not_agree_in_visibility_2379": "ゲッターおよびセッターでの表示が許可されていません",
458458
"Global_module_exports_may_only_appear_at_top_level_1316": "グローバル モジュールのエクスポートは最上位レベルにのみ出現可能です。",
459459
"Global_module_exports_may_only_appear_in_declaration_files_1315": "グローバル モジュールのエクスポートは宣言ファイルにのみ出現可能です。",
460460
"Global_module_exports_may_only_appear_in_module_files_1314": "グローバル モジュールのエクスポートはモジュール ファイルにのみ出現可能です。",

lib/lib.es2015.symbol.wellknown.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*! *****************************************************************************
2-
Copyright (c) Microsoft Corporation. All rights reserved.
2+
Copyright (c) Microsoft Corporation. All rights reserved.
33
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
44
this file except in compliance with the License. You may obtain a copy of the
5-
License at http://www.apache.org/licenses/LICENSE-2.0
6-
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
77
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
88
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10-
MERCHANTABLITY OR NON-INFRINGEMENT.
11-
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
1212
See the Apache Version 2.0 License for specific language governing permissions
1313
and limitations under the License.
1414
***************************************************************************** */
@@ -91,7 +91,7 @@ interface Array<T> {
9191
* Returns an object whose properties have the value 'true'
9292
* when they will be absent when used in a 'with' statement.
9393
*/
94-
[Symbol.unscopables](): {
94+
[Symbol.unscopables]: {
9595
copyWithin: boolean;
9696
entries: boolean;
9797
fill: boolean;

0 commit comments

Comments
 (0)