Skip to content

Commit 7c241ba

Browse files
committed
Merge branch 'conditionalTypes' into inferTypes
# Conflicts: # src/compiler/checker.ts # tests/cases/fourslash/completionInJSDocFunctionNew.ts # tests/cases/fourslash/completionInJSDocFunctionThis.ts
2 parents 03a3847 + 01516c8 commit 7c241ba

397 files changed

Lines changed: 26428 additions & 8322 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ scripts/word2md.js
3939
scripts/buildProtocol.js
4040
scripts/ior.js
4141
scripts/authors.js
42-
scripts/configureNightly.js
42+
scripts/configurePrerelease.js
4343
scripts/processDiagnosticMessages.d.ts
4444
scripts/processDiagnosticMessages.js
4545
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js

.mailmap

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,13 @@ Zeeshan Ahmed <ziishaned@gmail.com>
291291
Orta <orta.therox+github@gmail.com> # Orta Therox
292292
IdeaHunter <admin@fckn.me> # @IdeaHunter
293293
kujon <jakub.korzeniowski@gmail.com> # Jakub Korzeniowski
294-
Matt <begincalendar@users.noreply.github.com> @begincalendar
294+
Matt <begincalendar@users.noreply.github.com> # @begincalendar
295295
meyer <github.com@meyer.fm> # @meyer
296296
micbou <contact@micbou.com> # @micbou
297297
Alan Agius <alan.agius4@gmail.com>
298298
Alex Khomchenko <akhomchenko@gmail.com>
299299
Oussama Ben Brahim <benbraou@gmail.com> benbraou <benbraou@users.noreply.github.com>
300300
Cameron Taggart <cameron.taggart@gmail.com>
301-
csigs <csigs@outlook.com> csigs <csigs@users.noreply.github.com>
302301
Eugene Timokhov <timocov@gmail.com>
303302
Kris Zyp <kriszyp@gmail.com>
304303
Jing Ma <mjingm87@qq.com>
@@ -311,4 +310,10 @@ Sharon Rolel <sharonrolel@gmail.com>
311310
Stanislav Iliev <gigobest2@gmail.com>
312311
Wenlu Wang <805037171@163.com> wenlu.wang <805037171@163.com> kingwl <805037171@163.com>
313312
Wilson Hobbs <wilsonhobbs1@gmail.com>
314-
Yuval Greenfield <ubershmekel@gmail.com>
313+
Yuval Greenfield <ubershmekel@gmail.com>
314+
Daniel <nieltg@users.noreply.github.com> # @nieltg
315+
Adnan Chowdhury <bttf@users.noreply.github.com>
316+
Esakki Raj <esakkiraj.tce@gmail.com>
317+
Jack Williams <jw@jackw.io>
318+
Philippe Voinov <philippevoinov@gmail.com>
319+
Stephan Ginthör <26004708+Lazarus535@users.noreply.github.com>

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ Jakefile.js
1818
.settings/
1919
.travis.yml
2020
.vscode/
21-
test.config
21+
test.config
22+
package-lock.json

