Skip to content

Commit 88babf2

Browse files
Titian Cernicova-DragomirTitian Cernicova-Dragomir
authored andcommitted
Merge remote-tracking branch 'remotes/origin/master' into GH-26563
2 parents 8d66d55 + 62b0d98 commit 88babf2

File tree

594 files changed

+265382
-30182
lines changed

Some content is hidden

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

594 files changed

+265382
-30182
lines changed

.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

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ node_js:
55
- '10'
66
- '8'
77

8-
sudo: false
9-
108
env:
119
- workerCount=3 timeout=600000
1210

Gulpfile.js

Lines changed: 38 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ const merge2 = require("merge2");
1212
const mkdirp = require("mkdirp");
1313
const { src, dest, task, parallel, series, watch } = require("gulp");
1414
const { append, transform } = require("gulp-insert");
15-
const { browserify } = require("./scripts/build/browserify");
1615
const { prependFile } = require("./scripts/build/prepend");
17-
const { exec, readJson, needsUpdate, getDiffTool, getDirSize, flatten, rm } = require("./scripts/build/utils");
18-
const { runConsoleTests, cleanTestDirs, writeTestConfigFile, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require("./scripts/build/tests");
16+
const { exec, readJson, needsUpdate, getDiffTool, getDirSize, rm } = require("./scripts/build/utils");
17+
const { runConsoleTests, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require("./scripts/build/tests");
1918
const { buildProject, cleanProject, watchProject } = require("./scripts/build/projects");
2019
const cmdLineOptions = require("./scripts/build/options");
2120

@@ -114,18 +113,8 @@ const localPreBuild = parallel(generateLibs, series(buildScripts, generateDiagno
114113
const preBuild = cmdLineOptions.lkg ? lkgPreBuild : localPreBuild;
115114

116115
const buildServices = (() => {
117-
// flatten the services project
118-
const flattenServicesConfig = async () => flatten("src/services/tsconfig.json", "built/local/typescriptServices.tsconfig.json", {
119-
compilerOptions: {
120-
"removeComments": false,
121-
"stripInternal": true,
122-
"declarationMap": false,
123-
"outFile": "typescriptServices.out.js"
124-
}
125-
});
126-
127116
// build typescriptServices.out.js
128-
const buildTypescriptServicesOut = () => buildProject("built/local/typescriptServices.tsconfig.json", cmdLineOptions);
117+
const buildTypescriptServicesOut = () => buildProject("src/typescriptServices/tsconfig.json", cmdLineOptions);
129118

130119
// create typescriptServices.js
131120
const createTypescriptServicesJs = () => src("built/local/typescriptServices.out.js")
@@ -167,13 +156,13 @@ const buildServices = (() => {
167156
.pipe(dest("built/local"));
168157

169158
return series(
170-
flattenServicesConfig,
171159
buildTypescriptServicesOut,
172160
createTypescriptServicesJs,
173161
createTypescriptServicesDts,
174162
createTypescriptJs,
175163
createTypescriptDts,
176-
createTypescriptStandaloneDts);
164+
createTypescriptStandaloneDts,
165+
);
177166
})();
178167
task("services", series(preBuild, buildServices));
179168
task("services").description = "Builds the language service";
@@ -186,13 +175,13 @@ const cleanServices = async () => {
186175
await cleanProject("built/local/typescriptServices.tsconfig.json");
187176
}
188177
await del([
189-
"built/local/typescriptServices.tsconfig.json",
190178
"built/local/typescriptServices.out.js",
191179
"built/local/typescriptServices.out.d.ts",
180+
"built/local/typescriptServices.out.tsbuildinfo",
192181
"built/local/typescriptServices.js",
193182
"built/local/typescript.js",
194183
"built/local/typescript.d.ts",
195-
"built/local/typescript_standalone.d.ts",
184+
"built/local/typescript_standalone.d.ts"
196185
]);
197186
};
198187
cleanTasks.push(cleanServices);
@@ -248,20 +237,8 @@ task("watch-min").flags = {
248237
}
249238

250239
const buildLssl = (() => {
251-
// flatten the server project
252-
const flattenTsServerProject = async () => flatten("src/tsserver/tsconfig.json", "built/local/tsserverlibrary.tsconfig.json", {
253-
exclude: ["src/tsserver/server.ts"],
254-
compilerOptions: {
255-
"removeComments": false,
256-
"stripInternal": true,
257-
"declaration": true,
258-
"declarationMap": false,
259-
"outFile": "tsserverlibrary.out.js"
260-
}
261-
});
262-
263240
// build tsserverlibrary.out.js
264-
const buildServerLibraryOut = () => buildProject("built/local/tsserverlibrary.tsconfig.json", cmdLineOptions);
241+
const buildServerLibraryOut = () => buildProject("src/tsserverlibrary/tsconfig.json", cmdLineOptions);
265242

266243
// create tsserverlibrary.js
267244
const createServerLibraryJs = () => src("built/local/tsserverlibrary.out.js")
@@ -282,10 +259,10 @@ const buildLssl = (() => {
282259
.pipe(dest("built/local"));
283260

284261
return series(
285-
flattenTsServerProject,
286262
buildServerLibraryOut,
287263
createServerLibraryJs,
288-
createServerLibraryDts);
264+
createServerLibraryDts,
265+
);
289266
})();
290267
task("lssl", series(preBuild, buildLssl));
291268
task("lssl").description = "Builds language service server library";
@@ -298,9 +275,9 @@ const cleanLssl = async () => {
298275
await cleanProject("built/local/tsserverlibrary.tsconfig.json");
299276
}
300277
await del([
301-
"built/local/tsserverlibrary.tsconfig.json",
302278
"built/local/tsserverlibrary.out.js",
303279
"built/local/tsserverlibrary.out.d.ts",
280+
"built/local/tsserverlibrary.out.tsbuildinfo",
304281
"built/local/tsserverlibrary.js",
305282
"built/local/tsserverlibrary.d.ts",
306283
]);
@@ -373,9 +350,34 @@ task("lint").flags = {
373350
" --f[iles]=<regex>": "pattern to match files to lint",
374351
};
375352

353+
const buildCancellationToken = () => buildProject("src/cancellationToken");
354+
const cleanCancellationToken = () => cleanProject("src/cancellationToken");
355+
cleanTasks.push(cleanCancellationToken);
356+
357+
const buildTypingsInstaller = () => buildProject("src/typingsInstaller");
358+
const cleanTypingsInstaller = () => cleanProject("src/typingsInstaller");
359+
cleanTasks.push(cleanTypingsInstaller);
360+
361+
const buildWatchGuard = () => buildProject("src/watchGuard");
362+
const cleanWatchGuard = () => cleanProject("src/watchGuard");
363+
cleanTasks.push(cleanWatchGuard);
364+
365+
const generateTypesMap = () => src("src/server/typesMap.json")
366+
.pipe(newer("built/local/typesMap.json"))
367+
.pipe(transform(contents => (JSON.parse(contents), contents))) // validates typesMap.json is valid JSON
368+
.pipe(dest("built/local"));
369+
task("generate-types-map", generateTypesMap);
370+
371+
const cleanTypesMap = () => del("built/local/typesMap.json");
372+
cleanTasks.push(cleanTypesMap);
373+
374+
const buildOtherOutputs = parallel(buildCancellationToken, buildTypingsInstaller, buildWatchGuard, generateTypesMap);
375+
task("other-outputs", series(preBuild, buildOtherOutputs));
376+
task("other-outputs").description = "Builds miscelaneous scripts and documents distributed with the LKG";
377+
376378
const buildFoldStart = async () => { if (fold.isTravis()) console.log(fold.start("build")); };
377379
const buildFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("build")); };
378-
task("local", series(buildFoldStart, preBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl), buildFoldEnd));
380+
task("local", series(buildFoldStart, preBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildOtherOutputs), buildFoldEnd));
379381
task("local").description = "Builds the full compiler and services";
380382
task("local").flags = {
381383
" --built": "Compile using the built version of the compiler."
@@ -429,44 +431,6 @@ task("runtests-parallel").flags = {
429431
" --built": "Compile using the built version of the compiler.",
430432
};
431433

432-
const buildWebTestServer = () => buildProject("tests/webTestServer.tsconfig.json");
433-
const cleanWebTestServer = () => cleanProject("tests/webTestServer.tsconfig.json");
434-
cleanTasks.push(cleanWebTestServer);
435-
436-
const browserifyTests = () => src(["built/local/run.js"], { base: "built/local" })
437-
.pipe(newer("built/local/bundle.js"))
438-
.pipe(sourcemaps.init({ loadMaps: true }))
439-
.pipe(browserify())
440-
.pipe(rename("bundle.js"))
441-
.pipe(sourcemaps.write(".", /**@type {*}*/({ includeContent: false, destPath: "built/local" })))
442-
.pipe(dest("built/local"));
443-
444-
const runtestsBrowser = async () => {
445-
await cleanTestDirs();
446-
const { tests, runners, light } = cmdLineOptions;
447-
const testConfigFile = "test.config";
448-
await del([testConfigFile]);
449-
if (tests || runners || light) {
450-
writeTestConfigFile(tests, runners, light);
451-
}
452-
const args = ["tests/webTestServer.js"];
453-
if (cmdLineOptions.browser) {
454-
args.push(cmdLineOptions.browser);
455-
}
456-
if (tests) {
457-
args.push(JSON.stringify(tests));
458-
}
459-
await exec(process.execPath, args);
460-
};
461-
462-
task("runtests-browser", series(preBuild, parallel(buildTests, buildServices, buildLssl, buildWebTestServer), browserifyTests, runtestsBrowser));
463-
task("runtests-browser").description = "Runs the tests using the built run.js file like 'gulp runtests'.";
464-
task("runtests-browser").flags = {
465-
"-t --tests=<regex>": "pattern for tests to run",
466-
"-b --browser=<browser>": "Either 'IE' or 'chrome'",
467-
" --built": "Compile using the built version of the compiler.",
468-
};
469-
470434
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true }));
471435
task("diff").description = "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable";
472436

