Skip to content

Commit 5824df2

Browse files
committed
renames to cleanPersistedProgram
1 parent f37a9e3 commit 5824df2

File tree

19 files changed

+48
-48
lines changed

19 files changed

+48
-48
lines changed

src/compiler/commandLineParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,11 @@ namespace ts {
243243
description: Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us
244244
},
245245
{
246-
name: "cleanResolutions",
246+
name: "cleanPersistedProgram",
247247
type: "boolean",
248248
isCommandLineOnly: true,
249249
category: Diagnostics.Advanced_Options,
250-
description: Diagnostics.Save_module_and_type_reference_directive_resolution_information_in_tsbuildinfo_file,
250+
description: Diagnostics.Clean_persisted_program_information_in_tsbuildinfo_file,
251251
},
252252
];
253253

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4540,7 +4540,7 @@
45404540
"category": "Message",
45414541
"code": 6239
45424542
},
4543-
"Clean module and type reference directive resolution information in '.tsbuildinfo' file.": {
4543+
"Clean persisted program information in '.tsbuildinfo' file.": {
45444544
"category": "Message",
45454545
"code": 6240
45464546
},

src/compiler/tsbuildPublic.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace ts {
1717
/*@internal*/ pretty?: boolean;
1818
incremental?: boolean;
1919
assumeChangesOnlyAffectDirectDependencies?: boolean;
20-
/*@internal*/ cleanResolutions?: boolean;
20+
/*@internal*/ cleanPersistedProgram?: boolean;
2121

2222
traceResolution?: boolean;
2323
/* @internal */ diagnostics?: boolean;
@@ -133,10 +133,10 @@ namespace ts {
133133
export interface SolutionBuilder<T extends BuilderProgram> {
134134
build(project?: string, cancellationToken?: CancellationToken): ExitStatus;
135135
clean(project?: string): ExitStatus;
136-
cleanResolutions(project?: string): ExitStatus;
136+
cleanPersistedProgram(project?: string): ExitStatus;
137137
buildReferences(project: string, cancellationToken?: CancellationToken): ExitStatus;
138138
cleanReferences(project?: string): ExitStatus;
139-
cleanResolutionsOfReferences(project?: string): ExitStatus;
139+
cleanPersistedProgramOfReferences(project?: string): ExitStatus;
140140
getNextInvalidatedProject(cancellationToken?: CancellationToken): InvalidatedProject<T> | undefined;
141141

142142
// Currently used for testing but can be made public if needed:
@@ -1728,7 +1728,7 @@ namespace ts {
17281728
return ExitStatus.Success;
17291729
}
17301730

1731-
function cleanResolutions(state: SolutionBuilderState, project?: string, onlyReferences?: boolean) {
1731+
function cleanPersistedProgram(state: SolutionBuilderState, project?: string, onlyReferences?: boolean) {
17321732
const buildOrder = getBuildOrderFor(state, project, onlyReferences);
17331733
if (!buildOrder) return ExitStatus.InvalidProject_OutputsSkipped;
17341734

@@ -1743,7 +1743,7 @@ namespace ts {
17431743
const resolvedPath = toResolvedConfigFilePath(state, proj);
17441744
const parsed = parseConfigFile(state, proj, resolvedPath);
17451745
if (parsed) {
1746-
diagnostics += cleanResolutionsOfTsBuildInfoAndReportError(
1746+
diagnostics += cleanPersistedProgramOfTsBuildInfoAndReportError(
17471747
parsed.options,
17481748
state.compilerHost,
17491749
err => state.host.reportDiagnostic(err),
@@ -1918,10 +1918,10 @@ namespace ts {
19181918
return {
19191919
build: (project, cancellationToken) => build(state, project, cancellationToken),
19201920
clean: project => clean(state, project),
1921-
cleanResolutions: project => cleanResolutions(state, project),
1921+
cleanPersistedProgram: project => cleanPersistedProgram(state, project),
19221922
buildReferences: (project, cancellationToken) => build(state, project, cancellationToken, /*onlyReferences*/ true),
19231923
cleanReferences: project => clean(state, project, /*onlyReferences*/ true),
1924-
cleanResolutionsOfReferences: project => cleanResolutions(state, project, /*onlyReferences*/ true),
1924+
cleanPersistedProgramOfReferences: project => cleanPersistedProgram(state, project, /*onlyReferences*/ true),
19251925
getNextInvalidatedProject: cancellationToken => {
19261926
setupInitialBuild(state, cancellationToken);
19271927
return getNextInvalidatedProject(state, getBuildOrder(state), /*reportQueue*/ false);

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5876,7 +5876,7 @@ namespace ts {
58765876
incremental?: boolean;
58775877
tsBuildInfoFile?: string;
58785878
persistResolutions?: string;
5879-
cleanResolutions?: boolean;
5879+
cleanPersistedProgram?: boolean;
58805880
removeComments?: boolean;
58815881
rootDir?: string;
58825882
rootDirs?: string[];

src/compiler/watch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,17 @@ namespace ts {
233233
return ExitStatus.Success;
234234
}
235235

236-
export interface CleanResolutionsOfTsBuildInfoAndReportErrorHost extends CleanResolutionsOfTsBuildInfoHost {
236+
export interface CleanPersistedProgramOfTsBuildInfoAndReportErrorHost extends CleanPersistedProgramOfTsBuildInfoHost {
237237
getCurrentDirectory(): string;
238238
}
239-
export function cleanResolutionsOfTsBuildInfoAndReportError(
239+
export function cleanPersistedProgramOfTsBuildInfoAndReportError(
240240
options: CompilerOptions,
241-
host: CleanResolutionsOfTsBuildInfoAndReportErrorHost,
241+
host: CleanPersistedProgramOfTsBuildInfoAndReportErrorHost,
242242
reportDiagnostic: DiagnosticReporter,
243243
writeFileName?: (s: string) => void,
244244
reportSummary?: ReportEmitErrorSummary,
245245
): number {
246-
const { emittedFiles, diagnostics } = cleanResolutionsOfTsBuildInfo(options, host);
246+
const { emittedFiles, diagnostics } = cleanPersistedProgramOfTsBuildInfo(options, host);
247247
diagnostics.forEach(reportDiagnostic);
248248
if (writeFileName) {
249249
const currentDir = host.getCurrentDirectory();

src/compiler/watchPublic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ namespace ts {
1616
return createBuildProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
1717
}
1818

19-
export interface CleanResolutionsOfTsBuildInfoHost {
19+
export interface CleanPersistedProgramOfTsBuildInfoHost {
2020
readFile(fileName: string): string | undefined;
2121
writeFile: WriteFileCallback;
2222
}
23-
export function cleanResolutionsOfTsBuildInfo(compilerOptions: CompilerOptions, host: CleanResolutionsOfTsBuildInfoHost): EmitResult {
23+
export function cleanPersistedProgramOfTsBuildInfo(compilerOptions: CompilerOptions, host: CleanPersistedProgramOfTsBuildInfoHost): EmitResult {
2424
if (outFileWithoutPersistResolutions(compilerOptions)) return emitSkippedWithNoDiagnostics;
2525
const buildInfoPath = getTsBuildInfoEmitOutputFilePath(compilerOptions);
2626
if (!buildInfoPath) return emitSkippedWithNoDiagnostics;

src/executeCommandLine/executeCommandLine.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@ namespace ts {
261261
reportDiagnostic,
262262
configParseResult.options
263263
);
264-
if (commandLineOptions.cleanResolutions) {
264+
if (commandLineOptions.cleanPersistedProgram) {
265265
configParseResult.errors.forEach(reportDiagnostic);
266-
return cleanResolutions(sys, configParseResult.options, reportDiagnostic);
266+
return cleanPersistedProgram(sys, configParseResult.options, reportDiagnostic);
267267
}
268268
if (isWatchSet(configParseResult.options)) {
269269
if (reportWatchModeWithoutSysSupport(sys, reportDiagnostic)) return;
@@ -304,8 +304,8 @@ namespace ts {
304304
reportDiagnostic,
305305
commandLineOptions
306306
);
307-
if (commandLineOptions.cleanResolutions) {
308-
return cleanResolutions(sys, commandLineOptions, reportDiagnostic);
307+
if (commandLineOptions.cleanPersistedProgram) {
308+
return cleanPersistedProgram(sys, commandLineOptions, reportDiagnostic);
309309
}
310310
if (isWatchSet(commandLineOptions)) {
311311
if (reportWatchModeWithoutSysSupport(sys, reportDiagnostic)) return;
@@ -438,7 +438,7 @@ namespace ts {
438438
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
439439
}
440440

441-
if (buildOptions.cleanResolutions) {
441+
if (buildOptions.cleanPersistedProgram) {
442442
const buildHost = createSolutionBuilderHost(
443443
sys,
444444
/*createProgram*/ undefined,
@@ -448,7 +448,7 @@ namespace ts {
448448
);
449449
updateSolutionBuilderHost(sys, cb, buildHost);
450450
const builder = createSolutionBuilder(buildHost, projects, buildOptions);
451-
return sys.exit(builder.cleanResolutions());
451+
return sys.exit(builder.cleanPersistedProgram());
452452
}
453453

454454
if (buildOptions.watch) {
@@ -486,8 +486,8 @@ namespace ts {
486486
undefined;
487487
}
488488

489-
function cleanResolutions(sys: System, options: CompilerOptions, reportDiagnostic: DiagnosticReporter) {
490-
const diagnostics = cleanResolutionsOfTsBuildInfoAndReportError(
489+
function cleanPersistedProgram(sys: System, options: CompilerOptions, reportDiagnostic: DiagnosticReporter) {
490+
const diagnostics = cleanPersistedProgramOfTsBuildInfoAndReportError(
491491
options,
492492
sys,
493493
reportDiagnostic,

src/testRunner/unittests/tsbuild/persistResolutions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace ts {
4444
subScenario: "Clean resolutions",
4545
buildKind: BuildKind.IncrementalDtsChange,
4646
modifyFs: noop,
47-
commandLineArgs: [input, "src/project", "--cleanResolutions"]
47+
commandLineArgs: [input, "src/project", "--cleanPersistedProgram"]
4848
},
4949
noChangeRun,
5050
{

src/testRunner/unittests/tsbuild/sample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ class someClass2 { }`),
523523
subScenario: "Clean resolutions",
524524
buildKind: BuildKind.IncrementalDtsChange,
525525
modifyFs: noop,
526-
commandLineArgs: ["--b", "/src/tests", "--cleanResolutions"],
526+
commandLineArgs: ["--b", "/src/tests", "--cleanPersistedProgram"],
527527
},
528528
{
529529
subScenario: "Modify core",

src/testRunner/unittests/tsbuild/watchMode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ const a: string = "hello";`),
15331533
verifyTscWatchPersistentResolutionsWorker(`can build after resolutions have been saved in tsbuildinfo file${outFile ? " with outFile" : ""}`, input, () => getPersistentResoluitionsFilesWith(sys => executeCommandLine(sys, noop, [input, "."]), outFile));
15341534
verifyTscWatchPersistentResolutionsWorker(`can build after resolutions are cleaned${outFile ? " with outFile" : ""}`, input, () => getPersistentResoluitionsFilesWith(sys => {
15351535
executeCommandLine(sys, noop, [input, "."]);
1536-
executeCommandLine(sys, noop, [input, ".", "--cleanResolutions"]);
1536+
executeCommandLine(sys, noop, [input, ".", "--cleanPersistedProgram"]);
15371537
}, outFile));
15381538
}
15391539

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,7 +2851,7 @@ declare namespace ts {
28512851
incremental?: boolean;
28522852
tsBuildInfoFile?: string;
28532853
persistResolutions?: string;
2854-
cleanResolutions?: boolean;
2854+
cleanPersistedProgram?: boolean;
28552855
removeComments?: boolean;
28562856
rootDir?: string;
28572857
rootDirs?: string[];
@@ -4962,11 +4962,11 @@ declare namespace ts {
49624962
readFile(fileName: string): string | undefined;
49634963
}
49644964
function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined;
4965-
interface CleanResolutionsOfTsBuildInfoHost {
4965+
interface CleanPersistedProgramOfTsBuildInfoHost {
49664966
readFile(fileName: string): string | undefined;
49674967
writeFile: WriteFileCallback;
49684968
}
4969-
function cleanResolutionsOfTsBuildInfo(compilerOptions: CompilerOptions, host: CleanResolutionsOfTsBuildInfoHost): EmitResult;
4969+
function cleanPersistedProgramOfTsBuildInfo(compilerOptions: CompilerOptions, host: CleanPersistedProgramOfTsBuildInfoHost): EmitResult;
49704970
function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost;
49714971
interface IncrementalProgramOptions<T extends BuilderProgram> {
49724972
rootNames: readonly string[];
@@ -5131,10 +5131,10 @@ declare namespace ts {
51315131
interface SolutionBuilder<T extends BuilderProgram> {
51325132
build(project?: string, cancellationToken?: CancellationToken): ExitStatus;
51335133
clean(project?: string): ExitStatus;
5134-
cleanResolutions(project?: string): ExitStatus;
5134+
cleanPersistedProgram(project?: string): ExitStatus;
51355135
buildReferences(project: string, cancellationToken?: CancellationToken): ExitStatus;
51365136
cleanReferences(project?: string): ExitStatus;
5137-
cleanResolutionsOfReferences(project?: string): ExitStatus;
5137+
cleanPersistedProgramOfReferences(project?: string): ExitStatus;
51385138
getNextInvalidatedProject(cancellationToken?: CancellationToken): InvalidatedProject<T> | undefined;
51395139
}
51405140
/**

tests/baselines/reference/api/typescript.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,7 +2851,7 @@ declare namespace ts {
28512851
incremental?: boolean;
28522852
tsBuildInfoFile?: string;
28532853
persistResolutions?: string;
2854-
cleanResolutions?: boolean;
2854+
cleanPersistedProgram?: boolean;
28552855
removeComments?: boolean;
28562856
rootDir?: string;
28572857
rootDirs?: string[];
@@ -4962,11 +4962,11 @@ declare namespace ts {
49624962
readFile(fileName: string): string | undefined;
49634963
}
49644964
function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined;
4965-
interface CleanResolutionsOfTsBuildInfoHost {
4965+
interface CleanPersistedProgramOfTsBuildInfoHost {
49664966
readFile(fileName: string): string | undefined;
49674967
writeFile: WriteFileCallback;
49684968
}
4969-
function cleanResolutionsOfTsBuildInfo(compilerOptions: CompilerOptions, host: CleanResolutionsOfTsBuildInfoHost): EmitResult;
4969+
function cleanPersistedProgramOfTsBuildInfo(compilerOptions: CompilerOptions, host: CleanPersistedProgramOfTsBuildInfoHost): EmitResult;
49704970
function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost;
49714971
interface IncrementalProgramOptions<T extends BuilderProgram> {
49724972
rootNames: readonly string[];
@@ -5131,10 +5131,10 @@ declare namespace ts {
51315131
interface SolutionBuilder<T extends BuilderProgram> {
51325132
build(project?: string, cancellationToken?: CancellationToken): ExitStatus;
51335133
clean(project?: string): ExitStatus;
5134-
cleanResolutions(project?: string): ExitStatus;
5134+
cleanPersistedProgram(project?: string): ExitStatus;
51355135
buildReferences(project: string, cancellationToken?: CancellationToken): ExitStatus;
51365136
cleanReferences(project?: string): ExitStatus;
5137-
cleanResolutionsOfReferences(project?: string): ExitStatus;
5137+
cleanPersistedProgramOfReferences(project?: string): ExitStatus;
51385138
getNextInvalidatedProject(cancellationToken?: CancellationToken): InvalidatedProject<T> | undefined;
51395139
}
51405140
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"compilerOptions": {
3+
"cleanPersistedProgram": true
4+
}
5+
}

tests/baselines/reference/showConfig/Shows tsconfig for single option/cleanResolutions/tsconfig.json

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

tests/baselines/reference/tsbuild/persistResolutions/initial-build/saves-resolution-and-uses-it-for-new-program-with-outFile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ Input::
536536

537537

538538
Output::
539-
/lib/tsc --b src/project --cleanResolutions
539+
/lib/tsc --b src/project --cleanPersistedProgram
540540
exitCode:: ExitStatus.Success
541541

542542

tests/baselines/reference/tsbuild/persistResolutions/initial-build/saves-resolution-and-uses-it-for-new-program.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ Input::
561561

562562

563563
Output::
564-
/lib/tsc --b src/project --cleanResolutions
564+
/lib/tsc --b src/project --cleanPersistedProgram
565565
exitCode:: ExitStatus.Success
566566

567567

tests/baselines/reference/tsbuild/sample1/initial-build/persistResolutions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ Input::
722722

723723

724724
Output::
725-
/lib/tsc --b /src/tests --cleanResolutions
725+
/lib/tsc --b /src/tests --cleanPersistedProgram
726726
exitCode:: ExitStatus.Success
727727

728728

tests/baselines/reference/tsc/persistResolutions/initial-build/saves-resolution-and-uses-it-for-new-program-with-outFile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ Input::
766766

767767

768768
Output::
769-
/lib/tsc --p src/project --cleanResolutions
769+
/lib/tsc --p src/project --cleanPersistedProgram
770770
exitCode:: ExitStatus.Success
771771

772772

tests/baselines/reference/tsc/persistResolutions/initial-build/saves-resolution-and-uses-it-for-new-program.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ Input::
543543

544544

545545
Output::
546-
/lib/tsc --p src/project --cleanResolutions
546+
/lib/tsc --p src/project --cleanPersistedProgram
547547
exitCode:: ExitStatus.Success
548548

549549

0 commit comments

Comments
 (0)