AUTHORS.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ TypeScript is authored by:
33
* Abubaker Bashir
44
* Adam Freidin
55
* Adi Dahiya
6+
* Adnan Chowdhury
67
* Adrian Leonhard
78
* Ahmad Farid
89
* Akshar Patel
@@ -36,6 +37,7 @@ TypeScript is authored by:
3637
* Asad Saeeduddin
3738
* Avery Morin
3839
* Basarat Ali Syed
40+
* @begincalendar
3941
* Ben Duffield
4042
* Ben Mosher
4143
* Benjamin Bock
@@ -59,7 +61,6 @@ TypeScript is authored by:
5961
* Colby Russell
6062
* Colin Snover
6163
* Cotton Hou
62-
* csigs
6364
* Cyrus Najmabadi
6465
* Dafrok Zhang
6566
* Dahan Gong
@@ -87,6 +88,7 @@ TypeScript is authored by:
8788
* Eric Tsang
8889
* Erik Edrosa
8990
* Erik McClenney
91+
* Esakki Raj
9092
* Ethan Resnick
9193
* Ethan Rubio
9294
* Eugene Timokhov
@@ -124,6 +126,7 @@ TypeScript is authored by:
124126
* Ivan Enderlin
125127
* Ivo Gabe de Wolff
126128
* Iwata Hidetaka
129+
* Jack Williams
127130
* Jakub Korzeniowski
128131
* Jakub Młokosiewicz
129132
* James Henry
@@ -182,7 +185,6 @@ TypeScript is authored by:
182185
* Martin Hiller
183186
* Martin Vseticka
184187
* Masahiro Wakame
185-
* Matt
186188
* Matt Bierner
187189
* Matt McCutchen
188190
* Matt Mitchell
@@ -205,6 +207,7 @@ TypeScript is authored by:
205207
* Nathan Shively-Sanders
206208
* Nathan Yee
207209
* Nicolas Henry
210+
* @nieltg
208211
* Nima Zahedi
209212
* Noah Chen
210213
* Noel Varanda
@@ -223,6 +226,7 @@ TypeScript is authored by:
223226
* Perry Jiang
224227
* Peter Burns
225228
* Philip Bulley
229+
* Philippe Voinov
226230
* Piero Cangianiello
227231
* @piloopin
228232
* Prayag Verma
@@ -260,6 +264,7 @@ TypeScript is authored by:
260264
* Stanislav Iliev
261265
* Stanislav Sysoev
262266
* Stas Vilchik
267+
* Stephan Ginthör
263268
* Steve Lucco
264269
* Sudheesh Singanamalla
265270
* Sébastien Arod

Gulpfile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are:
11151115
const fileMatcher = cmdLineOptions.files;
11161116
const files = fileMatcher
11171117
? `src/**/${fileMatcher}`
1118-
: "Gulpfile.ts 'scripts/generateLocalizedDiagnosticMessages.ts' 'scripts/tslint/**/*.ts' 'src/**/*.ts' --exclude 'src/lib/*.d.ts'";
1118+
: `Gulpfile.ts "scripts/generateLocalizedDiagnosticMessages.ts" "scripts/tslint/**/*.ts" "src/**/*.ts" --exclude "src/lib/*.d.ts"`;
11191119
const cmd = `node node_modules/tslint/bin/tslint ${files} --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish`;
11201120
console.log("Linting: " + cmd);
11211121
child_process.execSync(cmd, { stdio: [0, 1, 2] });

Jakefile.js

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -556,16 +556,16 @@ desc("Generates a diagnostic file in TypeScript based on an input JSON file");
556556
task("generate-diagnostics", [diagnosticInfoMapTs]);
557557

558558
// Publish nightly
559-
var configureNightlyJs = path.join(scriptsDirectory, "configureNightly.js");
560-
var configureNightlyTs = path.join(scriptsDirectory, "configureNightly.ts");
559+
var configurePrereleaseJs = path.join(scriptsDirectory, "configurePrerelease.js");
560+
var configurePrereleaseTs = path.join(scriptsDirectory, "configurePrerelease.ts");
561561
var packageJson = "package.json";
562562
var versionFile = path.join(compilerDirectory, "core.ts");
563563

564-
file(configureNightlyTs);
564+
file(configurePrereleaseTs);
565565

