mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Mark APIs related to prepend option deprecated (#52344)
This commit is contained in:
@@ -154,6 +154,7 @@ export interface ReusableBuilderProgramState extends BuilderState {
|
||||
*/
|
||||
latestChangedDtsFile: string | undefined;
|
||||
/**
|
||||
* @deprecated
|
||||
* 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
|
||||
*/
|
||||
bundle?: BundleBuildInfo;
|
||||
|
||||
@@ -1168,6 +1168,7 @@ export const notImplementedResolver: EmitResolver = {
|
||||
/**
|
||||
* File that isnt present resulting in error or output files
|
||||
*
|
||||
* @deprecated
|
||||
* @internal
|
||||
*/
|
||||
export type EmitUsingBuildInfoResult = string | readonly OutputFile[];
|
||||
@@ -1199,7 +1200,7 @@ function createSourceFilesFromBundleBuildInfo(bundle: BundleBuildInfo, buildInfo
|
||||
});
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export function emitUsingBuildInfo(
|
||||
config: ParsedCommandLine,
|
||||
host: CompilerHost,
|
||||
|
||||
@@ -7273,8 +7273,11 @@ const syntheticFactory: BaseNodeFactory = {
|
||||
|
||||
export const factory = createNodeFactory(NodeFactoryFlags.NoIndentationOnFreshPropertyAccess, syntheticFactory);
|
||||
|
||||
/** @deprecated */
|
||||
export function createUnparsedSourceFile(text: string): UnparsedSource;
|
||||
/** @deprecated */
|
||||
export function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource;
|
||||
/** @deprecated */
|
||||
export function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource;
|
||||
export function createUnparsedSourceFile(textOrInputFiles: string | InputFiles, mapPathOrType?: string, mapTextOrStripInternal?: string | boolean): UnparsedSource {
|
||||
let stripInternal: boolean | undefined;
|
||||
@@ -7445,10 +7448,12 @@ function parseOldFileOfCurrentEmit(bundleFileInfo: BundleFileInfo) {
|
||||
}
|
||||
|
||||
// TODO(rbuckton): Move part of this to factory
|
||||
/** @deprecated */
|
||||
export function createInputFiles(
|
||||
javascriptText: string,
|
||||
declarationText: string
|
||||
): InputFiles;
|
||||
/** @deprecated */
|
||||
export function createInputFiles(
|
||||
javascriptText: string,
|
||||
declarationText: string,
|
||||
@@ -7457,6 +7462,7 @@ export function createInputFiles(
|
||||
declarationMapPath: string | undefined,
|
||||
declarationMapText: string | undefined
|
||||
): InputFiles;
|
||||
/** @deprecated */
|
||||
export function createInputFiles(
|
||||
readFileText: (path: string) => string | undefined,
|
||||
javascriptPath: string,
|
||||
@@ -7493,7 +7499,7 @@ export function createInputFiles(
|
||||
declarationMapTextOrBuildInfoPath,
|
||||
);
|
||||
}
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export function createInputFilesWithFilePaths(
|
||||
readFileText: (path: string) => string | undefined,
|
||||
javascriptPath: string,
|
||||
@@ -7546,7 +7552,7 @@ export function createInputFilesWithFilePaths(
|
||||
});
|
||||
return node;
|
||||
}
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export function createInputFilesWithFileTexts(
|
||||
javascriptPath: string | undefined,
|
||||
javascriptText: string,
|
||||
|
||||
@@ -1011,7 +1011,7 @@ export function isEnumMember(node: Node): node is EnumMember {
|
||||
// Unparsed
|
||||
|
||||
// TODO(rbuckton): isUnparsedPrologue
|
||||
|
||||
/** @deprecated */
|
||||
export function isUnparsedPrepend(node: Node): node is UnparsedPrepend {
|
||||
return node.kind === SyntaxKind.UnparsedPrepend;
|
||||
}
|
||||
@@ -1029,6 +1029,7 @@ export function isBundle(node: Node): node is Bundle {
|
||||
return node.kind === SyntaxKind.Bundle;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function isUnparsedSource(node: Node): node is UnparsedSource {
|
||||
return node.kind === SyntaxKind.UnparsedSource;
|
||||
}
|
||||
|
||||
@@ -5023,7 +5023,7 @@ export function parseConfigHostFromCompilerHostLike(host: CompilerHostLike, dire
|
||||
};
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export function createPrependNodes(
|
||||
projectReferences: readonly ProjectReference[] | undefined,
|
||||
getCommandLine: (ref: ProjectReference, index: number) => ParsedCommandLine | undefined,
|
||||
|
||||
@@ -16,6 +16,7 @@ export enum UpToDateStatusType {
|
||||
*/
|
||||
UpToDateWithUpstreamTypes,
|
||||
/**
|
||||
* @deprecated
|
||||
* The project appears out of date because its upstream inputs are newer than its outputs,
|
||||
* but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.
|
||||
* This means we can Pseudo-build (just manipulate outputs), as if we had actually built this project.
|
||||
@@ -87,6 +88,7 @@ export namespace Status {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* The project is up to date with respect to its inputs except for prepend output changed (no declaration file change in prepend).
|
||||
*/
|
||||
export interface OutOfDateWithPrepend {
|
||||
|
||||
@@ -237,8 +237,8 @@ export interface SolutionBuilderHostBase<T extends BuilderProgram> extends Progr
|
||||
// TODO: To do better with watch mode and normal build mode api that creates program and emits files
|
||||
// This currently helps enable --diagnostics and --extendedDiagnostics
|
||||
afterProgramEmitAndDiagnostics?(program: T): void;
|
||||
/** @internal */ beforeEmitBundle?(config: ParsedCommandLine): void;
|
||||
/** @internal */ afterEmitBundle?(config: ParsedCommandLine): void;
|
||||
/** @deprecated @internal */ beforeEmitBundle?(config: ParsedCommandLine): void;
|
||||
/** @deprecated @internal */ afterEmitBundle?(config: ParsedCommandLine): void;
|
||||
|
||||
// For testing
|
||||
/** @internal */ now?(): Date;
|
||||
@@ -795,7 +795,7 @@ function setupInitialBuild<T extends BuilderProgram>(state: SolutionBuilderState
|
||||
|
||||
export enum InvalidatedProjectKind {
|
||||
Build,
|
||||
UpdateBundle,
|
||||
/** @deprecated */ UpdateBundle,
|
||||
UpdateOutputFileStamps
|
||||
}
|
||||
|
||||
@@ -847,6 +847,7 @@ export interface BuildInvalidedProject<T extends BuilderProgram> extends Invalid
|
||||
// emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export interface UpdateBundleProject<T extends BuilderProgram> extends InvalidatedProjectBase {
|
||||
readonly kind: InvalidatedProjectKind.UpdateBundle;
|
||||
emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject<T> | undefined;
|
||||
@@ -898,9 +899,9 @@ enum BuildStep {
|
||||
SyntaxDiagnostics,
|
||||
SemanticDiagnostics,
|
||||
Emit,
|
||||
EmitBundle,
|
||||
/** @deprecated */ EmitBundle,
|
||||
EmitBuildInfo,
|
||||
BuildInvalidatedProjectOfBundle,
|
||||
/** @deprecated */ BuildInvalidatedProjectOfBundle,
|
||||
QueueReferencingProjects,
|
||||
Done
|
||||
}
|
||||
|
||||
+47
-35
@@ -378,17 +378,17 @@ export const enum SyntaxKind {
|
||||
// Enum
|
||||
EnumMember,
|
||||
// Unparsed
|
||||
UnparsedPrologue,
|
||||
UnparsedPrepend,
|
||||
UnparsedText,
|
||||
UnparsedInternalText,
|
||||
UnparsedSyntheticReference,
|
||||
/** @deprecated */ UnparsedPrologue,
|
||||
/** @deprecated */ UnparsedPrepend,
|
||||
/** @deprecated */ UnparsedText,
|
||||
/** @deprecated */ UnparsedInternalText,
|
||||
/** @deprecated */ UnparsedSyntheticReference,
|
||||
|
||||
// Top-level nodes
|
||||
SourceFile,
|
||||
Bundle,
|
||||
UnparsedSource,
|
||||
InputFiles,
|
||||
/** @deprecated */ UnparsedSource,
|
||||
/** @deprecated */ InputFiles,
|
||||
|
||||
// JSDoc nodes
|
||||
JSDocTypeExpression,
|
||||
@@ -4408,7 +4408,7 @@ export type ExportedModulesFromDeclarationEmit = readonly Symbol[];
|
||||
|
||||
export interface Bundle extends Node {
|
||||
readonly kind: SyntaxKind.Bundle;
|
||||
readonly prepends: readonly (InputFiles | UnparsedSource)[];
|
||||
/** @deprecated */ readonly prepends: readonly (InputFiles | UnparsedSource)[];
|
||||
readonly sourceFiles: readonly SourceFile[];
|
||||
/** @internal */ syntheticFileReferences?: readonly FileReference[];
|
||||
/** @internal */ syntheticTypeReferences?: readonly FileReference[];
|
||||
@@ -4416,6 +4416,7 @@ export interface Bundle extends Node {
|
||||
/** @internal */ hasNoDefaultLib?: boolean;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export interface InputFiles extends Node {
|
||||
readonly kind: SyntaxKind.InputFiles;
|
||||
javascriptPath?: string;
|
||||
@@ -4431,6 +4432,7 @@ export interface InputFiles extends Node {
|
||||
/** @internal */ oldFileOfCurrentEmit?: boolean;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export interface UnparsedSource extends Node {
|
||||
readonly kind: SyntaxKind.UnparsedSource;
|
||||
fileName: string;
|
||||
@@ -4455,29 +4457,34 @@ export interface UnparsedSource extends Node {
|
||||
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export type UnparsedSourceText =
|
||||
| UnparsedPrepend
|
||||
| UnparsedTextLike
|
||||
;
|
||||
|
||||
/** @deprecated */
|
||||
export type UnparsedNode =
|
||||
| UnparsedPrologue
|
||||
| UnparsedSourceText
|
||||
| UnparsedSyntheticReference
|
||||
;
|
||||
|
||||
/** @deprecated */
|
||||
export interface UnparsedSection extends Node {
|
||||
readonly kind: SyntaxKind;
|
||||
readonly parent: UnparsedSource;
|
||||
readonly data?: string;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export interface UnparsedPrologue extends UnparsedSection {
|
||||
readonly kind: SyntaxKind.UnparsedPrologue;
|
||||
readonly parent: UnparsedSource;
|
||||
readonly data: string;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export interface UnparsedPrepend extends UnparsedSection {
|
||||
readonly kind: SyntaxKind.UnparsedPrepend;
|
||||
readonly parent: UnparsedSource;
|
||||
@@ -4485,11 +4492,13 @@ export interface UnparsedPrepend extends UnparsedSection {
|
||||
readonly texts: readonly UnparsedTextLike[];
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export interface UnparsedTextLike extends UnparsedSection {
|
||||
readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText;
|
||||
readonly parent: UnparsedSource;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export interface UnparsedSyntheticReference extends UnparsedSection {
|
||||
readonly kind: SyntaxKind.UnparsedSyntheticReference;
|
||||
readonly parent: UnparsedSource;
|
||||
@@ -8008,7 +8017,7 @@ export interface EmitHost extends ScriptReferenceHost, ModuleSpecifierResolution
|
||||
|
||||
isEmitBlocked(emitFileName: string): boolean;
|
||||
|
||||
getPrependNodes(): readonly (InputFiles | UnparsedSource)[];
|
||||
/** @deprecated */ getPrependNodes(): readonly (InputFiles | UnparsedSource)[];
|
||||
|
||||
writeFile: WriteFileCallback;
|
||||
getBuildInfo(bundle: BundleBuildInfo | undefined): BuildInfo | undefined;
|
||||
@@ -8666,12 +8675,12 @@ export interface NodeFactory {
|
||||
|
||||
/** @internal */ createRedirectedSourceFile(redirectInfo: RedirectInfo): SourceFile;
|
||||
|
||||
/** @internal */ createUnparsedSource(prologues: readonly UnparsedPrologue[], syntheticReferences: readonly UnparsedSyntheticReference[] | undefined, texts: readonly UnparsedSourceText[]): UnparsedSource;
|
||||
/** @internal */ createUnparsedPrologue(data?: string): UnparsedPrologue;
|
||||
/** @internal */ createUnparsedPrepend(data: string | undefined, texts: readonly UnparsedSourceText[]): UnparsedPrepend;
|
||||
/** @internal */ createUnparsedTextLike(data: string | undefined, internal: boolean): UnparsedTextLike;
|
||||
/** @internal */ createUnparsedSyntheticReference(section: BundleFileHasNoDefaultLib | BundleFileReference): UnparsedSyntheticReference;
|
||||
/** @internal */ createInputFiles(): InputFiles;
|
||||
/** @deprecated @internal */ createUnparsedSource(prologues: readonly UnparsedPrologue[], syntheticReferences: readonly UnparsedSyntheticReference[] | undefined, texts: readonly UnparsedSourceText[]): UnparsedSource;
|
||||
/** @deprecated @internal */ createUnparsedPrologue(data?: string): UnparsedPrologue;
|
||||
/** @deprecated @internal */ createUnparsedPrepend(data: string | undefined, texts: readonly UnparsedSourceText[]): UnparsedPrepend;
|
||||
/** @deprecated @internal */ createUnparsedTextLike(data: string | undefined, internal: boolean): UnparsedTextLike;
|
||||
/** @deprecated @internal */ createUnparsedSyntheticReference(section: BundleFileHasNoDefaultLib | BundleFileReference): UnparsedSyntheticReference;
|
||||
/** @deprecated @internal */ createInputFiles(): InputFiles;
|
||||
|
||||
//
|
||||
// Synthetic Nodes
|
||||
@@ -8692,8 +8701,10 @@ export interface NodeFactory {
|
||||
/** @internal */ updateSyntheticReferenceExpression(node: SyntheticReferenceExpression, expression: Expression, thisArg: Expression): SyntheticReferenceExpression;
|
||||
createCommaListExpression(elements: readonly Expression[]): CommaListExpression;
|
||||
updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression;
|
||||
createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
|
||||
updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
|
||||
createBundle(sourceFiles: readonly SourceFile[]): Bundle;
|
||||
/** @deprecated*/ createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; // eslint-disable-line @typescript-eslint/unified-signatures
|
||||
updateBundle(node: Bundle, sourceFiles: readonly SourceFile[]): Bundle;
|
||||
/** @deprecated*/ updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; // eslint-disable-line @typescript-eslint/unified-signatures
|
||||
|
||||
//
|
||||
// Common operators
|
||||
@@ -9159,10 +9170,10 @@ export interface Printer {
|
||||
/** @internal */ writeList<T extends Node>(format: ListFormat, list: NodeArray<T> | undefined, sourceFile: SourceFile | undefined, writer: EmitTextWriter): void;
|
||||
/** @internal */ writeFile(sourceFile: SourceFile, writer: EmitTextWriter, sourceMapGenerator: SourceMapGenerator | undefined): void;
|
||||
/** @internal */ writeBundle(bundle: Bundle, writer: EmitTextWriter, sourceMapGenerator: SourceMapGenerator | undefined): void;
|
||||
/** @internal */ bundleFileInfo?: BundleFileInfo;
|
||||
/** @deprecated @internal */ bundleFileInfo?: BundleFileInfo;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export const enum BundleFileSectionKind {
|
||||
Prologue = "prologue",
|
||||
EmitHelpers = "emitHelpers",
|
||||
@@ -9178,51 +9189,51 @@ export const enum BundleFileSectionKind {
|
||||
// comments?
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface BundleFileSectionBase extends TextRange {
|
||||
kind: BundleFileSectionKind;
|
||||
data?: string;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface BundleFilePrologue extends BundleFileSectionBase {
|
||||
kind: BundleFileSectionKind.Prologue;
|
||||
data: string;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface BundleFileEmitHelpers extends BundleFileSectionBase {
|
||||
kind: BundleFileSectionKind.EmitHelpers;
|
||||
data: string;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface BundleFileHasNoDefaultLib extends BundleFileSectionBase {
|
||||
kind: BundleFileSectionKind.NoDefaultLib;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface BundleFileReference extends BundleFileSectionBase {
|
||||
kind: BundleFileSectionKind.Reference | BundleFileSectionKind.Type | BundleFileSectionKind.Lib | BundleFileSectionKind.TypeResolutionModeImport | BundleFileSectionKind.TypeResolutionModeRequire;
|
||||
data: string;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface BundleFilePrepend extends BundleFileSectionBase {
|
||||
kind: BundleFileSectionKind.Prepend;
|
||||
data: string;
|
||||
texts: BundleFileTextLike[];
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export type BundleFileTextLikeKind = BundleFileSectionKind.Text | BundleFileSectionKind.Internal;
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface BundleFileTextLike extends BundleFileSectionBase {
|
||||
kind: BundleFileTextLikeKind;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export type BundleFileSection =
|
||||
BundleFilePrologue
|
||||
| BundleFileEmitHelpers
|
||||
@@ -9231,31 +9242,31 @@ export type BundleFileSection =
|
||||
| BundleFilePrepend
|
||||
| BundleFileTextLike;
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface SourceFilePrologueDirectiveExpression extends TextRange {
|
||||
text: string;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface SourceFilePrologueDirective extends TextRange {
|
||||
expression: SourceFilePrologueDirectiveExpression;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface SourceFilePrologueInfo {
|
||||
file: number;
|
||||
text: string;
|
||||
directives: SourceFilePrologueDirective[];
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface SourceFileInfo {
|
||||
// List of helpers in own source files emitted if no prepend is present
|
||||
helpers?: string[];
|
||||
prologues?: SourceFilePrologueInfo[];
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface BundleFileInfo {
|
||||
sections: BundleFileSection[];
|
||||
hash?: string;
|
||||
@@ -9263,7 +9274,7 @@ export interface BundleFileInfo {
|
||||
sources?: SourceFileInfo;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export interface BundleBuildInfo {
|
||||
js?: BundleFileInfo;
|
||||
dts?: BundleFileInfo;
|
||||
@@ -9273,6 +9284,7 @@ export interface BundleBuildInfo {
|
||||
|
||||
/** @internal */
|
||||
export interface BuildInfo {
|
||||
/** @deprecated */
|
||||
bundle?: BundleBuildInfo;
|
||||
program?: ProgramBuildInfo;
|
||||
version: string;
|
||||
@@ -9351,7 +9363,7 @@ export interface PrinterOptions {
|
||||
/** @internal */ extendedDiagnostics?: boolean;
|
||||
/** @internal */ onlyPrintJsDocStyle?: boolean;
|
||||
/** @internal */ neverAsciiEscape?: boolean;
|
||||
/** @internal */ writeBundleFileInfo?: boolean;
|
||||
/** @deprecated @internal */ writeBundleFileInfo?: boolean;
|
||||
/** @internal */ recordInternalSection?: boolean;
|
||||
/** @internal */ stripInternal?: boolean;
|
||||
/** @internal */ preserveSourceNewlines?: boolean;
|
||||
|
||||
@@ -7406,7 +7406,7 @@ export function getNameOfAccessExpression(node: AccessExpression) {
|
||||
return node.argumentExpression;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
/** @deprecated @internal */
|
||||
export function isBundleFileTextLike(section: BundleFileSection): section is BundleFileTextLike {
|
||||
switch (section.kind) {
|
||||
case BundleFileSectionKind.Text:
|
||||
|
||||
@@ -1376,6 +1376,7 @@ export function isNamedExportBindings(node: Node): node is NamedExportBindings {
|
||||
return node.kind === SyntaxKind.NamespaceExport || node.kind === SyntaxKind.NamedExports;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function isUnparsedTextLike(node: Node): node is UnparsedTextLike {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.UnparsedText:
|
||||
@@ -1386,6 +1387,7 @@ export function isUnparsedTextLike(node: Node): node is UnparsedTextLike {
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function isUnparsedNode(node: Node): node is UnparsedNode {
|
||||
return isUnparsedTextLike(node) ||
|
||||
node.kind === SyntaxKind.UnparsedPrologue ||
|
||||
|
||||
Reference in New Issue
Block a user