@@ -500,16 +464,6 @@ cleanTasks.push(cleanWebHost);
500464
task("clean-webhost", cleanWebHost);
501465
task("clean-webhost").description = "Cleans the outputs of the tsc web host";
502466

503-
// TODO(rbuckton): Determine if 'perftsc' is still in use.
504-
const buildPerfTsc = () => buildProject("tests/perftsc.tsconfig.json");
505-
task("perftsc", series(lkgPreBuild, buildPerfTsc));
506-
task("perftsc").description = "Builds augmented version of the compiler for perf tests";
507-
508-
const cleanPerfTsc = () => cleanProject("tests/perftsc.tsconfig.json");
509-
cleanTasks.push(cleanPerfTsc);
510-
task("clean-perftsc", cleanPerfTsc);
511-
task("clean-perftsc").description = "Cleans the outputs of the perftsc project";
512-
513467
const buildLoggedIO = async () => {
514468
mkdirp.sync("built/local/temp");
515469
await exec(process.execPath, ["lib/tsc", "--types", "--target", "es5", "--lib", "es5", "--outdir", "built/local/temp", "src/harness/loggedIO.ts"]);
@@ -551,28 +505,6 @@ const buildReleaseTsc = () => buildProject("src/tsc/tsconfig.release.json");
551505
const cleanReleaseTsc = () => cleanProject("src/tsc/tsconfig.release.json");
552506
cleanTasks.push(cleanReleaseTsc);
553507

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

578510
const produceLKG = async () => {
@@ -602,7 +534,7 @@ const produceLKG = async () => {
602534
}
603535
};
604536

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

0 commit comments

Comments
 (0)