Skip to content

Commit 15b01fd

Browse files
committed
Merge branch 'master' into feat/17227
2 parents aa4e38e + 3da5982 commit 15b01fd

File tree

2,823 files changed

+361610
-119130
lines changed

Some content is hidden

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

2,823 files changed

+361610
-119130
lines changed

.devcontainer/Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.154.0/containers/javascript-node/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Node.js version: 14, 12, 10
4+
ARG VARIANT="14-buster"
5+
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
6+
7+
RUN sudo -u node npm install -g gulp-cli

.devcontainer/devcontainer.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Node.js",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"VARIANT": "14"
7+
}
8+
},
9+
"settings": {
10+
"terminal.integrated.shell.linux": "/bin/bash"
11+
},
12+
"extensions": [
13+
"dbaeumer.vscode-eslint"
14+
],
15+
"remoteUser": "node"
16+
}

.github/ISSUE_TEMPLATE/Bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If possible, please try testing the nightly version of TS to see if it's already
2929
For npm: `typescript@next`
3030
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
3131
32-
Note: The TypeScript Playground can be used to try older verions of TypeScript.
32+
Note: The TypeScript Playground can be used to try older versions of TypeScript.
3333
3434
Please keep and fill in the line that best applies:
3535
-->

.github/workflows/new-release-branch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' src/compiler/corePublic.ts
2323
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
2424
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
25+
sed -i -e 's/const version\(: string\)\{0,1\} = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts
2626
npm ci
2727
gulp LKG
2828
npm test

.github/workflows/set-version.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' src/compiler/corePublic.ts
2929
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
3030
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
31+
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "${{ github.event.client_payload.package_version }}" as string;/g' src/compiler/corePublic.ts
3232
npm ci
3333
gulp LKG
3434
npm test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ tests/baselines/reference/dt
8585
.failed-tests
8686
TEST-results.xml
8787
package-lock.json
88+
tests/cases/user/npm/npm
8889
tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter
8990
tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter
9091
tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ scripts
1010
src
1111
tests
1212
Jakefile.js
13+
.devcontainer
1314
.eslintrc
1415
.eslintignore
1516
.editorconfig

.travis.yml

-28
This file was deleted.

CONTRIBUTING.md

+22-6
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ In general, things we find useful when reviewing suggestions are:
7070

7171
## Tips
7272

73+
### Using a development container
74+
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:
76+
77+
- Clone the TypeScript repository locally and use the `Open Folder in Container` command.
78+
- Use the `Clone Repository in Container Volume` command to clone the TypeScript repository into a new container.
79+
7380
### Faster clones
7481

7582
The TypeScript repository is relatively large. To save some time, you might want to clone it without the repo's full history using `git clone --depth=1`.
@@ -153,17 +160,17 @@ gulp runtests --tests=2dArrays
153160

154161
## Debugging the tests
155162

156-
You can debug with VS Code or Node instead with `gulp runtests --inspect`:
163+
You can debug with VS Code or Node instead with `gulp runtests -i`:
157164

158165
```Shell
159-
gulp runtests --tests=2dArrays --inspect
166+
gulp runtests --tests=2dArrays -i
160167
```
161168

162169
You can also use the [provided VS Code launch configuration](./.vscode/launch.template.json) to launch a debug session for an open test file. Rename the file 'launch.json', open the test file of interest, and launch the debugger from the debug panel (or press F5).
163170

164171
## Adding a Test
165172

166-
To add a new test case, add a `.ts` file in `tests\cases\compiler` with code that shows the your bug is now fixed, or your new feature now works.
173+
To add a new test case, add a `.ts` file in `tests\cases\compiler` with code that shows the bug is now fixed, or your new feature now works.
167174

168175
These files support metadata tags in the format `// @metaDataName: value`.
169176
The supported names and values are the same as those supported in the compiler itself, with the addition of the `fileName` flag.
@@ -189,16 +196,25 @@ import { f as g } from "file1";
189196
var x = g();
190197
```
191198

192-
## Managing the Baselines
199+
## Managing the baselines
193200

194-
Compiler tests generate baselines: one file each for the emitted `.js`, the errors produced by the compiler, the type of each expression, and symbol for each identifier. Additionally, some tests generate baselines for the source map output.
201+
Most tests generate "baselines" to find differences in output.
202+
As an example, compiler tests usually emit one file each for
203+
204+
- the `.js` and `.d.ts` output (all in the same `.js` output file),
205+
- the errors produced by the compiler (in an `.errors.txt` file),
206+
- the types of each expression (in a `.types` file),
207+
- the symbols for each identifier (in a `.symbols` file), and
208+
- the source map outputs for files if a test opts into them (in a `.js.map` file).
195209

196210
When a change in the baselines is detected, the test will fail. To inspect changes vs the expected baselines, use
197211

198212
```Shell
199-
gulp diff
213+
git diff --diff-filter=AM --no-index ./tests/baselines/reference ./tests/baselines/local
200214
```
201215

216+
Alternatively, you can set the `DIFF` environment variable and run `gulp diff`, or manually run your favorite folder diffing tool between `tests/baselines/reference` and `tests/baselines/local`. Our team largely uses Beyond Compare and WinMerge.
217+
202218
After verifying that the changes in the baselines are correct, run
203219

204220
```Shell

