Skip to content

Commit d237468

Browse files
authored
Add --no-typecheck option for runtests/runtests-parallel/min/local (#51460)
1 parent 1b35985 commit d237468

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

Herebyfile.mjs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ function entrypointBuildTask(options) {
354354
}
355355

356356

357-
const { main: tsc, watch: watchTsc } = entrypointBuildTask({
357+
const { main: tsc, build: buildTsc, watch: watchTsc } = entrypointBuildTask({
358358
name: "tsc",
359359
description: "Builds the command-line compiler",
360360
buildDeps: [generateDiagnostics],
@@ -392,7 +392,7 @@ export const dtsServices = task({
392392
});
393393

394394

395-
const { main: tsserver, watch: watchTsserver } = entrypointBuildTask({
395+
const { main: tsserver, build: buildTsserver, watch: watchTsserver } = entrypointBuildTask({
396396
name: "tsserver",
397397
description: "Builds the language server",
398398
buildDeps: [generateDiagnostics],
@@ -410,10 +410,15 @@ const { main: tsserver, watch: watchTsserver } = entrypointBuildTask({
410410
export { tsserver, watchTsserver };
411411

412412

413+
const buildMin = task({
414+
name: "build-min",
415+
dependencies: [buildTsc, buildTsserver],
416+
});
417+
413418
export const min = task({
414419
name: "min",
415420
description: "Builds only tsc and tsserver",
416-
dependencies: [tsc, tsserver],
421+
dependencies: [tsc, tsserver].concat(cmdLineOptions.typecheck ? [buildMin] : []),
417422
});
418423

419424
export const watchMin = task({
@@ -577,10 +582,15 @@ export const watchOtherOutputs = task({
577582
dependencies: [watchCancellationToken, watchTypingsInstaller, watchWatchGuard, generateTypesMap, copyBuiltLocalDiagnosticMessages],
578583
});
579584

585+
const buildLocal = task({
586+
name: "build-local",
587+
dependencies: [buildTsc, buildTsserver, buildServices, buildLssl]
588+
});
589+
580590
export const local = task({
581591
name: "local",
582592
description: "Builds the full compiler and services",
583-
dependencies: [localize, tsc, tsserver, services, lssl, otherOutputs, dts, buildSrc],
593+
dependencies: [localize, tsc, tsserver, services, lssl, otherOutputs, dts].concat(cmdLineOptions.typecheck ? [buildLocal] : []),
584594
});
585595
export default local;
586596

@@ -591,11 +601,12 @@ export const watchLocal = task({
591601
dependencies: [localize, watchTsc, watchTsserver, watchServices, watchLssl, watchOtherOutputs, dts, watchSrc],
592602
});
593603

604+
const runtestsDeps = [tests, generateLibs].concat(cmdLineOptions.typecheck ? [dts, buildSrc] : []);
594605

595606
export const runTests = task({
596607
name: "runtests",
597608
description: "Runs the tests using the built run.js file.",
598-
dependencies: [tests, generateLibs, dts, buildSrc],
609+
dependencies: runtestsDeps,
599610
run: () => runConsoleTests(testRunner, "mocha-fivemat-progress-reporter", /*runInParallel*/ false),
600611
});
601612
// task("runtests").flags = {
@@ -617,7 +628,7 @@ export const runTests = task({
617628
export const runTestsParallel = task({
618629
name: "runtests-parallel",
619630
description: "Runs all the tests in parallel using the built run.js file.",
620-
dependencies: [tests, generateLibs, dts, buildSrc],
631+
dependencies: runtestsDeps,
621632
run: () => runConsoleTests(testRunner, "min", /*runInParallel*/ cmdLineOptions.workers > 1),
622633
});
623634
// task("runtests-parallel").flags = {

scripts/build/options.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import os from "os";
44
const ci = ["1", "true"].includes(process.env.CI ?? "");
55

66
const parsed = minimist(process.argv.slice(2), {
7-
boolean: ["dirty", "light", "colors", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built", "ci", "bundle"],
7+
boolean: ["dirty", "light", "colors", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built", "ci", "bundle", "typecheck"],
88
string: ["browser", "tests", "break", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
99
alias: {
1010
/* eslint-disable quote-props */
@@ -39,7 +39,8 @@ const parsed = minimist(process.argv.slice(2), {
3939
dirty: false,
4040
built: false,
4141
ci,
42-
bundle: true
42+
bundle: true,
43+
typecheck: true,
4344
}
4445
});
4546

@@ -80,5 +81,6 @@ export default options;
8081
* @property {string} shardId
8182
* @property {string} break
8283
* @property {boolean} bundle
84+
* @property {boolean} typecheck
8385
*/
8486
void 0;

0 commit comments

Comments
 (0)