Skip to content

Commit e59c3e6

Browse files
committed
Merge branch 'master' into nestedConditionalTypes
2 parents 8931791 + 8fe8284 commit e59c3e6

File tree

749 files changed

+39520
-10932
lines changed

Some content is hidden

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

749 files changed

+39520
-10932
lines changed

.eslintrc.json

+11-1
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/workflows/ci.yml

+3
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+
+38
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

+32
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+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Create Releasable Package Drop
2+
3+
on:
4+
push:
5+
branches:
6+
- release-*
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Use node version 12
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 12
18+
- name: Remove existing TypeScript
19+
run: |
20+
npm uninstall typescript --no-save
21+
npm uninstall tslint --no-save
22+
- name: npm install and test
23+
run: |
24+
npm install
25+
npm update
26+
npm test
27+
env:
28+
CI: true
29+
- name: Validate the browser can import TypeScript
30+
run: gulp test-browser-integration
31+
- name: LKG, clean, and pack
32+
run: |
33+
gulp LKG
34+
gulp clean
35+
npm pack ./
36+
mv typescript-*.tgz typescript.tgz
37+
env:
38+
CI: true
39+
- name: Upload built tarfile
40+
uses: actions/upload-artifact@v1
41+
with:
42+
name: tgz
43+
path: typescript.tgz
44+

.github/workflows/set-version.yaml

+44
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

+29
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

CONTRIBUTING.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ Design changes will not be accepted at this time. If you have a design change pr
6969

7070
## Legal
7171

72-
You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright.
73-
74-
Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.pdf](https://opensource.microsoft.com/pdf/microsoft-contribution-license-agreement.pdf)), sign, scan, and email it back to <[email protected]>. Be sure to include your GitHub user name along with the agreement. Once we have received the signed CLA, we'll review the request.
72+
You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. Upon submitting a pull request, you will automatically be given instructions on how to sign the CLA.
7573

7674
## Housekeeping
7775

CopyrightNotice.txt

+6-6
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

+19-3
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,18 @@ task("generate-types-map", generateTypesMap);
408408
const cleanTypesMap = () => del("built/local/typesMap.json");
409409
cleanTasks.push(cleanTypesMap);
410410

411-
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);
412423
task("other-outputs", series(preBuild, buildOtherOutputs));
413424
task("other-outputs").description = "Builds miscelaneous scripts and documents distributed with the LKG";
414425

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

433-
const preTest = parallel(buildTests, buildServices, buildLssl);
444+
const preTest = parallel(buildTsc, buildTests, buildServices, buildLssl);
434445
preTest.displayName = "preTest";
435446

436447
const postTest = (done) => cmdLineOptions.lint ? lint(done) : done();
@@ -456,7 +467,7 @@ task("runtests").flags = {
456467
" --shardId": "1-based ID of this shard (default: 1)",
457468
};
458469

459-
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);
460471
task("runtests-parallel", series(preBuild, preTest, runTestsParallel, postTest));
461472
task("runtests-parallel").description = "Runs all the tests in parallel using the built run.js file.";
462473
task("runtests-parallel").flags = {
@@ -472,6 +483,11 @@ task("runtests-parallel").flags = {
472483
" --shardId": "1-based ID of this shard (default: 1)",
473484
};
474485

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+
475491
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true, waitForExit: false }));
476492
task("diff").description = "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable";
477493

package.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typescript",
33
"author": "Microsoft Corp.",
44
"homepage": "https://www.typescriptlang.org/",
5-
"version": "3.8.0",
5+
"version": "3.9.0",
66
"license": "Apache-2.0",
77
"description": "TypeScript is a language for application scale JavaScript development",
88
"keywords": [
@@ -54,9 +54,9 @@
5454
"@types/through2": "latest",
5555
"@types/travis-fold": "latest",
5656
"@types/xml2js": "^0.4.0",
57-
"@typescript-eslint/eslint-plugin": "2.3.2",
58-
"@typescript-eslint/experimental-utils": "2.3.2",
59-
"@typescript-eslint/parser": "2.3.2",
57+
"@typescript-eslint/eslint-plugin": "2.18.0",
58+
"@typescript-eslint/experimental-utils": "2.18.0",
59+
"@typescript-eslint/parser": "2.18.0",
6060
"async": "latest",
6161
"azure-devops-node-api": "^8.0.0",
6262
"browser-resolve": "^1.11.2",
@@ -65,10 +65,10 @@
6565
"chalk": "latest",
6666
"convert-source-map": "latest",
6767
"del": "5.1.0",
68-
"eslint": "6.5.1",
69-
"eslint-formatter-autolinkable-stylish": "1.0.3",
70-
"eslint-plugin-import": "2.18.2",
71-
"eslint-plugin-jsdoc": "15.9.9",
68+
"eslint": "6.8.0",
69+
"eslint-formatter-autolinkable-stylish": "1.1.1",
70+
"eslint-plugin-import": "2.20.0",
71+
"eslint-plugin-jsdoc": "21.0.0",
7272
"eslint-plugin-no-null": "1.0.2",
7373
"fancy-log": "latest",
7474
"fs-extra": "^6.0.1",
@@ -87,6 +87,7 @@
8787
"mocha-fivemat-progress-reporter": "latest",
8888
"ms": "latest",
8989
"node-fetch": "^2.6.0",
90+
"playwright": "latest",
9091
"plugin-error": "latest",
9192
"pretty-hrtime": "^1.0.3",
9293
"prex": "^0.4.3",

0 commit comments

Comments
 (0)