566-
compileFile(/*outfile*/configureNightlyJs,
567-
/*sources*/[configureNightlyTs],
568-
/*prereqs*/[configureNightlyTs],
566+
compileFile(/*outfile*/configurePrereleaseJs,
567+
/*sources*/[configurePrereleaseTs],
568+
/*prereqs*/[configurePrereleaseTs],
569569
/*prefixes*/[],
570570
/*useBuiltCompiler*/ false,
571571
{ noOutFile: false, generateDeclarations: false, keepComments: false, noResolve: false, stripInternal: false });
@@ -574,8 +574,8 @@ task("setDebugMode", function () {
574574
useDebugMode = true;
575575
});
576576

577-
task("configure-nightly", [configureNightlyJs], function () {
578-
var cmd = host + " " + configureNightlyJs + " " + packageJson + " " + versionFile;
577+
task("configure-nightly", [configurePrereleaseJs], function () {
578+
var cmd = host + " " + configurePrereleaseJs + " dev " + packageJson + " " + versionFile;
579579
console.log(cmd);
580580
exec(cmd);
581581
}, { async: true });
@@ -587,6 +587,19 @@ task("publish-nightly", ["configure-nightly", "LKG", "clean", "setDebugMode", "r
587587
exec(cmd);
588588
});
589589

590+
task("configure-insiders", [configurePrereleaseJs], function () {
591+
var cmd = host + " " + configurePrereleaseJs + " insiders " + packageJson + " " + versionFile;
592+
console.log(cmd);
593+
exec(cmd);
594+
}, { async: true });
595+
596+
desc("Configure, build, test, and publish the insiders release.");
597+
task("publish-insiders", ["configure-insiders", "LKG", "clean", "setDebugMode", "runtests-parallel"], function () {
598+
var cmd = "npm publish --tag insiders";
599+
console.log(cmd);
600+
exec(cmd);
601+
});
602+
590603
var importDefinitelyTypedTestsDirectory = path.join(scriptsDirectory, "importDefinitelyTypedTests");
591604
var importDefinitelyTypedTestsJs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.js");
592605
var importDefinitelyTypedTestsTs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.ts");
@@ -1199,23 +1212,12 @@ task("update-sublime", ["local", serverFile], function () {
11991212
});
12001213

12011214
var tslintRuleDir = "scripts/tslint/rules";
1202-
var tslintRules = [
1203-
"booleanTriviaRule",
1204-
"debugAssertRule",
1205-
"nextLineRule",
1206-
"noBomRule",
1207-
"noDoubleSpaceRule",
1208-
"noIncrementDecrementRule",
1209-
"noInOperatorRule",
1210-
"noTypeAssertionWhitespaceRule",
1211-
"objectLiteralSurroundingSpaceRule",
1212-
"typeOperatorSpacingRule",
1213-
];
1215+
var tslintRules = fs.readdirSync(tslintRuleDir);
12141216
var tslintRulesFiles = tslintRules.map(function (p) {
1215-
return path.join(tslintRuleDir, p + ".ts");
1217+
return path.join(tslintRuleDir, p);
12161218
});
12171219
var tslintRulesOutFiles = tslintRules.map(function (p) {
1218-
return path.join(builtLocalDirectory, "tslint/rules", p + ".js");
1220+
return path.join(builtLocalDirectory, "tslint/rules", p.replace(".ts", ".js"));
12191221
});
12201222
var tslintFormattersDir = "scripts/tslint/formatters";
12211223
var tslintFormatters = [

issue_template.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
1-
<!-- BUGS: Please use this template. -->
2-
<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->
3-
<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->
1+
<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 -->
2+
<!--
3+
Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.
4+
5+
Please help us by doing the following steps before logging an issue:
6+
* Search: https://github.com/Microsoft/TypeScript/search?type=Issues
7+
* Read the CONTRIBUTING guidelines: https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md
8+
* Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ
9+
-->
10+
11+
<!-- If you have a QUESTION:
12+
THIS IS NOT A FORUM FOR QUESTIONS.
13+
Ask questions at http://stackoverflow.com/questions/tagged/typescript
14+
or https://gitter.im/Microsoft/TypeScript
15+
-->
16+
17+
<!-- If you have a SUGGESTION:
18+
Most suggestion reports are duplicates, please search extra hard before logging a new suggestion.
19+
See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md
20+
-->
21+
22+
<!-- If you have a BUG:
23+
Please fill in the *entire* template below.
24+
-->
425

526
<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
627
**TypeScript Version:** 2.7.0-dev.201xxxxx
728

29+
<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
30+
**Search Terms:**
31+
832
**Code**
933

1034
```ts
@@ -16,4 +40,6 @@
1640

1741
**Actual behavior:**
1842

19-
**Related:**
43+
**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
44+
45+
**Related Issues:**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typescript",
33
"author": "Microsoft Corp.",
44
"homepage": "http://typescriptlang.org/",
5-
"version": "2.7.0",
5+
"version": "2.8.0",
66
"license": "Apache-2.0",
77
"description": "TypeScript is a language for application scale JavaScript development",
88
"keywords": [

scripts/authors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ namespace Commands {
164164
}
165165
});
166166
};
167-
listAuthors.description = "List known and unknown authors for a given spec";
167+
listAuthors.description = "List known and unknown authors for a given spec, e.g. 'node authors.js listAuthors origin/release-2.6..origin/release-2.7'";
168168
}
169169

170170
var args = process.argv.slice(2);
Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,39 @@ interface PackageJson {
1111

1212
function main(): void {
1313
const sys = ts.sys;
14-
if (sys.args.length < 2) {
14+
if (sys.args.length < 3) {
1515
sys.write("Usage:" + sys.newLine)
16-
sys.write("\tnode configureNightly.js <package.json location> <file containing version>" + sys.newLine);
16+
sys.write("\tnode configureNightly.js <dev|insiders> <package.json location> <file containing version>" + sys.newLine);
1717
return;
1818
}
1919

20+
const tag = sys.args[0];
21+
if (tag !== "dev" && tag !== "insiders") {
22+
throw new Error(`Unexpected tag name '${tag}'.`);
23+
}
24+
2025
// Acquire the version from the package.json file and modify it appropriately.
21-
const packageJsonFilePath = ts.normalizePath(sys.args[0]);
26+
const packageJsonFilePath = ts.normalizePath(sys.args[1]);
2227
const packageJsonValue: PackageJson = JSON.parse(sys.readFile(packageJsonFilePath));
2328

2429
const { majorMinor, patch } = parsePackageJsonVersion(packageJsonValue.version);
25-
const nightlyPatch = getNightlyPatch(patch);
30+
const prereleasePatch = getPrereleasePatch(tag, patch);
2631

2732
// Acquire and modify the source file that exposes the version string.
28-
const tsFilePath = ts.normalizePath(sys.args[1]);
33+
const tsFilePath = ts.normalizePath(sys.args[2]);
2934
const tsFileContents = ts.sys.readFile(tsFilePath);
30-
const modifiedTsFileContents = updateTsFile(tsFilePath, tsFileContents, majorMinor, patch, nightlyPatch);
35+
const modifiedTsFileContents = updateTsFile(tsFilePath, tsFileContents, majorMinor, patch, prereleasePatch);
3136

3237
// Ensure we are actually changing something - the user probably wants to know that the update failed.
3338
if (tsFileContents === modifiedTsFileContents) {
34-
let err = `\n '${tsFilePath}' was not updated while configuring for a nightly publish.\n `;
39+
let err = `\n '${tsFilePath}' was not updated while configuring for a prerelease publish for '${tag}'.\n `;
3540
err += `Ensure that you have not already run this script; otherwise, erase your changes using 'git checkout -- "${tsFilePath}"'.`;
36-
throw err + "\n";
41+
throw new Error(err + "\n");
3742
}
3843

3944
// Finally write the changes to disk.
4045
// Modify the package.json structure
41-
packageJsonValue.version = `${majorMinor}.${nightlyPatch}`;
46+
packageJsonValue.version = `${majorMinor}.${prereleasePatch}`;
4247
sys.writeFile(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4))
4348
sys.writeFile(tsFilePath, modifiedTsFileContents);
4449
}
@@ -69,15 +74,15 @@ function parsePackageJsonVersion(versionString: string): { majorMinor: string, p
6974
}
7075

7176
/** e.g. 0-dev.20170707 */
72-
function getNightlyPatch(plainPatch: string): string {
77+
function getPrereleasePatch(tag: string, plainPatch: string): string {
7378
// We're going to append a representation of the current time at the end of the current version.
7479
// String.prototype.toISOString() returns a 24-character string formatted as 'YYYY-MM-DDTHH:mm:ss.sssZ',
7580
// but we'd prefer to just remove separators and limit ourselves to YYYYMMDD.
7681
// UTC time will always be implicit here.
7782
const now = new Date();
7883
const timeStr = now.toISOString().replace(/:|T|\.|-/g, "").slice(0, 8);
7984

80-
return `${plainPatch}-dev.${timeStr}`;
85+
return `${plainPatch}-${tag}.${timeStr}`;
8186
}
8287

8388
main();

0 commit comments

Comments
 (0)