Skip to content

Commit 43cebe3

Browse files
author
Andy Hanson
committed
Merge branch 'master' into createRange
2 parents 964218b + 657d011 commit 43cebe3

File tree

2,850 files changed

+564221
-533582
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,850 files changed

+564221
-533582
lines changed

.github/ISSUE_TEMPLATE/Bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Please fill in the *entire* template below.
1616
-->
1717

1818
<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
19-
**TypeScript Version:** 2.9.0-dev.201xxxxx
19+
**TypeScript Version:** 3.0.0-dev.201xxxxx
2020

2121
<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
2222
**Search Terms:**

.github/issue_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Please help us by doing the following steps before logging an issue:
2424
-->
2525

2626
<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
27-
**TypeScript Version:** 2.9.0-dev.201xxxxx
27+
**TypeScript Version:** 3.0.0-dev.201xxxxx
2828

2929
<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
3030
**Search Terms:**

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ tests/services/browser/typescriptServices.js
2323
src/harness/*.js
2424
src/compiler/diagnosticInformationMap.generated.ts
2525
src/compiler/diagnosticMessages.generated.json
26+
src/parser/diagnosticInformationMap.generated.ts
27+
src/parser/diagnosticMessages.generated.json
2628
rwc-report.html
2729
*.swp
2830
build.json
@@ -44,6 +46,7 @@ scripts/configurePrerelease.js
4446
scripts/open-user-pr.js
4547
scripts/processDiagnosticMessages.d.ts
4648
scripts/processDiagnosticMessages.js
49+
scripts/produceLKG.js
4750
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
4851
scripts/generateLocalizedDiagnosticMessages.js
4952
scripts/*.js.map

.mailmap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,4 +340,5 @@ Paul Koerbitz <[email protected]>
340340
EcoleKeine <[email protected]> # Ecole Keine
341341
342342
rhysd <[email protected]> # @rhysd
343-
Zen <[email protected]> Zzzen <[email protected]> # @Zzzen
343+
Zen <[email protected]> Zzzen <[email protected]> # @Zzzen
344+
bluelovers <[email protected]> # @bluelovers

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
built
22
doc
3-
Gulpfile.ts
3+
Gulpfile.js
44
internal
55
jenkins.sh
66
lib/README.md
@@ -23,3 +23,4 @@ test.config
2323
package-lock.json
2424
yarn.lock
2525
.github/
26+
CONTRIBUTING.md

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ TypeScript is authored by:
5252
* Bill Ticehurst
5353
* Blaine Bublitz
5454
* Blake Embrey
55+
* @bluelovers
5556
* @bootstraponline
5657
* Bowden Kelly
5758
* Bowden Kenny

Gulpfile.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const concat = require("gulp-concat");
1111
const clone = require("gulp-clone");
1212
const newer = require("gulp-newer");
1313
const tsc = require("gulp-typescript");
14+
const tsc_oop = require("./scripts/build/gulp-typescript-oop");
15+
const getDirSize = require("./scripts/build/getDirSize");
1416
const insert = require("gulp-insert");
1517
const sourcemaps = require("gulp-sourcemaps");
1618
const Q = require("q");
@@ -36,7 +38,7 @@ const constEnumCaptureRegexp = /^(\s*)(export )?const enum (\S+) {(\s*)$/gm;
3638
const constEnumReplacement = "$1$2enum $3 {$4";
3739

3840
const cmdLineOptions = minimist(process.argv.slice(2), {
39-
boolean: ["debug", "inspect", "light", "colors", "lint", "soft"],
41+
boolean: ["debug", "inspect", "light", "colors", "lint", "soft", "fix"],
4042
string: ["browser", "tests", "host", "reporter", "stackTraceLimit", "timeout"],
4143
alias: {
4244
"b": "browser",
@@ -47,6 +49,7 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
4749
"r": "reporter",
4850
"c": "colors", "color": "colors",
4951
"w": "workers",
52+
"f": "fix",
5053
},
5154
default: {
5255
soft: false,
@@ -61,6 +64,7 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
6164
light: process.env.light === undefined || process.env.light !== "false",
6265
reporter: process.env.reporter || process.env.r,
6366
lint: process.env.lint || true,
67+
fix: process.env.fix || process.env.f,
6468
workers: process.env.workerCount || os.cpus().length,
6569
}
6670
});
@@ -260,6 +264,7 @@ function getCompilerSettings(base, useBuiltCompiler) {
260264
for (const key in base) {
261265
copy[key] = base[key];
262266
}
267+
copy.strictNullChecks = true;
263268
if (!useDebugMode) {
264269
if (copy.removeComments === undefined) copy.removeComments = true;
265270
}
@@ -409,6 +414,10 @@ function prependCopyright(outputCopyright = !useDebugMode) {
409414
return insert.prepend(outputCopyright ? (copyrightContent || (copyrightContent = fs.readFileSync(copyright).toString())) : "");
410415
}
411416

417+
function getCompilerPath(useBuiltCompiler) {
418+
return useBuiltCompiler ? "./built/local/typescript.js" : "./lib/typescript.js";
419+
}
420+
412421
gulp.task(builtLocalCompiler, /*help*/ false, [servicesFile], () => {
413422
const localCompilerProject = tsc.createProject("src/compiler/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/ true));
414423
return localCompilerProject.src()
@@ -421,7 +430,7 @@ gulp.task(builtLocalCompiler, /*help*/ false, [servicesFile], () => {
421430
});
422431

423432
gulp.task(servicesFile, /*help*/ false, ["lib", "generate-diagnostics"], () => {
424-
const servicesProject = tsc.createProject("src/services/tsconfig.json", getCompilerSettings({ removeComments: false }, /*useBuiltCompiler*/ false));
433+
const servicesProject = tsc_oop.createProject("src/services/tsconfig.json", getCompilerSettings({ removeComments: false }), { typescript: getCompilerPath(/*useBuiltCompiler*/ false) });
425434
const {js, dts} = servicesProject.src()
426435
.pipe(newer(servicesFile))
427436
.pipe(sourcemaps.init())
@@ -496,7 +505,7 @@ const tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js")
496505
const tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts");
497506

498507
gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile, typesMapJson], (done) => {
499-
const serverLibraryProject = tsc.createProject("src/server/tsconfig.library.json", getCompilerSettings({ removeComments: false }, /*useBuiltCompiler*/ true));
508+
const serverLibraryProject = tsc_oop.createProject("src/server/tsconfig.library.json", getCompilerSettings({ removeComments: false }), { typescript: getCompilerPath(/*useBuiltCompiler*/ true) });
500509
/** @type {{ js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream }} */
501510
const {js, dts} = serverLibraryProject.src()
502511
.pipe(sourcemaps.init())
@@ -580,14 +589,20 @@ gulp.task("VerifyLKG", /*help*/ false, [], () => {
580589
gulp.task("LKGInternal", /*help*/ false, ["lib", "local"]);
581590

582591
gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUseDebugMode"], () => {
583-
return runSequence("LKGInternal", "VerifyLKG");
592+
const sizeBefore = getDirSize(lkgDirectory);
593+
const seq = runSequence("LKGInternal", "VerifyLKG");
594+
const sizeAfter = getDirSize(lkgDirectory);
595+
if (sizeAfter > (sizeBefore * 1.10)) {
596+
throw new Error("The lib folder increased by 10% or more. This likely indicates a bug.");
597+
}
598+
return seq;
584599
});
585600

586601

587602
// Task to build the tests infrastructure using the built compiler
588603
const run = path.join(builtLocalDirectory, "run.js");
589604
gulp.task(run, /*help*/ false, [servicesFile, tsserverLibraryFile], () => {
590-
const testProject = tsc.createProject("src/harness/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/ true));
605+
const testProject = tsc_oop.createProject("src/harness/tsconfig.json", getCompilerSettings({}), { typescript: getCompilerPath(/*useBuiltCompiler*/ true) });
591606
return testProject.src()
592607
.pipe(newer(run))
593608
.pipe(sourcemaps.init())
@@ -1069,7 +1084,7 @@ gulp.task("build-rules", "Compiles tslint rules to js", () => {
10691084
gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are: --f[iles]=regex", ["build-rules"], () => {
10701085
if (fold.isTravis()) console.log(fold.start("lint"));
10711086
for (const project of ["scripts/tslint/tsconfig.json", "src/tsconfig-base.json"]) {
1072-
const cmd = `node node_modules/tslint/bin/tslint --project ${project} --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish`;
1087+
const cmd = `node node_modules/tslint/bin/tslint --project ${project} --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish${cmdLineOptions.fix ? " --fix" : ""}`;
10731088
console.log("Linting: " + cmd);
10741089
child_process.execSync(cmd, { stdio: [0, 1, 2] });
10751090
}

0 commit comments

Comments
 (0)