diff --git a/src/compiler/_namespaces/ts.ts b/src/compiler/_namespaces/ts.ts index 1ce7091080e7a..e5c3db7415dd4 100644 --- a/src/compiler/_namespaces/ts.ts +++ b/src/compiler/_namespaces/ts.ts @@ -70,6 +70,7 @@ export * from "../watch"; export * from "../watchPublic"; export * from "../tsbuild"; export * from "../tsbuildPublic"; +export * from "../executeCommandLine"; import * as moduleSpecifiers from "./ts.moduleSpecifiers"; export { moduleSpecifiers }; import * as performance from "./ts.performance"; diff --git a/src/executeCommandLine/executeCommandLine.ts b/src/compiler/executeCommandLine.ts similarity index 97% rename from src/executeCommandLine/executeCommandLine.ts rename to src/compiler/executeCommandLine.ts index 16d02310b5eb7..ed5c1836c9bbb 100644 --- a/src/executeCommandLine/executeCommandLine.ts +++ b/src/compiler/executeCommandLine.ts @@ -1,4 +1,3 @@ -import * as performance from "../compiler/performance"; import { arrayFrom, BuilderProgram, @@ -85,8 +84,10 @@ import { validateLocaleAndSetLanguage, version, WatchCompilerHost, + WatchOfConfigFile, WatchOptions, } from "./_namespaces/ts"; +import * as performance from "./performance"; interface Statistic { name: string; @@ -94,6 +95,7 @@ interface Statistic { type: StatisticType; } +/** @internal */ export enum StatisticType { time, count, @@ -730,6 +732,7 @@ function executeCommandLineWorker( } } +/** @internal */ export function isBuild(commandLineArgs: readonly string[]) { if (commandLineArgs.length > 0 && commandLineArgs[0].charCodeAt(0) === CharacterCodes.minus) { const firstOption = commandLineArgs[0].slice(commandLineArgs[0].charCodeAt(1) === CharacterCodes.minus ? 2 : 1).toLowerCase(); @@ -738,12 +741,14 @@ export function isBuild(commandLineArgs: readonly string[]) { return false; } +/** @internal */ export type ExecuteCommandLineCallbacks = (program: Program | BuilderProgram | ParsedCommandLine) => void; +/** @internal */ export function executeCommandLine( system: System, cb: ExecuteCommandLineCallbacks, commandLineArgs: readonly string[], -) { +): void | SolutionBuilder | WatchOfConfigFile { if (isBuild(commandLineArgs)) { const { buildOptions, watchOptions, projects, errors } = parseBuildCommand(commandLineArgs.slice(1)); if (buildOptions.generateCpuProfile && system.enableCPUProfiler) { diff --git a/src/executeCommandLine/_namespaces/ts.ts b/src/executeCommandLine/_namespaces/ts.ts deleted file mode 100644 index 488d183df4a38..0000000000000 --- a/src/executeCommandLine/_namespaces/ts.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* Generated file to emulate the ts namespace. */ - -export * from "../../compiler/_namespaces/ts"; -export * from "../executeCommandLine"; diff --git a/src/executeCommandLine/tsconfig.json b/src/executeCommandLine/tsconfig.json deleted file mode 100644 index c988aed5d19c3..0000000000000 --- a/src/executeCommandLine/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../tsconfig-base", - "compilerOptions": { - }, - - "references": [ - { "path": "../compiler" } - ], - - "include": ["**/*"] -} diff --git a/src/testRunner/_namespaces/ts.ts b/src/testRunner/_namespaces/ts.ts index 18d1bb33fc953..27efc73b10f55 100644 --- a/src/testRunner/_namespaces/ts.ts +++ b/src/testRunner/_namespaces/ts.ts @@ -1,7 +1,6 @@ /* Generated file to emulate the ts namespace. */ export * from "../../compiler/_namespaces/ts"; -export * from "../../executeCommandLine/_namespaces/ts"; export * from "../../services/_namespaces/ts"; export * from "../../jsTyping/_namespaces/ts"; export * from "../../server/_namespaces/ts"; diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 29d2f351b62cf..10bd1d9ef6807 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -9,7 +9,6 @@ }, "references": [ { "path": "../compiler" }, - { "path": "../executeCommandLine" }, { "path": "../services" }, { "path": "../jsTyping" }, { "path": "../server" }, diff --git a/src/tsc/_namespaces/ts.ts b/src/tsc/_namespaces/ts.ts index 8e361ae718461..b9fd7c710ab69 100644 --- a/src/tsc/_namespaces/ts.ts +++ b/src/tsc/_namespaces/ts.ts @@ -1,4 +1,3 @@ /* Generated file to emulate the ts namespace. */ export * from "../../compiler/_namespaces/ts"; -export * from "../../executeCommandLine/_namespaces/ts"; diff --git a/src/tsc/tsconfig.json b/src/tsc/tsconfig.json index 21e193ad5d70c..e0e98fac65db6 100644 --- a/src/tsc/tsconfig.json +++ b/src/tsc/tsconfig.json @@ -3,8 +3,7 @@ "compilerOptions": { }, "references": [ - { "path": "../compiler" }, - { "path": "../executeCommandLine" } + { "path": "../compiler" } ], "include": ["**/*"] } diff --git a/src/tsconfig.json b/src/tsconfig.json index c585d3480f266..0e422305f9d4d 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -5,7 +5,6 @@ { "path": "./cancellationToken" }, { "path": "./compiler" }, { "path": "./deprecatedCompat" }, - { "path": "./executeCommandLine" }, { "path": "./harness" }, { "path": "./jsTyping" }, { "path": "./server" },