Skip to content

Commit 19090aa

Browse files
author
Andy Hanson
committed
Merge branch 'master' into untypedModuleImport_noImplicitAny_typesForPackageExist
2 parents e96a20a + 6c8ecc7 commit 19090aa

File tree

2,035 files changed

+527959
-516917
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,035 files changed

+527959
-516917
lines changed

.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

Gulpfile.js

Lines changed: 16 additions & 4 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");
@@ -412,6 +414,10 @@ function prependCopyright(outputCopyright = !useDebugMode) {
412414
return insert.prepend(outputCopyright ? (copyrightContent || (copyrightContent = fs.readFileSync(copyright).toString())) : "");
413415
}
414416

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

426432
gulp.task(servicesFile, /*help*/ false, ["lib", "generate-diagnostics"], () => {
427-
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) });
428434
const {js, dts} = servicesProject.src()
429435
.pipe(newer(servicesFile))
430436
.pipe(sourcemaps.init())
@@ -499,7 +505,7 @@ const tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js")
499505
const tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts");
500506

501507
gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile, typesMapJson], (done) => {
502-
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) });
503509
/** @type {{ js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream }} */
504510
const {js, dts} = serverLibraryProject.src()
505511
.pipe(sourcemaps.init())
@@ -583,14 +589,20 @@ gulp.task("VerifyLKG", /*help*/ false, [], () => {
583589
gulp.task("LKGInternal", /*help*/ false, ["lib", "local"]);
584590

585591
gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUseDebugMode"], () => {
586-
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;
587599
});
588600

589601

590602
// Task to build the tests infrastructure using the built compiler
591603
const run = path.join(builtLocalDirectory, "run.js");
592604
gulp.task(run, /*help*/ false, [servicesFile, tsserverLibraryFile], () => {
593-
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) });
594606
return testProject.src()
595607
.pipe(newer(run))
596608
.pipe(sourcemaps.init())

0 commit comments

Comments
 (0)