diff --git a/Gulpfile.js b/Gulpfile.js index d66ab605b25..e65db00dcd5 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -14,7 +14,7 @@ const { src, dest, task, parallel, series, watch } = require("gulp"); const { append, transform } = require("gulp-insert"); const { browserify } = require("./scripts/build/browserify"); const { prependFile } = require("./scripts/build/prepend"); -const { exec, readJson, needsUpdate, getDiffTool, getDirSize, flatten, rm } = require("./scripts/build/utils"); +const { exec, readJson, needsUpdate, getDiffTool, getDirSize, rm } = require("./scripts/build/utils"); const { runConsoleTests, cleanTestDirs, writeTestConfigFile, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require("./scripts/build/tests"); const { buildProject, cleanProject, watchProject } = require("./scripts/build/projects"); const cmdLineOptions = require("./scripts/build/options"); @@ -114,21 +114,8 @@ const localPreBuild = parallel(generateLibs, series(buildScripts, generateDiagno const preBuild = cmdLineOptions.lkg ? lkgPreBuild : localPreBuild; const buildServices = (() => { - // flatten the services project - const flattenServicesConfig = async () => flatten("src/services/tsconfig.json", "built/local/typescriptServices.tsconfig.json", { - compilerOptions: { - "removeComments": false, - "stripInternal": true, - "declarationMap": false, - "outFile": "typescriptServices.out.js" - } - }); - // build typescriptServices.out.js - const buildTypescriptServicesOut = () => buildProject("built/local/typescriptServices.tsconfig.json", cmdLineOptions); - - // build typescriptServices/typescriptServices.js - const buildTypescriptServicesOut1 = () => buildProject("src/typescriptServices/tsconfig.json", { ...cmdLineOptions, lkg: false }); + const buildTypescriptServicesOut = () => buildProject("src/typescriptServices/tsconfig.json", cmdLineOptions); // create typescriptServices.js const createTypescriptServicesJs = () => src("built/local/typescriptServices.out.js") @@ -139,15 +126,6 @@ const buildServices = (() => { .pipe(sourcemaps.write(".", { includeContent: false, destPath: "built/local" })) .pipe(dest("built/local")); - // create typescriptServices1.js - const createTypescriptServicesJs1 = () => src("built/local/typescriptServices/typescriptServices.js") - .pipe(newer("built/local/typescriptServices1.js")) - .pipe(sourcemaps.init({ loadMaps: true })) - .pipe(prependFile(copyright)) - .pipe(rename("typescriptServices1.js")) - .pipe(sourcemaps.write(".", { includeContent: false, destPath: "built/local" })) - .pipe(dest("built/local")); - // create typescriptServices.d.ts const createTypescriptServicesDts = () => src("built/local/typescriptServices.out.d.ts") .pipe(newer("built/local/typescriptServices.d.ts")) @@ -156,14 +134,6 @@ const buildServices = (() => { .pipe(rename("typescriptServices.d.ts")) .pipe(dest("built/local")); - // create typescriptServices1.d.ts - const createTypescriptServicesDts1 = () => src("built/local/typescriptServices/typescriptServices.d.ts") - .pipe(newer("built/local/typescriptServices1.d.ts")) - .pipe(prependFile(copyright)) - .pipe(transform(content => content.replace(/^(\s*)(export )?const enum (\S+) {(\s*)$/gm, "$1$2enum $3 {$4"))) - .pipe(rename("typescriptServices1.d.ts")) - .pipe(dest("built/local")); - // create typescript.js const createTypescriptJs = () => src("built/local/typescriptServices.js") .pipe(newer("built/local/typescript.js")) @@ -172,14 +142,6 @@ const buildServices = (() => { .pipe(sourcemaps.write(".", { includeContent: false, destPath: "built/local" })) .pipe(dest("built/local")); - // create typescript1.js - const createTypescriptJs1 = () => src("built/local/typescriptServices1.js") - .pipe(newer("built/local/typescript1.js")) - .pipe(sourcemaps.init({ loadMaps: true })) - .pipe(rename("typescript1.js")) - .pipe(sourcemaps.write(".", { includeContent: false, destPath: "built/local" })) - .pipe(dest("built/local")); - // create typescript.d.ts const createTypescriptDts = () => src("built/local/typescriptServices.d.ts") .pipe(newer("built/local/typescript.d.ts")) @@ -187,13 +149,6 @@ const buildServices = (() => { .pipe(rename("typescript.d.ts")) .pipe(dest("built/local")); - // create typescript1.d.ts - const createTypescriptDts1 = () => src("built/local/typescriptServices1.d.ts") - .pipe(newer("built/local/typescript1.d.ts")) - .pipe(append("\nexport = ts;")) - .pipe(rename("typescript1.d.ts")) - .pipe(dest("built/local")); - // create typescript_standalone.d.ts const createTypescriptStandaloneDts = () => src("built/local/typescriptServices.d.ts") .pipe(newer("built/local/typescript_standalone.d.ts")) @@ -201,28 +156,13 @@ const buildServices = (() => { .pipe(rename("typescript_standalone.d.ts")) .pipe(dest("built/local")); - // create typescript_standalone.d.ts - const createTypescriptStandaloneDts1 = () => src("built/local/typescriptServices1.d.ts") - .pipe(newer("built/local/typescript_standalone1.d.ts")) - .pipe(transform(content => content.replace(/declare (namespace|module) ts/g, 'declare module "typescript"'))) - .pipe(rename("typescript_standalone1.d.ts")) - .pipe(dest("built/local")); - return series( - flattenServicesConfig, buildTypescriptServicesOut, createTypescriptServicesJs, createTypescriptServicesDts, createTypescriptJs, createTypescriptDts, createTypescriptStandaloneDts, - //localPreBuild, - //buildTypescriptServicesOut1, - //createTypescriptServicesJs1, - //createTypescriptServicesDts1, - //createTypescriptJs1, - //createTypescriptDts1, - //createTypescriptStandaloneDts1, ); })(); task("services", series(preBuild, buildServices)); @@ -236,20 +176,13 @@ const cleanServices = async () => { await cleanProject("built/local/typescriptServices.tsconfig.json"); } await del([ - "built/local/typescriptServices.tsconfig.json", "built/local/typescriptServices.out.js", "built/local/typescriptServices.out.d.ts", + "built/local/typescriptServices.out.tsbuildinfo", "built/local/typescriptServices.js", "built/local/typescript.js", "built/local/typescript.d.ts", - "built/local/typescript_standalone.d.ts", - "built/local/typescriptServices/typescriptServices.js", - "built/local/typescriptServices/typescriptServices.js.map", - "built/local/typescriptServices/typescriptServices.d.ts", - "built/local/typescriptServices1.js", - "built/local/typescript1.js", - "built/local/typescript1.d.ts", - "built/local/typescript_standalone1.d.ts", + "built/local/typescript_standalone.d.ts" ]); }; cleanTasks.push(cleanServices); @@ -305,23 +238,8 @@ task("watch-min").flags = { } const buildLssl = (() => { - // flatten the server project - const flattenTsServerProject = async () => flatten("src/tsserver/tsconfig.json", "built/local/tsserverlibrary.tsconfig.json", { - exclude: ["src/tsserver/server.ts"], - compilerOptions: { - "removeComments": false, - "stripInternal": true, - "declaration": true, - "declarationMap": false, - "outFile": "tsserverlibrary.out.js" - } - }); - // build tsserverlibrary.out.js - const buildServerLibraryOut = () => buildProject("built/local/tsserverlibrary.tsconfig.json", cmdLineOptions); - - // build tsserverlibrary1.out.js - const buildServerLibraryOut1 = () => buildProject("src/tsserverlibrary/tsconfig.json", { ...cmdLineOptions, lkg: false }); + const buildServerLibraryOut = () => buildProject("src/tsserverlibrary/tsconfig.json", cmdLineOptions); // create tsserverlibrary.js const createServerLibraryJs = () => src("built/local/tsserverlibrary.out.js") @@ -332,15 +250,6 @@ const buildLssl = (() => { .pipe(sourcemaps.write(".", { includeContent: false, destPath: "built/local" })) .pipe(dest("built/local")); - // create tsserverlibrary1.js - const createServerLibraryJs1 = () => src("built/local/tsserverlibrary/tsserverlibrary.js") - .pipe(newer("built/local/tsserverlibrary1.js")) - .pipe(sourcemaps.init({ loadMaps: true })) - .pipe(prependFile(copyright)) - .pipe(rename("tsserverlibrary1.js")) - .pipe(sourcemaps.write(".", { includeContent: false, destPath: "built/local" })) - .pipe(dest("built/local")); - // create tsserverlibrary.d.ts const createServerLibraryDts = () => src("built/local/tsserverlibrary.out.d.ts") .pipe(newer("built/local/tsserverlibrary.d.ts")) @@ -350,24 +259,10 @@ const buildLssl = (() => { .pipe(rename("tsserverlibrary.d.ts")) .pipe(dest("built/local")); - // create tsserverlibrary1.d.ts - const createServerLibraryDts1 = () => src("built/local/tsserverlibrary/tsserverlibrary.d.ts") - .pipe(newer("built/local/tsserverlibrary1.d.ts")) - .pipe(prependFile(copyright)) - .pipe(transform(content => content.replace(/^(\s*)(export )?const enum (\S+) {(\s*)$/gm, "$1$2enum $3 {$4"))) - .pipe(append("\nexport = ts;\nexport as namespace ts;")) - .pipe(rename("tsserverlibrary1.d.ts")) - .pipe(dest("built/local")); - return series( - flattenTsServerProject, buildServerLibraryOut, createServerLibraryJs, createServerLibraryDts, - //localPreBuild, - //buildServerLibraryOut1, - //createServerLibraryJs1, - //createServerLibraryDts1 ); })(); task("lssl", series(preBuild, buildLssl)); @@ -381,9 +276,9 @@ const cleanLssl = async () => { await cleanProject("built/local/tsserverlibrary.tsconfig.json"); } await del([ - "built/local/tsserverlibrary.tsconfig.json", "built/local/tsserverlibrary.out.js", "built/local/tsserverlibrary.out.d.ts", + "built/local/tsserverlibrary.out.tsbuildinfo", "built/local/tsserverlibrary.js", "built/local/tsserverlibrary.d.ts", "built/local/tsserverlibrary/tsserverlibrary.js", diff --git a/src/cancellationToken/tsconfig.json b/src/cancellationToken/tsconfig.json index 6d9e0af7724..6d27fe45cf3 100644 --- a/src/cancellationToken/tsconfig.json +++ b/src/cancellationToken/tsconfig.json @@ -7,6 +7,7 @@ "declaration": false, "declarationMap": false, "removeComments": true, + "incremental": false, "module": "commonjs", "types": [ "node" diff --git a/src/tsconfig-library-base.json b/src/tsconfig-library-base.json index 1ec945796ee..46de44a48ff 100644 --- a/src/tsconfig-library-base.json +++ b/src/tsconfig-library-base.json @@ -2,7 +2,9 @@ "extends": "./tsconfig-base", "compilerOptions": { "declarationMap": false, + "sourceMap": false, "composite": false, + "incremental": true, "declaration": true, "stripInternal": true } diff --git a/src/tsconfig-noncomposite-base.json b/src/tsconfig-noncomposite-base.json index 569269f7562..879a038f5a0 100644 --- a/src/tsconfig-noncomposite-base.json +++ b/src/tsconfig-noncomposite-base.json @@ -3,6 +3,7 @@ "compilerOptions": { "declaration": false, "declarationMap": false, - "composite": false + "composite": false, + "incremental": true } } diff --git a/src/watchGuard/tsconfig.json b/src/watchGuard/tsconfig.json index aafa2270297..b169f00c95b 100644 --- a/src/watchGuard/tsconfig.json +++ b/src/watchGuard/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../tsconfig-noncomposite-base", "compilerOptions": { "removeComments": true, + "incremental": false, "outFile": "../../built/local/watchGuard.js", "types": [ "node"