Skip to content

Commit e474b3d

Browse files
authored
Mark APIs related to prepend option deprecated (microsoft#52344)
1 parent d76f361 commit e474b3d

File tree

12 files changed

+138
-68
lines changed

12 files changed

+138
-68
lines changed

src/compiler/builder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export interface ReusableBuilderProgramState extends BuilderState {
154154
*/
155155
latestChangedDtsFile: string | undefined;
156156
/**
157+
* @deprecated
157158
* Bundle information either from oldState or current one so it can be used to complete the information in buildInfo when emitting only js or dts files
158159
*/
159160
bundle?: BundleBuildInfo;

src/compiler/emitter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,7 @@ export const notImplementedResolver: EmitResolver = {
11681168
/**
11691169
* File that isnt present resulting in error or output files
11701170
*
1171+
* @deprecated
11711172
* @internal
11721173
*/
11731174
export type EmitUsingBuildInfoResult = string | readonly OutputFile[];
@@ -1199,7 +1200,7 @@ function createSourceFilesFromBundleBuildInfo(bundle: BundleBuildInfo, buildInfo
11991200
});
12001201
}
12011202

1202-
/** @internal */
1203+
/** @deprecated @internal */
12031204
export function emitUsingBuildInfo(
12041205
config: ParsedCommandLine,
12051206
host: CompilerHost,

src/compiler/factory/nodeFactory.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7273,8 +7273,11 @@ const syntheticFactory: BaseNodeFactory = {
72737273

72747274
export const factory = createNodeFactory(NodeFactoryFlags.NoIndentationOnFreshPropertyAccess, syntheticFactory);
72757275

7276+
/** @deprecated */
72767277
export function createUnparsedSourceFile(text: string): UnparsedSource;
7278+
/** @deprecated */
72777279
export function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource;
7280+
/** @deprecated */
72787281
export function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource;
72797282
export function createUnparsedSourceFile(textOrInputFiles: string | InputFiles, mapPathOrType?: string, mapTextOrStripInternal?: string | boolean): UnparsedSource {
72807283
let stripInternal: boolean | undefined;
@@ -7445,10 +7448,12 @@ function parseOldFileOfCurrentEmit(bundleFileInfo: BundleFileInfo) {
74457448
}
74467449

74477450
// TODO(rbuckton): Move part of this to factory
7451+
/** @deprecated */
74487452
export function createInputFiles(
74497453
javascriptText: string,
74507454
declarationText: string
74517455
): InputFiles;
7456+
/** @deprecated */
74527457
export function createInputFiles(
74537458
javascriptText: string,
74547459
declarationText: string,
@@ -7457,6 +7462,7 @@ export function createInputFiles(
74577462
declarationMapPath: string | undefined,
74587463
declarationMapText: string | undefined
74597464
): InputFiles;
7465+
/** @deprecated */
74607466
export function createInputFiles(
74617467
readFileText: (path: string) => string | undefined,
74627468
javascriptPath: string,
@@ -7493,7 +7499,7 @@ export function createInputFiles(
74937499
declarationMapTextOrBuildInfoPath,
74947500
);
74957501
}
7496-
/** @internal */
7502+
/** @deprecated @internal */
74977503
export function createInputFilesWithFilePaths(
74987504
readFileText: (path: string) => string | undefined,
74997505
javascriptPath: string,
@@ -7546,7 +7552,7 @@ export function createInputFilesWithFilePaths(
75467552
});
75477553
return node;
75487554
}
7549-
/** @internal */
7555+
/** @deprecated @internal */
75507556
export function createInputFilesWithFileTexts(
75517557
javascriptPath: string | undefined,
75527558
javascriptText: string,

src/compiler/factory/nodeTests.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ export function isEnumMember(node: Node): node is EnumMember {
10111011
// Unparsed
10121012

10131013
// TODO(rbuckton): isUnparsedPrologue
1014-
1014+
/** @deprecated */
10151015
export function isUnparsedPrepend(node: Node): node is UnparsedPrepend {
10161016
return node.kind === SyntaxKind.UnparsedPrepend;
10171017
}
@@ -1029,6 +1029,7 @@ export function isBundle(node: Node): node is Bundle {
10291029
return node.kind === SyntaxKind.Bundle;
10301030
}
10311031

1032+
/** @deprecated */
10321033
export function isUnparsedSource(node: Node): node is UnparsedSource {
10331034
return node.kind === SyntaxKind.UnparsedSource;
10341035
}

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5023,7 +5023,7 @@ export function parseConfigHostFromCompilerHostLike(host: CompilerHostLike, dire
50235023
};
50245024
}
50255025

5026-
/** @internal */
5026+
/** @deprecated @internal */
50275027
export function createPrependNodes(
50285028
projectReferences: readonly ProjectReference[] | undefined,
50295029
getCommandLine: (ref: ProjectReference, index: number) => ParsedCommandLine | undefined,

src/compiler/tsbuild.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export enum UpToDateStatusType {
1616
*/
1717
UpToDateWithUpstreamTypes,
1818
/**
19+
* @deprecated
1920
* The project appears out of date because its upstream inputs are newer than its outputs,
2021
* but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.
2122
* This means we can Pseudo-build (just manipulate outputs), as if we had actually built this project.
@@ -87,6 +88,7 @@ export namespace Status {
8788
}
8889

8990
/**
91+
* @deprecated
9092
* The project is up to date with respect to its inputs except for prepend output changed (no declaration file change in prepend).
9193
*/
9294
export interface OutOfDateWithPrepend {

src/compiler/tsbuildPublic.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ export interface SolutionBuilderHostBase<T extends BuilderProgram> extends Progr
237237
// TODO: To do better with watch mode and normal build mode api that creates program and emits files
238238
// This currently helps enable --diagnostics and --extendedDiagnostics
239239
afterProgramEmitAndDiagnostics?(program: T): void;
240-
/** @internal */ beforeEmitBundle?(config: ParsedCommandLine): void;
241-
/** @internal */ afterEmitBundle?(config: ParsedCommandLine): void;
240+
/** @deprecated @internal */ beforeEmitBundle?(config: ParsedCommandLine): void;
241+
/** @deprecated @internal */ afterEmitBundle?(config: ParsedCommandLine): void;
242242

243243
// For testing
244244
/** @internal */ now?(): Date;
@@ -795,7 +795,7 @@ function setupInitialBuild<T extends BuilderProgram>(state: SolutionBuilderState
795795

796796
export enum InvalidatedProjectKind {
797797
Build,
798-
UpdateBundle,
798+
/** @deprecated */ UpdateBundle,
799799
UpdateOutputFileStamps
800800
}
801801

@@ -847,6 +847,7 @@ export interface BuildInvalidedProject<T extends BuilderProgram> extends Invalid
847847
// emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>;
848848
}
849849

850+
/** @deprecated */
850851
export interface UpdateBundleProject<T extends BuilderProgram> extends InvalidatedProjectBase {
851852
readonly kind: InvalidatedProjectKind.UpdateBundle;
852853
emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject<T> | undefined;
@@ -898,9 +899,9 @@ enum BuildStep {
898899
SyntaxDiagnostics,
899900
SemanticDiagnostics,
900901
Emit,
901-
EmitBundle,
902+
/** @deprecated */ EmitBundle,
902903
EmitBuildInfo,
903-
BuildInvalidatedProjectOfBundle,
904+
/** @deprecated */ BuildInvalidatedProjectOfBundle,
904905
QueueReferencingProjects,
905906
Done
906907
}

0 commit comments

Comments
 (0)