Skip to content

Commit 5144b3e

Browse files
authored
Export executeCommandLine from public API (internal for now) (#58057)
1 parent 84eff8f commit 5144b3e

File tree

9 files changed

+9
-23
lines changed

9 files changed

+9
-23
lines changed

src/compiler/_namespaces/ts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export * from "../watch";
7070
export * from "../watchPublic";
7171
export * from "../tsbuild";
7272
export * from "../tsbuildPublic";
73+
export * from "../executeCommandLine";
7374
import * as moduleSpecifiers from "./ts.moduleSpecifiers";
7475
export { moduleSpecifiers };
7576
import * as performance from "./ts.performance";

src/executeCommandLine/executeCommandLine.ts renamed to src/compiler/executeCommandLine.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as performance from "../compiler/performance";
21
import {
32
arrayFrom,
43
BuilderProgram,
@@ -85,15 +84,18 @@ import {
8584
validateLocaleAndSetLanguage,
8685
version,
8786
WatchCompilerHost,
87+
WatchOfConfigFile,
8888
WatchOptions,
8989
} from "./_namespaces/ts";
90+
import * as performance from "./performance";
9091

9192
interface Statistic {
9293
name: string;
9394
value: number;
9495
type: StatisticType;
9596
}
9697

98+
/** @internal */
9799
export enum StatisticType {
98100
time,
99101
count,
@@ -730,6 +732,7 @@ function executeCommandLineWorker(
730732
}
731733
}
732734

735+
/** @internal */
733736
export function isBuild(commandLineArgs: readonly string[]) {
734737
if (commandLineArgs.length > 0 && commandLineArgs[0].charCodeAt(0) === CharacterCodes.minus) {
735738
const firstOption = commandLineArgs[0].slice(commandLineArgs[0].charCodeAt(1) === CharacterCodes.minus ? 2 : 1).toLowerCase();
@@ -738,12 +741,14 @@ export function isBuild(commandLineArgs: readonly string[]) {
738741
return false;
739742
}
740743

744+
/** @internal */
741745
export type ExecuteCommandLineCallbacks = (program: Program | BuilderProgram | ParsedCommandLine) => void;
746+
/** @internal */
742747
export function executeCommandLine(
743748
system: System,
744749
cb: ExecuteCommandLineCallbacks,
745750
commandLineArgs: readonly string[],
746-
) {
751+
): void | SolutionBuilder<EmitAndSemanticDiagnosticsBuilderProgram> | WatchOfConfigFile<EmitAndSemanticDiagnosticsBuilderProgram> {
747752
if (isBuild(commandLineArgs)) {
748753
const { buildOptions, watchOptions, projects, errors } = parseBuildCommand(commandLineArgs.slice(1));
749754
if (buildOptions.generateCpuProfile && system.enableCPUProfiler) {

src/executeCommandLine/_namespaces/ts.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/executeCommandLine/tsconfig.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/testRunner/_namespaces/ts.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* Generated file to emulate the ts namespace. */
22

33
export * from "../../compiler/_namespaces/ts";
4-
export * from "../../executeCommandLine/_namespaces/ts";
54
export * from "../../services/_namespaces/ts";
65
export * from "../../jsTyping/_namespaces/ts";
76
export * from "../../server/_namespaces/ts";

src/testRunner/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
},
1010
"references": [
1111
{ "path": "../compiler" },
12-
{ "path": "../executeCommandLine" },
1312
{ "path": "../services" },
1413
{ "path": "../jsTyping" },
1514
{ "path": "../server" },

src/tsc/_namespaces/ts.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/* Generated file to emulate the ts namespace. */
22

33
export * from "../../compiler/_namespaces/ts";
4-
export * from "../../executeCommandLine/_namespaces/ts";

src/tsc/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"compilerOptions": {
44
},
55
"references": [
6-
{ "path": "../compiler" },
7-
{ "path": "../executeCommandLine" }
6+
{ "path": "../compiler" }
87
],
98
"include": ["**/*"]
109
}

src/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
{ "path": "./cancellationToken" },
66
{ "path": "./compiler" },
77
{ "path": "./deprecatedCompat" },
8-
{ "path": "./executeCommandLine" },
98
{ "path": "./harness" },
109
{ "path": "./jsTyping" },
1110
{ "path": "./server" },

0 commit comments

Comments
 (0)