Gulpfile.js

+6-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const log = require("fancy-log");
55
const newer = require("gulp-newer");
66
const sourcemaps = require("gulp-sourcemaps");
77
const del = require("del");
8-
const fold = require("travis-fold");
98
const rename = require("gulp-rename");
109
const concat = require("gulp-concat");
1110
const merge2 = require("merge2");
@@ -346,9 +345,6 @@ const runEslintRulesTests = () => runConsoleTests("scripts/eslint/built/tests",
346345
task("run-eslint-rules-tests", series(buildEslintRules, runEslintRulesTests));
347346
task("run-eslint-rules-tests").description = "Runs the eslint rule tests";
348347

349-
const lintFoldStart = async () => { if (fold.isTravis()) console.log(fold.start("lint")); };
350-
const lintFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("lint")); };
351-
352348
/** @type { (folder: string) => { (): Promise<any>; displayName?: string } } */
353349
const eslint = (folder) => async () => {
354350

@@ -374,20 +370,20 @@ const eslint = (folder) => async () => {
374370

375371
const lintScripts = eslint("scripts");
376372
lintScripts.displayName = "lint-scripts";
377-
task("lint-scripts", series([buildEslintRules, lintFoldStart, lintScripts, lintFoldEnd]));
373+
task("lint-scripts", series([buildEslintRules, lintScripts]));
378374
task("lint-scripts").description = "Runs eslint on the scripts sources.";
379375

380376
const lintCompiler = eslint("src");
381377
lintCompiler.displayName = "lint-compiler";
382-
task("lint-compiler", series([buildEslintRules, lintFoldStart, lintCompiler, lintFoldEnd]));
378+
task("lint-compiler", series([buildEslintRules, lintCompiler]));
383379
task("lint-compiler").description = "Runs eslint on the compiler sources.";
384380
task("lint-compiler").flags = {
385381
" --ci": "Runs eslint additional rules",
386382
};
387383

388-
const lint = series([buildEslintRules, lintFoldStart, lintScripts, lintCompiler, lintFoldEnd]);
384+
const lint = series([buildEslintRules, lintScripts, lintCompiler]);
389385
lint.displayName = "lint";
390-
task("lint", series([buildEslintRules, lintFoldStart, lint, lintFoldEnd]));
386+
task("lint", series([buildEslintRules, lint]));
391387
task("lint").description = "Runs eslint on the compiler and scripts sources.";
392388
task("lint").flags = {
393389
" --ci": "Runs eslint additional rules",
@@ -429,9 +425,7 @@ const buildOtherOutputs = parallel(buildCancellationToken, buildTypingsInstaller
429425
task("other-outputs", series(preBuild, buildOtherOutputs));
430426
task("other-outputs").description = "Builds miscelaneous scripts and documents distributed with the LKG";
431427

432-
const buildFoldStart = async () => { if (fold.isTravis()) console.log(fold.start("build")); };
433-
const buildFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("build")); };
434-
task("local", series(buildFoldStart, preBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildOtherOutputs), buildFoldEnd));
428+
task("local", series(preBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildOtherOutputs)));
435429
task("local").description = "Builds the full compiler and services";
436430
task("local").flags = {
437431
" --built": "Compile using the built version of the compiler."
@@ -459,8 +453,7 @@ task("runtests").flags = {
459453
"-t --tests=<regex>": "Pattern for tests to run.",
460454
" --failed": "Runs tests listed in '.failed-tests'.",
461455
"-r --reporter=<reporter>": "The mocha reporter to use.",
462-
"-d --debug": "Runs tests in debug mode (NodeJS 6 and earlier)",
463-
"-i --inspect": "Runs tests in inspector mode (NodeJS 8 and later)",
456+
"-i --break": "Runs tests in inspector mode (NodeJS 8 and later)",
464457
" --keepFailed": "Keep tests in .failed-tests even if they pass",
465458
" --light": "Run tests in light mode (fewer verifications, but tests run faster)",
466459
" --dirty": "Run tests without first cleaning test output directories",

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# TypeScript
33

4-
[![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/microsoft/TypeScript)
4+
[![GitHub Actions CI](https://github.com/microsoft/TypeScript/workflows/CI/badge.svg)](https://github.com/microsoft/TypeScript/actions?query=workflow%3ACI)
55
[![Devops Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build?definitionId=7)
66
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
77
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)

0 commit comments

Comments
 (0)