Skip to content

Commit 47fbc47

Browse files
committed
Merge branch 'master' into conditional-type-simpliciations
2 parents d60667e + f776bea commit 47fbc47

File tree

322 files changed

+27680
-13540
lines changed

Some content is hidden

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

322 files changed

+27680
-13540
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Here's a checklist you might find useful.
55
* [ ] There is an associated issue that is labeled
66
'Bug' or 'help wanted' or is in the Community milestone
77
* [ ] Code is up-to-date with the `master` branch
8-
* [ ] You've successfully run `jake runtests` locally
8+
* [ ] You've successfully run `gulp runtests` locally
99
* [ ] You've signed the CLA
1010
* [ ] There are new or updated unit tests validating the change
1111

.npmignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ tests
1212
tslint.json
1313
Jakefile.js
1414
.editorconfig
15+
.failed-tests
16+
.git
17+
.git/
1518
.gitattributes
19+
.github/
1620
.gitmodules
1721
.settings/
1822
.travis.yml
@@ -23,6 +27,5 @@ Jakefile.js
2327
test.config
2428
package-lock.json
2529
yarn.lock
26-
.github/
2730
CONTRIBUTING.md
2831
TEST-results.xml

CONTRIBUTING.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Any changes should be made to [src/lib](https://github.com/Microsoft/TypeScript/
104104
Library files in `built/local/` are updated automatically by running the standard build task:
105105

106106
```sh
107-
jake
107+
gulp
108108
```
109109

110110
The files in `lib/` are used to bootstrap compilation and usually **should not** be updated unless publishing a new version or updating the LKG.
@@ -115,49 +115,49 @@ The files `src/lib/dom.generated.d.ts` and `src/lib/webworker.generated.d.ts` bo
115115

116116
## Running the Tests
117117

118-
To run all tests, invoke the `runtests-parallel` target using jake:
118+
To run all tests, invoke the `runtests-parallel` target using gulp:
119119

120120
```Shell
121-
jake runtests-parallel
121+
gulp runtests-parallel
122122
```
123123

124124
This will run all tests; to run only a specific subset of tests, use:
125125

126126
```Shell
127-
jake runtests tests=<regex>
127+
gulp runtests --tests=<regex>
128128
```
129129

130130
e.g. to run all compiler baseline tests:
131131

132132
```Shell
133-
jake runtests tests=compiler
133+
gulp runtests --tests=compiler
134134
```
135135

136136
or to run a specific test: `tests\cases\compiler\2dArrays.ts`
137137

138138
```Shell
139-
jake runtests tests=2dArrays
139+
gulp runtests --tests=2dArrays
140140
```
141141

142142
## Debugging the tests
143143

144-
To debug the tests, invoke the `runtests-browser` task from jake.
144+
To debug the tests, invoke the `runtests-browser` task from gulp.
145145
You will probably only want to debug one test at a time:
146146

147147
```Shell
148-
jake runtests-browser tests=2dArrays
148+
gulp runtests-browser --tests=2dArrays
149149
```
150150

151151
You can specify which browser to use for debugging. Currently Chrome and IE are supported:
152152

153153
```Shell
154-
jake runtests-browser tests=2dArrays browser=chrome
154+
gulp runtests-browser --tests=2dArrays --browser=chrome
155155
```
156156

157-
You can debug with VS Code or Node instead with `jake runtests inspect=true`:
157+
You can debug with VS Code or Node instead with `gulp runtests --inspect=true`:
158158

159159
```Shell
160-
jake runtests tests=2dArrays inspect=true
160+
gulp runtests --tests=2dArrays --inspect=true
161161
```
162162

163163
## Adding a Test
@@ -197,20 +197,20 @@ Compiler testcases generate baselines that track the emitted `.js`, the errors p
197197
When a change in the baselines is detected, the test will fail. To inspect changes vs the expected baselines, use
198198

199199
```Shell
200-
jake diff
200+
gulp diff
201201
```
202202

203203
After verifying that the changes in the baselines are correct, run
204204

205205
```Shell
206-
jake baseline-accept
206+
gulp baseline-accept
207207
```
208208

209209
to establish the new baselines as the desired behavior. This will change the files in `tests\baselines\reference`, which should be included as part of your commit. It's important to carefully validate changes in the baselines.
210210

211211
## Localization
212212

213213
All strings the user may see are stored in [`diagnosticMessages.json`](./src/compiler/diagnosticMessages.json).
214-
If you make changes to it, run `jake generate-diagnostics` to push them to the `Diagnostic` interface in `diagnosticInformationMap.generated.ts`.
214+
If you make changes to it, run `gulp generate-diagnostics` to push them to the `Diagnostic` interface in `diagnosticInformationMap.generated.ts`.
215215

216216
See [coding guidelines on diagnostic messages](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#diagnostic-messages).

Gulpfile.js

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ task("watch-tsserver").flags = {
232232
" --built": "Compile using the built version of the compiler."
233233
}
234234

235-
task("min", series(lkgPreBuild, parallel(buildTsc, buildServer)));
235+
task("min", series(preBuild, parallel(buildTsc, buildServer)));
236236
task("min").description = "Builds only tsc and tsserver";
237237
task("min").flags = {
238238
" --built": "Compile using the built version of the compiler."
@@ -373,9 +373,34 @@ task("lint").flags = {
373373
" --f[iles]=<regex>": "pattern to match files to lint",
374374
};
375375

376+
const buildCancellationToken = () => buildProject("src/cancellationToken");
377+
const cleanCancellationToken = () => cleanProject("src/cancellationToken");
378+
cleanTasks.push(cleanCancellationToken);
379+
380+
const buildTypingsInstaller = () => buildProject("src/typingsInstaller");
381+
const cleanTypingsInstaller = () => cleanProject("src/typingsInstaller");
382+
cleanTasks.push(cleanTypingsInstaller);
383+
384+
const buildWatchGuard = () => buildProject("src/watchGuard");
385+
const cleanWatchGuard = () => cleanProject("src/watchGuard");
386+
cleanTasks.push(cleanWatchGuard);
387+
388+
const generateTypesMap = () => src("src/server/typesMap.json")
389+
.pipe(newer("built/local/typesMap.json"))
390+
.pipe(transform(contents => (JSON.parse(contents), contents))) // validates typesMap.json is valid JSON
391+
.pipe(dest("built/local"));
392+
task("generate-types-map", generateTypesMap);
393+
394+
const cleanTypesMap = () => del("built/local/typesMap.json");
395+
cleanTasks.push(cleanTypesMap);
396+
397+
const buildOtherOutputs = parallel(buildCancellationToken, buildTypingsInstaller, buildWatchGuard, generateTypesMap);
398+
task("other-outputs", series(preBuild, buildOtherOutputs));
399+
task("other-outputs").description = "Builds miscelaneous scripts and documents distributed with the LKG";
400+
376401
const buildFoldStart = async () => { if (fold.isTravis()) console.log(fold.start("build")); };
377402
const buildFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("build")); };
378-
task("local", series(buildFoldStart, lkgPreBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl), buildFoldEnd));
403+
task("local", series(buildFoldStart, preBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildOtherOutputs), buildFoldEnd));
379404
task("local").description = "Builds the full compiler and services";
380405
task("local").flags = {
381406
" --built": "Compile using the built version of the compiler."
@@ -473,22 +498,23 @@ task("diff").description = "Diffs the compiler baselines using the diff tool spe
473498
task("diff-rwc", () => exec(getDiffTool(), [refRwcBaseline, localRwcBaseline], { ignoreExitCode: true }));
474499
task("diff-rwc").description = "Diffs the RWC baselines using the diff tool specified by the 'DIFF' environment variable";
475500

476-
const baselineAccept = subfolder => merge2(
477-
src([`${localBaseline}${subfolder ? `${subfolder}/` : ``}**`, `!${localBaseline}${subfolder}/**/*.delete`], { base: localBaseline })
501+
/**
502+
* @param {string} localBaseline Path to the local copy of the baselines
503+
* @param {string} refBaseline Path to the reference copy of the baselines
504+
*/
505+
const baselineAccept = (localBaseline, refBaseline) => merge2(
506+
src([`${localBaseline}/**`, `!${localBaseline}/**/*.delete`], { base: localBaseline })
478507
.pipe(dest(refBaseline)),
479-
src([`${localBaseline}${subfolder ? `${subfolder}/` : ``}**/*.delete`], { base: localBaseline, read: false })
508+
src([`${localBaseline}/**/*.delete`], { base: localBaseline, read: false })
480509
.pipe(rm())
481510
.pipe(rename({ extname: "" }))
482511
.pipe(rm(refBaseline)));
483-
task("baseline-accept", () => baselineAccept(""));
512+
task("baseline-accept", () => baselineAccept(localBaseline, refBaseline));
484513
task("baseline-accept").description = "Makes the most recent test results the new baseline, overwriting the old baseline";
485514

486-
task("baseline-accept-rwc", () => baselineAccept("rwc"));
515+
task("baseline-accept-rwc", () => baselineAccept(localRwcBaseline, refRwcBaseline));
487516
task("baseline-accept-rwc").description = "Makes the most recent rwc test results the new baseline, overwriting the old baseline";
488517

489-
task("baseline-accept-test262", () => baselineAccept("test262"));
490-
task("baseline-accept-test262").description = "Makes the most recent test262 test results the new baseline, overwriting the old baseline";
491-
492518
// TODO(rbuckton): Determine if 'webhost' is still in use.
493519
const buildWebHost = () => buildProject("tests/webhost/webtsc.tsconfig.json");
494520
task("webhost", series(lkgPreBuild, buildWebHost));
@@ -550,28 +576,6 @@ const buildReleaseTsc = () => buildProject("src/tsc/tsconfig.release.json");
550576
const cleanReleaseTsc = () => cleanProject("src/tsc/tsconfig.release.json");
551577
cleanTasks.push(cleanReleaseTsc);
552578

553-
const buildCancellationToken = () => buildProject("src/cancellationToken");
554-
const cleanCancellationToken = () => cleanProject("src/cancellationToken");
555-
cleanTasks.push(cleanCancellationToken);
556-
557-
const buildTypingsInstaller = () => buildProject("src/typingsInstaller");
558-
const cleanTypingsInstaller = () => cleanProject("src/typingsInstaller");
559-
cleanTasks.push(cleanTypingsInstaller);
560-
561-
const buildWatchGuard = () => buildProject("src/watchGuard");
562-
const cleanWatchGuard = () => cleanProject("src/watchGuard");
563-
cleanTasks.push(cleanWatchGuard);
564-
565-
// TODO(rbuckton): This task isn't triggered by any other task. Is it still needed?
566-
const generateTypesMap = () => src("src/server/typesMap.json")
567-
.pipe(newer("built/local/typesMap.json"))
568-
.pipe(transform(contents => (JSON.parse(contents), contents))) // validates typesMap.json is valid JSON
569-
.pipe(dest("built/local"));
570-
task("generate-types-map", generateTypesMap);
571-
572-
const cleanTypesMap = () => del("built/local/typesMap.json");
573-
cleanTasks.push(cleanTypesMap);
574-
575579
const cleanBuilt = () => del("built");
576580

577581
const produceLKG = async () => {
@@ -601,7 +605,7 @@ const produceLKG = async () => {
601605
}
602606
};
603607

604-
task("LKG", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildCancellationToken, buildTypingsInstaller, buildWatchGuard, buildReleaseTsc), produceLKG));
608+
task("LKG", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildOtherOutputs, buildReleaseTsc), produceLKG));
605609
task("LKG").description = "Makes a new LKG out of the built js files";
606610
task("LKG").flags = {
607611
" --built": "Compile using the built version of the compiler.",

0 commit comments

Comments
 (0)